|
@@ -698,24 +698,29 @@ int ipu_idmac_enable_channel(struct ipuv3_channel *channel)
|
|
|
}
|
|
|
EXPORT_SYMBOL_GPL(ipu_idmac_enable_channel);
|
|
|
|
|
|
-int ipu_idmac_disable_channel(struct ipuv3_channel *channel)
|
|
|
+int ipu_idmac_wait_busy(struct ipuv3_channel *channel, int ms)
|
|
|
{
|
|
|
struct ipu_soc *ipu = channel->ipu;
|
|
|
- u32 val;
|
|
|
- unsigned long flags;
|
|
|
unsigned long timeout;
|
|
|
|
|
|
- timeout = jiffies + msecs_to_jiffies(50);
|
|
|
+ timeout = jiffies + msecs_to_jiffies(ms);
|
|
|
while (ipu_idmac_read(ipu, IDMAC_CHA_BUSY(channel->num)) &
|
|
|
idma_mask(channel->num)) {
|
|
|
- if (time_after(jiffies, timeout)) {
|
|
|
- dev_warn(ipu->dev, "disabling busy idmac channel %d\n",
|
|
|
- channel->num);
|
|
|
- break;
|
|
|
- }
|
|
|
+ if (time_after(jiffies, timeout))
|
|
|
+ return -ETIMEDOUT;
|
|
|
cpu_relax();
|
|
|
}
|
|
|
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+EXPORT_SYMBOL_GPL(ipu_idmac_wait_busy);
|
|
|
+
|
|
|
+int ipu_idmac_disable_channel(struct ipuv3_channel *channel)
|
|
|
+{
|
|
|
+ struct ipu_soc *ipu = channel->ipu;
|
|
|
+ u32 val;
|
|
|
+ unsigned long flags;
|
|
|
+
|
|
|
spin_lock_irqsave(&ipu->lock, flags);
|
|
|
|
|
|
/* Disable DMA channel(s) */
|