Message ID | 1353557099-21599-2-git-send-email-gururaja.hebbar@ti.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
On Thu, Nov 22, 2012 at 09:34:58AM +0530, Hebbar, Gururaja wrote: > + pinctrl = devm_pinctrl_get_select_default(&pdev->dev); > + if (IS_ERR(pinctrl)) > + dev_warn(&pdev->dev, > + "pins are not configured from the driver\n"); Since the driver is happy to continue without the pins why is it bothering requesting them in the first place? In other words, this should be a hard error.
>>>>> "Mark" == Mark Brown <broonie@opensource.wolfsonmicro.com> writes: Hi, Mark> On Thu, Nov 22, 2012 at 09:34:58AM +0530, Hebbar, Gururaja wrote: >> + pinctrl = devm_pinctrl_get_select_default(&pdev->dev); >> + if (IS_ERR(pinctrl)) >> + dev_warn(&pdev->dev, >> + "pins are not configured from the driver\n"); Mark> Since the driver is happy to continue without the pins why is it Mark> bothering requesting them in the first place? In other words, this Mark> should be a hard error. Sorry, I disagree. As was discussed recently, there's several reasons why the pinctrl call might fail, and not all are fatal (E.G. pinmux already setup by bootloader): http://article.gmane.org/gmane.linux.kernel/1399756
On Mon, Nov 26, 2012 at 09:55:33PM -0800, Peter Korsgaard wrote: > >>>>> "Mark" == Mark Brown <broonie@opensource.wolfsonmicro.com> writes: > Mark> Since the driver is happy to continue without the pins why is it > Mark> bothering requesting them in the first place? In other words, this > Mark> should be a hard error. > Sorry, I disagree. As was discussed recently, there's several reasons > why the pinctrl call might fail, and not all are fatal (E.G. pinmux > already setup by bootloader): > http://article.gmane.org/gmane.linux.kernel/1399756 I'd expect the platform to provide stub mappings for cases where the pinmux code shouldn't do anything.
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index 5715595..76c05d9 100644 --- a/sound/soc/davinci/davinci-mcasp.c +++ b/sound/soc/davinci/davinci-mcasp.c @@ -25,6 +25,7 @@ #include <linux/of.h> #include <linux/of_platform.h> #include <linux/of_device.h> +#include <linux/pinctrl/consumer.h> #include <sound/core.h> #include <sound/pcm.h> @@ -1108,6 +1109,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev) struct resource *mem, *ioarea, *res; struct snd_platform_data *pdata; struct davinci_audio_dev *dev; + struct pinctrl *pinctrl; int ret; if (!pdev->dev.platform_data && !pdev->dev.of_node) { @@ -1139,6 +1141,11 @@ static int davinci_mcasp_probe(struct platform_device *pdev) return -EBUSY; } + pinctrl = devm_pinctrl_get_select_default(&pdev->dev); + if (IS_ERR(pinctrl)) + dev_warn(&pdev->dev, + "pins are not configured from the driver\n"); + pm_runtime_enable(&pdev->dev); ret = pm_runtime_get_sync(&pdev->dev);