Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1213003 > unrolled thread

Re: [PATCH] pwrseq: bind pinctrl pins before using the gpios

Started byUlf Hansson <ulf.hansson@linaro.org>
First post2015-08-25 14:10 +0200
Last post2015-08-27 10:50 +0200
Articles 2 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] pwrseq: bind pinctrl pins before using the gpios Ulf Hansson <ulf.hansson@linaro.org> - 2015-08-25 14:10 +0200
    Re: [PATCH] pwrseq: bind pinctrl pins before using the gpios Ulf Hansson <ulf.hansson@linaro.org> - 2015-08-27 10:50 +0200

#1213003 — Re: [PATCH] pwrseq: bind pinctrl pins before using the gpios

FromUlf Hansson <ulf.hansson@linaro.org>
Date2015-08-25 14:10 +0200
SubjectRe: [PATCH] pwrseq: bind pinctrl pins before using the gpios
Message-ID<q1ld8-60p-11@gated-at.bofh.it>
On 17 August 2015 at 13:58, Srinivas Kandagatla
<srinivas.kandagatla@linaro.org> wrote:
> Some of the pin-controllers like the Qualcomms "qcom,pm8921", which
> require a pinconf to be setup to use pins as gpios. Using the pins
> directly without pinconf setup would result in incorrect output voltage
> or load settings. On the other hand pwrseq code does not configure the
> pinctrl by default as it does not go thru the driver core.
>
> This patch adds a call to pinctrl_bind_pins() to bind pins which
> are going to be used as gpios.
>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

Thanks, applied for next! I add the "mmc:" to the prefix of the commit
message header.

Kind regards
Uffe

> ---
>  drivers/mmc/core/pwrseq.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/mmc/core/pwrseq.c b/drivers/mmc/core/pwrseq.c
> index 4c1d175..6e5d8b3 100644
> --- a/drivers/mmc/core/pwrseq.c
> +++ b/drivers/mmc/core/pwrseq.c
> @@ -12,6 +12,7 @@
>  #include <linux/err.h>
>  #include <linux/of.h>
>  #include <linux/of_platform.h>
> +#include <linux/pinctrl/devinfo.h>
>
>  #include <linux/mmc/host.h>
>
> @@ -65,6 +66,10 @@ int mmc_pwrseq_alloc(struct mmc_host *host)
>                 goto err;
>         }
>
> +       ret = pinctrl_bind_pins(&pdev->dev);
> +       if (ret)
> +               goto err;
> +
>         match = mmc_pwrseq_find(np);
>         if (IS_ERR(match)) {
>                 ret = PTR_ERR(match);
> --
> 1.9.1
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1214392

FromUlf Hansson <ulf.hansson@linaro.org>
Date2015-08-27 10:50 +0200
Message-ID<q212G-7MP-17@gated-at.bofh.it>
In reply to#1213003
+ Stephen Rothwell

On 25 August 2015 at 14:06, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> On 17 August 2015 at 13:58, Srinivas Kandagatla
> <srinivas.kandagatla@linaro.org> wrote:
>> Some of the pin-controllers like the Qualcomms "qcom,pm8921", which
>> require a pinconf to be setup to use pins as gpios. Using the pins
>> directly without pinconf setup would result in incorrect output voltage
>> or load settings. On the other hand pwrseq code does not configure the
>> pinctrl by default as it does not go thru the driver core.
>>
>> This patch adds a call to pinctrl_bind_pins() to bind pins which
>> are going to be used as gpios.
>>
>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>
> Thanks, applied for next! I add the "mmc:" to the prefix of the commit
> message header.

This went in too quickly, my bad!

The kbuild test robot reports an error when building i386 with
allmodconfig, so I will drop this patch from my next branch.
https://lists.01.org/pipermail/kbuild-all/2015-August/011806.html

Moreover I have some more comment around the patch, see below.

>
> Kind regards
> Uffe
>
>> ---
>>  drivers/mmc/core/pwrseq.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/drivers/mmc/core/pwrseq.c b/drivers/mmc/core/pwrseq.c
>> index 4c1d175..6e5d8b3 100644
>> --- a/drivers/mmc/core/pwrseq.c
>> +++ b/drivers/mmc/core/pwrseq.c
>> @@ -12,6 +12,7 @@
>>  #include <linux/err.h>
>>  #include <linux/of.h>
>>  #include <linux/of_platform.h>
>> +#include <linux/pinctrl/devinfo.h>
>>
>>  #include <linux/mmc/host.h>
>>
>> @@ -65,6 +66,10 @@ int mmc_pwrseq_alloc(struct mmc_host *host)
>>                 goto err;
>>         }
>>
>> +       ret = pinctrl_bind_pins(&pdev->dev);

pinctrl_bind_bins() uses devm_* functions and that's not going to work
as the used device here isn't being probed/released.

Instead you need to use the *non* devm_pinctrl_*() APIs, such as
pinctrl_get|put() etc.

>> +       if (ret)
>> +               goto err;
>> +
>>         match = mmc_pwrseq_find(np);
>>         if (IS_ERR(match)) {
>>                 ret = PTR_ERR(match);
>> --
>> 1.9.1
>>

Kind regards
Uffe
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web