Dear Bryan Wu, > On Sun, Aug 26, 2012 at 5:12 PM, Marek Vasut <marex@xxxxxxx> wrote: > > Dear Bryan Wu, > > > >> On Sun, Aug 26, 2012 at 3:30 AM, Marek Vasut <marex@xxxxxxx> wrote: > >> > Add call to pinctrl, so the gpio-leds driver can configure the > >> > pin multiplexing of GPIOs driving the LEDs connected to them. > >> > >> You just introduce a new instant 'pinctrl', but there is no code use > >> it in this driver? Did I miss something? > > > > I just need this gpio-leds driver to configure the pins for me, did I go > > wrong about it? Please advise. > > Maybe I don't understand how to use this 'pinctrl' in this patch, > since I didn't see any code to use that. > Could you please post code to configure the pins in gpio-leds driver? It's not code that uses this, it's a DT property. But then, if the DT property is not present, this fails ... so this patch is wrong. The pinctrl is used by simply specifying the "pinctrl-names" and "pinctrl-0" properties in the DT file. But I wonder how to go about this. > -Bryan > > >> > Signed-off-by: Marek Vasut <marex@xxxxxxx> > >> > Cc: Bryan Wu <bryan.wu@xxxxxxxxxxxxx> > >> > Cc: Richard Purdie <rpurdie@xxxxxxxxx> > >> > Cc: Grant Likely <grant.likely@xxxxxxxxxxxx> > >> > Cc: Rob Herring <rob.herring@xxxxxxxxxxx> > >> > Cc: linux-leds@xxxxxxxxxxxxxxx > >> > --- > >> > > >> > drivers/leds/leds-gpio.c | 6 ++++++ > >> > 1 file changed, 6 insertions(+) > >> > > >> > diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c > >> > index cde85ba..877d69e 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; > >> > > >> > @@ -234,8 +235,13 @@ 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)) > >> > + return PTR_ERR(pinctrl); > >> > + > >> > > >> > if (pdata && pdata->num_leds) { > >> > > >> > priv = devm_kzalloc(&pdev->dev, > >> > > >> > sizeof_gpio_leds_priv(pdata->num_leds) > >> > , > >> > > >> > -- > >> > 1.7.10.4 > > > > Best regards, > > Marek Vasut Best regards, Marek Vasut -- To unsubscribe from this list: send the line "unsubscribe linux-leds" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html