Lines Matching refs:slot
222 struct atmel_mci_slot *slot[ATMCI_MAX_NR_SLOTS]; member
286 struct atmel_mci_slot *slot = s->private; in atmci_req_show() local
293 spin_lock_bh(&slot->host->lock); in atmci_req_show()
294 mrq = slot->mrq; in atmci_req_show()
319 spin_unlock_bh(&slot->host->lock); in atmci_req_show()
474 static void atmci_init_debugfs(struct atmel_mci_slot *slot) in atmci_init_debugfs() argument
476 struct mmc_host *mmc = slot->mmc; in atmci_init_debugfs()
477 struct atmel_mci *host = slot->host; in atmci_init_debugfs()
492 node = debugfs_create_file("req", S_IRUSR, root, slot, &atmci_req_fops); in atmci_init_debugfs()
557 &pdata->slot[slot_id].bus_width)) in atmci_of_init()
558 pdata->slot[slot_id].bus_width = 1; in atmci_of_init()
560 pdata->slot[slot_id].detect_pin = in atmci_of_init()
563 pdata->slot[slot_id].detect_is_active_high = in atmci_of_init()
566 pdata->slot[slot_id].non_removable = in atmci_of_init()
569 pdata->slot[slot_id].wp_pin = in atmci_of_init()
630 struct atmel_mci_slot *slot, struct mmc_data *data) in atmci_set_timeout() argument
654 dev_vdbg(&slot->mmc->class_dev, "setting timeout to %u cycles\n", in atmci_set_timeout()
1136 struct atmel_mci_slot *slot) in atmci_start_request() argument
1144 mrq = slot->mrq; in atmci_start_request()
1145 host->cur_slot = slot; in atmci_start_request()
1166 atmci_writel(host, ATMCI_SDCR, slot->sdc_reg); in atmci_start_request()
1170 dev_dbg(&slot->mmc->class_dev, "WARNING: IMR=0x%08x\n", in atmci_start_request()
1173 if (unlikely(test_and_clear_bit(ATMCI_CARD_NEED_INIT, &slot->flags))) { in atmci_start_request()
1182 atmci_set_timeout(host, slot, data); in atmci_start_request()
1187 dev_vdbg(&slot->mmc->class_dev, "BLKR=0x%08x\n", in atmci_start_request()
1195 cmdflags = atmci_prepare_command(slot->mmc, cmd); in atmci_start_request()
1213 host->stop_cmdr = atmci_prepare_command(slot->mmc, mrq->stop); in atmci_start_request()
1235 struct atmel_mci_slot *slot, struct mmc_request *mrq) in atmci_queue_request() argument
1237 dev_vdbg(&slot->mmc->class_dev, "queue request: state=%d\n", in atmci_queue_request()
1241 slot->mrq = mrq; in atmci_queue_request()
1244 atmci_start_request(host, slot); in atmci_queue_request()
1247 list_add_tail(&slot->queue_node, &host->queue); in atmci_queue_request()
1254 struct atmel_mci_slot *slot = mmc_priv(mmc); in atmci_request() local
1255 struct atmel_mci *host = slot->host; in atmci_request()
1258 WARN_ON(slot->mrq); in atmci_request()
1271 if (!test_bit(ATMCI_CARD_PRESENT, &slot->flags)) { in atmci_request()
1284 atmci_queue_request(host, slot, mrq); in atmci_request()
1289 struct atmel_mci_slot *slot = mmc_priv(mmc); in atmci_set_ios() local
1290 struct atmel_mci *host = slot->host; in atmci_set_ios()
1295 slot->sdc_reg &= ~ATMCI_SDCBUS_MASK; in atmci_set_ios()
1298 slot->sdc_reg |= ATMCI_SDCBUS_1BIT; in atmci_set_ios()
1301 slot->sdc_reg |= ATMCI_SDCBUS_4BIT; in atmci_set_ios()
1321 slot->clock = ios->clock; in atmci_set_ios()
1323 if (host->slot[i] && host->slot[i]->clock in atmci_set_ios()
1324 && host->slot[i]->clock < clock_min) in atmci_set_ios()
1325 clock_min = host->slot[i]->clock; in atmci_set_ios()
1384 slot->clock = 0; in atmci_set_ios()
1386 if (host->slot[i] && host->slot[i]->clock) { in atmci_set_ios()
1407 set_bit(ATMCI_CARD_NEED_INIT, &slot->flags); in atmci_set_ios()
1434 struct atmel_mci_slot *slot = mmc_priv(mmc); in atmci_get_ro() local
1436 if (gpio_is_valid(slot->wp_pin)) { in atmci_get_ro()
1437 read_only = gpio_get_value(slot->wp_pin); in atmci_get_ro()
1448 struct atmel_mci_slot *slot = mmc_priv(mmc); in atmci_get_cd() local
1450 if (gpio_is_valid(slot->detect_pin)) { in atmci_get_cd()
1451 present = !(gpio_get_value(slot->detect_pin) ^ in atmci_get_cd()
1452 slot->detect_is_active_high); in atmci_get_cd()
1462 struct atmel_mci_slot *slot = mmc_priv(mmc); in atmci_enable_sdio_irq() local
1463 struct atmel_mci *host = slot->host; in atmci_enable_sdio_irq()
1466 atmci_writel(host, ATMCI_IER, slot->sdio_irq); in atmci_enable_sdio_irq()
1468 atmci_writel(host, ATMCI_IDR, slot->sdio_irq); in atmci_enable_sdio_irq()
1484 struct atmel_mci_slot *slot = NULL; in atmci_request_end() local
1503 slot = list_entry(host->queue.next, in atmci_request_end()
1505 list_del(&slot->queue_node); in atmci_request_end()
1507 mmc_hostname(slot->mmc)); in atmci_request_end()
1509 atmci_start_request(host, slot); in atmci_request_end()
1553 struct atmel_mci_slot *slot = (struct atmel_mci_slot *)data; in atmci_detect_change() local
1564 if (test_bit(ATMCI_SHUTDOWN, &slot->flags)) in atmci_detect_change()
1567 enable_irq(gpio_to_irq(slot->detect_pin)); in atmci_detect_change()
1568 present = !(gpio_get_value(slot->detect_pin) ^ in atmci_detect_change()
1569 slot->detect_is_active_high); in atmci_detect_change()
1570 present_old = test_bit(ATMCI_CARD_PRESENT, &slot->flags); in atmci_detect_change()
1572 dev_vdbg(&slot->mmc->class_dev, "detect change: %d (was %d)\n", in atmci_detect_change()
1576 struct atmel_mci *host = slot->host; in atmci_detect_change()
1579 dev_dbg(&slot->mmc->class_dev, "card %s\n", in atmci_detect_change()
1585 clear_bit(ATMCI_CARD_PRESENT, &slot->flags); in atmci_detect_change()
1587 set_bit(ATMCI_CARD_PRESENT, &slot->flags); in atmci_detect_change()
1590 mrq = slot->mrq; in atmci_detect_change()
1630 list_del(&slot->queue_node); in atmci_detect_change()
1638 mmc_request_done(slot->mmc, mrq); in atmci_detect_change()
1644 mmc_detect_change(slot->mmc, 0); in atmci_detect_change()
1997 struct atmel_mci_slot *slot = host->slot[i]; in atmci_sdio_interrupt() local
1998 if (slot && (status & slot->sdio_irq)) { in atmci_sdio_interrupt()
1999 mmc_signal_sdio_irq(slot->mmc); in atmci_sdio_interrupt()
2135 struct atmel_mci_slot *slot = dev_id; in atmci_detect_interrupt() local
2143 mod_timer(&slot->detect_timer, jiffies + msecs_to_jiffies(20)); in atmci_detect_interrupt()
2153 struct atmel_mci_slot *slot; in atmci_init_slot() local
2159 slot = mmc_priv(mmc); in atmci_init_slot()
2160 slot->mmc = mmc; in atmci_init_slot()
2161 slot->host = host; in atmci_init_slot()
2162 slot->detect_pin = slot_data->detect_pin; in atmci_init_slot()
2163 slot->wp_pin = slot_data->wp_pin; in atmci_init_slot()
2164 slot->detect_is_active_high = slot_data->detect_is_active_high; in atmci_init_slot()
2165 slot->sdc_reg = sdc_reg; in atmci_init_slot()
2166 slot->sdio_irq = sdio_irq; in atmci_init_slot()
2205 set_bit(ATMCI_CARD_PRESENT, &slot->flags); in atmci_init_slot()
2206 if (gpio_is_valid(slot->detect_pin)) { in atmci_init_slot()
2207 if (devm_gpio_request(&host->pdev->dev, slot->detect_pin, in atmci_init_slot()
2210 slot->detect_pin = -EBUSY; in atmci_init_slot()
2211 } else if (gpio_get_value(slot->detect_pin) ^ in atmci_init_slot()
2212 slot->detect_is_active_high) { in atmci_init_slot()
2213 clear_bit(ATMCI_CARD_PRESENT, &slot->flags); in atmci_init_slot()
2217 if (!gpio_is_valid(slot->detect_pin)) { in atmci_init_slot()
2224 if (gpio_is_valid(slot->wp_pin)) { in atmci_init_slot()
2225 if (devm_gpio_request(&host->pdev->dev, slot->wp_pin, in atmci_init_slot()
2228 slot->wp_pin = -EBUSY; in atmci_init_slot()
2232 host->slot[id] = slot; in atmci_init_slot()
2236 if (gpio_is_valid(slot->detect_pin)) { in atmci_init_slot()
2239 setup_timer(&slot->detect_timer, atmci_detect_change, in atmci_init_slot()
2240 (unsigned long)slot); in atmci_init_slot()
2242 ret = request_irq(gpio_to_irq(slot->detect_pin), in atmci_init_slot()
2245 "mmc-detect", slot); in atmci_init_slot()
2249 gpio_to_irq(slot->detect_pin)); in atmci_init_slot()
2250 slot->detect_pin = -EBUSY; in atmci_init_slot()
2254 atmci_init_debugfs(slot); in atmci_init_slot()
2259 static void atmci_cleanup_slot(struct atmel_mci_slot *slot, in atmci_cleanup_slot() argument
2264 set_bit(ATMCI_SHUTDOWN, &slot->flags); in atmci_cleanup_slot()
2267 mmc_remove_host(slot->mmc); in atmci_cleanup_slot()
2269 if (gpio_is_valid(slot->detect_pin)) { in atmci_cleanup_slot()
2270 int pin = slot->detect_pin; in atmci_cleanup_slot()
2272 free_irq(gpio_to_irq(pin), slot); in atmci_cleanup_slot()
2273 del_timer_sync(&slot->detect_timer); in atmci_cleanup_slot()
2276 slot->host->slot[id] = NULL; in atmci_cleanup_slot()
2277 mmc_free_host(slot->mmc); in atmci_cleanup_slot()
2464 if (pdata->slot[0].bus_width) { in atmci_probe()
2465 ret = atmci_init_slot(host, &pdata->slot[0], in atmci_probe()
2469 host->buf_size = host->slot[0]->mmc->max_req_size; in atmci_probe()
2472 if (pdata->slot[1].bus_width) { in atmci_probe()
2473 ret = atmci_init_slot(host, &pdata->slot[1], in atmci_probe()
2477 if (host->slot[1]->mmc->max_req_size > host->buf_size) in atmci_probe()
2479 host->slot[1]->mmc->max_req_size; in atmci_probe()
2510 if (host->slot[i]) in atmci_probe()
2511 atmci_cleanup_slot(host->slot[i], i); in atmci_probe()
2539 if (host->slot[i]) in atmci_remove()
2540 atmci_cleanup_slot(host->slot[i], i); in atmci_remove()