diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-26 12:29:02 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-26 12:29:02 -0500 |
| commit | 0512c04a2b5d29a33d96d315e1d14c55f5148aa7 (patch) | |
| tree | 6373c0370abe32e1e42a933bd9cd08727e48b5d9 /include/linux/platform_data | |
| parent | 5115f3c19d17851aaff5a857f55b4a019c908775 (diff) | |
| parent | 4b07c5d5123f76487c61cf9dc3f987d0b8c88a94 (diff) | |
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds
Pull LED subsystem update from Bryan Wu.
* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds: (61 commits)
leds: leds-sunfire: use dev_err()/pr_err() instead of printk()
leds: 88pm860x: Add missing of_node_put()
leds: tca6507: Use of_get_child_count()
leds: leds-pwm: make it depend on PWM and not HAVE_PWM
Documentation: leds: update LP55xx family devices
leds-lp55xx: fix problem on removing LED attributes
leds-lp5521/5523: add author and copyright description
leds-lp5521/5523: use new lp55xx common header
leds-lp55xx: clean up headers
leds-lp55xx: clean up definitions
leds-lp55xx: clean up unused data and functions
leds-lp55xx: clean up _remove()
leds-lp55xx: add new function for removing device attribtues
leds-lp55xx: code refactoring on selftest function
leds-lp55xx: use common device attribute driver function
leds-lp55xx: support device specific attributes
leds-lp5523: use generic firmware interface
leds-lp5521: use generic firmware interface
leds-lp55xx: support firmware interface
leds-lp55xx: add new lp55xx_register_sysfs() for the firmware interface
...
Diffstat (limited to 'include/linux/platform_data')
| -rw-r--r-- | include/linux/platform_data/leds-lp55xx.h | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/include/linux/platform_data/leds-lp55xx.h b/include/linux/platform_data/leds-lp55xx.h new file mode 100644 index 000000000000..1509570d5a3f --- /dev/null +++ b/include/linux/platform_data/leds-lp55xx.h | |||
| @@ -0,0 +1,87 @@ | |||
| 1 | /* | ||
| 2 | * LP55XX Platform Data Header | ||
| 3 | * | ||
| 4 | * Copyright (C) 2012 Texas Instruments | ||
| 5 | * | ||
| 6 | * Author: Milo(Woogyom) Kim <milo.kim@ti.com> | ||
| 7 | * | ||
| 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. | ||
| 11 | * | ||
| 12 | * Derived from leds-lp5521.h, leds-lp5523.h | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef _LEDS_LP55XX_H | ||
| 16 | #define _LEDS_LP55XX_H | ||
| 17 | |||
| 18 | /* Clock configuration */ | ||
| 19 | #define LP55XX_CLOCK_AUTO 0 | ||
| 20 | #define LP55XX_CLOCK_INT 1 | ||
| 21 | #define LP55XX_CLOCK_EXT 2 | ||
| 22 | |||
| 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 */ | ||
| 34 | |||
| 35 | struct lp55xx_led_config { | ||
| 36 | const char *name; | ||
| 37 | u8 chan_nr; | ||
| 38 | u8 led_current; /* mA x10, 0 if led is not connected */ | ||
| 39 | u8 max_current; | ||
| 40 | }; | ||
| 41 | |||
| 42 | struct lp55xx_predef_pattern { | ||
| 43 | u8 *r; | ||
| 44 | u8 *g; | ||
| 45 | u8 *b; | ||
| 46 | u8 size_r; | ||
| 47 | u8 size_g; | ||
| 48 | u8 size_b; | ||
| 49 | }; | ||
| 50 | |||
| 51 | /* | ||
| 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 | ||
| 63 | */ | ||
| 64 | struct lp55xx_platform_data { | ||
| 65 | |||
| 66 | /* LED channel configuration */ | ||
| 67 | struct lp55xx_led_config *led_config; | ||
| 68 | u8 num_channels; | ||
| 69 | const char *label; | ||
| 70 | |||
| 71 | /* Clock configuration */ | ||
| 72 | u8 clock_mode; | ||
| 73 | |||
| 74 | /* Platform specific functions */ | ||
| 75 | int (*setup_resources)(void); | ||
| 76 | void (*release_resources)(void); | ||
| 77 | void (*enable)(bool state); | ||
| 78 | |||
| 79 | /* Predefined pattern data */ | ||
| 80 | struct lp55xx_predef_pattern *patterns; | ||
| 81 | unsigned int num_patterns; | ||
| 82 | |||
| 83 | /* _CONFIG register */ | ||
| 84 | u8 update_config; | ||
| 85 | }; | ||
| 86 | |||
| 87 | #endif /* _LEDS_LP55XX_H */ | ||
