devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: Dong Aisheng <b29396@freescale.com>
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	devicetree-discuss@lists.ozlabs.org,
	linus.walleij@stericsson.com, s.hauer@pengutronix.de,
	shawn.guo@freescale.com, kernel@pengutronix.de,
	grant.likely@secretlab.ca, rob.herring@calxeda.com
Subject: Re: [PATCH 3/3] ARM: imx6q: switch to use pinctrl driver
Date: Tue, 17 Apr 2012 14:23:36 -0600	[thread overview]
Message-ID: <4F8DD148.4000902@wwwdotorg.org> (raw)
In-Reply-To: <1334333915-1174-3-git-send-email-b29396@freescale.com>

On 04/13/2012 10:18 AM, Dong Aisheng wrote:
> From: Dong Aisheng <dong.aisheng@linaro.org>
> 
> ---
> This patch is used for test the new pinctrl driver.

> diff --git a/arch/arm/boot/dts/imx6q-arm2.dts b/arch/arm/boot/dts/imx6q-arm2.dts

>                       usdhc@0219c000 { /* uSDHC4 */
>  				fsl,card-wired;
>  				vmmc-supply = <&reg_3p3v>;
>  				status = "okay";
> +				pinctrl-names = "default";
> +				pinctrl-0 = <&pinctrl_usdhc4_1>;
>  			};
>  
>  			uart4: uart@021f0000 {
>  				status = "okay";
> +				pinctrl-names = "default";
> +				pinctrl-0 = <&pinctrl_uart4_1>;
>  			};

That seems reasonable.

> diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi

> +				usdhc4 {
> +					pinctrl_usdhc4_1: usdhc4grp-1 {

I'm slightly confused about how this part of the binding is structured.

I'd expect the label "pinctrl_usdhc4_1:" to point at the node "usdhc4"
here. As written, there's no possibility of using a different pin
configuration values such as pull/drive-strength/... for some of the
pins, which I'm pretty sure will be an issue.

For example, see tegra-cardhu.dts - it has a pull up on the SDMMC data
and clock lines, but no pull on the SDMMC command line. I assume it's
this way because of some aspect of the SDMMC specification, rather than
something odd about Tegra.

I guess you've allowed a list of mux functions in the fsl,mux property.
Perhaps you can also allow a list in the other properties.

In that case though, what is the top-level usdhc4 node for? Perhaps it
groups multiple different available pin configurations for the USDHC4
controller together just as documentation? I don't think it's that
useful to do that; it doesn't actually convey any extra information, and
the fact the node is a configuration for the USDHC4 controller is
readily apparent from the node's label and name.

> +						fsl,pins =	"MX6Q_PAD_SD4_CMD",
> +								"MX6Q_PAD_SD4_CLK",
> +								"MX6Q_PAD_SD4_DAT0",
> +								"MX6Q_PAD_SD4_DAT1",
> +								"MX6Q_PAD_SD4_DAT2",
> +								"MX6Q_PAD_SD4_DAT3",
> +								"MX6Q_PAD_SD4_DAT4",
> +								"MX6Q_PAD_SD4_DAT5",
> +								"MX6Q_PAD_SD4_DAT6",
> +								"MX6Q_PAD_SD4_DAT7";
> +						fsl,mux = <0 0 1 1 1 1 1 1 1 1>;
> +						fsl,pull = <1>;
> +						fsl,pue = <1>;
> +						fsl,pke = <1>;
> +						fsl,speed = <1>;
> +						fsl,drive-strength = <3>;
> +						fsl,slew-rate = <1>;
> +						fsl,hysteresis = <1>;
> +					};

> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c

> @@ -467,6 +469,12 @@ static int __devinit sdhci_esdhc_imx_probe(struct platform_device *pdev)
>  	clk_prepare_enable(clk);
>  	pltfm_host->clk = clk;
>  
> +	imx_data->p = pinctrl_get_select_default(&pdev->dev);

If you use devm_pinctrl_get_select_default() here (once it's checked in) ...

>  no_card_detect_pin:
>  no_board_data:
> +	pinctrl_put(imx_data->p);

... you don't need that ...

> @@ -586,6 +596,8 @@ static int __devexit sdhci_esdhc_imx_remove(struct platform_device *pdev)
>  		gpio_free(boarddata->cd_gpio);
>  	}
>  
> +	pinctrl_put(imx_data->p);

... or that.

  parent reply	other threads:[~2012-04-17 20:23 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-13 16:18 [PATCH 1/3] pinctrl: pinctrl-imx: add imx pinctrl core driver Dong Aisheng
2012-04-13 16:18 ` [PATCH 2/3] pinctrl: pinctrl-imx: add imx6q pinctrl driver Dong Aisheng
2012-04-17 20:12   ` Stephen Warren
2012-04-18  3:40     ` Dong Aisheng
2012-04-13 16:18 ` [PATCH 3/3] ARM: imx6q: switch to use " Dong Aisheng
2012-04-14 13:53   ` Sascha Hauer
2012-04-15  4:03     ` Dong Aisheng
     [not found]       ` <CAA+hA=QhSUZg0bWTss_4ROwZ--OOQfcP=mpt+MP7-ZKPkEwXyA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-04-15  7:37         ` Shawn Guo
2012-04-16  3:35           ` Dong Aisheng
2012-04-20  1:08             ` Jean-Christophe PLAGNIOL-VILLARD
2012-04-24  8:23             ` Linus Walleij
2012-04-24  8:46               ` Dong Aisheng
2012-04-17 20:23   ` Stephen Warren [this message]
2012-04-13 18:17 ` [PATCH 1/3] pinctrl: pinctrl-imx: add imx pinctrl core driver Dong Aisheng
     [not found] ` <1334333915-1174-1-git-send-email-b29396-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2012-04-14 13:48   ` Sascha Hauer
2012-04-15  3:49     ` Dong Aisheng
2012-04-15 14:17       ` Shawn Guo
2012-04-15 14:45         ` Sascha Hauer
2012-04-15 17:29         ` Sascha Hauer
     [not found]           ` <20120415172958.GG20478-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-04-16  1:47             ` Shawn Guo
2012-04-16 18:01               ` Stephen Warren
2012-04-16  3:47         ` Dong Aisheng
2012-04-16  3:46           ` Shawn Guo
2012-04-17  9:57             ` Dong Aisheng
2012-04-17 12:30               ` Sascha Hauer
2012-04-18  3:38                 ` Dong Aisheng
2012-04-17 20:58 ` Stephen Warren
2012-04-18  7:19   ` Dong Aisheng
2012-04-18 18:06     ` Stephen Warren
2012-04-19 15:28 ` Shawn Guo

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=4F8DD148.4000902@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=b29396@freescale.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=kernel@pengutronix.de \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rob.herring@calxeda.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawn.guo@freescale.com \
    /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).