Lines Matching refs:ios

326 		struct sdhc_io ios;  in rcar_mmc_reset()  local
328 memcpy(&ios, &data->host_io, sizeof(ios)); in rcar_mmc_reset()
329 memset(&data->host_io, 0, sizeof(ios)); in rcar_mmc_reset()
331 data->host_io.power_mode = ios.power_mode; in rcar_mmc_reset()
333 ret = sdhc_set_io(dev, &ios); in rcar_mmc_reset()
339 if (can_retune && (ios.timing == SDHC_TIMING_SDR50 || in rcar_mmc_reset()
340 ios.timing == SDHC_TIMING_SDR104 || in rcar_mmc_reset()
341 ios.timing == SDHC_TIMING_HS200)) { in rcar_mmc_reset()
1018 struct sdhc_io *ios) in rcar_mmc_change_voltage() argument
1023 if (!ios->signal_voltage || ios->signal_voltage == host_io->signal_voltage) { in rcar_mmc_change_voltage()
1027 switch (ios->signal_voltage) { in rcar_mmc_change_voltage()
1053 host_io->signal_voltage = ios->signal_voltage; in rcar_mmc_change_voltage()
1090 static int rcar_mmc_set_clk_rate(const struct device *dev, struct sdhc_io *ios) in rcar_mmc_set_clk_rate() argument
1099 if (host_io->clock == ios->clock) { in rcar_mmc_set_clk_rate()
1103 if (ios->clock == 0) { in rcar_mmc_set_clk_rate()
1108 if (ios->clock > data->props.f_max || ios->clock < data->props.f_min) { in rcar_mmc_set_clk_rate()
1109 LOG_ERR("SDHC I/O: clock (%d) isn't in range %d - %d Hz", ios->clock, in rcar_mmc_set_clk_rate()
1114 divisor = DIV_ROUND_UP(cfg->max_frequency, ios->clock); in rcar_mmc_set_clk_rate()
1140 host_io->clock = ios->clock; in rcar_mmc_set_clk_rate()
1163 host_io->clock = ios->clock; in rcar_mmc_set_clk_rate()
1165 LOG_DBG("%s: set clock rate to %d", dev->name, ios->clock); in rcar_mmc_set_clk_rate()
1187 static int rcar_mmc_set_bus_width(const struct device *dev, struct sdhc_io *ios) in rcar_mmc_set_bus_width() argument
1196 if (host_io->bus_width == ios->bus_width) { in rcar_mmc_set_bus_width()
1200 if (!ios->bus_width) { in rcar_mmc_set_bus_width()
1204 switch (ios->bus_width) { in rcar_mmc_set_bus_width()
1243 host_io->bus_width = ios->bus_width; in rcar_mmc_set_bus_width()
1297 static int rcar_mmc_set_timings(const struct device *dev, struct sdhc_io *ios) in rcar_mmc_set_timings() argument
1304 if (host_io->timing == ios->timing) { in rcar_mmc_set_timings()
1314 switch (ios->timing) { in rcar_mmc_set_timings()
1360 ios->signal_voltage = new_voltage; in rcar_mmc_set_timings()
1361 if (rcar_mmc_change_voltage(dev->config, host_io, ios)) { in rcar_mmc_set_timings()
1370 host_io->timing = ios->timing; in rcar_mmc_set_timings()
1389 static int rcar_mmc_set_io(const struct device *dev, struct sdhc_io *ios) in rcar_mmc_set_io() argument
1395 if (!dev || !ios || !dev->data || !dev->config) { in rcar_mmc_set_io()
1404 ios->bus_width, ios->clock, ios->power_mode == SDHC_POWER_ON ? "ON" : "OFF", in rcar_mmc_set_io()
1405 rcar_mmc_get_timing_str(ios->timing), in rcar_mmc_set_io()
1406 rcar_mmc_get_signal_voltage_str(ios->signal_voltage)); in rcar_mmc_set_io()
1409 ret = rcar_mmc_set_clk_rate(dev, ios); in rcar_mmc_set_io()
1412 host_io->clock, ios->clock); in rcar_mmc_set_io()
1452 if (ios->bus_mode != SDHC_BUSMODE_PUSHPULL) { in rcar_mmc_set_io()
1453 LOG_ERR("SDHC I/O: not supported bus mode %d", ios->bus_mode); in rcar_mmc_set_io()
1456 host_io->bus_mode = ios->bus_mode; in rcar_mmc_set_io()
1459 if (ios->power_mode && host_io->power_mode != ios->power_mode) { in rcar_mmc_set_io()
1462 switch (ios->power_mode) { in rcar_mmc_set_io()
1497 LOG_ERR("SDHC I/O: not supported power mode %d", ios->power_mode); in rcar_mmc_set_io()
1504 host_io->power_mode = ios->power_mode; in rcar_mmc_set_io()
1507 ret = rcar_mmc_set_bus_width(dev, ios); in rcar_mmc_set_io()
1510 host_io->bus_width, ios->bus_width); in rcar_mmc_set_io()
1514 ret = rcar_mmc_set_timings(dev, ios); in rcar_mmc_set_io()
1517 host_io->timing, ios->timing); in rcar_mmc_set_io()
1521 ret = rcar_mmc_change_voltage(dev->config, host_io, ios); in rcar_mmc_set_io()
1524 host_io->signal_voltage, ios->signal_voltage); in rcar_mmc_set_io()
2024 struct sdhc_io ios = {0}; in rcar_mmc_init_controller_regs() local
2085 ios.clock = data->props.f_min; in rcar_mmc_init_controller_regs()
2086 rcar_mmc_set_clk_rate(dev, &ios); in rcar_mmc_init_controller_regs()