aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-24 23:00:58 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-24 23:00:58 -0500
commitab7826595e9ec51a51f622c5fc91e2f59440481a (patch)
tree34241b399fa7a12c260e06e6c1c31bc69d46e1e3 /drivers/video
parent21fbd5809ad126b949206d78e0a0e07ec872ea11 (diff)
parentff7109fa632654eaef657186f2942f5b679023d6 (diff)
Merge tag 'mfd-3.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
Pull MFS updates from Samuel Ortiz: "This is the MFD pull request for the 3.9 merge window. No new drivers this time, but a bunch of fairly big cleanups: - Roger Quadros worked on a OMAP USBHS and TLL platform data consolidation, OMAP5 support and clock management code cleanup. - The first step of a major sync for the ab8500 driver from Lee Jones. In particular, the debugfs and the sysct interfaces got extended and improved. - Peter Ujfalusi sent a nice patchset for cleaning and fixing the twl-core driver, with a much needed module id lookup code improvement. - The regular wm5102 and arizona cleanups and fixes from Mark Brown. - Laxman Dewangan extended the palmas APIs in order to implement the palmas GPIO and rt drivers. - Laxman also added DT support for the tps65090 driver. - The Intel SCH and ICH drivers got a couple fixes from Aaron Sierra and Darren Hart. - Linus Walleij patchset for the ab8500 driver allowed ab8500 and ab9540 based devices to switch to the new abx500 pin-ctrl driver. - The max8925 now has device tree and irqdomain support thanks to Qing Xu. - The recently added rtsx driver got a few cleanups and fixes for a better card detection code path and now also supports the RTS5227 chipset, thanks to Wei Wang and Roger Tseng." * tag 'mfd-3.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (109 commits) mfd: lpc_ich: Use devres API to allocate private data mfd: lpc_ich: Add Device IDs for Intel Wellsburg PCH mfd: lpc_sch: Accomodate partial population of the MFD devices mfd: da9052-i2c: Staticize da9052_i2c_fix() mfd: syscon: Fix sparse warning mfd: twl-core: Fix kernel panic on boot mfd: rtsx: Fix issue that booting OS with SD card inserted mfd: ab8500: Fix compile error mfd: Add missing GENERIC_HARDIRQS dependecies Documentation: Add docs for max8925 dt mfd: max8925: Add dts mfd: max8925: Support dt for backlight mfd: max8925: Fix onkey driver irq base mfd: max8925: Fix mfd device register failure mfd: max8925: Add irqdomain for dt mfd: vexpress: Allow vexpress-sysreg to self-initialise mfd: rtsx: Support RTS5227 mfd: rtsx: Implement driving adjustment to device-dependent callbacks mfd: vexpress: Add pseudo-GPIO based LEDs mfd: ab8500: Rename ab8500 to abx500 for hwmon driver ...
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/backlight/max8925_bl.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/drivers/video/backlight/max8925_bl.c b/drivers/video/backlight/max8925_bl.c
index 2c9bce050aa9..5ca11b066b7e 100644
--- a/drivers/video/backlight/max8925_bl.c
+++ b/drivers/video/backlight/max8925_bl.c
@@ -101,6 +101,29 @@ static const struct backlight_ops max8925_backlight_ops = {
101 .get_brightness = max8925_backlight_get_brightness, 101 .get_brightness = max8925_backlight_get_brightness,
102}; 102};
103 103
104#ifdef CONFIG_OF
105static int max8925_backlight_dt_init(struct platform_device *pdev,
106 struct max8925_backlight_pdata *pdata)
107{
108 struct device_node *nproot = pdev->dev.parent->of_node, *np;
109 int dual_string;
110
111 if (!nproot)
112 return -ENODEV;
113 np = of_find_node_by_name(nproot, "backlight");
114 if (!np) {
115 dev_err(&pdev->dev, "failed to find backlight node\n");
116 return -ENODEV;
117 }
118
119 of_property_read_u32(np, "maxim,max8925-dual-string", &dual_string);
120 pdata->dual_string = dual_string;
121 return 0;
122}
123#else
124#define max8925_backlight_dt_init(x, y) (-1)
125#endif
126
104static int max8925_backlight_probe(struct platform_device *pdev) 127static int max8925_backlight_probe(struct platform_device *pdev)
105{ 128{
106 struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent); 129 struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent);
@@ -147,6 +170,13 @@ static int max8925_backlight_probe(struct platform_device *pdev)
147 platform_set_drvdata(pdev, bl); 170 platform_set_drvdata(pdev, bl);
148 171
149 value = 0; 172 value = 0;
173 if (pdev->dev.parent->of_node && !pdata) {
174 pdata = devm_kzalloc(&pdev->dev,
175 sizeof(struct max8925_backlight_pdata),
176 GFP_KERNEL);
177 max8925_backlight_dt_init(pdev, pdata);
178 }
179
150 if (pdata) { 180 if (pdata) {
151 if (pdata->lxw_scl) 181 if (pdata->lxw_scl)
152 value |= (1 << 7); 182 value |= (1 << 7);
@@ -158,7 +188,6 @@ static int max8925_backlight_probe(struct platform_device *pdev)
158 ret = max8925_set_bits(chip->i2c, data->reg_mode_cntl, 0xfe, value); 188 ret = max8925_set_bits(chip->i2c, data->reg_mode_cntl, 0xfe, value);
159 if (ret < 0) 189 if (ret < 0)
160 goto out_brt; 190 goto out_brt;
161
162 backlight_update_status(bl); 191 backlight_update_status(bl);
163 return 0; 192 return 0;
164out_brt: 193out_brt: