Re: [PATCH/RFC 2/3] mmc: sh_mobile_sdhi: Add tuning support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +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: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux