aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds
diff options
context:
space:
mode:
authorAnilKumar Ch <anilkumar@ti.com>2012-09-01 04:16:30 -0400
committerBryan Wu <bryan.wu@canonical.com>2012-09-11 06:32:43 -0400
commit8fe4554f675c5822a0e12382e6843965ffd11c30 (patch)
tree3807dd77e465c89c39fa09050d1f4e08320b845c /drivers/leds
parentb98d13c725920e9ab7696e0d7d19c4db1bdf6737 (diff)
leds: leds-gpio: adopt pinctrl support
Adopt pinctrl support to leds-gpio driver based on leds-gpio device pointer, pinctrl driver configure SoC pins to GPIO mode according to definitions provided in .dts file. Signed-off-by: AnilKumar Ch <anilkumar@ti.com> Acked-by: Marek Vasut <marex@denx.de> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/leds-gpio.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
index cde85ba1903a..087d1e66f4f7 100644
--- a/drivers/leds/leds-gpio.c
+++ b/drivers/leds/leds-gpio.c
@@ -20,6 +20,7 @@
20#include <linux/slab.h> 20#include <linux/slab.h>
21#include <linux/workqueue.h> 21#include <linux/workqueue.h>
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/pinctrl/consumer.h>
23 24
24struct gpio_led_data { 25struct gpio_led_data {
25 struct led_classdev cdev; 26 struct led_classdev cdev;
@@ -234,8 +235,14 @@ static int __devinit gpio_led_probe(struct platform_device *pdev)
234{ 235{
235 struct gpio_led_platform_data *pdata = pdev->dev.platform_data; 236 struct gpio_led_platform_data *pdata = pdev->dev.platform_data;
236 struct gpio_leds_priv *priv; 237 struct gpio_leds_priv *priv;
238 struct pinctrl *pinctrl;
237 int i, ret = 0; 239 int i, ret = 0;
238 240
241 pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
242 if (IS_ERR(pinctrl))
243 dev_warn(&pdev->dev,
244 "pins are not configured from the driver\n");
245
239 if (pdata && pdata->num_leds) { 246 if (pdata && pdata->num_leds) {
240 priv = devm_kzalloc(&pdev->dev, 247 priv = devm_kzalloc(&pdev->dev,
241 sizeof_gpio_leds_priv(pdata->num_leds), 248 sizeof_gpio_leds_priv(pdata->num_leds),