public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 8250 serial driver and PM
@ 2005-08-29 17:55 Grigory Tolstolytkin
  2005-08-31 10:08 ` Russell King
  2005-08-31 10:57 ` Vitaly Wool
  0 siblings, 2 replies; 3+ messages in thread
From: Grigory Tolstolytkin @ 2005-08-29 17:55 UTC (permalink / raw)
  To: linux-kernel

Hi,

I'm working on power management support for a particular ARM based board 
and I've got a question:
I want to add a board specific power management for standard uart driver 
(serial8250). For this purpose there is a special hook defined in 
uart_8250_port structure (drivers/serial/8250.c):
...
 >        /*
 >        * We provide a per-port pm hook.
 >         */
 >        void                    (*pm)(struct uart_port *port,
 >                                      unsigned int state, unsigned int 
old);
...

When driver goes into suspend/resume, serial8250_pm() function is called 
and it checks for the hook and executes it if it exists. But I didn't 
find a proper way to assign my own function to this hook.
How this hook is supposed to be changed? Is there a way to correctly 
initialize it and how it should be done?
Whether it's a good way to initialize it, for example, in 
serial8250_isa_init_ports():
...
                up->mcr_mask = ~ALPHA_KLUDGE_MCR;
                up->mcr_force = ALPHA_KLUDGE_MCR;

                up->port.ops = &serial8250_pops;

#ifdef CONFIG_ARCH_XXX
                up->pm = pnx4008_uart_pm;
#endif
       }
...

Or it's a bad manner?

Any help appreciated,

Thanks,
Grigory.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 8250 serial driver and PM
  2005-08-29 17:55 8250 serial driver and PM Grigory Tolstolytkin
@ 2005-08-31 10:08 ` Russell King
  2005-08-31 10:57 ` Vitaly Wool
  1 sibling, 0 replies; 3+ messages in thread
From: Russell King @ 2005-08-31 10:08 UTC (permalink / raw)
  To: Grigory Tolstolytkin; +Cc: linux-kernel

On Mon, Aug 29, 2005 at 09:55:04PM +0400, Grigory Tolstolytkin wrote:
> I'm working on power management support for a particular ARM based board 
> and I've got a question:
> I want to add a board specific power management for standard uart driver 
> (serial8250). For this purpose there is a special hook defined in 
> uart_8250_port structure (drivers/serial/8250.c):
> ...
>  >        /*
>  >        * We provide a per-port pm hook.
>  >         */
>  >        void                    (*pm)(struct uart_port *port,
>  >                                      unsigned int state, unsigned int 
> old);
> ...
> 
> When driver goes into suspend/resume, serial8250_pm() function is called 
> and it checks for the hook and executes it if it exists. But I didn't 
> find a proper way to assign my own function to this hook.

We probably want to pass it via the platform device - which probably
means changing that interface.

> How this hook is supposed to be changed?

It's something which wasn't thought about since there were very few
people wanting to use it, and further work needed to be done (as my
first comment) to allow it to be used - which basically meant changing
the initialisation paths to allow platform devices (now done).

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 8250 serial driver and PM
  2005-08-29 17:55 8250 serial driver and PM Grigory Tolstolytkin
  2005-08-31 10:08 ` Russell King
@ 2005-08-31 10:57 ` Vitaly Wool
  1 sibling, 0 replies; 3+ messages in thread
From: Vitaly Wool @ 2005-08-31 10:57 UTC (permalink / raw)
  To: Grigory Tolstolytkin; +Cc: linux-kernel

Hi Grigory,
it's unclear from your letter where you take pnx4008_uart_pm from. Can 
you please elaborate?

What I would think of if I were you is adding a field 'pm' to struct 
plat_serial8250_port which is filled in in the architecture-specific 
part and setting up->pm accrodingly.
I'll send a patch that may be of a help for you shortly.

Best regards,
   Vitaly


Grigory Tolstolytkin wrote:

> Hi,
>
> I'm working on power management support for a particular ARM based 
> board and I've got a question:
> I want to add a board specific power management for standard uart 
> driver (serial8250). For this purpose there is a special hook defined 
> in uart_8250_port structure (drivers/serial/8250.c):
> ...
> >        /*
> >        * We provide a per-port pm hook.
> >         */
> >        void                    (*pm)(struct uart_port *port,
> >                                      unsigned int state, unsigned 
> int old);
> ...
>
> When driver goes into suspend/resume, serial8250_pm() function is 
> called and it checks for the hook and executes it if it exists. But I 
> didn't find a proper way to assign my own function to this hook.
> How this hook is supposed to be changed? Is there a way to correctly 
> initialize it and how it should be done?
> Whether it's a good way to initialize it, for example, in 
> serial8250_isa_init_ports():
> ...
>                up->mcr_mask = ~ALPHA_KLUDGE_MCR;
>                up->mcr_force = ALPHA_KLUDGE_MCR;
>
>                up->port.ops = &serial8250_pops;
>
> #ifdef CONFIG_ARCH_XXX
>                up->pm = pnx4008_uart_pm;
> #endif
>       }
> ...
>
> Or it's a bad manner?
>
> Any help appreciated,
>
> Thanks,
> Grigory.
>
> -
> To unsubscribe from this list: send the line "unsubscribe 
> linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-08-31 10:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-29 17:55 8250 serial driver and PM Grigory Tolstolytkin
2005-08-31 10:08 ` Russell King
2005-08-31 10:57 ` Vitaly Wool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox