Add fwnode support to the lm3630a driver and optionally allow configuring the label, default brightness level, and maximum brightness level. The two outputs can be controlled by bank A and B independently or bank A can control both outputs. If the platform data was not configured, then the driver defaults to enabling both banks. This patch changes the default value to disable both banks before parsing the firmware node so that just a single bank can be enabled if desired. There are no in-tree users of this driver. Driver was tested on a LG Nexus 5 (hammerhead) phone.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -38,9 +38,11 @@ enum lm3630a_ledb_ctrl { · 37 unmodified lines | |||
| 38 | 38 | ||
| 39 | #define LM3630A_MAX_BRIGHTNESS 255 | 39 | #define LM3630A_MAX_BRIGHTNESS 255 |
| 40 | /* | 40 | /* |
| 41 | *@leda_label : optional led a label. | ||
| 41 | *@leda_init_brt : led a init brightness. 4~255 | 42 | *@leda_init_brt : led a init brightness. 4~255 |
| 42 | *@leda_max_brt : led a max brightness. 4~255 | 43 | *@leda_max_brt : led a max brightness. 4~255 |
| 43 | *@leda_ctrl : led a disable, enable linear, enable exponential | 44 | *@leda_ctrl : led a disable, enable linear, enable exponential |
| 45 | *@ledb_label : optional led b label. | ||
| 44 | *@ledb_init_brt : led b init brightness. 4~255 | 46 | *@ledb_init_brt : led b init brightness. 4~255 |
| 45 | *@ledb_max_brt : led b max brightness. 4~255 | 47 | *@ledb_max_brt : led b max brightness. 4~255 |
| 46 | *@ledb_ctrl : led b disable, enable linear, enable exponential | 48 | *@ledb_ctrl : led b disable, enable linear, enable exponential |
| @@ -50,10 +52,12 @@ enum lm3630a_ledb_ctrl { · 3 unmodified lines | |||
| 50 | struct lm3630a_platform_data { | 52 | struct lm3630a_platform_data { |
| 51 | 53 | ||
| 52 | /* led a config. */ | 54 | /* led a config. */ |
| 55 | const char *leda_label; | ||
| 53 | int leda_init_brt; | 56 | int leda_init_brt; |
| 54 | int leda_max_brt; | 57 | int leda_max_brt; |
| 55 | enum lm3630a_leda_ctrl leda_ctrl; | 58 | enum lm3630a_leda_ctrl leda_ctrl; |
| 56 | /* led b config. */ | 59 | /* led b config. */ |
| 60 | const char *ledb_label; | ||
| 57 | int ledb_init_brt; | 61 | int ledb_init_brt; |
| 58 | int ledb_max_brt; | 62 | int ledb_max_brt; |
| 59 | enum lm3630a_ledb_ctrl ledb_ctrl; | 63 | enum lm3630a_ledb_ctrl ledb_ctrl; |