From: Wolfram Sang <wsa@the-dreams.de>
To: Simon Horman <horms+renesas@verge.net.au>
Cc: Ian Molton <ian@mnementh.co.uk>,
Ulf Hansson <ulf.hansson@linaro.org>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
Magnus Damm <magnus.damm@gmail.com>,
linux-mmc@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
Ben Hutchings <ben.hutchings@codethink.co.uk>
Subject: Re: [PATCH/RFC 2/3] mmc: sh_mobile_sdhi: Add tuning support
Date: Thu, 12 May 2016 18:50:13 +0200 [thread overview]
Message-ID: <20160512165013.GD13121@katana> (raw)
In-Reply-To: <1462859524-28522-3-git-send-email-horms+renesas@verge.net.au>
[-- Attachment #1: Type: text/plain, Size: 2071 bytes --]
> +struct sh_mobile_sdhi_scc {
> + unsigned long clk; /* clock for SDR104 */
'clk_rate' please. clk is too often used with struct clk *.
> +static void sh_mobile_sdhi_set_clk_div(struct platform_device *pdev, int state)
> +{
> + struct mmc_host *mmc = platform_get_drvdata(pdev);
> + struct tmio_mmc_host *host = mmc_priv(mmc);
> +
> + if (state) {
> + sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, ~0x0100 &
> + sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL));
> + sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, 0x00ff);
> + }
> +}
Left over? Doesn't seemt to get used in patch 1?
> +static inline u32 sd_scc_read32(struct tmio_mmc_host *host, int addr)
> +{
> + struct platform_device *pdev = host->pdev;
> + const struct of_device_id *of_id =
> + of_match_device(sh_mobile_sdhi_of_match, &pdev->dev);
> + const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
> +
> + return readl(host->ctl + of_data->scc_offset +
> + (addr << host->bus_shift));
> +}
> +
> +static inline void sd_scc_write32(struct tmio_mmc_host *host, int addr,
> + u32 val)
> +{
> + struct platform_device *pdev = host->pdev;
> + const struct of_device_id *of_id =
> + of_match_device(sh_mobile_sdhi_of_match, &pdev->dev);
> + const struct sh_mobile_sdhi_of_data *of_data = of_id->data;
> +
> + writel(val, host->ctl + of_data->scc_offset +
> + (addr << host->bus_shift));
It probably makes sense to store the SCC base pointer somewhere to
prevent all these lookups with every read/write.
> +static bool sh_mobile_sdhi_inquiry_tuning(struct tmio_mmc_host *host)
> +{
> + /* SDHI should be tuning only SDR104 */
> + if (host->mmc->ios.timing == MMC_TIMING_UHS_SDR104)
> + return true;
> + else
> + return false;
> +}
Really needed? See patch 1.
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> @@ -357,6 +588,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
> host->bus_shift = of_data->bus_shift;
> }
>
> + host->set_clk_div = sh_mobile_sdhi_set_clk_div;
Left over?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-05-12 16:50 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-10 5:52 [PATCH/RFC 0/3] UHS-I SDR-104 support for sh_mobile_sdhi Simon Horman
2016-05-10 5:52 ` [PATCH/RFC 1/3] mmc: tmio: Add tuning support Simon Horman
2016-05-12 6:12 ` Yoshihiro Shimoda
2016-05-13 2:36 ` Simon Horman
2016-05-12 16:50 ` Wolfram Sang
2016-05-13 2:28 ` Simon Horman
2016-05-13 3:31 ` Simon Horman
2016-05-10 5:52 ` [PATCH/RFC 2/3] mmc: sh_mobile_sdhi: " Simon Horman
2016-05-10 6:25 ` Kuninori Morimoto
2016-05-11 23:13 ` Simon Horman
2016-05-12 16:50 ` Wolfram Sang [this message]
2016-05-10 5:52 ` [PATCH/RFC 3/3] ARM: dts: r8a7790: lager: Enable UHS-I SDR-104 Simon Horman
2016-05-10 9:13 ` Magnus Damm
2016-05-11 12:44 ` Wolfram Sang
2016-05-11 23:11 ` Simon Horman
2016-05-12 6:30 ` [PATCH/RFC 0/3] UHS-I SDR-104 support for sh_mobile_sdhi Yoshihiro Shimoda
2016-05-12 6:45 ` Geert Uytterhoeven
2016-05-12 7:45 ` Yoshihiro Shimoda
2016-05-12 7:47 ` Geert Uytterhoeven
2016-05-12 8:09 ` Yoshihiro Shimoda
2016-05-12 8:32 ` Geert Uytterhoeven
[not found] ` <SG2PR06MB0919824AFCAE20C395E50738D8730@SG2PR06MB0919.apcprd06.prod.outlook.com>
2016-05-12 12:32 ` Geert Uytterhoeven
2016-05-12 12:41 ` Wolfram Sang
2016-05-12 12:53 ` Geert Uytterhoeven
2016-05-13 2:32 ` Simon Horman
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=20160512165013.GD13121@katana \
--to=wsa@the-dreams.de \
--cc=ben.hutchings@codethink.co.uk \
--cc=horms+renesas@verge.net.au \
--cc=ian@mnementh.co.uk \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=ulf.hansson@linaro.org \
--cc=wsa+renesas@sang-engineering.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).