Lines Matching defs:host

11 #include <linux/mmc/host.h>
102 static void dw_mci_k3_set_ios(struct dw_mci *host, struct mmc_ios *ios)
106 ret = clk_set_rate(host->ciu_clk, ios->clock);
108 dev_warn(host->dev, "failed to set rate %uHz\n", ios->clock);
110 host->bus_hz = clk_get_rate(host->ciu_clk);
117 static int dw_mci_hi6220_parse_dt(struct dw_mci *host)
121 priv = devm_kzalloc(host->dev, sizeof(*priv), GFP_KERNEL);
125 priv->reg = syscon_regmap_lookup_by_phandle(host->dev->of_node,
130 priv->ctrl_id = of_alias_get_id(host->dev->of_node, "mshc");
137 host->priv = priv;
145 struct dw_mci *host;
149 host = slot->host;
150 priv = host->priv;
166 dev_dbg(host->dev, "voltage not supported\n");
171 dev_dbg(host->dev, "switch voltage failed\n");
180 dev_dbg(host->dev, "Regulator set error %d: %d - %d\n",
188 static void dw_mci_hi6220_set_ios(struct dw_mci *host, struct mmc_ios *ios)
195 ret = clk_set_rate(host->biu_clk, clock);
197 dev_warn(host->dev, "failed to set rate %uHz\n", clock);
199 host->bus_hz = clk_get_rate(host->biu_clk);
216 static void dw_mci_hs_set_timing(struct dw_mci *host, int timing,
227 priv = host->priv;
249 mci_writel(host, GPIO, 0x0);
255 mci_writel(host, UHS_REG_EXT, reg_value);
257 mci_writel(host, ENABLE_SHIFT, enable_shift);
261 mci_writel(host, GPIO, (unsigned int)reg_value | GPIO_CLK_ENABLE);
267 static int dw_mci_hi3660_init(struct dw_mci *host)
269 mci_writel(host, CDTHRCTL, SDMMC_SET_THLD(SDCARD_RD_THRESHOLD,
272 dw_mci_hs_set_timing(host, MMC_TIMING_LEGACY, -1);
273 host->bus_hz /= (GENCLK_DIV + 1);
278 static int dw_mci_set_sel18(struct dw_mci *host, bool set)
284 priv = host->priv;
290 dev_err(host->dev, "sel18 %u error\n", val);
297 static void dw_mci_hi3660_set_ios(struct dw_mci *host, struct mmc_ios *ios)
302 struct k3_priv *priv = host->priv;
308 ret = clk_set_rate(host->ciu_clk, wanted);
310 dev_err(host->dev, "failed to set rate %luHz\n", wanted);
313 actual = clk_get_rate(host->ciu_clk);
315 dw_mci_hs_set_timing(host, ios->timing, -1);
316 host->bus_hz = actual / (GENCLK_DIV + 1);
317 host->current_speed = 0;
318 priv->cur_speed = host->bus_hz;
370 struct dw_mci *host = slot->host;
379 mci_writel(host, TMOUT, ~0);
380 dw_mci_hs_set_timing(host, mmc->ios.timing, smpl_phase);
390 dev_err(host->dev, "All phases bad!\n");
394 dw_mci_hs_set_timing(host, mmc->ios.timing, best_clksmpl);
396 dev_info(host->dev, "tuning ok best_clksmpl %u tuning_sample_flag %x\n",
407 struct dw_mci *host;
409 host = slot->host;
410 priv = host->priv;
419 ret = dw_mci_set_sel18(host, 0);
421 ret = dw_mci_set_sel18(host, 1);
428 dev_err(host->dev, "Regulator set error %d\n", ret);