diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-27 14:34:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-27 14:34:55 -0400 |
commit | cad719d86e9dbd06634eaba6401e022c8101d6b2 (patch) | |
tree | ee0aa444e817e5cd29a9dea58dc36d0f3c65a50d /include/linux | |
parent | 3ddab4788d4980b1b3dc324fdd105adab3812418 (diff) | |
parent | 67e67df8da723debf24f7763605776891203e8d5 (diff) |
Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight
* 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight:
gta02: Use pcf50633 backlight driver instead of platform backlight driver.
backlight: pcf50633: Register a pcf50633-backlight device in pcf50633 core driver.
backlight: Add pcf50633 backlight driver
backlight: 88pm860x_bl: fix error handling in pm860x_backlight_probe
backlight: max8925_bl: Fix error handling path
backlight: l4f00242t03: fix error handling in l4f00242t03_probe
backlight: add S6E63M0 AMOLED LCD Panel driver
backlight: adp8860: add support for ADP8861 & ADP8863
backlight: mbp_nvidia_bl - Fix DMI_SYS_VENDOR for MacBook1,1
backlight: Add Cirrus EP93xx backlight driver
backlight: l4f00242t03: Fix regulators handling code in remove function
backlight: fix adp8860_bl build errors
backlight: new driver for the ADP8860 backlight parts
backlight: 88pm860x_bl - potential memory leak
backlight: mbp_nvidia_bl - add support for older MacBookPro and MacBook 6,1.
backlight: Kconfig cleanup
backlight: backlight_device_register() return ERR_PTR()
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/i2c/adp8860.h | 154 | ||||
-rw-r--r-- | include/linux/lcd.h | 23 | ||||
-rw-r--r-- | include/linux/mfd/pcf50633/backlight.h | 51 | ||||
-rw-r--r-- | include/linux/mfd/pcf50633/core.h | 4 |
4 files changed, 232 insertions, 0 deletions
diff --git a/include/linux/i2c/adp8860.h b/include/linux/i2c/adp8860.h new file mode 100644 index 000000000000..0b4d39855c91 --- /dev/null +++ b/include/linux/i2c/adp8860.h | |||
@@ -0,0 +1,154 @@ | |||
1 | /* | ||
2 | * Definitions and platform data for Analog Devices | ||
3 | * Backlight drivers ADP8860 | ||
4 | * | ||
5 | * Copyright 2009-2010 Analog Devices Inc. | ||
6 | * | ||
7 | * Licensed under the GPL-2 or later. | ||
8 | */ | ||
9 | |||
10 | #ifndef __LINUX_I2C_ADP8860_H | ||
11 | #define __LINUX_I2C_ADP8860_H | ||
12 | |||
13 | #include <linux/leds.h> | ||
14 | #include <linux/types.h> | ||
15 | |||
16 | #define ID_ADP8860 8860 | ||
17 | |||
18 | #define ADP8860_MAX_BRIGHTNESS 0x7F | ||
19 | #define FLAG_OFFT_SHIFT 8 | ||
20 | |||
21 | /* | ||
22 | * LEDs subdevice platform data | ||
23 | */ | ||
24 | |||
25 | #define ADP8860_LED_DIS_BLINK (0 << FLAG_OFFT_SHIFT) | ||
26 | #define ADP8860_LED_OFFT_600ms (1 << FLAG_OFFT_SHIFT) | ||
27 | #define ADP8860_LED_OFFT_1200ms (2 << FLAG_OFFT_SHIFT) | ||
28 | #define ADP8860_LED_OFFT_1800ms (3 << FLAG_OFFT_SHIFT) | ||
29 | |||
30 | #define ADP8860_LED_ONT_200ms 0 | ||
31 | #define ADP8860_LED_ONT_600ms 1 | ||
32 | #define ADP8860_LED_ONT_800ms 2 | ||
33 | #define ADP8860_LED_ONT_1200ms 3 | ||
34 | |||
35 | #define ADP8860_LED_D7 (7) | ||
36 | #define ADP8860_LED_D6 (6) | ||
37 | #define ADP8860_LED_D5 (5) | ||
38 | #define ADP8860_LED_D4 (4) | ||
39 | #define ADP8860_LED_D3 (3) | ||
40 | #define ADP8860_LED_D2 (2) | ||
41 | #define ADP8860_LED_D1 (1) | ||
42 | |||
43 | /* | ||
44 | * Backlight subdevice platform data | ||
45 | */ | ||
46 | |||
47 | #define ADP8860_BL_D7 (1 << 6) | ||
48 | #define ADP8860_BL_D6 (1 << 5) | ||
49 | #define ADP8860_BL_D5 (1 << 4) | ||
50 | #define ADP8860_BL_D4 (1 << 3) | ||
51 | #define ADP8860_BL_D3 (1 << 2) | ||
52 | #define ADP8860_BL_D2 (1 << 1) | ||
53 | #define ADP8860_BL_D1 (1 << 0) | ||
54 | |||
55 | #define ADP8860_FADE_T_DIS 0 /* Fade Timer Disabled */ | ||
56 | #define ADP8860_FADE_T_300ms 1 /* 0.3 Sec */ | ||
57 | #define ADP8860_FADE_T_600ms 2 | ||
58 | #define ADP8860_FADE_T_900ms 3 | ||
59 | #define ADP8860_FADE_T_1200ms 4 | ||
60 | #define ADP8860_FADE_T_1500ms 5 | ||
61 | #define ADP8860_FADE_T_1800ms 6 | ||
62 | #define ADP8860_FADE_T_2100ms 7 | ||
63 | #define ADP8860_FADE_T_2400ms 8 | ||
64 | #define ADP8860_FADE_T_2700ms 9 | ||
65 | #define ADP8860_FADE_T_3000ms 10 | ||
66 | #define ADP8860_FADE_T_3500ms 11 | ||
67 | #define ADP8860_FADE_T_4000ms 12 | ||
68 | #define ADP8860_FADE_T_4500ms 13 | ||
69 | #define ADP8860_FADE_T_5000ms 14 | ||
70 | #define ADP8860_FADE_T_5500ms 15 /* 5.5 Sec */ | ||
71 | |||
72 | #define ADP8860_FADE_LAW_LINEAR 0 | ||
73 | #define ADP8860_FADE_LAW_SQUARE 1 | ||
74 | #define ADP8860_FADE_LAW_CUBIC1 2 | ||
75 | #define ADP8860_FADE_LAW_CUBIC2 3 | ||
76 | |||
77 | #define ADP8860_BL_AMBL_FILT_80ms 0 /* Light sensor filter time */ | ||
78 | #define ADP8860_BL_AMBL_FILT_160ms 1 | ||
79 | #define ADP8860_BL_AMBL_FILT_320ms 2 | ||
80 | #define ADP8860_BL_AMBL_FILT_640ms 3 | ||
81 | #define ADP8860_BL_AMBL_FILT_1280ms 4 | ||
82 | #define ADP8860_BL_AMBL_FILT_2560ms 5 | ||
83 | #define ADP8860_BL_AMBL_FILT_5120ms 6 | ||
84 | #define ADP8860_BL_AMBL_FILT_10240ms 7 /* 10.24 sec */ | ||
85 | |||
86 | /* | ||
87 | * Blacklight current 0..30mA | ||
88 | */ | ||
89 | #define ADP8860_BL_CUR_mA(I) ((I * 127) / 30) | ||
90 | |||
91 | /* | ||
92 | * L2 comparator current 0..1106uA | ||
93 | */ | ||
94 | #define ADP8860_L2_COMP_CURR_uA(I) ((I * 255) / 1106) | ||
95 | |||
96 | /* | ||
97 | * L3 comparator current 0..138uA | ||
98 | */ | ||
99 | #define ADP8860_L3_COMP_CURR_uA(I) ((I * 255) / 138) | ||
100 | |||
101 | struct adp8860_backlight_platform_data { | ||
102 | u8 bl_led_assign; /* 1 = Backlight 0 = Individual LED */ | ||
103 | |||
104 | u8 bl_fade_in; /* Backlight Fade-In Timer */ | ||
105 | u8 bl_fade_out; /* Backlight Fade-Out Timer */ | ||
106 | u8 bl_fade_law; /* fade-on/fade-off transfer characteristic */ | ||
107 | |||
108 | u8 en_ambl_sens; /* 1 = enable ambient light sensor */ | ||
109 | u8 abml_filt; /* Light sensor filter time */ | ||
110 | |||
111 | u8 l1_daylight_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
112 | u8 l1_daylight_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
113 | u8 l2_office_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
114 | u8 l2_office_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
115 | u8 l3_dark_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
116 | u8 l3_dark_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */ | ||
117 | |||
118 | u8 l2_trip; /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */ | ||
119 | u8 l2_hyst; /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */ | ||
120 | u8 l3_trip; /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */ | ||
121 | u8 l3_hyst; /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */ | ||
122 | |||
123 | /** | ||
124 | * Independent Current Sinks / LEDS | ||
125 | * Sinks not assigned to the Backlight can be exposed to | ||
126 | * user space using the LEDS CLASS interface | ||
127 | */ | ||
128 | |||
129 | int num_leds; | ||
130 | struct led_info *leds; | ||
131 | u8 led_fade_in; /* LED Fade-In Timer */ | ||
132 | u8 led_fade_out; /* LED Fade-Out Timer */ | ||
133 | u8 led_fade_law; /* fade-on/fade-off transfer characteristic */ | ||
134 | u8 led_on_time; | ||
135 | |||
136 | /** | ||
137 | * Gain down disable. Setting this option does not allow the | ||
138 | * charge pump to switch to lower gains. NOT AVAILABLE on ADP8860 | ||
139 | * 1 = the charge pump doesn't switch down in gain until all LEDs are 0. | ||
140 | * The charge pump switches up in gain as needed. This feature is | ||
141 | * useful if the ADP8863 charge pump is used to drive an external load. | ||
142 | * This feature must be used when utilizing small fly capacitors | ||
143 | * (0402 or smaller). | ||
144 | * 0 = the charge pump automatically switches up and down in gain. | ||
145 | * This provides optimal efficiency, but is not suitable for driving | ||
146 | * loads that are not connected through the ADP8863 diode drivers. | ||
147 | * Additionally, the charge pump fly capacitors should be low ESR | ||
148 | * and sized 0603 or greater. | ||
149 | */ | ||
150 | |||
151 | u8 gdwn_dis; | ||
152 | }; | ||
153 | |||
154 | #endif /* __LINUX_I2C_ADP8860_H */ | ||
diff --git a/include/linux/lcd.h b/include/linux/lcd.h index c67fecafff90..8877123f2d6e 100644 --- a/include/linux/lcd.h +++ b/include/linux/lcd.h | |||
@@ -69,6 +69,29 @@ struct lcd_device { | |||
69 | struct device dev; | 69 | struct device dev; |
70 | }; | 70 | }; |
71 | 71 | ||
72 | struct lcd_platform_data { | ||
73 | /* reset lcd panel device. */ | ||
74 | int (*reset)(struct lcd_device *ld); | ||
75 | /* on or off to lcd panel. if 'enable' is 0 then | ||
76 | lcd power off and 1, lcd power on. */ | ||
77 | int (*power_on)(struct lcd_device *ld, int enable); | ||
78 | |||
79 | /* it indicates whether lcd panel was enabled | ||
80 | from bootloader or not. */ | ||
81 | int lcd_enabled; | ||
82 | /* it means delay for stable time when it becomes low to high | ||
83 | or high to low that is dependent on whether reset gpio is | ||
84 | low active or high active. */ | ||
85 | unsigned int reset_delay; | ||
86 | /* stable time needing to become lcd power on. */ | ||
87 | unsigned int power_on_delay; | ||
88 | /* stable time needing to become lcd power off. */ | ||
89 | unsigned int power_off_delay; | ||
90 | |||
91 | /* it could be used for any purpose. */ | ||
92 | void *pdata; | ||
93 | }; | ||
94 | |||
72 | static inline void lcd_set_power(struct lcd_device *ld, int power) | 95 | static inline void lcd_set_power(struct lcd_device *ld, int power) |
73 | { | 96 | { |
74 | mutex_lock(&ld->update_lock); | 97 | mutex_lock(&ld->update_lock); |
diff --git a/include/linux/mfd/pcf50633/backlight.h b/include/linux/mfd/pcf50633/backlight.h new file mode 100644 index 000000000000..83747e217b27 --- /dev/null +++ b/include/linux/mfd/pcf50633/backlight.h | |||
@@ -0,0 +1,51 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009-2010, Lars-Peter Clausen <lars@metafoo.de> | ||
3 | * PCF50633 backlight device driver | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License as published by the | ||
7 | * Free Software Foundation; either version 2 of the License, or (at your | ||
8 | * option) any later version. | ||
9 | * | ||
10 | * You should have received a copy of the GNU General Public License along | ||
11 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
12 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #ifndef __LINUX_MFD_PCF50633_BACKLIGHT | ||
17 | #define __LINUX_MFD_PCF50633_BACKLIGHT | ||
18 | |||
19 | /* | ||
20 | * @default_brightness: Backlight brightness is initialized to this value | ||
21 | * | ||
22 | * Brightness to be used after the driver has been probed. | ||
23 | * Valid range 0-63. | ||
24 | * | ||
25 | * @default_brightness_limit: The actual brightness is limited by this value | ||
26 | * | ||
27 | * Brightness limit to be used after the driver has been probed. This is useful | ||
28 | * when it is not known how much power is available for the backlight during | ||
29 | * probe. | ||
30 | * Valid range 0-63. Can be changed later with pcf50633_bl_set_brightness_limit. | ||
31 | * | ||
32 | * @ramp_time: Display ramp time when changing brightness | ||
33 | * | ||
34 | * When changing the backlights brightness the change is not instant, instead | ||
35 | * it fades smooth from one state to another. This value specifies how long | ||
36 | * the fade should take. The lower the value the higher the fade time. | ||
37 | * Valid range 0-255 | ||
38 | */ | ||
39 | struct pcf50633_bl_platform_data { | ||
40 | unsigned int default_brightness; | ||
41 | unsigned int default_brightness_limit; | ||
42 | uint8_t ramp_time; | ||
43 | }; | ||
44 | |||
45 | |||
46 | struct pcf50633; | ||
47 | |||
48 | int pcf50633_bl_set_brightness_limit(struct pcf50633 *pcf, unsigned int limit); | ||
49 | |||
50 | #endif | ||
51 | |||
diff --git a/include/linux/mfd/pcf50633/core.h b/include/linux/mfd/pcf50633/core.h index 3398bd9aab11..ad411a78870c 100644 --- a/include/linux/mfd/pcf50633/core.h +++ b/include/linux/mfd/pcf50633/core.h | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/regulator/driver.h> | 18 | #include <linux/regulator/driver.h> |
19 | #include <linux/regulator/machine.h> | 19 | #include <linux/regulator/machine.h> |
20 | #include <linux/power_supply.h> | 20 | #include <linux/power_supply.h> |
21 | #include <linux/mfd/pcf50633/backlight.h> | ||
21 | 22 | ||
22 | struct pcf50633; | 23 | struct pcf50633; |
23 | 24 | ||
@@ -43,6 +44,8 @@ struct pcf50633_platform_data { | |||
43 | void (*force_shutdown)(struct pcf50633 *); | 44 | void (*force_shutdown)(struct pcf50633 *); |
44 | 45 | ||
45 | u8 resumers[5]; | 46 | u8 resumers[5]; |
47 | |||
48 | struct pcf50633_bl_platform_data *backlight_data; | ||
46 | }; | 49 | }; |
47 | 50 | ||
48 | struct pcf50633_irq { | 51 | struct pcf50633_irq { |
@@ -152,6 +155,7 @@ struct pcf50633 { | |||
152 | struct platform_device *mbc_pdev; | 155 | struct platform_device *mbc_pdev; |
153 | struct platform_device *adc_pdev; | 156 | struct platform_device *adc_pdev; |
154 | struct platform_device *input_pdev; | 157 | struct platform_device *input_pdev; |
158 | struct platform_device *bl_pdev; | ||
155 | struct platform_device *regulator_pdev[PCF50633_NUM_REGULATORS]; | 159 | struct platform_device *regulator_pdev[PCF50633_NUM_REGULATORS]; |
156 | }; | 160 | }; |
157 | 161 | ||