omap.c (0337966d121ebebf73a1c346123e8112796e684e) omap.c (2ee4f6200597bda9713e28a9c1e65a392615b4b5)
1/*
2 * linux/drivers/mmc/host/omap.c
3 *
4 * Copyright (C) 2004 Nokia Corporation
5 * Written by Tuukka Tikkanen and Juha Yrjölä<juha.yrjola@nokia.com>
6 * Misc hacks here and there by Tony Lindgren <tony@atomide.com>
7 * Other hacks (DMA, SD, etc) by David Brownell
8 *

--- 611 unchanged lines hidden (view full) ---

620 } else
621 mmc_omap_cmd_done(host, host->cmd);
622
623 host->abort = 0;
624 enable_irq(host->irq);
625}
626
627static void
1/*
2 * linux/drivers/mmc/host/omap.c
3 *
4 * Copyright (C) 2004 Nokia Corporation
5 * Written by Tuukka Tikkanen and Juha Yrjölä<juha.yrjola@nokia.com>
6 * Misc hacks here and there by Tony Lindgren <tony@atomide.com>
7 * Other hacks (DMA, SD, etc) by David Brownell
8 *

--- 611 unchanged lines hidden (view full) ---

620 } else
621 mmc_omap_cmd_done(host, host->cmd);
622
623 host->abort = 0;
624 enable_irq(host->irq);
625}
626
627static void
628mmc_omap_cmd_timer(unsigned long data)
628mmc_omap_cmd_timer(struct timer_list *t)
629{
629{
630 struct mmc_omap_host *host = (struct mmc_omap_host *) data;
630 struct mmc_omap_host *host = from_timer(host, t, cmd_abort_timer);
631 unsigned long flags;
632
633 spin_lock_irqsave(&host->slot_lock, flags);
634 if (host->cmd != NULL && !host->abort) {
635 OMAP_MMC_WRITE(host, IE, 0);
636 disable_irq(host->irq);
637 host->abort = 1;
638 queue_work(host->mmc_omap_wq, &host->cmd_abort_work);

--- 10 unchanged lines hidden (view full) ---

649 sg = host->data->sg + host->sg_idx;
650 host->buffer_bytes_left = sg->length;
651 host->buffer = sg_virt(sg);
652 if (host->buffer_bytes_left > host->total_bytes_left)
653 host->buffer_bytes_left = host->total_bytes_left;
654}
655
656static void
631 unsigned long flags;
632
633 spin_lock_irqsave(&host->slot_lock, flags);
634 if (host->cmd != NULL && !host->abort) {
635 OMAP_MMC_WRITE(host, IE, 0);
636 disable_irq(host->irq);
637 host->abort = 1;
638 queue_work(host->mmc_omap_wq, &host->cmd_abort_work);

--- 10 unchanged lines hidden (view full) ---

649 sg = host->data->sg + host->sg_idx;
650 host->buffer_bytes_left = sg->length;
651 host->buffer = sg_virt(sg);
652 if (host->buffer_bytes_left > host->total_bytes_left)
653 host->buffer_bytes_left = host->total_bytes_left;
654}
655
656static void
657mmc_omap_clk_timer(unsigned long data)
657mmc_omap_clk_timer(struct timer_list *t)
658{
658{
659 struct mmc_omap_host *host = (struct mmc_omap_host *) data;
659 struct mmc_omap_host *host = from_timer(host, t, clk_timer);
660
661 mmc_omap_fclk_enable(host, 0);
662}
663
664/* PIO only */
665static void
666mmc_omap_xfer_data(struct mmc_omap_host *host, int write)
667{

--- 201 unchanged lines hidden (view full) ---

869 if (cover_open != slot->cover_open) {
870 slot->cover_open = cover_open;
871 sysfs_notify(&slot->mmc->class_dev.kobj, NULL, "cover_switch");
872 }
873
874 tasklet_hi_schedule(&slot->cover_tasklet);
875}
876
660
661 mmc_omap_fclk_enable(host, 0);
662}
663
664/* PIO only */
665static void
666mmc_omap_xfer_data(struct mmc_omap_host *host, int write)
667{

--- 201 unchanged lines hidden (view full) ---

869 if (cover_open != slot->cover_open) {
870 slot->cover_open = cover_open;
871 sysfs_notify(&slot->mmc->class_dev.kobj, NULL, "cover_switch");
872 }
873
874 tasklet_hi_schedule(&slot->cover_tasklet);
875}
876
877static void mmc_omap_cover_timer(unsigned long arg)
877static void mmc_omap_cover_timer(struct timer_list *t)
878{
878{
879 struct mmc_omap_slot *slot = (struct mmc_omap_slot *) arg;
879 struct mmc_omap_slot *slot = from_timer(slot, t, cover_timer);
880 tasklet_schedule(&slot->cover_tasklet);
881}
882
883static void mmc_omap_cover_handler(unsigned long param)
884{
885 struct mmc_omap_slot *slot = (struct mmc_omap_slot *)param;
886 int cover_open = mmc_omap_cover_is_open(slot);
887

--- 371 unchanged lines hidden (view full) ---

1259 */
1260 mmc->max_segs = 32;
1261 mmc->max_blk_size = 2048; /* BLEN is 11 bits (+1) */
1262 mmc->max_blk_count = 2048; /* NBLK is 11 bits (+1) */
1263 mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;
1264 mmc->max_seg_size = mmc->max_req_size;
1265
1266 if (slot->pdata->get_cover_state != NULL) {
880 tasklet_schedule(&slot->cover_tasklet);
881}
882
883static void mmc_omap_cover_handler(unsigned long param)
884{
885 struct mmc_omap_slot *slot = (struct mmc_omap_slot *)param;
886 int cover_open = mmc_omap_cover_is_open(slot);
887

--- 371 unchanged lines hidden (view full) ---

1259 */
1260 mmc->max_segs = 32;
1261 mmc->max_blk_size = 2048; /* BLEN is 11 bits (+1) */
1262 mmc->max_blk_count = 2048; /* NBLK is 11 bits (+1) */
1263 mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;
1264 mmc->max_seg_size = mmc->max_req_size;
1265
1266 if (slot->pdata->get_cover_state != NULL) {
1267 setup_timer(&slot->cover_timer, mmc_omap_cover_timer,
1268 (unsigned long)slot);
1267 timer_setup(&slot->cover_timer, mmc_omap_cover_timer, 0);
1269 tasklet_init(&slot->cover_tasklet, mmc_omap_cover_handler,
1270 (unsigned long)slot);
1271 }
1272
1273 r = mmc_add_host(mmc);
1274 if (r < 0)
1275 goto err_remove_host;
1276

--- 70 unchanged lines hidden (view full) ---

1347 host->virt_base = devm_ioremap_resource(&pdev->dev, res);
1348 if (IS_ERR(host->virt_base))
1349 return PTR_ERR(host->virt_base);
1350
1351 INIT_WORK(&host->slot_release_work, mmc_omap_slot_release_work);
1352 INIT_WORK(&host->send_stop_work, mmc_omap_send_stop_work);
1353
1354 INIT_WORK(&host->cmd_abort_work, mmc_omap_abort_command);
1268 tasklet_init(&slot->cover_tasklet, mmc_omap_cover_handler,
1269 (unsigned long)slot);
1270 }
1271
1272 r = mmc_add_host(mmc);
1273 if (r < 0)
1274 goto err_remove_host;
1275

--- 70 unchanged lines hidden (view full) ---

1346 host->virt_base = devm_ioremap_resource(&pdev->dev, res);
1347 if (IS_ERR(host->virt_base))
1348 return PTR_ERR(host->virt_base);
1349
1350 INIT_WORK(&host->slot_release_work, mmc_omap_slot_release_work);
1351 INIT_WORK(&host->send_stop_work, mmc_omap_send_stop_work);
1352
1353 INIT_WORK(&host->cmd_abort_work, mmc_omap_abort_command);
1355 setup_timer(&host->cmd_abort_timer, mmc_omap_cmd_timer,
1356 (unsigned long) host);
1354 timer_setup(&host->cmd_abort_timer, mmc_omap_cmd_timer, 0);
1357
1358 spin_lock_init(&host->clk_lock);
1355
1356 spin_lock_init(&host->clk_lock);
1359 setup_timer(&host->clk_timer, mmc_omap_clk_timer, (unsigned long) host);
1357 timer_setup(&host->clk_timer, mmc_omap_clk_timer, 0);
1360
1361 spin_lock_init(&host->dma_lock);
1362 spin_lock_init(&host->slot_lock);
1363 init_waitqueue_head(&host->slot_wq);
1364
1365 host->pdata = pdata;
1366 host->features = host->pdata->slots[0].features;
1367 host->dev = &pdev->dev;

--- 146 unchanged lines hidden ---
1358
1359 spin_lock_init(&host->dma_lock);
1360 spin_lock_init(&host->slot_lock);
1361 init_waitqueue_head(&host->slot_wq);
1362
1363 host->pdata = pdata;
1364 host->features = host->pdata->slots[0].features;
1365 host->dev = &pdev->dev;

--- 146 unchanged lines hidden ---