Lines Matching refs:gpi_dev

467 struct gpi_dev {  struct
498 struct gpi_dev *gpi_dev; argument
611 devm_free_irq(gpii->gpi_dev->dev, gpii->irq, gpii); in gpi_disable_interrupts()
626 ret = devm_request_irq(gpii->gpi_dev->dev, gpii->irq, in gpi_config_interrupts()
630 dev_err(gpii->gpi_dev->dev, "error request irq:%d ret:%d\n", in gpi_config_interrupts()
693 dev_dbg(gpii->gpi_dev->dev, in gpi_send_cmd()
707 dev_err(gpii->gpi_dev->dev, "cmd: %s completion timeout:%u\n", in gpi_send_cmd()
804 dev_dbg(gpii->gpi_dev->dev, "irq_stts:0x%x\n", irq_stts); in gpi_process_gen_err_irq()
823 dev_err(gpii->gpi_dev->dev, "invalid error status:0x%x\n", irq_stts); in gpi_process_glob_err_irq()
846 dev_err(gpii->gpi_dev->dev, "receive interrupt while in %s state\n", in gpi_handle_irq()
872 dev_dbg(gpii->gpi_dev->dev, in gpi_handle_irq()
893 dev_dbg(gpii->gpi_dev->dev, "setting EV state to %s\n", in gpi_handle_irq()
901 dev_dbg(gpii->gpi_dev->dev, "process CH CTRL interrupts\n"); in gpi_handle_irq()
907 dev_err(gpii->gpi_dev->dev, "Unhandled interrupt status:0x%x\n", type); in gpi_handle_irq()
939 dev_err(gpii->gpi_dev->dev, "skipping processing event because ch @ %s state\n", in gpi_process_imed_data_event()
951 dev_dbg(gpii->gpi_dev->dev, "event without a pending descriptor!\n"); in gpi_process_imed_data_event()
953 dev_dbg(gpii->gpi_dev->dev, in gpi_process_imed_data_event()
958 dev_dbg(gpii->gpi_dev->dev, in gpi_process_imed_data_event()
1019 dev_err(gpii->gpi_dev->dev, "skipping processing event because ch @ %s state\n", in gpi_process_xfer_compl_event()
1030 dev_err(gpii->gpi_dev->dev, "Event without a pending descriptor!\n"); in gpi_process_xfer_compl_event()
1032 dev_err(gpii->gpi_dev->dev, in gpi_process_xfer_compl_event()
1063 dev_err(gpii->gpi_dev->dev, "Error in Transaction\n"); in gpi_process_xfer_compl_event()
1066 dev_dbg(gpii->gpi_dev->dev, "Transaction Success\n"); in gpi_process_xfer_compl_event()
1070 dev_dbg(gpii->gpi_dev->dev, "Residue %d\n", result.residue); in gpi_process_xfer_compl_event()
1102 dev_dbg(gpii->gpi_dev->dev, in gpi_process_events()
1115 dev_dbg(gpii->gpi_dev->dev, "stale event, not processing\n"); in gpi_process_events()
1123 dev_dbg(gpii->gpi_dev->dev, "QUP_NOTIF_EV_TYPE\n"); in gpi_process_events()
1126 dev_dbg(gpii->gpi_dev->dev, in gpi_process_events()
1150 dev_err(gpii->gpi_dev->dev, "not processing any events, pm_state:%s\n", in gpi_ev_tasklet()
1199 dev_err(gpii->gpi_dev->dev, "Error with cmd:%s ret:%d\n", in gpi_reset_chan()
1232 dev_err(gpii->gpi_dev->dev, "Error with cmd:%s ret:%d\n", in gpi_start_chan()
1252 dev_err(gpii->gpi_dev->dev, "Error with cmd:%s ret:%d\n", in gpi_stop_chan()
1273 dev_err(gpii->gpi_dev->dev, "Error with cmd:%s ret:%d\n", in gpi_alloc_chan()
1308 dev_err(gpii->gpi_dev->dev, "error with cmd:%s ret:%d\n", in gpi_alloc_ev_chan()
1393 dma_free_coherent(gpii->gpi_dev->dev, ring->alloc_size, in gpi_free_ring()
1411 dev_dbg(gpii->gpi_dev->dev, in gpi_alloc_ring()
1416 ring->pre_aligned = dma_alloc_coherent(gpii->gpi_dev->dev, in gpi_alloc_ring()
1420 dev_err(gpii->gpi_dev->dev, "could not alloc size:%zu mem for ring\n", in gpi_alloc_ring()
1439 dev_dbg(gpii->gpi_dev->dev, in gpi_alloc_ring()
1457 dev_err(gpii->gpi_dev->dev, "Error adding ring element to xfer ring\n"); in gpi_queue_xfer()
1502 dev_err(gpii->gpi_dev->dev, "Error resetting channel ret:%d\n", ret); in gpi_terminate_all()
1509 dev_err(gpii->gpi_dev->dev, "Error alloc_channel ret:%d\n", ret); in gpi_terminate_all()
1520 dev_err(gpii->gpi_dev->dev, "Error Starting Channel ret:%d\n", ret); in gpi_terminate_all()
1544 dev_dbg(gpii->gpi_dev->dev, "channel is already paused\n"); in gpi_pause()
1580 dev_dbg(gpii->gpi_dev->dev, "channel is already active\n"); in gpi_resume()
1591 dev_err(gpii->gpi_dev->dev, "Error starting chan, ret:%d\n", ret); in gpi_resume()
1634 struct device *dev = chan->gpii->gpi_dev->dev; in gpi_create_i2c_tre()
1709 struct device *dev = chan->gpii->gpi_dev->dev; in gpi_create_spi_tre()
1790 struct device *dev = gpii->gpi_dev->dev; in gpi_prep_slave_sg()
1799 dev_err(gpii->gpi_dev->dev, "invalid dma direction: %d\n", direction); in gpi_prep_slave_sg()
1886 const int ev_factor = gpii->gpi_dev->ev_factor; in gpi_ch_init()
1899 dev_err(gpii->gpi_dev->dev, "protocol did not match protocol %u != %u\n", in gpi_ch_init()
1918 dev_err(gpii->gpi_dev->dev, "error config. interrupts, ret:%d\n", ret); in gpi_ch_init()
1925 dev_err(gpii->gpi_dev->dev, "error alloc_ev_chan:%d\n", ret); in gpi_ch_init()
1933 dev_err(gpii->gpi_dev->dev, "Error allocating chan:%d\n", ret); in gpi_ch_init()
1942 dev_err(gpii->gpi_dev->dev, "Error start chan:%d\n", ret); in gpi_ch_init()
1988 dev_err(gpii->gpi_dev->dev, "error resetting channel:%d\n", ret); in gpi_free_chan_resources()
2061 static int gpi_find_avail_gpii(struct gpi_dev *gpi_dev, u32 seid) in gpi_find_avail_gpii() argument
2067 for (gpii = 0; gpii < gpi_dev->max_gpii; gpii++) { in gpi_find_avail_gpii()
2068 if (!((1 << gpii) & gpi_dev->gpii_mask)) in gpi_find_avail_gpii()
2071 tx_chan = &gpi_dev->gpiis[gpii].gchan[GPI_TX_CHAN]; in gpi_find_avail_gpii()
2072 rx_chan = &gpi_dev->gpiis[gpii].gchan[GPI_RX_CHAN]; in gpi_find_avail_gpii()
2081 for (gpii = 0; gpii < gpi_dev->max_gpii; gpii++) { in gpi_find_avail_gpii()
2082 if (!((1 << gpii) & gpi_dev->gpii_mask)) in gpi_find_avail_gpii()
2085 tx_chan = &gpi_dev->gpiis[gpii].gchan[GPI_TX_CHAN]; in gpi_find_avail_gpii()
2086 rx_chan = &gpi_dev->gpiis[gpii].gchan[GPI_RX_CHAN]; in gpi_find_avail_gpii()
2105 struct gpi_dev *gpi_dev = (struct gpi_dev *)of_dma->of_dma_data; in gpi_of_dma_xlate() local
2111 dev_err(gpi_dev->dev, "gpii require minimum 2 args, client passed:%d args\n", in gpi_of_dma_xlate()
2118 dev_err(gpi_dev->dev, "gpii channel:%d not valid\n", chid); in gpi_of_dma_xlate()
2125 gpii = gpi_find_avail_gpii(gpi_dev, seid); in gpi_of_dma_xlate()
2127 dev_err(gpi_dev->dev, "no available gpii instances\n"); in gpi_of_dma_xlate()
2131 gchan = &gpi_dev->gpiis[gpii].gchan[chid]; in gpi_of_dma_xlate()
2133 dev_err(gpi_dev->dev, "gpii:%d chid:%d seid:%d already configured\n", in gpi_of_dma_xlate()
2146 struct gpi_dev *gpi_dev; in gpi_probe() local
2151 gpi_dev = devm_kzalloc(&pdev->dev, sizeof(*gpi_dev), GFP_KERNEL); in gpi_probe()
2152 if (!gpi_dev) in gpi_probe()
2155 gpi_dev->dev = &pdev->dev; in gpi_probe()
2156 gpi_dev->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &gpi_dev->res); in gpi_probe()
2157 if (IS_ERR(gpi_dev->regs)) in gpi_probe()
2158 return PTR_ERR(gpi_dev->regs); in gpi_probe()
2159 gpi_dev->ee_base = gpi_dev->regs; in gpi_probe()
2161 ret = of_property_read_u32(gpi_dev->dev->of_node, "dma-channels", in gpi_probe()
2162 &gpi_dev->max_gpii); in gpi_probe()
2164 dev_err(gpi_dev->dev, "missing 'max-no-gpii' DT node\n"); in gpi_probe()
2168 ret = of_property_read_u32(gpi_dev->dev->of_node, "dma-channel-mask", in gpi_probe()
2169 &gpi_dev->gpii_mask); in gpi_probe()
2171 dev_err(gpi_dev->dev, "missing 'gpii-mask' DT node\n"); in gpi_probe()
2175 ee_offset = (uintptr_t)device_get_match_data(gpi_dev->dev); in gpi_probe()
2176 gpi_dev->ee_base = gpi_dev->ee_base - ee_offset; in gpi_probe()
2178 gpi_dev->ev_factor = EV_FACTOR; in gpi_probe()
2180 ret = dma_set_mask(gpi_dev->dev, DMA_BIT_MASK(64)); in gpi_probe()
2182 dev_err(gpi_dev->dev, "Error setting dma_mask to 64, ret:%d\n", ret); in gpi_probe()
2186 gpi_dev->gpiis = devm_kzalloc(gpi_dev->dev, sizeof(*gpi_dev->gpiis) * in gpi_probe()
2187 gpi_dev->max_gpii, GFP_KERNEL); in gpi_probe()
2188 if (!gpi_dev->gpiis) in gpi_probe()
2192 INIT_LIST_HEAD(&gpi_dev->dma_device.channels); in gpi_probe()
2193 for (i = 0; i < gpi_dev->max_gpii; i++) { in gpi_probe()
2194 struct gpii *gpii = &gpi_dev->gpiis[i]; in gpi_probe()
2197 if (!((1 << i) & gpi_dev->gpii_mask)) in gpi_probe()
2201 gpii->ev_cntxt_base_reg = gpi_dev->ee_base + GPII_n_EV_CH_k_CNTXT_0_OFFS(i, 0); in gpi_probe()
2202 gpii->ev_cntxt_db_reg = gpi_dev->ee_base + GPII_n_EV_CH_k_DOORBELL_0_OFFS(i, 0); in gpi_probe()
2204 gpii->ev_cmd_reg = gpi_dev->ee_base + GPII_n_EV_CH_CMD_OFFS(i); in gpi_probe()
2205 gpii->ieob_clr_reg = gpi_dev->ee_base + GPII_n_CNTXT_SRC_IEOB_IRQ_CLR_OFFS(i); in gpi_probe()
2218 gchan->ch_cntxt_base_reg = gpi_dev->ee_base + in gpi_probe()
2220 gchan->ch_cntxt_db_reg = gpi_dev->ee_base + in gpi_probe()
2222 gchan->ch_cmd_reg = gpi_dev->ee_base + GPII_n_CH_CMD_OFFS(i); in gpi_probe()
2225 vchan_init(&gchan->vc, &gpi_dev->dma_device); in gpi_probe()
2237 gpii->regs = gpi_dev->ee_base; in gpi_probe()
2238 gpii->gpi_dev = gpi_dev; in gpi_probe()
2241 platform_set_drvdata(pdev, gpi_dev); in gpi_probe()
2244 dma_cap_zero(gpi_dev->dma_device.cap_mask); in gpi_probe()
2245 dma_cap_set(DMA_SLAVE, gpi_dev->dma_device.cap_mask); in gpi_probe()
2248 gpi_dev->dma_device.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV); in gpi_probe()
2249 gpi_dev->dma_device.residue_granularity = DMA_RESIDUE_GRANULARITY_DESCRIPTOR; in gpi_probe()
2250 gpi_dev->dma_device.src_addr_widths = DMA_SLAVE_BUSWIDTH_8_BYTES; in gpi_probe()
2251 gpi_dev->dma_device.dst_addr_widths = DMA_SLAVE_BUSWIDTH_8_BYTES; in gpi_probe()
2252 gpi_dev->dma_device.device_alloc_chan_resources = gpi_alloc_chan_resources; in gpi_probe()
2253 gpi_dev->dma_device.device_free_chan_resources = gpi_free_chan_resources; in gpi_probe()
2254 gpi_dev->dma_device.device_tx_status = dma_cookie_status; in gpi_probe()
2255 gpi_dev->dma_device.device_issue_pending = gpi_issue_pending; in gpi_probe()
2256 gpi_dev->dma_device.device_prep_slave_sg = gpi_prep_slave_sg; in gpi_probe()
2257 gpi_dev->dma_device.device_config = gpi_peripheral_config; in gpi_probe()
2258 gpi_dev->dma_device.device_terminate_all = gpi_terminate_all; in gpi_probe()
2259 gpi_dev->dma_device.dev = gpi_dev->dev; in gpi_probe()
2260 gpi_dev->dma_device.device_pause = gpi_pause; in gpi_probe()
2261 gpi_dev->dma_device.device_resume = gpi_resume; in gpi_probe()
2264 ret = dma_async_device_register(&gpi_dev->dma_device); in gpi_probe()
2266 dev_err(gpi_dev->dev, "async_device_register failed ret:%d", ret); in gpi_probe()
2270 ret = of_dma_controller_register(gpi_dev->dev->of_node, in gpi_probe()
2271 gpi_of_dma_xlate, gpi_dev); in gpi_probe()
2273 dev_err(gpi_dev->dev, "of_dma_controller_reg failed ret:%d", ret); in gpi_probe()