@@ -235,7 +235,10 @@ static void omap_uart_block_sleep(struct omap_uart_state *uart)
omap_uart_smart_idle_enable(uart, 0);
uart->can_sleep = 0;
- mod_timer(&uart->timer, jiffies + uart->timeout);
+ if (uart->timeout)
+ mod_timer(&uart->timer, jiffies + uart->timeout);
+ else
+ del_timer(&uart->timer);
}
static void omap_uart_allow_sleep(struct omap_uart_state *uart)
@@ -465,8 +468,14 @@ static ssize_t sleep_timeout_store(struct kobject *kobj,
return -EINVAL;
}
sleep_timeout = value * HZ;
- list_for_each_entry(uart, &uart_list, node)
+ list_for_each_entry(uart, &uart_list, node) {
uart->timeout = sleep_timeout;
+ if (uart->timeout)
+ mod_timer(&uart->timer, jiffies + uart->timeout);
+ else
+ /* A zero value means disable timeout feature */
+ omap_uart_block_sleep(uart);
+ }
return n;
}
Writing zero to /sys/devices/platform/serial8250.<uart>/sleep_timeout will disable the timeout feature and prevent UART clocks from being disabled. Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com> --- arch/arm/mach-omap2/serial.c | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-)