[fedora-arm] arm turnoff gpio's power
Andy Green
andy at warmcat.com
Mon Dec 27 09:23:00 UTC 2010
On 12/27/10 01:25, Somebody in the thread at some point said:
> Hi guys,
> I want to turnoff some gpio's power on my board when it entered suspend
> and when it resumed turnon the gpio.My codes is:
> "gpio_set_value(BABBAGE_POWER_ON, 0);"
> "gpio_set_value(BABBAGE_POWER_ON, 1);"
> I want to know where can I put my codes in?I have tried to put it in the
> two functions "suspend_devices_and_enter()","suspend_enter()" which are
> in kerne/power/suspend.c,but it
> didn't work which can't resume.
> Anyone can give me some tips,I really don't konw what can I do.Thanks all!
Hi -
No you shouldn't put your board-specific stuff down ./kernel/...
What I did in the past for this is make a simple device that represents
the special board features, and use the suspend and resume device
callbacks in there.
For example here's the implementation I wrote for an e-book reader
http://git.warmcat.com/cgi-bin/cgit/txtr-kernel/tree/arch/arm/mach-mx3/txtr-a-features.c?h=txtr-tracking
If you go down to line 677 you can see the suspend and resume handling.
If you rip all the other stuff out of the file and rename the functions,
you then need to call platform_device_register() using the name of your
driver (and arrange for the driver to be in Kconfig and Makefile, and
selected in your .config).
-Andy
More information about the arm
mailing list