> +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