drivers/video/backlight/platform_lcd.c: introduce probe callback
authorAndrew Bresticker <abrestic@chromium.org>
Mon, 29 Apr 2013 23:17:58 +0000 (16:17 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 30 Apr 2013 01:28:18 +0000 (18:28 -0700)
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>
drivers/video/backlight/platform_lcd.c
include/video/platform_lcd.h

index 54d94de652b0fa099832fed58cbc50ecb56722f6..05683670670895aeaf061979c776ff3150c1b370 100644 (file)
@@ -86,6 +86,12 @@ static int platform_lcd_probe(struct platform_device *pdev)
                return -EINVAL;
        }
 
+       if (pdata->probe) {
+               err = pdata->probe(pdata);
+               if (err)
+                       return err;
+       }
+
        plcd = devm_kzalloc(&pdev->dev, sizeof(struct platform_lcd),
                            GFP_KERNEL);
        if (!plcd) {
index ad3bdfe743b294372df1689aca5ac393119ff595..23864b2841477887cda6e6dab13fcb4a12b46db8 100644 (file)
@@ -15,6 +15,7 @@ struct plat_lcd_data;
 struct fb_info;
 
 struct plat_lcd_data {
+       int     (*probe)(struct plat_lcd_data *);
        void    (*set_power)(struct plat_lcd_data *, unsigned int power);
        int     (*match_fb)(struct plat_lcd_data *, struct fb_info *);
 };