summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel `sdrfnord` McKinnon <sdrfnord@gmx.de>2013-04-05 23:08:36 +0200
committerMartin Hauke <mardnh@gmx.de>2020-08-02 16:39:39 +0200
commitbedfdc9b62484e481c8de7850951b14fb165b5e2 (patch)
treebca50c97f57edc7c2e4be406bbfce199688a8bfb
parentb95a897655ae0817b92e4d80190b6d852b152215 (diff)
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
-rw-r--r--src/target/firmware/abb/twl3025.c9
-rwxr-xr-xsrc/target/firmware/include/abb/twl3025.h1
2 files changed, 10 insertions, 0 deletions
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);