Lines Matching full:host

29 static void s5p_sdhci_set_control_reg(struct sdhci_host *host)  in s5p_sdhci_set_control_reg()  argument
39 sdhci_writel(host, SDHCI_CTRL4_DRIVE_MASK(0x3), SDHCI_CONTROL4); in s5p_sdhci_set_control_reg()
41 val = sdhci_readl(host, SDHCI_CONTROL2); in s5p_sdhci_set_control_reg()
49 sdhci_writel(host, val, SDHCI_CONTROL2); in s5p_sdhci_set_control_reg()
61 sdhci_writel(host, val, SDHCI_CONTROL3); in s5p_sdhci_set_control_reg()
69 ctrl = sdhci_readl(host, SDHCI_CONTROL2); in s5p_sdhci_set_control_reg()
72 sdhci_writel(host, ctrl, SDHCI_CONTROL2); in s5p_sdhci_set_control_reg()
75 static void s5p_set_clock(struct sdhci_host *host, u32 div) in s5p_set_clock() argument
78 set_mmc_clk(host->index, div); in s5p_set_clock()
86 static int s5p_sdhci_core_init(struct sdhci_host *host) in s5p_sdhci_core_init() argument
88 host->name = S5P_NAME; in s5p_sdhci_core_init()
90 host->quirks = SDHCI_QUIRK_NO_HISPD_BIT | SDHCI_QUIRK_BROKEN_VOLTAGE | in s5p_sdhci_core_init()
93 host->max_clk = 52000000; in s5p_sdhci_core_init()
94 host->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195; in s5p_sdhci_core_init()
95 host->ops = &s5p_sdhci_ops; in s5p_sdhci_core_init()
97 if (host->bus_width == 8) in s5p_sdhci_core_init()
98 host->host_caps |= MMC_MODE_8BIT; in s5p_sdhci_core_init()
101 return add_sdhci(host, 0, 400000); in s5p_sdhci_core_init()
109 struct sdhci_host *host = calloc(1, sizeof(struct sdhci_host)); in s5p_sdhci_init() local
110 if (!host) { in s5p_sdhci_init()
114 host->ioaddr = (void *)regbase; in s5p_sdhci_init()
115 host->index = index; in s5p_sdhci_init()
116 host->bus_width = bus_width; in s5p_sdhci_init()
118 return s5p_sdhci_core_init(host); in s5p_sdhci_init()
121 static int do_sdhci_init(struct sdhci_host *host) in do_sdhci_init() argument
125 flag = host->bus_width == 8 ? PINMUX_FLAG_8BIT_MODE : PINMUX_FLAG_NONE; in do_sdhci_init()
126 dev_id = host->index + PERIPH_ID_SDMMC0; in do_sdhci_init()
134 if (dm_gpio_is_valid(&host->pwr_gpio)) { in do_sdhci_init()
135 dm_gpio_set_value(&host->pwr_gpio, 1); in do_sdhci_init()
143 if (dm_gpio_is_valid(&host->cd_gpio)) { in do_sdhci_init()
144 ret = dm_gpio_get_value(&host->cd_gpio); in do_sdhci_init()
151 return s5p_sdhci_core_init(host); in do_sdhci_init()
154 static int sdhci_get_config(const void *blob, int node, struct sdhci_host *host) in sdhci_get_config() argument
165 host->index = dev_id - PERIPH_ID_SDMMC0; in sdhci_get_config()
173 host->bus_width = bus_width; in sdhci_get_config()
181 host->ioaddr = (void *)base; in sdhci_get_config()
184 &host->pwr_gpio, GPIOD_IS_OUT); in sdhci_get_config()
186 &host->cd_gpio, GPIOD_IS_IN); in sdhci_get_config()
196 struct sdhci_host *host = dev_get_priv(dev); in s5p_sdhci_probe() local
199 ret = sdhci_get_config(gd->fdt_blob, dev_of_offset(dev), host); in s5p_sdhci_probe()
203 ret = do_sdhci_init(host); in s5p_sdhci_probe()
207 ret = sdhci_setup_cfg(&plat->cfg, host, 0, 400000); in s5p_sdhci_probe()
211 host->mmc = &plat->mmc; in s5p_sdhci_probe()
212 host->mmc->priv = host; in s5p_sdhci_probe()
213 host->mmc->dev = dev; in s5p_sdhci_probe()
214 upriv->mmc = host->mmc; in s5p_sdhci_probe()