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

ZhangJieJing kzjeef at gmail.com
Sat Oct 10 01:00:36 EDT 2009


Hi,

I'm thinking, on pc this is a ACPID to do power related things, but
not available for openwrt, partly because the router normally NOT need
power consuming management.

But for nanoBen, it's a hand-held device, power consuming management
is required,
feather may including:

*  power off support (just a solution for CLI interface)
*  cpu dynamic frequency  management (also can do it in kernel space)
*  back light of LCD control. (timeout of turn off LCD back light -
just for CLI)

this daemon is aim to be a simple acpid.

what you idea?

---
Best regards,
Zhang Jiejing



On Fri, Oct 9, 2009 at 4:37 PM, XiangFu Liu <xiangfu at qi-hardware.com> wrote:
> Hi
>
> On Wed, Oct 7, 2009 at 11:15 PM, ZhangJieJing <kzjeef at gmail.com> wrote:
>>
>> 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.
>
> enable the INPUT_EVDEV and CONFIG_KEYBOARD_GPIO
> you will get /dev/input/event0  and that is the power button.
>
>
>>
>> > 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