[PATCH] powerON/OFF button is work. (but the code is not good enough)

ZhangJieJing kzjeef at gmail.com
Wed Oct 7 11:15:00 EDT 2009


Hi,

On Wed, Oct 7, 2009 at 8:08 PM, XiangFu Liu <xiangfu at qi-hardware.com> wrote:
> Hi
> thanks for reply. you are right. I upload a new patch
> 510-power-button.patch map the PowerOn/OFF key to KEY_POWER
>
> not there is /dev/input/event0 in system
I check the
root at OpenWrt:/# cat /sys/devices/platform/matrix-keypad/uevent
DRIVER=matrix-keypad
MODALIAS=platform:matrix-keypad
I don't know how to get this event from user space.
> seems we need a user space daemon to handle the event.

Yes, maybe openwrt is for router, and it doesn't need power off.
I think we need a daemon control power consuming, on x86 there is a
acpid, it's control all things about power(battery, power key, changer
plugin ...) but it needs acpi support in kernel, but I can't find it
in mips kernel, maybe we should write an simple one to do this? or
some other package to instead.
>
>
> On Wed, Oct 7, 2009 at 6:49 PM, ZhangJieJing <kzjeef at gmail.com> wrote:
>>
>> Hi xiangfu,
>>
>> the last email have was wrong.
>>
>> This driver is just for the power button, But i tested the 'poweroff'
>> command is works fine,
>> I think this button is just submit a _poweroff_key_event_ and the up
>> level like openwrt, it should check this key evnet, and do some prompt
>> a menu to user and sync filesystem.. etc.. and  do poweroff (call
>> reboot(2) system call).
>>
>> I don't very clear about did openwrt deal with the _poweroff_key_event.
>>
>> ---
>> Best regards,
>> Zhang Jiejing
>>
>>
>>
>> On Wed, Oct 7, 2009 at 5:16 PM, ZhangJieJing <kzjeef at gmail.com> wrote:
>> > hi xiangfu,
>> >
>> > sorry for so delay, last 2 weeks I was have the vacation with my family.
>> >  I'm back now.
>> >
>> >
>> > it's my opinion the power off is a part of machine, also will
>> > different among machines, I think it's not just a char driver, I think
>> > put it to arch/mips/mach-jz4740/ is better place.
>> >
>> > what you think?
>> > ---
>> > Best regards,
>> > Zhang Jiejing
>> >
>> >
>> >
>> > On Fri, Oct 2, 2009 at 12:42 AM, XiangFu Liu <xiangfu at qi-hardware.com>
>> > wrote:
>> >> Hi Lars, Jiejing Zhang
>> >>   I write some powerOn/Off button driver. it works. but I think the
>> >> code is not
>> >> good enough. so I am not commit this code to openwrt-xburst.
>> >>   also try to write another poweroff.c file like the jz4740_batt.c
>> >> file.
>> >>
>> >> do you have any advice?
>> >>
>> >> Question:
>> >>   where this file I should put to? I saw in Ingenic's code. there is
>> >> "driver/char/jzchar/poweroff.c" , is this good?
>> >>
>> >>
>> >> thanks
>> >>
>> >
>
>




More information about the discussion mailing list


interactive