016-dsmg600_auto_power_on.patch 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. ---
  2. arch/arm/mach-ixp4xx/dsmg600-power.c | 13 +++++++++----
  3. 1 file changed, 9 insertions(+), 4 deletions(-)
  4. Index: linux-2.6.22-rc5-armeb/arch/arm/mach-ixp4xx/dsmg600-power.c
  5. ===================================================================
  6. --- linux-2.6.22-rc5-armeb.orig/arch/arm/mach-ixp4xx/dsmg600-power.c
  7. +++ linux-2.6.22-rc5-armeb/arch/arm/mach-ixp4xx/dsmg600-power.c
  8. @@ -50,6 +50,13 @@
  9. if (*IXP4XX_GPIO_GPINR & DSMG600_PB_BM) {
  10. /* IO Pin is 1 (button pushed) */
  11. + if (power_button_countdown > 0) {
  12. + power_button_countdown--;
  13. + }
  14. +
  15. + } else {
  16. +
  17. + /* Done on button release, to allow for auto-power-on mods. */
  18. if (power_button_countdown == 0) {
  19. /* Signal init to do the ctrlaltdel action, this will bypass
  20. * init if it hasn't started and do a kernel_restart.
  21. @@ -58,11 +65,9 @@
  22. /* Change the state of the power LED to "blink" */
  23. gpio_line_set(DSMG600_LED_PWR_GPIO, IXP4XX_GPIO_LOW);
  24. + } else {
  25. + power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
  26. }
  27. - power_button_countdown--;
  28. -
  29. - } else {
  30. - power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
  31. }
  32. mod_timer(&dsmg600_power_timer, jiffies + msecs_to_jiffies(500));