diff options
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx/xduoo_x3/sadc-xduoo_x3.c')
-rw-r--r-- | firmware/target/mips/ingenic_jz47xx/xduoo_x3/sadc-xduoo_x3.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/xduoo_x3/sadc-xduoo_x3.c b/firmware/target/mips/ingenic_jz47xx/xduoo_x3/sadc-xduoo_x3.c index be02167a5d..d227255b8a 100644 --- a/firmware/target/mips/ingenic_jz47xx/xduoo_x3/sadc-xduoo_x3.c +++ b/firmware/target/mips/ingenic_jz47xx/xduoo_x3/sadc-xduoo_x3.c | |||
@@ -53,6 +53,13 @@ bool headphones_inserted(void) | |||
53 | return (__gpio_get_pin(PIN_PH_DECT) != 0); | 53 | return (__gpio_get_pin(PIN_PH_DECT) != 0); |
54 | } | 54 | } |
55 | 55 | ||
56 | bool lineout_inserted(void) | ||
57 | { | ||
58 | /* We want to prevent LO being "enabled" if HP is attached | ||
59 | to avoid potential eardrum damage */ | ||
60 | return (__gpio_get_pin(PIN_LO_DECT) == 0) && !headphones_inserted(); | ||
61 | } | ||
62 | |||
56 | void button_init_device(void) | 63 | void button_init_device(void) |
57 | { | 64 | { |
58 | key_val = 0xfff; | 65 | key_val = 0xfff; |
@@ -72,11 +79,11 @@ void button_init_device(void) | |||
72 | __gpio_set_pin(PIN_CHARGE_CON); /* 0.7 A */ | 79 | __gpio_set_pin(PIN_CHARGE_CON); /* 0.7 A */ |
73 | __gpio_as_output(PIN_CHARGE_CON); | 80 | __gpio_as_output(PIN_CHARGE_CON); |
74 | 81 | ||
75 | __gpio_as_input(PIN_LO_DECT); | ||
76 | __gpio_as_input(PIN_PH_DECT); | 82 | __gpio_as_input(PIN_PH_DECT); |
83 | __gpio_disable_pull(PIN_PH_DECT); | ||
77 | 84 | ||
85 | __gpio_as_input(PIN_LO_DECT); | ||
78 | __gpio_disable_pull(PIN_LO_DECT); | 86 | __gpio_disable_pull(PIN_LO_DECT); |
79 | __gpio_disable_pull(PIN_PH_DECT); | ||
80 | } | 87 | } |
81 | 88 | ||
82 | bool button_hold(void) | 89 | bool button_hold(void) |