Commit 46e1915e authored by Andrew Bresticker's avatar Andrew Bresticker Committed by Linus Torvalds

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: default avatarAndrew Bresticker <abrestic@chromium.org>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Reviewed-by: default avatarDoug Anderson <dianders@chromium.org>
Acked-by: default avatarJingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 40d88fc6
...@@ -86,6 +86,12 @@ static int platform_lcd_probe(struct platform_device *pdev) ...@@ -86,6 +86,12 @@ static int platform_lcd_probe(struct platform_device *pdev)
return -EINVAL; return -EINVAL;
} }
if (pdata->probe) {
err = pdata->probe(pdata);
if (err)
return err;
}
plcd = devm_kzalloc(&pdev->dev, sizeof(struct platform_lcd), plcd = devm_kzalloc(&pdev->dev, sizeof(struct platform_lcd),
GFP_KERNEL); GFP_KERNEL);
if (!plcd) { if (!plcd) {
......
...@@ -15,6 +15,7 @@ struct plat_lcd_data; ...@@ -15,6 +15,7 @@ struct plat_lcd_data;
struct fb_info; struct fb_info;
struct plat_lcd_data { struct plat_lcd_data {
int (*probe)(struct plat_lcd_data *);
void (*set_power)(struct plat_lcd_data *, unsigned int power); void (*set_power)(struct plat_lcd_data *, unsigned int power);
int (*match_fb)(struct plat_lcd_data *, struct fb_info *); int (*match_fb)(struct plat_lcd_data *, struct fb_info *);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment