if (priv->quirks && priv->quirks->hs400_4taps)
sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TAPSET,
- host->tap_set / 2);
+ priv->tap_set / 2);
sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_CKSEL,
SH_MOBILE_SDHI_SCC_CKSEL_DTSEL |
* result requiring the tap to be good in both runs before
* considering it for tuning selection.
*/
- for (i = 0; i < host->tap_num * 2; i++) {
- int offset = host->tap_num * (i < host->tap_num ? 1 : -1);
+ for (i = 0; i < priv->tap_num * 2; i++) {
+ int offset = priv->tap_num * (i < priv->tap_num ? 1 : -1);
- if (!test_bit(i, host->taps))
- clear_bit(i + offset, host->taps);
+ if (!test_bit(i, priv->taps))
+ clear_bit(i + offset, priv->taps);
}
/*
ntap = 0;
tap_start = 0;
tap_end = 0;
- for (i = 0; i < host->tap_num * 2; i++) {
- if (test_bit(i, host->taps)) {
+ for (i = 0; i < priv->tap_num * 2; i++) {
+ if (test_bit(i, priv->taps)) {
ntap++;
} else {
if (ntap > tap_cnt) {
}
if (tap_cnt >= SH_MOBILE_SDHI_MAX_TAP)
- host->tap_set = (tap_start + tap_end) / 2 % host->tap_num;
+ priv->tap_set = (tap_start + tap_end) / 2 % priv->tap_num;
else
return -EIO;
/* Set SCC */
- sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TAPSET, host->tap_set);
+ sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TAPSET, priv->tap_set);
/* Enable auto re-tuning */
sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_RVSCNTL,
struct renesas_sdhi *priv = host_to_priv(host);
int i, ret;
- host->tap_num = renesas_sdhi_init_tuning(host);
- if (!host->tap_num)
+ priv->tap_num = renesas_sdhi_init_tuning(host);
+ if (!priv->tap_num)
return 0; /* Tuning is not supported */
- if (host->tap_num * 2 >= sizeof(host->taps) * BITS_PER_BYTE) {
+ if (priv->tap_num * 2 >= sizeof(priv->taps) * BITS_PER_BYTE) {
dev_err(&host->pdev->dev,
"Too many taps, please update 'taps' in tmio_mmc_host!\n");
return -EINVAL;
}
priv->doing_tune = true;
- bitmap_zero(host->taps, host->tap_num * 2);
+ bitmap_zero(priv->taps, priv->tap_num * 2);
/* Issue CMD19 twice for each tap */
- for (i = 0; i < 2 * host->tap_num; i++) {
+ for (i = 0; i < 2 * priv->tap_num; i++) {
/* Set sampling clock position */
- sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TAPSET, i % host->tap_num);
+ sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TAPSET, i % priv->tap_num);
ret = mmc_send_tuning(host->mmc, opcode, NULL);
if (ret == 0)
- set_bit(i, host->taps);
+ set_bit(i, priv->taps);
}
return renesas_sdhi_select_tuning(host);
static bool renesas_sdhi_manual_correction(struct tmio_mmc_host *host, bool use_4tap)
{
struct renesas_sdhi *priv = host_to_priv(host);
- unsigned long new_tap = host->tap_set;
+ unsigned long new_tap = priv->tap_set;
u32 val;
val = sd_scc_read32(host, priv, SH_MOBILE_SDHI_SCC_RVSREQ);
return false;
}
- host->tap_set = (new_tap % host->tap_num);
+ priv->tap_set = (new_tap % priv->tap_num);
sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TAPSET,
- host->tap_set / (use_4tap ? 2 : 1));
+ priv->tap_set / (use_4tap ? 2 : 1));
return false;
}