Hi Arnd, On Fri, 04 Jul 2008 21:05:36 +0200 [EMAIL PROTECTED] wrote: > > This patch adds support for the power button on future IBM cell blades. > It actually doesn't shut down the machine. Instead it exposes an > input device /dev/input/event0 to userspace which sends KEY_POWER > if power button has been pressed. > haldaemon actually recognizes the button, so a plattform independent acpid > replacement should handle it correctly. > > Signed-off-by: Christian Krafft <[EMAIL PROTECTED]> > Signed-off-by: Arnd Bergmann <[EMAIL PROTECTED]>
Was this written by you or Christian?
> @@ -105,10 +110,21 @@ static int cbe_system_reset_exception(struct pt_regs
> *regs)
> */
> if (sysreset_hack && (cpu = smp_processor_id()) == 0) {
> pmd = cbe_get_cpu_pmd_regs(cpu);
> - if (in_be64(&pmd->ras_esc_0) & 0xffff) {
> + if (in_be64(&pmd->ras_esc_0) & 0x0000ffff) {
> out_be64(&pmd->ras_esc_0, 0);
> return 0;
> }
> + if (in_be64(&pmd->ras_esc_0) & 0x00010000) {
Do we really want to read that register twice? (Just asking, I don't
know how the hardware works ...) Also, do we want to recognise this bit
even if some lower order bits are set? (this code won't)
> +static int __init cbe_power_button_init(void)
> +{
> + int ret;
> + struct input_dev *dev;
> +
> + if (!sysreset_hack)
> + return 0;
> +
> + dev = input_allocate_device();
> + if (!dev) {
> + ret = -ENOMEM;
> + printk(KERN_ERR "%s: Not enough memory\n", __func__);
> + goto out;
> + }
Some white space damage here.
> + ret = input_register_device(dev);
> + if (ret) {
> + printk(KERN_ERR "%s: Failed to register device\n", __func__);
> + goto out_free_pdev;
> + }
And here.
--
Cheers,
Stephen Rothwell [EMAIL PROTECTED]
http://www.canb.auug.org.au/~sfr/
pgpkvIK5BBVdO.pgp
Description: PGP signature
_______________________________________________ Linuxppc-dev mailing list [email protected] https://ozlabs.org/mailman/listinfo/linuxppc-dev
