lkml.org 
[lkml]   [2008]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 02/10] atmel_serial: Fix build on avr32 with CONFIG_PM enabled
Date
On Thursday 13 March 2008, Haavard Skinnemoen wrote:
> AVR32 doesn't have at91_suspend_entering_slow_clock(). Just assume the
> clock will keep running for now.

Well, it should acquire the clk_must_disable() or somesuch... :)

By the way, I noticed a goof in this driver's clock management.
It should leave the clock off whenever the device isn't open.
As it is, it wastes power both at runtime and during suspend.

- Dave


> Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
> ---
> drivers/serial/atmel_serial.c | 11 ++++++++++-
> 1 files changed, 10 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c
> index d57bf3e..2efbdf6 100644
> --- a/drivers/serial/atmel_serial.c
> +++ b/drivers/serial/atmel_serial.c
> @@ -1428,6 +1428,15 @@ static struct uart_driver atmel_uart = {
> };
>
> #ifdef CONFIG_PM
> +static bool atmel_serial_clk_will_stop(void)
> +{
> +#ifdef CONFIG_ARCH_AT91
> + return at91_suspend_entering_slow_clock();
> +#else
> + return false;
> +#endif
> +}
> +
> static int atmel_serial_suspend(struct platform_device *pdev,
> pm_message_t state)
> {
> @@ -1435,7 +1444,7 @@ static int atmel_serial_suspend(struct platform_device *pdev,
> struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
>
> if (device_may_wakeup(&pdev->dev)
> - && !at91_suspend_entering_slow_clock())
> + && !atmel_serial_clk_will_stop())
> enable_irq_wake(port->irq);
> else {
> uart_suspend_port(&atmel_uart, port);
> --
> 1.5.4.3
>




\
 
 \ /
  Last update: 2008-03-13 21:41    [from the cache]
©2003-2011 Jasper Spaans