leds: leds-mc13783: Remove duplicate field in platform data

LED platform data are overwhelmed by excessive field "max_cur"
which just replicates few bits of "led_control" field.
This patch removes this field and adds a definition for the
current settings in the header.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
This commit is contained in:
Alexander Shiyan 2013-12-06 22:22:18 -08:00 committed by Bryan Wu
commit 01a7a063e8
3 changed files with 36 additions and 93 deletions

View file

@ -112,9 +112,6 @@ struct mc13xxx_led_platform_data {
int id;
const char *name;
const char *default_trigger;
/* Three or two bits current selection depending on the led */
char max_current;
};
#define MAX_LED_CONTROL_REGS 6
@ -123,7 +120,7 @@ struct mc13xxx_leds_platform_data {
struct mc13xxx_led_platform_data *led;
int num_leds;
/* LED Control 0 */
/* MC13783 LED Control 0 */
#define MC13783_LED_C0_ENABLE (1 << 0)
#define MC13783_LED_C0_TRIODE_MD (1 << 7)
#define MC13783_LED_C0_TRIODE_AD (1 << 8)
@ -131,21 +128,43 @@ struct mc13xxx_leds_platform_data {
#define MC13783_LED_C0_BOOST (1 << 10)
#define MC13783_LED_C0_ABMODE(x) (((x) & 0x7) << 11)
#define MC13783_LED_C0_ABREF(x) (((x) & 0x3) << 14)
/* LED Control 1 */
/* MC13783 LED Control 1 */
#define MC13783_LED_C1_TC1HALF (1 << 18)
#define MC13783_LED_C1_SLEWLIM (1 << 23)
/* LED Control 2 */
/* MC13783 LED Control 2 */
#define MC13783_LED_C2_CURRENT_MD(x) (((x) & 0x7) << 0)
#define MC13783_LED_C2_CURRENT_AD(x) (((x) & 0x7) << 3)
#define MC13783_LED_C2_CURRENT_KP(x) (((x) & 0x7) << 6)
#define MC13783_LED_C2_PERIOD(x) (((x) & 0x3) << 21)
#define MC13783_LED_C2_SLEWLIM (1 << 23)
/* LED Control 3 */
/* MC13783 LED Control 3 */
#define MC13783_LED_C3_CURRENT_R1(x) (((x) & 0x3) << 0)
#define MC13783_LED_C3_CURRENT_G1(x) (((x) & 0x3) << 2)
#define MC13783_LED_C3_CURRENT_B1(x) (((x) & 0x3) << 4)
#define MC13783_LED_C3_PERIOD(x) (((x) & 0x3) << 21)
#define MC13783_LED_C3_TRIODE_TC1 (1 << 23)
/* LED Control 4 */
/* MC13783 LED Control 4 */
#define MC13783_LED_C4_CURRENT_R2(x) (((x) & 0x3) << 0)
#define MC13783_LED_C4_CURRENT_G2(x) (((x) & 0x3) << 2)
#define MC13783_LED_C4_CURRENT_B2(x) (((x) & 0x3) << 4)
#define MC13783_LED_C4_PERIOD(x) (((x) & 0x3) << 21)
#define MC13783_LED_C4_TRIODE_TC2 (1 << 23)
/* LED Control 5 */
/* MC13783 LED Control 5 */
#define MC13783_LED_C5_CURRENT_R3(x) (((x) & 0x3) << 0)
#define MC13783_LED_C5_CURRENT_G3(x) (((x) & 0x3) << 2)
#define MC13783_LED_C5_CURRENT_B3(x) (((x) & 0x3) << 4)
#define MC13783_LED_C5_PERIOD(x) (((x) & 0x3) << 21)
#define MC13783_LED_C5_TRIODE_TC3 (1 << 23)
/* MC13892 LED Control 0 */
#define MC13892_LED_C0_CURRENT_MD(x) (((x) & 0x7) << 9)
#define MC13892_LED_C0_CURRENT_AD(x) (((x) & 0x7) << 21)
/* MC13892 LED Control 1 */
#define MC13892_LED_C1_CURRENT_KP(x) (((x) & 0x7) << 9)
/* MC13892 LED Control 2 */
#define MC13892_LED_C2_CURRENT_R(x) (((x) & 0x7) << 9)
#define MC13892_LED_C2_CURRENT_G(x) (((x) & 0x7) << 21)
/* MC13892 LED Control 3 */
#define MC13892_LED_C3_CURRENT_B(x) (((x) & 0x7) << 9)
u32 led_control[MAX_LED_CONTROL_REGS];
};