Lines Matching refs:host
30 static void s5p_sdhci_set_control_reg(struct sdhci_host *host) in s5p_sdhci_set_control_reg() argument
40 sdhci_writel(host, SDHCI_CTRL4_DRIVE_MASK(0x3), SDHCI_CONTROL4); in s5p_sdhci_set_control_reg()
42 val = sdhci_readl(host, SDHCI_CONTROL2); in s5p_sdhci_set_control_reg()
50 sdhci_writel(host, val, SDHCI_CONTROL2); in s5p_sdhci_set_control_reg()
62 sdhci_writel(host, val, SDHCI_CONTROL3); in s5p_sdhci_set_control_reg()
70 ctrl = sdhci_readl(host, SDHCI_CONTROL2); in s5p_sdhci_set_control_reg()
73 sdhci_writel(host, ctrl, SDHCI_CONTROL2); in s5p_sdhci_set_control_reg()
76 static void s5p_set_clock_ext(struct sdhci_host *host, u32 div) in s5p_set_clock_ext() argument
79 set_mmc_clk(host->index, div); in s5p_set_clock_ext()
87 static int s5p_sdhci_core_init(struct sdhci_host *host) in s5p_sdhci_core_init() argument
89 host->name = S5P_NAME; in s5p_sdhci_core_init()
91 host->quirks = SDHCI_QUIRK_NO_HISPD_BIT | SDHCI_QUIRK_BROKEN_VOLTAGE | in s5p_sdhci_core_init()
94 host->max_clk = 52000000; in s5p_sdhci_core_init()
95 host->voltages = MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195; in s5p_sdhci_core_init()
96 host->ops = &s5p_sdhci_ops; in s5p_sdhci_core_init()
98 if (host->bus_width == 8) in s5p_sdhci_core_init()
99 host->host_caps |= MMC_MODE_8BIT; in s5p_sdhci_core_init()
102 return add_sdhci(host, 0, 400000); in s5p_sdhci_core_init()
110 struct sdhci_host *host = calloc(1, sizeof(struct sdhci_host)); in s5p_sdhci_init() local
111 if (!host) { in s5p_sdhci_init()
115 host->ioaddr = (void *)regbase; in s5p_sdhci_init()
116 host->index = index; in s5p_sdhci_init()
117 host->bus_width = bus_width; in s5p_sdhci_init()
119 return s5p_sdhci_core_init(host); in s5p_sdhci_init()
125 static int do_sdhci_init(struct sdhci_host *host) in do_sdhci_init() argument
129 flag = host->bus_width == 8 ? PINMUX_FLAG_8BIT_MODE : PINMUX_FLAG_NONE; in do_sdhci_init()
130 dev_id = host->index + PERIPH_ID_SDMMC0; in do_sdhci_init()
138 if (dm_gpio_is_valid(&host->pwr_gpio)) { in do_sdhci_init()
139 dm_gpio_set_value(&host->pwr_gpio, 1); in do_sdhci_init()
147 if (dm_gpio_is_valid(&host->cd_gpio)) { in do_sdhci_init()
148 ret = dm_gpio_get_value(&host->cd_gpio); in do_sdhci_init()
155 return s5p_sdhci_core_init(host); in do_sdhci_init()
158 static int sdhci_get_config(const void *blob, int node, struct sdhci_host *host) in sdhci_get_config() argument
169 host->index = dev_id - PERIPH_ID_SDMMC0; in sdhci_get_config()
177 host->bus_width = bus_width; in sdhci_get_config()
185 host->ioaddr = (void *)base; in sdhci_get_config()
188 &host->pwr_gpio, GPIOD_IS_OUT); in sdhci_get_config()
190 &host->cd_gpio, GPIOD_IS_IN); in sdhci_get_config()
197 struct sdhci_host *host; in process_nodes() local
209 host = &sdhci_host[i]; in process_nodes()
211 ret = sdhci_get_config(blob, node, host); in process_nodes()
218 ret = do_sdhci_init(host); in process_nodes()
247 struct sdhci_host *host = dev_get_priv(dev); in s5p_sdhci_probe() local
250 ret = sdhci_get_config(gd->fdt_blob, dev_of_offset(dev), host); in s5p_sdhci_probe()
254 ret = do_sdhci_init(host); in s5p_sdhci_probe()
258 ret = sdhci_setup_cfg(&plat->cfg, host, 0, 400000); in s5p_sdhci_probe()
262 host->mmc = &plat->mmc; in s5p_sdhci_probe()
263 host->mmc->priv = host; in s5p_sdhci_probe()
264 host->mmc->dev = dev; in s5p_sdhci_probe()
265 upriv->mmc = host->mmc; in s5p_sdhci_probe()