On Thu Feb 5 09:48:52 2026 +0800, LiPeng Huang wrote:
> sensor:increase IR_MAX_DURATION to 1000ms
>  to fix long IR remote timeouts Certain infrared remotes
>  (e.g., brand-specific smart home remotes, custom consumer electronics)
>  send extended code sequences that exceed the default 500ms
>  IR_MAX_DURATION threshold. This causes the kernel's raw
>  IR driver to discard incomplete code, resulting in unrecognized commands.
> 
> Increase IR_MAX_DURATION to 1000ms:
> - Aligns with common extended IR protocol specs
>  (most long sequences use 700-900ms)
> - No impact on standard remotes
>  (all mainstream IR codes are <500ms)
> - Validated on vivo X200 and vivo X300,
>  resolves timeout issues without regressions
> 
> Signed-off-by: LiPeng Huang <[email protected]>
> Signed-off-by: Sean Young <[email protected]>
> Signed-off-by: Hans Verkuil <[email protected]>

Patch committed.

Thanks,
Hans Verkuil

 drivers/media/rc/gpio-ir-tx.c | 4 ++--
 include/media/rc-core.h       | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

---

diff --git a/drivers/media/rc/gpio-ir-tx.c b/drivers/media/rc/gpio-ir-tx.c
index e185ead40464..d15fb17fa0fa 100644
--- a/drivers/media/rc/gpio-ir-tx.c
+++ b/drivers/media/rc/gpio-ir-tx.c
@@ -51,7 +51,7 @@ static int gpio_ir_tx_set_carrier(struct rc_dev *dev, u32 
carrier)
 static void delay_until(ktime_t until)
 {
        /*
-        * delta should never exceed 0.5 seconds (IR_MAX_DURATION) and on
+        * delta should never exceed 1 second (IR_MAX_DURATION) and on
         * m68k ndelay(s64) does not compile; so use s32 rather than s64.
         */
        s32 delta;
@@ -95,7 +95,7 @@ static void gpio_ir_tx_modulated(struct gpio_ir *gpio_ir, 
uint *txbuf,
 {
        ktime_t edge;
        /*
-        * delta should never exceed 0.5 seconds (IR_MAX_DURATION) and on
+        * delta should never exceed 1 second (IR_MAX_DURATION) and on
         * m68k ndelay(s64) does not compile; so use s32 rather than s64.
         */
        s32 delta;
diff --git a/include/media/rc-core.h b/include/media/rc-core.h
index 7c964b5ad792..d37fffc5dc3c 100644
--- a/include/media/rc-core.h
+++ b/include/media/rc-core.h
@@ -301,7 +301,7 @@ struct ir_raw_event {
 
 #define US_TO_NS(usec)         ((usec) * 1000)
 #define MS_TO_US(msec)         ((msec) * 1000)
-#define IR_MAX_DURATION                MS_TO_US(500)
+#define IR_MAX_DURATION                MS_TO_US(1000)
 #define IR_DEFAULT_TIMEOUT     MS_TO_US(125)
 #define IR_MAX_TIMEOUT         LIRC_VALUE_MASK
 
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to