From 6c7f413846afb67ecf5dfecce8ae8bde56c061de Mon Sep 17 00:00:00 2001 From: Bichao Zheng Date: Thu, 15 Nov 2018 14:01:55 +0800 Subject: [PATCH] irblaster: meson: add support for tl1 [1/1] PD#172587 Problem: 1.Bringup TL1. 2.Invalid frequency setting Solution: 1.Add ir blaster device tree for tl1. 2.Add frequency setting Verify: verify on tl1. Change-Id: I51759e32577172ff766fd4d50f92a00ef77c7495 Signed-off-by: Bichao Zheng --- drivers/amlogic/irblaster/meson-irblaster.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/amlogic/irblaster/meson-irblaster.c b/drivers/amlogic/irblaster/meson-irblaster.c index f0c7e38df083..2627bd192412 100644 --- a/drivers/amlogic/irblaster/meson-irblaster.c +++ b/drivers/amlogic/irblaster/meson-irblaster.c @@ -54,12 +54,25 @@ static int write_to_fifo(struct aml_irblaster_dev *dev, unsigned int hightime, unsigned int lowtime) { unsigned int count_delay; + unsigned int high_ct, low_ct; unsigned int cycle = 1000 / (dev->carrier_freqs / 1000); uint32_t val; int n = 0; int tb[3] = { 1, 10, 100 }; + + /* + *1. set mod_high_count = 13 + *2. set mod_low_count = 13 + *3. 60khz-8us, 38k-13us + */ + high_ct = cycle * dev->duty_cycle / 100; + low_ct = cycle - high_ct; + writel((BLASTER_MODULATION_LOW_COUNT(low_ct - 1) | + BLASTER_MODULATION_HIGH_COUNT(high_ct - 1)), + dev->reg_base + AO_IR_BLASTER_ADDR1); + /* hightime: modulator signal. MODULATOR_TB: @@ -208,7 +221,7 @@ static int send(struct aml_irblaster_dev *dev, const char *buf, int len) send_all_data(dev); ret = wait_for_completion_interruptible_timeout( &dev->blaster_completion, msecs_to_jiffies(sum_time / 1000)); - if (ret) + if (!ret) pr_err("failed to send all data\n"); return ret; }