Lines Matching full:sdhost
442 static void via_pwron_sleep(struct via_crdr_mmc_host *sdhost) in via_pwron_sleep() argument
444 if (sdhost->quirks & VIA_CRDR_QUIRK_300MS_PWRDELAY) in via_pwron_sleep()
874 struct via_crdr_mmc_host *sdhost = dev_id; in via_sdc_isr() local
880 if (!sdhost) in via_sdc_isr()
883 spin_lock(&sdhost->lock); in via_sdc_isr()
885 addrbase = sdhost->pcictrl_mmiobase; in via_sdc_isr()
892 addrbase = sdhost->sdhc_mmiobase; in via_sdc_isr()
905 schedule_work(&sdhost->carddet_work); in via_sdc_isr()
912 via_sdc_cmd_isr(sdhost, sd_status & VIA_CRDR_SDSTS_CMD_MASK); in via_sdc_isr()
917 via_sdc_data_isr(sdhost, sd_status & VIA_CRDR_SDSTS_DATA_MASK); in via_sdc_isr()
923 mmc_hostname(sdhost->mmc), sd_status); in via_sdc_isr()
930 spin_unlock(&sdhost->lock); in via_sdc_isr()
937 struct via_crdr_mmc_host *sdhost; in via_sdc_timeout() local
940 sdhost = from_timer(sdhost, t, timer); in via_sdc_timeout()
942 spin_lock_irqsave(&sdhost->lock, flags); in via_sdc_timeout()
944 if (sdhost->mrq) { in via_sdc_timeout()
946 "cmd:0x%x\n", mmc_hostname(sdhost->mmc), in via_sdc_timeout()
947 sdhost->mrq->cmd->opcode); in via_sdc_timeout()
949 if (sdhost->data) { in via_sdc_timeout()
951 sdhost->ddma_mmiobase + VIA_CRDR_DMACTRL); in via_sdc_timeout()
952 sdhost->data->error = -ETIMEDOUT; in via_sdc_timeout()
953 via_sdc_finish_data(sdhost); in via_sdc_timeout()
955 if (sdhost->cmd) in via_sdc_timeout()
956 sdhost->cmd->error = -ETIMEDOUT; in via_sdc_timeout()
958 sdhost->mrq->cmd->error = -ETIMEDOUT; in via_sdc_timeout()
959 queue_work(system_bh_wq, &sdhost->finish_bh_work); in via_sdc_timeout()
963 spin_unlock_irqrestore(&sdhost->lock, flags); in via_sdc_timeout()
1082 struct via_crdr_mmc_host *sdhost; in via_sd_probe() local
1109 sdhost = mmc_priv(mmc); in via_sd_probe()
1110 sdhost->mmc = mmc; in via_sd_probe()
1111 dev_set_drvdata(&pcidev->dev, sdhost); in via_sd_probe()
1115 sdhost->mmiobase = ioremap(base, len); in via_sd_probe()
1116 if (!sdhost->mmiobase) { in via_sd_probe()
1121 sdhost->sdhc_mmiobase = in via_sd_probe()
1122 sdhost->mmiobase + VIA_CRDR_SDC_OFF; in via_sd_probe()
1123 sdhost->ddma_mmiobase = in via_sd_probe()
1124 sdhost->mmiobase + VIA_CRDR_DDMA_OFF; in via_sd_probe()
1125 sdhost->pcictrl_mmiobase = in via_sd_probe()
1126 sdhost->mmiobase + VIA_CRDR_PCICTRL_OFF; in via_sd_probe()
1128 sdhost->power = MMC_VDD_165_195; in via_sd_probe()
1131 writeb(gatt, sdhost->pcictrl_mmiobase + VIA_CRDR_PCICLKGATT); in via_sd_probe()
1132 via_pwron_sleep(sdhost); in via_sd_probe()
1134 writeb(gatt, sdhost->pcictrl_mmiobase + VIA_CRDR_PCICLKGATT); in via_sd_probe()
1137 via_init_mmc_host(sdhost); in via_sd_probe()
1141 sdhost); in via_sd_probe()
1146 sdhost->pcictrl_mmiobase + VIA_CRDR_PCIINTCTRL); in via_sd_probe()
1148 sdhost->pcictrl_mmiobase + VIA_CRDR_PCITMOCTRL); in via_sd_probe()
1153 sdhost->quirks = VIA_CRDR_QUIRK_300MS_PWRDELAY; in via_sd_probe()
1162 iounmap(sdhost->mmiobase); in via_sd_probe()
1175 struct via_crdr_mmc_host *sdhost = pci_get_drvdata(pcidev); in via_sd_remove() local
1179 spin_lock_irqsave(&sdhost->lock, flags); in via_sd_remove()
1182 sdhost->reject = 1; in via_sd_remove()
1185 writeb(0x0, sdhost->pcictrl_mmiobase + VIA_CRDR_PCIINTCTRL); in via_sd_remove()
1187 if (sdhost->mrq) { in via_sd_remove()
1189 "transfer\n", mmc_hostname(sdhost->mmc)); in via_sd_remove()
1193 sdhost->ddma_mmiobase + VIA_CRDR_DMACTRL); in via_sd_remove()
1194 sdhost->mrq->cmd->error = -ENOMEDIUM; in via_sd_remove()
1195 if (sdhost->mrq->stop) in via_sd_remove()
1196 sdhost->mrq->stop->error = -ENOMEDIUM; in via_sd_remove()
1197 queue_work(system_bh_wq, &sdhost->finish_bh_work); in via_sd_remove()
1199 spin_unlock_irqrestore(&sdhost->lock, flags); in via_sd_remove()
1201 mmc_remove_host(sdhost->mmc); in via_sd_remove()
1203 free_irq(pcidev->irq, sdhost); in via_sd_remove()
1205 del_timer_sync(&sdhost->timer); in via_sd_remove()
1207 cancel_work_sync(&sdhost->finish_bh_work); in via_sd_remove()
1210 gatt = readb(sdhost->pcictrl_mmiobase + VIA_CRDR_PCICLKGATT); in via_sd_remove()
1212 writeb(gatt, sdhost->pcictrl_mmiobase + VIA_CRDR_PCICLKGATT); in via_sd_remove()
1214 iounmap(sdhost->mmiobase); in via_sd_remove()
1215 mmc_free_host(sdhost->mmc); in via_sd_remove()
1277 struct via_crdr_mmc_host *sdhost; in via_sd_resume() local
1280 sdhost = dev_get_drvdata(dev); in via_sd_resume()
1283 if (sdhost->power == MMC_VDD_165_195) in via_sd_resume()
1287 writeb(gatt, sdhost->pcictrl_mmiobase + VIA_CRDR_PCICLKGATT); in via_sd_resume()
1288 via_pwron_sleep(sdhost); in via_sd_resume()
1290 writeb(gatt, sdhost->pcictrl_mmiobase + VIA_CRDR_PCICLKGATT); in via_sd_resume()
1295 via_restore_pcictrlreg(sdhost); in via_sd_resume()
1296 via_init_sdc_pm(sdhost); in via_sd_resume()