devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
To: Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org>
Cc: Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Adrian Hunter
	<adrian.hunter-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Russell King <linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org>,
	linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	nsekhar-l0cyMroinI0@public.gmane.org
Subject: Re: [PATCH 06/12] mmc: sdhci_omap: Add support to set IODELAY values
Date: Thu, 14 Dec 2017 07:04:57 -0800	[thread overview]
Message-ID: <20171214150457.GH14441@atomide.com> (raw)
In-Reply-To: <20171214130941.26666-7-kishon-l0cyMroinI0@public.gmane.org>

Hi,

* Kishon Vijay Abraham I <kishon-l0cyMroinI0@public.gmane.org> [171214 13:13]:
> The data manual of J6/J6 Eco recommends to set different IODELAY values
> depending on the mode in which the MMC/SD is enumerated in order to
> ensure IO timings are met.
> 
> Add support to set the IODELAY values depending on the various MMC
> modes using the pinctrl APIs.
...

> --- a/drivers/mmc/host/sdhci-omap.c
> +++ b/drivers/mmc/host/sdhci-omap.c
> @@ -105,6 +109,20 @@ struct sdhci_omap_host {
>  	struct sdhci_host	*host;
>  	u8			bus_mode;
>  	u8			power_mode;
> +	u8			timing;
> +	u8			flags;
> +
> +	struct pinctrl		*pinctrl;
> +	struct pinctrl_state	*pinctrl_state;
> +	struct pinctrl_state	*default_pinctrl_state;
> +	struct pinctrl_state	*sdr104_pinctrl_state;
> +	struct pinctrl_state	*hs200_1_8v_pinctrl_state;
> +	struct pinctrl_state	*ddr50_pinctrl_state;
> +	struct pinctrl_state	*sdr50_pinctrl_state;
> +	struct pinctrl_state	*sdr25_pinctrl_state;
> +	struct pinctrl_state	*sdr12_pinctrl_state;
> +	struct pinctrl_state	*hs_pinctrl_state;
> +	struct pinctrl_state	*ddr_1_8v_pinctrl_state;
>  };


You can make the pinctrl code more generic by allocating an array
of states and have just:

	struct pinctrl_state **pinctrl_state;

Then access it with omap_host->pinctrl_state[MMC_TIMING_MMC_HS200]
and so on.

This way the code gets simplified and you can do a generic function
to initialize things and call it from a for loop etc.

Just remember that pinctrl use can be optional as the pins can be
set up in the bootloader alone. Then you can just continue with the
default iodelay state like we are currently doing.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-12-14 15:04 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-14 13:09 [PATCH 00/12] mmc: sdhci-omap: Add UHS/HS200 mode support Kishon Vijay Abraham I
2017-12-14 13:09 ` [PATCH 01/12] mmc: sdhci-omap: Update 'power_mode' outside sdhci_omap_init_74_clocks Kishon Vijay Abraham I
2017-12-21  8:57   ` Adrian Hunter
2017-12-14 13:09 ` [PATCH 02/12] mmc: sdhci-omap: Add card_busy host ops Kishon Vijay Abraham I
2017-12-21  8:59   ` Adrian Hunter
2017-12-14 13:09 ` [PATCH 03/12] mmc: sdhci-omap: Add custom set_uhs_signaling sdhci_host ops Kishon Vijay Abraham I
2017-12-21  9:01   ` Adrian Hunter
2017-12-14 13:09 ` [PATCH 04/12] mmc: sdhci-omap: Add tuning support Kishon Vijay Abraham I
2017-12-21  9:09   ` Adrian Hunter
     [not found] ` <20171214130941.26666-1-kishon-l0cyMroinI0@public.gmane.org>
2017-12-14 13:09   ` [PATCH 05/12] mmc: sdhci-omap: Workaround for Errata i802 Kishon Vijay Abraham I
2017-12-21  9:09     ` Adrian Hunter
2017-12-14 13:09 ` [PATCH 06/12] mmc: sdhci_omap: Add support to set IODELAY values Kishon Vijay Abraham I
     [not found]   ` <20171214130941.26666-7-kishon-l0cyMroinI0@public.gmane.org>
2017-12-14 15:04     ` Tony Lindgren [this message]
2017-12-14 13:09 ` [PATCH 07/12] mmc: sdhci_omap: Fix sdhci-omap quirks Kishon Vijay Abraham I
     [not found]   ` <20171214130941.26666-8-kishon-l0cyMroinI0@public.gmane.org>
2017-12-21  9:12     ` Adrian Hunter
2017-12-14 13:09 ` [PATCH 08/12] mmc: sdhci-omap: Add support to override f_max and iodelay from pdata Kishon Vijay Abraham I
2017-12-14 14:04   ` Philippe Ombredanne
     [not found]   ` <20171214130941.26666-9-kishon-l0cyMroinI0@public.gmane.org>
2017-12-21  9:13     ` Adrian Hunter
2017-12-14 13:09 ` [RFC PATCH 09/12] mmc: sdhci: Use software timer when timeout greater than hardware capablility Kishon Vijay Abraham I
2017-12-20 14:11   ` Adrian Hunter
2018-01-04 12:59     ` Kishon Vijay Abraham I
2018-01-11  8:46       ` Adrian Hunter
2018-02-02 13:25         ` Kishon Vijay Abraham I
2017-12-14 13:09 ` [PATCH 10/12] dt-bindings: sdhci-omap: Add K2G specific binding Kishon Vijay Abraham I
     [not found]   ` <20171214130941.26666-11-kishon-l0cyMroinI0@public.gmane.org>
2017-12-16 16:49     ` Rob Herring
2017-12-14 13:09 ` [PATCH 11/12] mmc: sdhci-omap: Add support for MMC/SD controller in k2g SoC Kishon Vijay Abraham I
2017-12-21  9:15   ` Adrian Hunter
2017-12-14 13:09 ` [PATCH 12/12] ARM: OMAP2+: Use sdhci-omap specific pdata-quirks for MMC/SD on DRA74x EVM Kishon Vijay Abraham I

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=20171214150457.GH14441@atomide.com \
    --to=tony-4v6ys6ai5vpbdgjk7y7tuq@public.gmane.org \
    --cc=adrian.hunter-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=kishon-l0cyMroinI0@public.gmane.org \
    --cc=linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=nsekhar-l0cyMroinI0@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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).