2 * LP55XX Platform Data Header
4 * Copyright (C) 2012 Texas Instruments
6 * Author: Milo(Woogyom) Kim <milo.kim@ti.com>
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * version 2 as published by the Free Software Foundation.
12 * Derived from leds-lp5521.h, leds-lp5523.h
15 #ifndef _LEDS_LP55XX_H
16 #define _LEDS_LP55XX_H
18 /* Clock configuration */
19 #define LP55XX_CLOCK_AUTO 0
20 #define LP55XX_CLOCK_INT 1
21 #define LP55XX_CLOCK_EXT 2
23 /* Bits in LP5521 CONFIG register. 'update_config' in lp55xx_platform_data */
24 #define LP5521_PWM_HF 0x40 /* PWM: 0 = 256Hz, 1 = 558Hz */
25 #define LP5521_PWRSAVE_EN 0x20 /* 1 = Power save mode */
26 #define LP5521_CP_MODE_OFF 0 /* Charge pump (CP) off */
27 #define LP5521_CP_MODE_BYPASS 8 /* CP forced to bypass mode */
28 #define LP5521_CP_MODE_1X5 0x10 /* CP forced to 1.5x mode */
29 #define LP5521_CP_MODE_AUTO 0x18 /* Automatic mode selection */
30 #define LP5521_R_TO_BATT 4 /* R out: 0 = CP, 1 = Vbat */
31 #define LP5521_CLK_SRC_EXT 0 /* Ext-clk source (CLK_32K) */
32 #define LP5521_CLK_INT 1 /* Internal clock */
33 #define LP5521_CLK_AUTO 2 /* Automatic clock selection */
35 struct lp55xx_led_config {
38 u8 led_current; /* mA x10, 0 if led is not connected */
42 struct lp55xx_predef_pattern {
52 * struct lp55xx_platform_data
53 * @led_config : Configurable led class device
54 * @num_channels : Number of LED channels
55 * @label : Used for naming LEDs
56 * @clock_mode : Input clock mode. LP55XX_CLOCK_AUTO or _INT or _EXT
57 * @setup_resources : Platform specific function before enabling the chip
58 * @release_resources : Platform specific function after disabling the chip
59 * @enable : EN pin control by platform side
60 * @patterns : Predefined pattern data for RGB channels
61 * @num_patterns : Number of patterns
62 * @update_config : Value of CONFIG register
64 struct lp55xx_platform_data {
66 /* LED channel configuration */
67 struct lp55xx_led_config *led_config;
71 /* Clock configuration */
74 /* Platform specific functions */
75 int (*setup_resources)(void);
76 void (*release_resources)(void);
77 void (*enable)(bool state);
79 /* Predefined pattern data */
80 struct lp55xx_predef_pattern *patterns;
81 unsigned int num_patterns;
83 /* _CONFIG register */
87 #endif /* _LEDS_LP55XX_H */