diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-28 16:56:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-28 16:56:35 -0400 |
commit | 30304e5a79d424eb2c8707b3ff0e9b8bf6ab3e8f (patch) | |
tree | 63968fb97b86861e31922515395feef8a110f884 /drivers/video | |
parent | 750f77064a290beb162352077b52c61b04bcae0e (diff) | |
parent | b8589e2a8065b8e7773742b60ae96b63b757bb69 (diff) |
Merge tag 'mfd_3.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
Pull MFD changes from Samuel Ortiz:
- 4 new drivers: Freescale i.MX on-chip Anatop, Ricoh's RC5T583 and
TI's TPS65090 and TPS65217.
- New variants support (8420, 8520 ab9540), cleanups and bug fixes for
the abx500 and db8500 ST-E chipsets.
- Some minor fixes and update for the wm8994 from Mark.
- The beginning of a long term TWL cleanup effort coming from the TI
folks.
- Various fixes and cleanups for the s5m, TPS659xx, pm860x, and MAX8997
drivers.
Fix up trivial conflicts due to duplicate patches and header file
cleanups (<linux/device.h> removal etc).
* tag 'mfd_3.4-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (97 commits)
gpio/twl: Add DT support to gpio-twl4030 driver
gpio/twl: Allocate irq_desc dynamically for SPARSE_IRQ support
mfd: Detach twl6040 from the pmic mfd driver
mfd: Replace twl-* pr_ macros by the dev_ equivalent and do various cleanups
mfd: Micro-optimization on twl4030 IRQ handler
mfd: Make twl4030 SIH SPARSE_IRQ capable
mfd: Move twl-core IRQ allocation into twl[4030|6030]-irq files
mfd: Remove references already defineid in header file from twl-core
mfd: Remove unneeded header from twl-core
mfd: Make twl-core not depend on pdata->irq_base/end
ARM: OMAP2+: board-omap4-*: Do not use anymore TWL6030_IRQ_BASE in board files
mfd: Return twl6030_mmc_card_detect IRQ for board setup
Revert "mfd: Add platform data for MAX8997 haptic driver"
mfd: Add support for TPS65090
mfd: Add some da9052-i2c section annotations
mfd: Build rtc5t583 only if I2C config is selected to y.
mfd: Add anatop mfd driver
mfd: Fix compilation error in tps65910.h
mfd: Add 8420 variant to db8500-prcmu
mfd: Add 8520 PRCMU variant to db8500-prcmu
...
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/backlight/88pm860x_bl.c | 49 |
1 files changed, 28 insertions, 21 deletions
diff --git a/drivers/video/backlight/88pm860x_bl.c b/drivers/video/backlight/88pm860x_bl.c index 915943af3f21..f49181c73113 100644 --- a/drivers/video/backlight/88pm860x_bl.c +++ b/drivers/video/backlight/88pm860x_bl.c | |||
@@ -67,6 +67,28 @@ static inline int wled_idc(int port) | |||
67 | return ret; | 67 | return ret; |
68 | } | 68 | } |
69 | 69 | ||
70 | static int backlight_power_set(struct pm860x_chip *chip, int port, | ||
71 | int on) | ||
72 | { | ||
73 | int ret = -EINVAL; | ||
74 | |||
75 | switch (port) { | ||
76 | case PM8606_BACKLIGHT1: | ||
77 | ret = on ? pm8606_osc_enable(chip, WLED1_DUTY) : | ||
78 | pm8606_osc_disable(chip, WLED1_DUTY); | ||
79 | break; | ||
80 | case PM8606_BACKLIGHT2: | ||
81 | ret = on ? pm8606_osc_enable(chip, WLED2_DUTY) : | ||
82 | pm8606_osc_disable(chip, WLED2_DUTY); | ||
83 | break; | ||
84 | case PM8606_BACKLIGHT3: | ||
85 | ret = on ? pm8606_osc_enable(chip, WLED3_DUTY) : | ||
86 | pm8606_osc_disable(chip, WLED3_DUTY); | ||
87 | break; | ||
88 | } | ||
89 | return ret; | ||
90 | } | ||
91 | |||
70 | static int pm860x_backlight_set(struct backlight_device *bl, int brightness) | 92 | static int pm860x_backlight_set(struct backlight_device *bl, int brightness) |
71 | { | 93 | { |
72 | struct pm860x_backlight_data *data = bl_get_data(bl); | 94 | struct pm860x_backlight_data *data = bl_get_data(bl); |
@@ -79,6 +101,9 @@ static int pm860x_backlight_set(struct backlight_device *bl, int brightness) | |||
79 | else | 101 | else |
80 | value = brightness; | 102 | value = brightness; |
81 | 103 | ||
104 | if (brightness) | ||
105 | backlight_power_set(chip, data->port, 1); | ||
106 | |||
82 | ret = pm860x_reg_write(data->i2c, wled_a(data->port), value); | 107 | ret = pm860x_reg_write(data->i2c, wled_a(data->port), value); |
83 | if (ret < 0) | 108 | if (ret < 0) |
84 | goto out; | 109 | goto out; |
@@ -115,6 +140,9 @@ static int pm860x_backlight_set(struct backlight_device *bl, int brightness) | |||
115 | if (ret < 0) | 140 | if (ret < 0) |
116 | goto out; | 141 | goto out; |
117 | 142 | ||
143 | if (brightness == 0) | ||
144 | backlight_power_set(chip, data->port, 0); | ||
145 | |||
118 | dev_dbg(chip->dev, "set brightness %d\n", value); | 146 | dev_dbg(chip->dev, "set brightness %d\n", value); |
119 | data->current_brightness = value; | 147 | data->current_brightness = value; |
120 | return 0; | 148 | return 0; |
@@ -170,7 +198,6 @@ static int pm860x_backlight_probe(struct platform_device *pdev) | |||
170 | struct backlight_device *bl; | 198 | struct backlight_device *bl; |
171 | struct resource *res; | 199 | struct resource *res; |
172 | struct backlight_properties props; | 200 | struct backlight_properties props; |
173 | unsigned char value; | ||
174 | char name[MFD_NAME_SIZE]; | 201 | char name[MFD_NAME_SIZE]; |
175 | int ret; | 202 | int ret; |
176 | 203 | ||
@@ -217,26 +244,6 @@ static int pm860x_backlight_probe(struct platform_device *pdev) | |||
217 | 244 | ||
218 | platform_set_drvdata(pdev, bl); | 245 | platform_set_drvdata(pdev, bl); |
219 | 246 | ||
220 | /* Enable reference VSYS */ | ||
221 | ret = pm860x_reg_read(data->i2c, PM8606_VSYS); | ||
222 | if (ret < 0) | ||
223 | goto out; | ||
224 | if ((ret & PM8606_VSYS_EN) == 0) { | ||
225 | value = ret | PM8606_VSYS_EN; | ||
226 | ret = pm860x_reg_write(data->i2c, PM8606_VSYS, value); | ||
227 | if (ret < 0) | ||
228 | goto out; | ||
229 | } | ||
230 | /* Enable reference OSC */ | ||
231 | ret = pm860x_reg_read(data->i2c, PM8606_MISC); | ||
232 | if (ret < 0) | ||
233 | goto out; | ||
234 | if ((ret & PM8606_MISC_OSC_EN) == 0) { | ||
235 | value = ret | PM8606_MISC_OSC_EN; | ||
236 | ret = pm860x_reg_write(data->i2c, PM8606_MISC, value); | ||
237 | if (ret < 0) | ||
238 | goto out; | ||
239 | } | ||
240 | /* read current backlight */ | 247 | /* read current backlight */ |
241 | ret = pm860x_backlight_get_brightness(bl); | 248 | ret = pm860x_backlight_get_brightness(bl); |
242 | if (ret < 0) | 249 | if (ret < 0) |