From: Wencai You Date: Tue, 20 Nov 2018 14:12:16 +0000 (+0800) Subject: irblaster: add synchronous transmit [1/1] X-Git-Tag: khadas-vims-v0.9.6-release~1115 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=08ce5f47816557d9d437ad332cd210f8e943999f;p=platform%2Fkernel%2Flinux-amlogic.git irblaster: add synchronous transmit [1/1] PD#SWPL-2170 Problem: cts fail android.hardware.consumerir.cts.ConsumerIrTest#test_timing Solution: add synchronous transmit when it returns the pattern has been transmitted Verify: verify on franklin Change-Id: I7e490236e5effc13f81e4fab3a1c7fc10c5dcfb3 Signed-off-by: Wencai You --- diff --git a/drivers/amlogic/irblaster/meson-irblaster.c b/drivers/amlogic/irblaster/meson-irblaster.c index 0ec658e..f0c7e38 100644 --- a/drivers/amlogic/irblaster/meson-irblaster.c +++ b/drivers/amlogic/irblaster/meson-irblaster.c @@ -118,7 +118,7 @@ static void send_all_data(struct aml_irblaster_dev *dev) } if (dev->count >= dev->buffer_size) { irblaster_dbg("The all datas finished!\n"); - complete(&dev->blaster_completion); + //complete(&dev->blaster_completion); } } @@ -127,6 +127,7 @@ static irqreturn_t meson_blaster_interrupt(int irq, void *dev_id) struct aml_irblaster_dev *dev = dev_id; irblaster_dbg("meson_blaster_interrupt !!\n"); + complete(&dev->blaster_completion); /*clear pending bit*/ writel(readl(dev->reg_base + AO_IR_BLASTER_ADDR3) & (~BLASTER_FIFO_THD_PENDING), @@ -400,6 +401,7 @@ static ssize_t store_send(struct device *dev, irblaster_dbg("%d\n", irblaster_dev->buffer[i]); irblaster_dbg("sum_time = %d\n", sum_time); irblaster_dev->count = 0; + init_completion(&irblaster_dev->blaster_completion); send_all_data(irblaster_dev); ret = wait_for_completion_interruptible_timeout( &irblaster_dev->blaster_completion,