aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/backlight/l4f00242t03.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 20:38:49 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 20:38:49 -0500
commit7c2db36e730ee4facd341679ecb21ee73ba92831 (patch)
tree75016fba72aaf0581b9263f7fa4c565e6e634f3c /drivers/video/backlight/l4f00242t03.c
parent8b5628ab83b671f96ac9f174c1bd51c92589fc82 (diff)
parenta47a376f1c025e23e836c0376813c0424de665c2 (diff)
Merge branch 'akpm' (incoming from Andrew)
Merge misc patches from Andrew Morton: - Florian has vanished so I appear to have become fbdev maintainer again :( - Joel and Mark are distracted to welcome to the new OCFS2 maintainer - The backlight queue - Small core kernel changes - lib/ updates - The rtc queue - Various random bits * akpm: (164 commits) rtc: rtc-davinci: use devm_*() functions rtc: rtc-max8997: use devm_request_threaded_irq() rtc: rtc-max8907: use devm_request_threaded_irq() rtc: rtc-da9052: use devm_request_threaded_irq() rtc: rtc-wm831x: use devm_request_threaded_irq() rtc: rtc-tps80031: use devm_request_threaded_irq() rtc: rtc-lp8788: use devm_request_threaded_irq() rtc: rtc-coh901331: use devm_clk_get() rtc: rtc-vt8500: use devm_*() functions rtc: rtc-tps6586x: use devm_request_threaded_irq() rtc: rtc-imxdi: use devm_clk_get() rtc: rtc-cmos: use dev_warn()/dev_dbg() instead of printk()/pr_debug() rtc: rtc-pcf8583: use dev_warn() instead of printk() rtc: rtc-sun4v: use pr_warn() instead of printk() rtc: rtc-vr41xx: use dev_info() instead of printk() rtc: rtc-rs5c313: use pr_err() instead of printk() rtc: rtc-at91rm9200: use dev_dbg()/dev_err() instead of printk()/pr_debug() rtc: rtc-rs5c372: use dev_dbg()/dev_warn() instead of printk()/pr_debug() rtc: rtc-ds2404: use dev_err() instead of printk() rtc: rtc-efi: use dev_err()/dev_warn()/pr_err() instead of printk() ...
Diffstat (limited to 'drivers/video/backlight/l4f00242t03.c')
-rw-r--r--drivers/video/backlight/l4f00242t03.c36
1 files changed, 11 insertions, 25 deletions
diff --git a/drivers/video/backlight/l4f00242t03.c b/drivers/video/backlight/l4f00242t03.c
index 9a35196d12d7..fb6155771326 100644
--- a/drivers/video/backlight/l4f00242t03.c
+++ b/drivers/video/backlight/l4f00242t03.c
@@ -49,7 +49,7 @@ static void l4f00242t03_reset(unsigned int gpio)
49static void l4f00242t03_lcd_init(struct spi_device *spi) 49static void l4f00242t03_lcd_init(struct spi_device *spi)
50{ 50{
51 struct l4f00242t03_pdata *pdata = spi->dev.platform_data; 51 struct l4f00242t03_pdata *pdata = spi->dev.platform_data;
52 struct l4f00242t03_priv *priv = dev_get_drvdata(&spi->dev); 52 struct l4f00242t03_priv *priv = spi_get_drvdata(spi);
53 const u16 cmd[] = { 0x36, param(0), 0x3A, param(0x60) }; 53 const u16 cmd[] = { 0x36, param(0), 0x3A, param(0x60) };
54 54
55 dev_dbg(&spi->dev, "initializing LCD\n"); 55 dev_dbg(&spi->dev, "initializing LCD\n");
@@ -70,7 +70,7 @@ static void l4f00242t03_lcd_init(struct spi_device *spi)
70static void l4f00242t03_lcd_powerdown(struct spi_device *spi) 70static void l4f00242t03_lcd_powerdown(struct spi_device *spi)
71{ 71{
72 struct l4f00242t03_pdata *pdata = spi->dev.platform_data; 72 struct l4f00242t03_pdata *pdata = spi->dev.platform_data;
73 struct l4f00242t03_priv *priv = dev_get_drvdata(&spi->dev); 73 struct l4f00242t03_priv *priv = spi_get_drvdata(spi);
74 74
75 dev_dbg(&spi->dev, "Powering down LCD\n"); 75 dev_dbg(&spi->dev, "Powering down LCD\n");
76 76
@@ -168,7 +168,7 @@ static int l4f00242t03_probe(struct spi_device *spi)
168 return -ENOMEM; 168 return -ENOMEM;
169 } 169 }
170 170
171 dev_set_drvdata(&spi->dev, priv); 171 spi_set_drvdata(spi, priv);
172 spi->bits_per_word = 9; 172 spi->bits_per_word = 9;
173 spi_setup(spi); 173 spi_setup(spi);
174 174
@@ -190,27 +190,24 @@ static int l4f00242t03_probe(struct spi_device *spi)
190 return ret; 190 return ret;
191 } 191 }
192 192
193 priv->io_reg = regulator_get(&spi->dev, "vdd"); 193 priv->io_reg = devm_regulator_get(&spi->dev, "vdd");
194 if (IS_ERR(priv->io_reg)) { 194 if (IS_ERR(priv->io_reg)) {
195 dev_err(&spi->dev, "%s: Unable to get the IO regulator\n", 195 dev_err(&spi->dev, "%s: Unable to get the IO regulator\n",
196 __func__); 196 __func__);
197 return PTR_ERR(priv->io_reg); 197 return PTR_ERR(priv->io_reg);
198 } 198 }
199 199
200 priv->core_reg = regulator_get(&spi->dev, "vcore"); 200 priv->core_reg = devm_regulator_get(&spi->dev, "vcore");
201 if (IS_ERR(priv->core_reg)) { 201 if (IS_ERR(priv->core_reg)) {
202 ret = PTR_ERR(priv->core_reg);
203 dev_err(&spi->dev, "%s: Unable to get the core regulator\n", 202 dev_err(&spi->dev, "%s: Unable to get the core regulator\n",
204 __func__); 203 __func__);
205 goto err1; 204 return PTR_ERR(priv->core_reg);
206 } 205 }
207 206
208 priv->ld = lcd_device_register("l4f00242t03", 207 priv->ld = lcd_device_register("l4f00242t03",
209 &spi->dev, priv, &l4f_ops); 208 &spi->dev, priv, &l4f_ops);
210 if (IS_ERR(priv->ld)) { 209 if (IS_ERR(priv->ld))
211 ret = PTR_ERR(priv->ld); 210 return PTR_ERR(priv->ld);
212 goto err2;
213 }
214 211
215 /* Init the LCD */ 212 /* Init the LCD */
216 l4f00242t03_lcd_init(spi); 213 l4f00242t03_lcd_init(spi);
@@ -220,33 +217,22 @@ static int l4f00242t03_probe(struct spi_device *spi)
220 dev_info(&spi->dev, "Epson l4f00242t03 lcd probed.\n"); 217 dev_info(&spi->dev, "Epson l4f00242t03 lcd probed.\n");
221 218
222 return 0; 219 return 0;
223
224err2:
225 regulator_put(priv->core_reg);
226err1:
227 regulator_put(priv->io_reg);
228
229 return ret;
230} 220}
231 221
232static int l4f00242t03_remove(struct spi_device *spi) 222static int l4f00242t03_remove(struct spi_device *spi)
233{ 223{
234 struct l4f00242t03_priv *priv = dev_get_drvdata(&spi->dev); 224 struct l4f00242t03_priv *priv = spi_get_drvdata(spi);
235 225
236 l4f00242t03_lcd_power_set(priv->ld, FB_BLANK_POWERDOWN); 226 l4f00242t03_lcd_power_set(priv->ld, FB_BLANK_POWERDOWN);
237 lcd_device_unregister(priv->ld); 227 lcd_device_unregister(priv->ld);
238 228 spi_set_drvdata(spi, NULL);
239 dev_set_drvdata(&spi->dev, NULL);
240
241 regulator_put(priv->io_reg);
242 regulator_put(priv->core_reg);
243 229
244 return 0; 230 return 0;
245} 231}
246 232
247static void l4f00242t03_shutdown(struct spi_device *spi) 233static void l4f00242t03_shutdown(struct spi_device *spi)
248{ 234{
249 struct l4f00242t03_priv *priv = dev_get_drvdata(&spi->dev); 235 struct l4f00242t03_priv *priv = spi_get_drvdata(spi);
250 236
251 if (priv) 237 if (priv)
252 l4f00242t03_lcd_power_set(priv->ld, FB_BLANK_POWERDOWN); 238 l4f00242t03_lcd_power_set(priv->ld, FB_BLANK_POWERDOWN);