linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Manish Narani <MNARANI@xilinx.com>
To: Michal Simek <michals@xilinx.com>, Ulf Hansson <ulf.hansson@linaro.org>
Cc: Michal Simek <michals@xilinx.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	git <git@xilinx.com>
Subject: RE: [PATCH] mmc: sdhci-of-arasan: Add pinctrl support to the driver
Date: Thu, 19 Nov 2020 17:20:25 +0000	[thread overview]
Message-ID: <BYAPR02MB589626845315581375811594C1E00@BYAPR02MB5896.namprd02.prod.outlook.com> (raw)
In-Reply-To: <aeb44b64-5ff6-5662-2761-0e804708ce8a@xilinx.com>

Hi Uffe/Michal,

> -----Original Message-----
> From: Michal Simek <michal.simek@xilinx.com>
> Sent: Wednesday, November 18, 2020 11:54 PM
> To: Ulf Hansson <ulf.hansson@linaro.org>; Manish Narani
> <MNARANI@xilinx.com>
> Cc: Michal Simek <michals@xilinx.com>; Adrian Hunter
> <adrian.hunter@intel.com>; Linux ARM <linux-arm-
> kernel@lists.infradead.org>; linux-mmc@vger.kernel.org; Linux Kernel
> Mailing List <linux-kernel@vger.kernel.org>; git <git@xilinx.com>
> Subject: Re: [PATCH] mmc: sdhci-of-arasan: Add pinctrl support to the driver
> 
> 
> 
> On 18. 11. 20 16:43, Ulf Hansson wrote:
> > On Wed, 18 Nov 2020 at 07:22, Manish Narani
> <manish.narani@xilinx.com> wrote:
> >>
> >> Driver should be able to handle optional pinctrl setting.
> >>
> >> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> >> Signed-off-by: Manish Narani <manish.narani@xilinx.com>
> >> ---
> >>  drivers/mmc/host/sdhci-of-arasan.c | 24 ++++++++++++++++++++++++
> >>  1 file changed, 24 insertions(+)
> >>
> >> diff --git a/drivers/mmc/host/sdhci-of-arasan.c
> b/drivers/mmc/host/sdhci-of-arasan.c
> >> index 829ccef87426..f788cc9d5914 100644
> >> --- a/drivers/mmc/host/sdhci-of-arasan.c
> >> +++ b/drivers/mmc/host/sdhci-of-arasan.c
> >> @@ -23,6 +23,7 @@
> >>  #include <linux/regmap.h>
> >>  #include <linux/of.h>
> >>  #include <linux/firmware/xlnx-zynqmp.h>
> >> +#include <linux/pinctrl/consumer.h>
> >>
> >>  #include "cqhci.h"
> >>  #include "sdhci-pltfm.h"
> >> @@ -135,6 +136,8 @@ struct sdhci_arasan_clk_data {
> >>   * @clk_ops:           Struct for the Arasan Controller Clock Operations.
> >>   * @soc_ctl_base:      Pointer to regmap for syscon for soc_ctl registers.
> >>   * @soc_ctl_map:       Map to get offsets into soc_ctl registers.
> >> + * @pinctrl:           Per-device pin control state holder.
> >> + * @pins_default:      Pinctrl state for a device.
> >>   * @quirks:            Arasan deviations from spec.
> >>   */
> >>  struct sdhci_arasan_data {
> >> @@ -149,6 +152,8 @@ struct sdhci_arasan_data {
> >>
> >>         struct regmap   *soc_ctl_base;
> >>         const struct sdhci_arasan_soc_ctl_map *soc_ctl_map;
> >> +       struct pinctrl  *pinctrl;
> >> +       struct pinctrl_state *pins_default;
> >>         unsigned int    quirks;
> >>
> >>  /* Controller does not have CD wired and will not function normally
> without */
> >> @@ -1619,6 +1624,25 @@ static int sdhci_arasan_probe(struct
> platform_device *pdev)
> >>                 goto unreg_clk;
> >>         }
> >>
> >> +       sdhci_arasan->pinctrl = devm_pinctrl_get(&pdev->dev);
> >> +       if (!IS_ERR(sdhci_arasan->pinctrl)) {
> >> +               sdhci_arasan->pins_default =
> >> +                       pinctrl_lookup_state(sdhci_arasan->pinctrl,
> >> +                                            PINCTRL_STATE_DEFAULT);
> >> +               if (IS_ERR(sdhci_arasan->pins_default)) {
> >> +                       dev_err(&pdev->dev, "Missing default pinctrl config\n");
> >> +                       ret = PTR_ERR(sdhci_arasan->pins_default);
> >> +                       goto unreg_clk;
> >> +               }
> >> +
> >> +               ret = pinctrl_select_state(sdhci_arasan->pinctrl,
> >> +                                          sdhci_arasan->pins_default);
> >> +               if (ret) {
> >> +                       dev_err(&pdev->dev, "could not select default state\n");
> >> +                       goto unreg_clk;
> >> +               }
> >> +       }
> >
> > Isn't all this already taken care of via pinctrl_bind_pins() called by
> > driver core during probe?
> >
> 
> Thanks for the hint.
> Manish: Can you please check it?

Thanks Uffe.
Yes, this is already taken care of via pinctrl_bind_pins() called during probe.
This patch is not required to be merged.

Thanks,
Manish

      reply	other threads:[~2020-11-19 17:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-18  6:21 [PATCH] mmc: sdhci-of-arasan: Add pinctrl support to the driver Manish Narani
2020-11-18 13:49 ` Michal Simek
2020-11-18 15:43 ` Ulf Hansson
2020-11-18 18:24   ` Michal Simek
2020-11-19 17:20     ` Manish Narani [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BYAPR02MB589626845315581375811594C1E00@BYAPR02MB5896.namprd02.prod.outlook.com \
    --to=mnarani@xilinx.com \
    --cc=adrian.hunter@intel.com \
    --cc=git@xilinx.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=michals@xilinx.com \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).