Lines Matching refs:slot

221 	struct atmel_mci_slot	*slot[ATMCI_MAX_NR_SLOTS];  member
285 struct atmel_mci_slot *slot = s->private; in atmci_req_show() local
292 spin_lock_bh(&slot->host->lock); in atmci_req_show()
293 mrq = slot->mrq; in atmci_req_show()
318 spin_unlock_bh(&slot->host->lock); in atmci_req_show()
473 static void atmci_init_debugfs(struct atmel_mci_slot *slot) in atmci_init_debugfs() argument
475 struct mmc_host *mmc = slot->mmc; in atmci_init_debugfs()
476 struct atmel_mci *host = slot->host; in atmci_init_debugfs()
491 node = debugfs_create_file("req", S_IRUSR, root, slot, &atmci_req_fops); in atmci_init_debugfs()
556 &pdata->slot[slot_id].bus_width)) in atmci_of_init()
557 pdata->slot[slot_id].bus_width = 1; in atmci_of_init()
559 pdata->slot[slot_id].detect_pin = in atmci_of_init()
562 pdata->slot[slot_id].detect_is_active_high = in atmci_of_init()
565 pdata->slot[slot_id].non_removable = in atmci_of_init()
568 pdata->slot[slot_id].wp_pin = in atmci_of_init()
629 struct atmel_mci_slot *slot, struct mmc_data *data) in atmci_set_timeout() argument
653 dev_vdbg(&slot->mmc->class_dev, "setting timeout to %u cycles\n", in atmci_set_timeout()
1135 struct atmel_mci_slot *slot) in atmci_start_request() argument
1143 mrq = slot->mrq; in atmci_start_request()
1144 host->cur_slot = slot; in atmci_start_request()
1165 atmci_writel(host, ATMCI_SDCR, slot->sdc_reg); in atmci_start_request()
1169 dev_dbg(&slot->mmc->class_dev, "WARNING: IMR=0x%08x\n", in atmci_start_request()
1172 if (unlikely(test_and_clear_bit(ATMCI_CARD_NEED_INIT, &slot->flags))) { in atmci_start_request()
1181 atmci_set_timeout(host, slot, data); in atmci_start_request()
1186 dev_vdbg(&slot->mmc->class_dev, "BLKR=0x%08x\n", in atmci_start_request()
1194 cmdflags = atmci_prepare_command(slot->mmc, cmd); in atmci_start_request()
1212 host->stop_cmdr = atmci_prepare_command(slot->mmc, mrq->stop); in atmci_start_request()
1234 struct atmel_mci_slot *slot, struct mmc_request *mrq) in atmci_queue_request() argument
1236 dev_vdbg(&slot->mmc->class_dev, "queue request: state=%d\n", in atmci_queue_request()
1240 slot->mrq = mrq; in atmci_queue_request()
1243 atmci_start_request(host, slot); in atmci_queue_request()
1246 list_add_tail(&slot->queue_node, &host->queue); in atmci_queue_request()
1253 struct atmel_mci_slot *slot = mmc_priv(mmc); in atmci_request() local
1254 struct atmel_mci *host = slot->host; in atmci_request()
1257 WARN_ON(slot->mrq); in atmci_request()
1270 if (!test_bit(ATMCI_CARD_PRESENT, &slot->flags)) { in atmci_request()
1283 atmci_queue_request(host, slot, mrq); in atmci_request()
1288 struct atmel_mci_slot *slot = mmc_priv(mmc); in atmci_set_ios() local
1289 struct atmel_mci *host = slot->host; in atmci_set_ios()
1294 slot->sdc_reg &= ~ATMCI_SDCBUS_MASK; in atmci_set_ios()
1297 slot->sdc_reg |= ATMCI_SDCBUS_1BIT; in atmci_set_ios()
1300 slot->sdc_reg |= ATMCI_SDCBUS_4BIT; in atmci_set_ios()
1320 slot->clock = ios->clock; in atmci_set_ios()
1322 if (host->slot[i] && host->slot[i]->clock in atmci_set_ios()
1323 && host->slot[i]->clock < clock_min) in atmci_set_ios()
1324 clock_min = host->slot[i]->clock; in atmci_set_ios()
1383 slot->clock = 0; in atmci_set_ios()
1385 if (host->slot[i] && host->slot[i]->clock) { in atmci_set_ios()
1406 set_bit(ATMCI_CARD_NEED_INIT, &slot->flags); in atmci_set_ios()
1433 struct atmel_mci_slot *slot = mmc_priv(mmc); in atmci_get_ro() local
1435 if (gpio_is_valid(slot->wp_pin)) { in atmci_get_ro()
1436 read_only = gpio_get_value(slot->wp_pin); in atmci_get_ro()
1447 struct atmel_mci_slot *slot = mmc_priv(mmc); in atmci_get_cd() local
1449 if (gpio_is_valid(slot->detect_pin)) { in atmci_get_cd()
1450 present = !(gpio_get_value(slot->detect_pin) ^ in atmci_get_cd()
1451 slot->detect_is_active_high); in atmci_get_cd()
1461 struct atmel_mci_slot *slot = mmc_priv(mmc); in atmci_enable_sdio_irq() local
1462 struct atmel_mci *host = slot->host; in atmci_enable_sdio_irq()
1465 atmci_writel(host, ATMCI_IER, slot->sdio_irq); in atmci_enable_sdio_irq()
1467 atmci_writel(host, ATMCI_IDR, slot->sdio_irq); in atmci_enable_sdio_irq()
1483 struct atmel_mci_slot *slot = NULL; in atmci_request_end() local
1502 slot = list_entry(host->queue.next, in atmci_request_end()
1504 list_del(&slot->queue_node); in atmci_request_end()
1506 mmc_hostname(slot->mmc)); in atmci_request_end()
1508 atmci_start_request(host, slot); in atmci_request_end()
1552 struct atmel_mci_slot *slot = (struct atmel_mci_slot *)data; in atmci_detect_change() local
1563 if (test_bit(ATMCI_SHUTDOWN, &slot->flags)) in atmci_detect_change()
1566 enable_irq(gpio_to_irq(slot->detect_pin)); in atmci_detect_change()
1567 present = !(gpio_get_value(slot->detect_pin) ^ in atmci_detect_change()
1568 slot->detect_is_active_high); in atmci_detect_change()
1569 present_old = test_bit(ATMCI_CARD_PRESENT, &slot->flags); in atmci_detect_change()
1571 dev_vdbg(&slot->mmc->class_dev, "detect change: %d (was %d)\n", in atmci_detect_change()
1575 struct atmel_mci *host = slot->host; in atmci_detect_change()
1578 dev_dbg(&slot->mmc->class_dev, "card %s\n", in atmci_detect_change()
1584 clear_bit(ATMCI_CARD_PRESENT, &slot->flags); in atmci_detect_change()
1586 set_bit(ATMCI_CARD_PRESENT, &slot->flags); in atmci_detect_change()
1589 mrq = slot->mrq; in atmci_detect_change()
1629 list_del(&slot->queue_node); in atmci_detect_change()
1637 mmc_request_done(slot->mmc, mrq); in atmci_detect_change()
1643 mmc_detect_change(slot->mmc, 0); in atmci_detect_change()
1996 struct atmel_mci_slot *slot = host->slot[i]; in atmci_sdio_interrupt() local
1997 if (slot && (status & slot->sdio_irq)) { in atmci_sdio_interrupt()
1998 mmc_signal_sdio_irq(slot->mmc); in atmci_sdio_interrupt()
2134 struct atmel_mci_slot *slot = dev_id; in atmci_detect_interrupt() local
2142 mod_timer(&slot->detect_timer, jiffies + msecs_to_jiffies(20)); in atmci_detect_interrupt()
2152 struct atmel_mci_slot *slot; in atmci_init_slot() local
2158 slot = mmc_priv(mmc); in atmci_init_slot()
2159 slot->mmc = mmc; in atmci_init_slot()
2160 slot->host = host; in atmci_init_slot()
2161 slot->detect_pin = slot_data->detect_pin; in atmci_init_slot()
2162 slot->wp_pin = slot_data->wp_pin; in atmci_init_slot()
2163 slot->detect_is_active_high = slot_data->detect_is_active_high; in atmci_init_slot()
2164 slot->sdc_reg = sdc_reg; in atmci_init_slot()
2165 slot->sdio_irq = sdio_irq; in atmci_init_slot()
2204 set_bit(ATMCI_CARD_PRESENT, &slot->flags); in atmci_init_slot()
2205 if (gpio_is_valid(slot->detect_pin)) { in atmci_init_slot()
2206 if (devm_gpio_request(&host->pdev->dev, slot->detect_pin, in atmci_init_slot()
2209 slot->detect_pin = -EBUSY; in atmci_init_slot()
2210 } else if (gpio_get_value(slot->detect_pin) ^ in atmci_init_slot()
2211 slot->detect_is_active_high) { in atmci_init_slot()
2212 clear_bit(ATMCI_CARD_PRESENT, &slot->flags); in atmci_init_slot()
2216 if (!gpio_is_valid(slot->detect_pin)) { in atmci_init_slot()
2223 if (gpio_is_valid(slot->wp_pin)) { in atmci_init_slot()
2224 if (devm_gpio_request(&host->pdev->dev, slot->wp_pin, in atmci_init_slot()
2227 slot->wp_pin = -EBUSY; in atmci_init_slot()
2231 host->slot[id] = slot; in atmci_init_slot()
2235 if (gpio_is_valid(slot->detect_pin)) { in atmci_init_slot()
2238 setup_timer(&slot->detect_timer, atmci_detect_change, in atmci_init_slot()
2239 (unsigned long)slot); in atmci_init_slot()
2241 ret = request_irq(gpio_to_irq(slot->detect_pin), in atmci_init_slot()
2244 "mmc-detect", slot); in atmci_init_slot()
2248 gpio_to_irq(slot->detect_pin)); in atmci_init_slot()
2249 slot->detect_pin = -EBUSY; in atmci_init_slot()
2253 atmci_init_debugfs(slot); in atmci_init_slot()
2258 static void atmci_cleanup_slot(struct atmel_mci_slot *slot, in atmci_cleanup_slot() argument
2263 set_bit(ATMCI_SHUTDOWN, &slot->flags); in atmci_cleanup_slot()
2266 mmc_remove_host(slot->mmc); in atmci_cleanup_slot()
2268 if (gpio_is_valid(slot->detect_pin)) { in atmci_cleanup_slot()
2269 int pin = slot->detect_pin; in atmci_cleanup_slot()
2271 free_irq(gpio_to_irq(pin), slot); in atmci_cleanup_slot()
2272 del_timer_sync(&slot->detect_timer); in atmci_cleanup_slot()
2275 slot->host->slot[id] = NULL; in atmci_cleanup_slot()
2276 mmc_free_host(slot->mmc); in atmci_cleanup_slot()
2446 if (pdata->slot[0].bus_width) { in atmci_probe()
2447 ret = atmci_init_slot(host, &pdata->slot[0], in atmci_probe()
2451 host->buf_size = host->slot[0]->mmc->max_req_size; in atmci_probe()
2454 if (pdata->slot[1].bus_width) { in atmci_probe()
2455 ret = atmci_init_slot(host, &pdata->slot[1], in atmci_probe()
2459 if (host->slot[1]->mmc->max_req_size > host->buf_size) in atmci_probe()
2461 host->slot[1]->mmc->max_req_size; in atmci_probe()
2492 if (host->slot[i]) in atmci_probe()
2493 atmci_cleanup_slot(host->slot[i], i); in atmci_probe()
2521 if (host->slot[i]) in atmci_remove()
2522 atmci_cleanup_slot(host->slot[i], i); in atmci_remove()