aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Thompson <daniel.thompson@linaro.org>2017-07-30 08:09:38 +0100
committerDaniel Thompson <daniel.thompson@linaro.org>2017-07-31 17:26:26 +0100
commitc2fc52b9d0e2e511d50f95ac3d369b6af4a2c579 (patch)
tree5bd1e6cc48454cfb074f14c857bf1cd9c6647e3d
parent31e0d6cb01296d19fb1c42789d3a6b2e72175e8e (diff)
include: rda: tgt_ap_headset_setting: RDA support
-rw-r--r--include/rda/tgt_ap_headset_setting.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/include/rda/tgt_ap_headset_setting.h b/include/rda/tgt_ap_headset_setting.h
new file mode 100644
index 0000000000..4a62cbdf99
--- /dev/null
+++ b/include/rda/tgt_ap_headset_setting.h
@@ -0,0 +1,67 @@
+#ifndef __TGT_AP_HEADSET_SETTING_H
+#define __TGT_AP_HEADSET_SETTING_H
+
+/* notice
+ * 1. when ap do vmic gpadc detect, headset ( or headphone ) will be detected according to first gpadc value
+ * 2. when ap donot do vmic gpadc detect, headset ( or headphone ) will be treated as headset only ( for now )
+ * 3. when ap donot do vmic gpadc detect, only on key will be processed.
+*/
+
+// used always
+// open this if ap do gpadc detect, or modem will report key to ap ( only KEY_MEDIA now )
+#define AP_DETECT_VMIC_GPADC 1
+
+// used when ap donot do gpadc detect
+// key code ( input.h ) that report when key down or up
+#define HEADSET_KEY_REPORT KEY_MEDIA
+
+// used always
+// 0 means gpio low when no headset, or high
+#define HEADSET_OUT_GPIO_STATE 1
+
+// used when ap do gpadc detect
+// VMIC gpadc channel
+#define AP_VMIC_GPADC_CHANNEL 0
+
+// used when ap do gpadc detect
+// debounce value
+#define HEADSET_GPADC_DEBOUNCE_VALUE 200
+
+// used when ap do gpadc detect
+// FIXME, should sync with modem PMD_POWER_ID_T
+#define BP_PMD_POWER_EARPIECE 9
+
+// used when ap do gpadc detect
+// under this value ,we think this is a headphone
+#define DETECT_HEADPHON_MAX_VALUE 0xFF
+
+// used when ap do gpadc detect
+// when MODEM_REPORT_KEY_ADC define, we need give right min adc value and max adc value
+// keycode in input.h (kernel) : min adc value : max adc value
+#define HEADSET_KEY_CAPS \
+ {KEY_MEDIA, 0x0, 0x70}, \
+ {KEY_VOLUMEUP, 0x80, 0xC0}, \
+ {KEY_VOLUMEDOWN, 0x130, 0x170},
+
+// used when ap do gpadc detect
+#define GPADC_DETECT_DELAY_MSECS 80
+// used when ap do gpadc detect
+#define GPADC_DETECT_DEBOUNCE_DELAY_MSECS 60
+
+// used always
+// for irq debounce
+#define GPIO_IRQ_DETECT_DEBOUNCE_DELAY_MSECS 200
+
+// used always
+// for out debounce
+#define GPIO_OUT_DETECT_DEBOUNCE_DELAY_MSECS 200
+
+//////////////////////////// need not change ////////////////////////////////
+#define RDA_HEADSET_KEYPAD_NAME "rda-headset-keypad"
+#define RDA_HEADSET_DETECT_NAME "h2w"
+
+#define RDA_HEADSET_DETECT_STATE_OUT "0"
+#define RDA_HEADSET_DETECT_STATE_HEADSET "1"
+#define RDA_HEADSET_DETECT_STATE_HEADPHONE "2"
+
+#endif