devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] leds: leds-gpio: adopt pinctrl support
@ 2012-09-01  8:16 AnilKumar Ch
  2012-09-05  3:06 ` Bryan Wu
                   ` (3 more replies)
  0 siblings, 4 replies; 38+ messages in thread
From: AnilKumar Ch @ 2012-09-01  8:16 UTC (permalink / raw)
  To: bryan.wu-Z7WLFzj8eWMS+FvcfC7Uqw, rpurdie-Fm38FmjxZ/leoWH0uzbU5w,
	tony-4v6yS6AI5VpBDgjK7y7TUQ
  Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-leds-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

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-l0cyMroinI0@public.gmane.org>
---
Changes from v1:
	- Seperated from "Add DT for AM33XX devices" patch series
	- Incorporated Tony's comments on v1
	  * Changed to warning message instead od error return

 drivers/leds/leds-gpio.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
index c032b21..ad577f4 100644
--- a/drivers/leds/leds-gpio.c
+++ b/drivers/leds/leds-gpio.c
@@ -20,6 +20,7 @@
 #include <linux/slab.h>
 #include <linux/workqueue.h>
 #include <linux/module.h>
+#include <linux/pinctrl/consumer.h>
 
 struct gpio_led_data {
 	struct led_classdev cdev;
@@ -236,8 +237,14 @@ static int __devinit gpio_led_probe(struct platform_device *pdev)
 {
 	struct gpio_led_platform_data *pdata = pdev->dev.platform_data;
 	struct gpio_leds_priv *priv;
+	struct pinctrl *pinctrl;
 	int i, ret = 0;
 
+	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+	if (IS_ERR(pinctrl))
+		dev_warn(&pdev->dev,
+			"pins are not configured from the driver\n");
+
 	if (pdata && pdata->num_leds) {
 		priv = devm_kzalloc(&pdev->dev,
 				sizeof_gpio_leds_priv(pdata->num_leds),
-- 
1.7.9.5

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

end of thread, other threads:[~2012-11-05 16:27 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-01  8:16 [PATCH v2] leds: leds-gpio: adopt pinctrl support AnilKumar Ch
2012-09-05  3:06 ` Bryan Wu
     [not found]   ` <CAK5ve-Jqc1xpXa0VM7=+MN1cvm=8ysg9W9WRiG66yq7GRfh+Gw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-09-05  3:13     ` Marek Vasut
2012-09-05 23:34       ` Tony Lindgren
2012-09-06  2:05         ` Marek Vasut
2012-09-06 17:45           ` Tony Lindgren
2012-09-07  0:09             ` Marek Vasut
2012-09-07  7:59               ` AnilKumar, Chimata
2012-09-07  8:22                 ` Marek Vasut
2012-09-07 16:00                 ` Bryan Wu
2012-09-07 21:39             ` Linus Walleij
     [not found]               ` <CACRpkdYgcYAFy7bBn3XNcrkSoCpeA8yNaa9LZNd4w33Zp3Jjnw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-09-07 21:46                 ` Tony Lindgren
     [not found] ` <1346487390-11399-1-git-send-email-anilkumar-l0cyMroinI0@public.gmane.org>
2012-09-07  8:48   ` Domenico Andreoli
2012-09-07  9:10     ` AnilKumar, Chimata
2012-09-07 11:02       ` Domenico Andreoli
2012-09-07 14:30         ` AnilKumar, Chimata
     [not found]           ` <331ABD5ECB02734CA317220B2BBEABC13EA29BF3-Er742YJ7I/eIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2012-09-07 16:00             ` Domenico Andreoli
2012-09-07 16:35               ` Tony Lindgren
2012-09-07 21:59                 ` Linus Walleij
2012-09-07 21:57               ` Linus Walleij
     [not found]                 ` <CACRpkdbz7CQtaj9e-1kcRVszpCSoqKz=19YT68sTMF9SOyWa8w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-09-08 23:44                   ` Domenico Andreoli
2012-09-10 15:23                     ` Linus Walleij
2012-09-10 17:41                       ` Stephen Warren
2012-09-10 19:34                         ` Linus Walleij
2012-09-10 19:44                           ` Stephen Warren
2012-09-07 21:36 ` Linus Walleij
2012-09-10 19:40 ` Linus Walleij
     [not found]   ` <CACRpkdbSY-aH_Vf3Q4h-ufz35m6=vVXCEecGGS-WOsG7vmPZ0g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-10-01  7:03     ` AnilKumar, Chimata
2012-10-01  8:24       ` Linus Walleij
2012-10-01 15:44         ` Tony Lindgren
2012-10-01 19:59           ` Linus Walleij
     [not found]             ` <CACRpkdaib2M1_UwSbyUG8qwZC2h7xaT5VU7WMj=y+h4S4LianQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-10-03 10:52               ` AnilKumar, Chimata
     [not found]                 ` <331ABD5ECB02734CA317220B2BBEABC13EA3F22E-Er742YJ7I/eIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2012-10-03 12:36                   ` Linus Walleij
2012-10-30 14:12                     ` AnilKumar, Chimata
2012-11-04 17:37                       ` Linus Walleij
2012-11-05  6:44                         ` AnilKumar, Chimata
2012-11-05 16:27                         ` Tony Lindgren
2012-10-03 15:53                 ` Tony Lindgren

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).