summaryrefslogtreecommitdiffstats
path: root/firmware/target/mips/ingenic_x1000/erosqnative/button-erosqnative.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/mips/ingenic_x1000/erosqnative/button-erosqnative.c')
-rw-r--r--firmware/target/mips/ingenic_x1000/erosqnative/button-erosqnative.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/firmware/target/mips/ingenic_x1000/erosqnative/button-erosqnative.c b/firmware/target/mips/ingenic_x1000/erosqnative/button-erosqnative.c
index 64041795a3..1583db175a 100644
--- a/firmware/target/mips/ingenic_x1000/erosqnative/button-erosqnative.c
+++ b/firmware/target/mips/ingenic_x1000/erosqnative/button-erosqnative.c
@@ -24,7 +24,7 @@
#include "backlight.h"
#include "powermgmt.h"
#include "panic.h"
-#include "axp192.h"
+#include "axp-pmu.h"
#include "gpio-x1000.h"
#include "irq-x1000.h"
#include "i2c-x1000.h"
@@ -89,7 +89,7 @@ static int hp_detect_tmo_cb(struct timeout* tmo)
static void hp_detect_init(void)
{
static struct timeout tmo;
- static const uint8_t gpio_reg = AXP_REG_GPIOLEVEL1;
+ static const uint8_t gpio_reg = AXP192_REG_GPIOSTATE1;
static i2c_descriptor desc = {
.slave_addr = AXP_PMU_ADDR,
.bus_cond = I2C_START | I2C_STOP,
@@ -105,11 +105,11 @@ static void hp_detect_init(void)
/* Headphone and LO detects are wired to AXP192 GPIOs 0 and 1,
* set them to inputs. */
- axp_set_gpio_function(0, AXP_GPIO_INPUT); /* HP detect */
- axp_set_gpio_function(1, AXP_GPIO_INPUT); /* LO detect */
+ i2c_reg_write1(AXP_PMU_BUS, AXP_PMU_ADDR, AXP192_REG_GPIO0FUNCTION, 0x01); /* HP detect */
+ i2c_reg_write1(AXP_PMU_BUS, AXP_PMU_ADDR, AXP192_REG_GPIO1FUNCTION, 0x01); /* LO detect */
/* Get an initial reading before startup */
- int r = axp_read(gpio_reg);
+ int r = i2c_reg_read1(AXP_PMU_BUS, AXP_PMU_ADDR, gpio_reg);
if(r >= 0)
{
hp_detect_reg = r;