File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525
2626#define DA9034_WLED_CONTROL1 0x3C
2727#define DA9034_WLED_CONTROL2 0x3D
28+ #define DA9034_WLED_ISET (x ) ((x) & 0x1f)
2829
2930#define DA9034_WLED_BOOST_EN (1 << 5)
3031
@@ -101,6 +102,7 @@ static struct backlight_ops da903x_backlight_ops = {
101102
102103static int da903x_backlight_probe (struct platform_device * pdev )
103104{
105+ struct da9034_backlight_pdata * pdata = pdev -> dev .platform_data ;
104106 struct da903x_backlight_data * data ;
105107 struct backlight_device * bl ;
106108 int max_brightness ;
@@ -127,6 +129,11 @@ static int da903x_backlight_probe(struct platform_device *pdev)
127129 data -> da903x_dev = pdev -> dev .parent ;
128130 data -> current_brightness = 0 ;
129131
132+ /* adjust the WLED output current */
133+ if (pdata )
134+ da903x_write (data -> da903x_dev , DA9034_WLED_CONTROL2 ,
135+ DA9034_WLED_ISET (pdata -> output_current ));
136+
130137 bl = backlight_device_register (pdev -> name , data -> da903x_dev ,
131138 data , & da903x_backlight_ops );
132139 if (IS_ERR (bl )) {
Original file line number Diff line number Diff line change @@ -96,6 +96,10 @@ struct da9034_touch_pdata {
9696 int y_inverted ;
9797};
9898
99+ struct da9034_backlight_pdata {
100+ int output_current ; /* output current of WLED, from 0-31 (in mA) */
101+ };
102+
99103/* DA9030 battery charger data */
100104struct power_supply_info ;
101105
You can’t perform that action at this time.
0 commit comments