#include #include #include #include #include #ifndef __AVM_HUI_GENERIC_GPIO_H__ #define __AVM_HUI_GENERIC_GPIO_H__ struct hui_generic_led; struct hui_generic_button; typedef int (*hui_generic_led_out)(struct hui_generic_led *led, struct led_color color); typedef int (*hui_generic_button_in)(struct hui_generic_button *button); struct hui_generic_led { struct device *dev; const char *name; void *handle; struct blink_code code; hui_generic_led_out out; struct { /* internal states */ u8 on_off; /**< Internal: current led state */ u8 _code; /**< Internal: configured blink code @ref LED_BLINK_CODE_DEFINES*/ u8 blink1_blink2; /**< Internal: defines wether in blink1/2 0 for 1, 1 for 2*/ u8 current_blink_step; /**< Internal: stores current blink step within array*/ u8 param1; /**< Internal: stores configured param1 for blink code*/ u8 param2; /**< Internal: stores configured param2 for blink code*/ u8 param_cnt; /**< Internal: param counter*/ struct led_color last_color; struct list_head list; } engine; }; struct hui_generic_button { struct device *dev; const char *name; void *handle; hui_generic_button_in in; struct { int state; struct list_head list; } engine; }; extern int hui_generic_blink_add_led(struct hui_generic_led *led); extern int hui_generic_blink_add_button(struct hui_generic_button *button); #define BLINK_CODE(...) \ ({ \ struct blink_code ___code = { __VA_ARGS__ }; \ ___code; \ }) extern struct avm_hui_led_ops hui_generic_ops; extern struct platform_driver hui_generic_button_avm; extern struct platform_driver hui_generic_led_avm; extern struct platform_driver hui_generic_led_ext; extern struct spi_driver hui_generic_lc882x; #if IS_ENABLED(CONFIG_GPIOLIB) extern struct platform_driver hui_generic_led_gpio; extern struct platform_driver hui_generic_button_gpio; #endif #if IS_ENABLED(CONFIG_PWM) extern struct platform_driver hui_generic_led_pwm; #endif #if IS_ENABLED(CONFIG_LEDS_CLASS) extern struct platform_driver hui_generic_led_class; #endif #endif