背光驱动内核层及驱动层分析

本文详细介绍了Linux系统中背光驱动的内核层和驱动层结构,包括`led_classdev`、`mt65xx_led_data`等结构体的解析,以及`mt65xx_leds_probe`、`led_brightness_store`等关键函数的工作原理。内容涵盖背光亮度设置、设备注册、工作队列和触发器等方面。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一些重要的结构体:

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值