一些重要的结构体:
struct mt65xx_led_data {
structled_classdev cdev;
structcust_mt65xx_led cust;
structwork_struct work;
intlevel;
intdelay_on;
intdelay_off;
};
struct led_classdev {
constchar *name;
int brightness;
int max_brightness;
int flags;
/*Lower 16 bits reflect status */
#define LED_SUSPENDED (1 << 0)
/*Upper 16 bits reflect control information */
#define LED_CORE_SUSPENDRESUME (1 << 16)
#define LED_BLINK_ONESHOT (1 << 17)
#define LED_BLINK_ONESHOT_STOP (1 << 18)
#define LED_BLINK_INVERT (1 << 19)
/*Set LED brightness level */
/*Must not sleep, use a workqueue if needed */
void (*brightness_set)(struct led_classdev*led_cdev,
enumled_brightness brightness);
/*Get LED brightness level */
enumled_brightness (*brightness_get)(struct led_classdev *led_cdev);
/*
* Activate hardware accelerated blink, delaysare in milliseconds
* and if both are zero then a sensible defaultshould be chosen.
* The call should adjust the timings in thatcase and if it can't
* match the values specified exactly.
* Deactivate blinking again w