Lines Matching refs:slot
218 int slot[EDMA_MAX_SLOTS]; member
422 static void edma_set_chmap(struct edma_chan *echan, int slot) in edma_set_chmap() argument
428 slot = EDMA_CHAN_SLOT(slot); in edma_set_chmap()
429 edma_write_array(ecc, EDMA_DCHMAP, channel, (slot << 5)); in edma_set_chmap()
452 static void edma_write_slot(struct edma_cc *ecc, unsigned slot, in edma_write_slot() argument
455 slot = EDMA_CHAN_SLOT(slot); in edma_write_slot()
456 if (slot >= ecc->num_slots) in edma_write_slot()
458 memcpy_toio(ecc->base + PARM_OFFSET(slot), param, PARM_SIZE); in edma_write_slot()
461 static void edma_read_slot(struct edma_cc *ecc, unsigned slot, in edma_read_slot() argument
464 slot = EDMA_CHAN_SLOT(slot); in edma_read_slot()
465 if (slot >= ecc->num_slots) in edma_read_slot()
467 memcpy_fromio(param, ecc->base + PARM_OFFSET(slot), PARM_SIZE); in edma_read_slot()
485 static int edma_alloc_slot(struct edma_cc *ecc, int slot) in edma_alloc_slot() argument
487 if (slot > 0) { in edma_alloc_slot()
488 slot = EDMA_CHAN_SLOT(slot); in edma_alloc_slot()
490 if (ecc->chmap_exist && slot < ecc->num_channels) in edma_alloc_slot()
491 slot = EDMA_SLOT_ANY; in edma_alloc_slot()
494 if (slot < 0) { in edma_alloc_slot()
496 slot = 0; in edma_alloc_slot()
498 slot = ecc->num_channels; in edma_alloc_slot()
500 slot = find_next_zero_bit(ecc->slot_inuse, in edma_alloc_slot()
502 slot); in edma_alloc_slot()
503 if (slot == ecc->num_slots) in edma_alloc_slot()
505 if (!test_and_set_bit(slot, ecc->slot_inuse)) in edma_alloc_slot()
508 } else if (slot >= ecc->num_slots) { in edma_alloc_slot()
510 } else if (test_and_set_bit(slot, ecc->slot_inuse)) { in edma_alloc_slot()
514 edma_write_slot(ecc, slot, &dummy_paramset); in edma_alloc_slot()
516 return EDMA_CTLR_CHAN(ecc->id, slot); in edma_alloc_slot()
519 static void edma_free_slot(struct edma_cc *ecc, unsigned slot) in edma_free_slot() argument
521 slot = EDMA_CHAN_SLOT(slot); in edma_free_slot()
522 if (slot >= ecc->num_slots) in edma_free_slot()
525 edma_write_slot(ecc, slot, &dummy_paramset); in edma_free_slot()
526 clear_bit(slot, ecc->slot_inuse); in edma_free_slot()
559 static dma_addr_t edma_get_position(struct edma_cc *ecc, unsigned slot, in edma_get_position() argument
564 slot = EDMA_CHAN_SLOT(slot); in edma_get_position()
565 offs = PARM_OFFSET(slot); in edma_get_position()
770 edma_write_slot(ecc, echan->slot[i], &edesc->pset[j].param); in edma_execute()
784 j, echan->ch_num, echan->slot[i], in edma_execute()
795 edma_link(ecc, echan->slot[i], echan->slot[i + 1]); in edma_execute()
807 edma_link(ecc, echan->slot[nslots - 1], echan->slot[1]); in edma_execute()
809 edma_link(ecc, echan->slot[nslots - 1], in edma_execute()
1076 if (echan->slot[i] < 0) { in edma_prep_slave_sg()
1077 echan->slot[i] = in edma_prep_slave_sg()
1079 if (echan->slot[i] < 0) { in edma_prep_slave_sg()
1193 if (echan->slot[1] < 0) { in edma_prep_dma_memcpy()
1194 echan->slot[1] = edma_alloc_slot(echan->ecc, in edma_prep_dma_memcpy()
1196 if (echan->slot[1] < 0) { in edma_prep_dma_memcpy()
1293 if (echan->slot[i] < 0) { in edma_prep_dma_cyclic()
1294 echan->slot[i] = in edma_prep_dma_cyclic()
1296 if (echan->slot[i] < 0) { in edma_prep_dma_cyclic()
1336 i, echan->ch_num, echan->slot[i], in edma_prep_dma_cyclic()
1427 u32 slot; in dma_irq_handler() local
1430 slot = __ffs(sh_ipr); in dma_irq_handler()
1431 sh_ipr &= ~(BIT(slot)); in dma_irq_handler()
1433 if (sh_ier & BIT(slot)) { in dma_irq_handler()
1434 channel = (bank << 5) | slot; in dma_irq_handler()
1436 edma_shadow0_write_array(ecc, SH_ICR, bank, BIT(slot)); in dma_irq_handler()
1456 edma_read_slot(ecc, echan->slot[0], &p); in edma_error_handler()
1610 echan->slot[0] = edma_alloc_slot(ecc, echan->ch_num); in edma_alloc_chan_resources()
1611 if (echan->slot[0] < 0) { in edma_alloc_chan_resources()
1618 edma_set_chmap(echan, echan->slot[0]); in edma_alloc_chan_resources()
1648 if (echan->slot[i] >= 0) { in edma_free_chan_resources()
1649 edma_free_slot(echan->ecc, echan->slot[i]); in edma_free_chan_resources()
1650 echan->slot[i] = -1; in edma_free_chan_resources()
1694 pos = edma_get_position(edesc->echan->ecc, edesc->echan->slot[0], dst); in edma_residue()
1851 echan->slot[j] = -1; in edma_dma_init()
2400 edma_set_chmap(&echan[i], echan[i].slot[0]); in edma_pm_resume()