diff options
Diffstat (limited to 'firmware/target/mips/ingenic_x1000/fiiom3k/button-fiiom3k.c')
-rw-r--r-- | firmware/target/mips/ingenic_x1000/fiiom3k/button-fiiom3k.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/firmware/target/mips/ingenic_x1000/fiiom3k/button-fiiom3k.c b/firmware/target/mips/ingenic_x1000/fiiom3k/button-fiiom3k.c index db5ece10b0..e27e0be464 100644 --- a/firmware/target/mips/ingenic_x1000/fiiom3k/button-fiiom3k.c +++ b/firmware/target/mips/ingenic_x1000/fiiom3k/button-fiiom3k.c | |||
@@ -23,13 +23,14 @@ | |||
23 | #include "kernel.h" | 23 | #include "kernel.h" |
24 | #include "backlight.h" | 24 | #include "backlight.h" |
25 | #include "panic.h" | 25 | #include "panic.h" |
26 | #include "lcd.h" | 26 | #include "axp173.h" |
27 | #include "gpio-x1000.h" | 27 | #include "gpio-x1000.h" |
28 | #include "i2c-x1000.h" | 28 | #include "i2c-x1000.h" |
29 | #include <string.h> | 29 | #include <string.h> |
30 | #include <stdbool.h> | 30 | #include <stdbool.h> |
31 | 31 | ||
32 | #ifndef BOOTLOADER | 32 | #ifndef BOOTLOADER |
33 | # include "lcd.h" | ||
33 | # include "font.h" | 34 | # include "font.h" |
34 | #endif | 35 | #endif |
35 | 36 | ||
@@ -409,7 +410,7 @@ static int hp_detect_tmo_cb(struct timeout* tmo) | |||
409 | static void hp_detect_init(void) | 410 | static void hp_detect_init(void) |
410 | { | 411 | { |
411 | static struct timeout tmo; | 412 | static struct timeout tmo; |
412 | static const uint8_t gpio_reg = 0x94; | 413 | static const uint8_t gpio_reg = AXP192_REG_GPIOSTATE1; |
413 | static i2c_descriptor desc = { | 414 | static i2c_descriptor desc = { |
414 | .slave_addr = AXP173_ADDR, | 415 | .slave_addr = AXP173_ADDR, |
415 | .bus_cond = I2C_START | I2C_STOP, | 416 | .bus_cond = I2C_START | I2C_STOP, |
@@ -423,9 +424,8 @@ static void hp_detect_init(void) | |||
423 | .next = NULL, | 424 | .next = NULL, |
424 | }; | 425 | }; |
425 | 426 | ||
426 | /* Headphone detect is wired to an undocumented GPIO on the AXP173. | 427 | /* Headphone detect is wired to AXP192 GPIO: set it to input state */ |
427 | * This sets it to input mode so we can see the pin state. */ | 428 | i2c_reg_write1(AXP173_BUS, AXP173_ADDR, AXP192_REG_GPIO2FUNCTION, 0x01); |
428 | i2c_reg_write1(AXP173_BUS, AXP173_ADDR, 0x93, 0x01); | ||
429 | 429 | ||
430 | /* Get an initial reading before startup */ | 430 | /* Get an initial reading before startup */ |
431 | int r = i2c_reg_read1(AXP173_BUS, AXP173_ADDR, gpio_reg); | 431 | int r = i2c_reg_read1(AXP173_BUS, AXP173_ADDR, gpio_reg); |