diff options
| author | Jingoo Han <jg1.han@samsung.com> | 2012-10-04 20:13:01 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-05 14:04:54 -0400 |
| commit | 52e842432f36d5b15227d0ee0d2aa3d2bc3cc0b2 (patch) | |
| tree | 06ef0a36c4760fa422a93e85a81c093050da0fb1 | |
| parent | 66be0e5bf5f555742a14a14712b537470dd2ba7e (diff) | |
drivers/video/backlight/platform_lcd.c: add support for device tree based probe
This patch adds the of_match_table to platform-lcd driver to be
probed when platform-lcd device node is found in the device tree.
[akpm@linux-foundation.org: include of.h]
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
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 | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/video/backlight/platform_lcd.c b/drivers/video/backlight/platform_lcd.c index b6672340d6c7..ca4f5d70fe10 100644 --- a/drivers/video/backlight/platform_lcd.c +++ b/drivers/video/backlight/platform_lcd.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/fb.h> | 16 | #include <linux/fb.h> |
| 17 | #include <linux/backlight.h> | 17 | #include <linux/backlight.h> |
| 18 | #include <linux/lcd.h> | 18 | #include <linux/lcd.h> |
| 19 | #include <linux/of.h> | ||
| 19 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
| 20 | 21 | ||
| 21 | #include <video/platform_lcd.h> | 22 | #include <video/platform_lcd.h> |
| @@ -145,6 +146,14 @@ static SIMPLE_DEV_PM_OPS(platform_lcd_pm_ops, platform_lcd_suspend, | |||
| 145 | platform_lcd_resume); | 146 | platform_lcd_resume); |
| 146 | #endif | 147 | #endif |
| 147 | 148 | ||
| 149 | #ifdef CONFIG_OF | ||
| 150 | static const struct of_device_id platform_lcd_of_match[] = { | ||
| 151 | { .compatible = "platform-lcd" }, | ||
| 152 | {}, | ||
| 153 | }; | ||
| 154 | MODULE_DEVICE_TABLE(of, platform_lcd_of_match); | ||
| 155 | #endif | ||
| 156 | |||
| 148 | static struct platform_driver platform_lcd_driver = { | 157 | static struct platform_driver platform_lcd_driver = { |
| 149 | .driver = { | 158 | .driver = { |
| 150 | .name = "platform-lcd", | 159 | .name = "platform-lcd", |
| @@ -152,6 +161,7 @@ static struct platform_driver platform_lcd_driver = { | |||
| 152 | #ifdef CONFIG_PM | 161 | #ifdef CONFIG_PM |
| 153 | .pm = &platform_lcd_pm_ops, | 162 | .pm = &platform_lcd_pm_ops, |
| 154 | #endif | 163 | #endif |
| 164 | .of_match_table = of_match_ptr(platform_lcd_of_match), | ||
| 155 | }, | 165 | }, |
| 156 | .probe = platform_lcd_probe, | 166 | .probe = platform_lcd_probe, |
| 157 | .remove = __devexit_p(platform_lcd_remove), | 167 | .remove = __devexit_p(platform_lcd_remove), |
