Hello all of you!
I'm just trying to get familiar with the new changes in the kernel 2.4.9-ac9-rmk1-np1,
and I'm
thinking about how to solve the powermanagment (once again) for my GraphicsClient +
board.
In previous versions of kernel the arch/arm/mach-sa1100/power.c had a lot off
if (machine_is_xxx ) { ... } else if (machine_is_xxx) { ... } statements before
calling cpu_sa1100_do_suspend(), and then again after resume a lot of
if (machine_is_xxx ) { ... } else if (machine_is_xxx) { ... } statements for each
board, this may not be the must beautiful way solving the problem.
So I see that in the new kernel 2.4.9-ac9-rmk1-np1 all this "not beautiful"
board specific stuff are removed from arch/arm/mach-sa1100/pm.c,
maybe or maybe the board specific code that needs to done before
"cpu_sa1100_do_suspend()" can be done registering a pm_callback
function, but it's just matter of time before the moment comes that
some foo_xxx_board will need to some critical operation that only can be
done just before calling "cpu_sa1100_do_suspend()", in the case of
the GraphicsClient + that has a external IRQ controller it's
necessary to save and restore some extra registers for that board.
I would prefer doing that just before calling "cpu_sa1100_do_suspend()" and
NOT registering a pm_callback function.
I would like propose something like:
/* Clear previous reset status */
RCSR = RCSR_HWR | RCSR_SWR | RCSR_WDR | RCSR_SMR;
/* set resume return address */
PSPR = virt_to_phys(sa1100_cpu_resume);
sa1100_pre_suspend();
/* go zzz */
sa1100_cpu_suspend();
sa1100_post_suspend();
/* ensure not to come back here if it wasn't intended */
PSPR = 0;
and the sa1100_pre_suspend && sa1100_post_suspend are global function pointer to a
board specific function where critical powermangament operations can be done.
ex. sa1100_pre_suspend -> graphicsclient_pre_suspend && sa1100_post_suspend ->
graphicsclient_post_suspend.
It may be boards that dont need kind this functionality, so sa1100_pre_suspend &&
sa1100_post_suspend points as default on setup to something like
ex. sa1100_pre_suspend -> dummy_pre_suspend && sa1100_post_suspend ->
dummy_post_suspend.
/Benny
_______________________________________________
http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
Please visit the above address for information on this list.