From bedfdc9b62484e481c8de7850951b14fb165b5e2 Mon Sep 17 00:00:00 2001 From: Marcel `sdrfnord` McKinnon Date: Fri, 5 Apr 2013 23:08:36 +0200 Subject: firmware/abb: Wrote twl3025_power_off_now to restart the phone if the power button is pressed I am not sure how other developers do this. There are probably better ways to make testing faster but I kind of like it this way. I just call the twl3025_power_off_now function when the power key is pressed. Change-Id: I1e55910acd8584c74e5e190b3334a8cf6987f5f3 --- src/target/firmware/abb/twl3025.c | 9 +++++++++ src/target/firmware/include/abb/twl3025.h | 1 + 2 files changed, 10 insertions(+) diff --git a/src/target/firmware/abb/twl3025.c b/src/target/firmware/abb/twl3025.c index ad2b01f9..5b792d68 100644 --- a/src/target/firmware/abb/twl3025.c +++ b/src/target/firmware/abb/twl3025.c @@ -229,6 +229,15 @@ void twl3025_power_off(void) twl3025_reg_write(VRPCDEV, 0x01); } +void twl3025_power_off_now(void) +{ + /* The phone will restart if the power butten has not been released. + * This can be useful for development. */ + unsigned long flags; + local_firq_save(flags); + twl3025_reg_write(VRPCDEV, 0x01); +} + void twl3025_clk13m(int enable) { if (enable) { diff --git a/src/target/firmware/include/abb/twl3025.h b/src/target/firmware/include/abb/twl3025.h index 727bde03..8bc2fb9d 100755 --- a/src/target/firmware/include/abb/twl3025.h +++ b/src/target/firmware/include/abb/twl3025.h @@ -147,6 +147,7 @@ uint16_t twl3025_reg_read(uint8_t reg); int twl3025_get_pwon(void); void twl3025_power_off(void); +void twl3025_power_off_now(void); void twl3025_clk13m(int enable); -- cgit v1.2.3