linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] backlight: platform_lcd: introduce probe callback
@ 2013-04-11 18:36 Andrew Bresticker
  2013-04-11 19:14 ` Doug Anderson
  2013-04-11 20:24 ` [PATCH v2] " Andrew Bresticker
  0 siblings, 2 replies; 8+ messages in thread
From: Andrew Bresticker @ 2013-04-11 18:36 UTC (permalink / raw)
  To: linux-fbdev
  Cc: Richard Purdie, Florian Tobias Schandinat, linux-kernel,
	Doug Anderson, Andrew Bresticker

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>
---
 drivers/video/backlight/platform_lcd.c | 8 ++++++++
 include/video/platform_lcd.h           | 1 +
 2 files changed, 9 insertions(+)

diff --git a/drivers/video/backlight/platform_lcd.c b/drivers/video/backlight/platform_lcd.c
index 54d94de..2fb24a1 100644
--- a/drivers/video/backlight/platform_lcd.c
+++ b/drivers/video/backlight/platform_lcd.c
@@ -86,6 +86,14 @@ static int platform_lcd_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
+	if (pdata->probe) {
+		err = pdata->probe(pdata);
+		if (err) {
+			dev_err(dev, "platform probe failed: %d\n", err);
+			return err;
+		}
+	}
+
 	plcd = devm_kzalloc(&pdev->dev, sizeof(struct platform_lcd),
 			    GFP_KERNEL);
 	if (!plcd) {
diff --git a/include/video/platform_lcd.h b/include/video/platform_lcd.h
index ad3bdfe..23864b2 100644
--- a/include/video/platform_lcd.h
+++ b/include/video/platform_lcd.h
@@ -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 *);
 };
-- 
1.8.1.3


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-04-16  0:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-11 18:36 [PATCH] backlight: platform_lcd: introduce probe callback Andrew Bresticker
2013-04-11 19:14 ` Doug Anderson
2013-04-11 20:17   ` Andrew Bresticker
2013-04-11 20:24 ` [PATCH v2] " Andrew Bresticker
2013-04-11 20:30   ` Doug Anderson
2013-04-15  1:47   ` Jingoo Han
2013-04-15 23:06   ` Andrew Morton
2013-04-16  0:53     ` Jingoo Han

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).