Merge "dmaengine: gpi: fix assigning same gpii's to qup SE instances"
This commit is contained in:
commit
c256012854
@ -486,6 +486,7 @@ struct gpi_dev {
|
||||
u32 klog_lvl;
|
||||
struct dentry *dentry;
|
||||
bool is_le_vm;
|
||||
struct mutex qup_se_lock; /* qup SE instance lock */
|
||||
};
|
||||
|
||||
static struct gpi_dev *gpi_dev_dbg[5];
|
||||
@ -3876,6 +3877,7 @@ static struct dma_chan *gpi_of_dma_xlate(struct of_phandle_args *args,
|
||||
u32 seid, chid;
|
||||
int gpii, static_gpii_no;
|
||||
struct gpii_chan *gpii_chan;
|
||||
struct dma_chan *dma_chan;
|
||||
|
||||
if (args->args_count < REQ_OF_DMA_ARGS) {
|
||||
GPI_ERR(gpi_dev,
|
||||
@ -3890,6 +3892,7 @@ static struct dma_chan *gpi_of_dma_xlate(struct of_phandle_args *args,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
mutex_lock(&gpi_dev->qup_se_lock);
|
||||
seid = args->args[1];
|
||||
static_gpii_no = (args->args[4] & STATIC_GPII_BMSK) >> STATIC_GPII_SHFT;
|
||||
|
||||
@ -3900,6 +3903,7 @@ static struct dma_chan *gpi_of_dma_xlate(struct of_phandle_args *args,
|
||||
|
||||
if (gpii < 0) {
|
||||
GPI_ERR(gpi_dev, "no available gpii instances\n");
|
||||
mutex_unlock(&gpi_dev->qup_se_lock);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -3907,6 +3911,7 @@ static struct dma_chan *gpi_of_dma_xlate(struct of_phandle_args *args,
|
||||
if (gpii_chan->vc.chan.client_count) {
|
||||
GPI_ERR(gpi_dev, "gpii:%d chid:%d seid:%d already configured\n",
|
||||
gpii, chid, gpii_chan->seid);
|
||||
mutex_unlock(&gpi_dev->qup_se_lock);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -3922,8 +3927,9 @@ static struct dma_chan *gpi_of_dma_xlate(struct of_phandle_args *args,
|
||||
"client req gpii:%u chid:%u #_tre:%u prio:%u proto:%u SE:%d init_config:%d\n",
|
||||
gpii, chid, gpii_chan->req_tres, gpii_chan->priority,
|
||||
gpii_chan->protocol, gpii_chan->seid, gpii_chan->init_config);
|
||||
|
||||
return dma_get_slave_channel(&gpii_chan->vc.chan);
|
||||
dma_chan = dma_get_slave_channel(&gpii_chan->vc.chan);
|
||||
mutex_unlock(&gpi_dev->qup_se_lock);
|
||||
return dma_chan;
|
||||
}
|
||||
|
||||
/* gpi_setup_debug - setup debug capabilities */
|
||||
@ -4059,6 +4065,7 @@ static int gpi_probe(struct platform_device *pdev)
|
||||
if (!gpi_dev->gpiis)
|
||||
return -ENOMEM;
|
||||
|
||||
mutex_init(&gpi_dev->qup_se_lock);
|
||||
gpi_dev->is_le_vm = of_property_read_bool(pdev->dev.of_node, "qcom,le-vm");
|
||||
if (gpi_dev->is_le_vm)
|
||||
GPI_LOG(gpi_dev, "LE-VM usecase\n");
|
||||
|
Loading…
Reference in New Issue
Block a user