diff options
author | Andrew Bresticker <abrestic@chromium.org> | 2013-04-29 19:17:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 21:28:18 -0400 |
commit | 46e1915eef9c0e935a09808a30e167abb857b4ec (patch) | |
tree | 5ebca88c181f8cda4ea901d56c83814eba3876ec | |
parent | 40d88fc60d426b0e1306adf6ec0be9da164e5d2a (diff) |
drivers/video/backlight/platform_lcd.c: introduce probe callback
Platform LCD devices may need to do some device-specific initialization
before they can be used (regulator or GPIO setup, for example), but
currently the driver does not support any way of doing this. This patch
adds a probe() callback to plat_lcd_data which platform LCD devices can
set to indicate that device-specific initialization is needed.
Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/video/backlight/platform_lcd.c | 6 | ||||
-rw-r--r-- | include/video/platform_lcd.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/drivers/video/backlight/platform_lcd.c b/drivers/video/backlight/platform_lcd.c index 54d94de652b0..056836706708 100644 --- a/drivers/video/backlight/platform_lcd.c +++ b/drivers/video/backlight/platform_lcd.c | |||
@@ -86,6 +86,12 @@ static int platform_lcd_probe(struct platform_device *pdev) | |||
86 | return -EINVAL; | 86 | return -EINVAL; |
87 | } | 87 | } |
88 | 88 | ||
89 | if (pdata->probe) { | ||
90 | err = pdata->probe(pdata); | ||
91 | if (err) | ||
92 | return err; | ||
93 | } | ||
94 | |||
89 | plcd = devm_kzalloc(&pdev->dev, sizeof(struct platform_lcd), | 95 | plcd = devm_kzalloc(&pdev->dev, sizeof(struct platform_lcd), |
90 | GFP_KERNEL); | 96 | GFP_KERNEL); |
91 | if (!plcd) { | 97 | if (!plcd) { |
diff --git a/include/video/platform_lcd.h b/include/video/platform_lcd.h index ad3bdfe743b2..23864b284147 100644 --- a/include/video/platform_lcd.h +++ b/include/video/platform_lcd.h | |||
@@ -15,6 +15,7 @@ struct plat_lcd_data; | |||
15 | struct fb_info; | 15 | struct fb_info; |
16 | 16 | ||
17 | struct plat_lcd_data { | 17 | struct plat_lcd_data { |
18 | int (*probe)(struct plat_lcd_data *); | ||
18 | void (*set_power)(struct plat_lcd_data *, unsigned int power); | 19 | void (*set_power)(struct plat_lcd_data *, unsigned int power); |
19 | int (*match_fb)(struct plat_lcd_data *, struct fb_info *); | 20 | int (*match_fb)(struct plat_lcd_data *, struct fb_info *); |
20 | }; | 21 | }; |