summaryrefslogtreecommitdiff
path: root/include/linux/headset_sprd_sc2723.h
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2017-08-30 08:25:59 +0000
committerYuval Adam <_@yuv.al>2017-08-30 08:25:59 +0000
commit8e4bff4cab0ddac6060645b0715210484d02ff40 (patch)
tree3a5c3024371a04692a3a6d9974d001cdff8ebf84 /include/linux/headset_sprd_sc2723.h
Initial file dump from open source releaseHEADmaster
Diffstat (limited to 'include/linux/headset_sprd_sc2723.h')
-rw-r--r--include/linux/headset_sprd_sc2723.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/include/linux/headset_sprd_sc2723.h b/include/linux/headset_sprd_sc2723.h
new file mode 100644
index 00000000..fb8143ca
--- /dev/null
+++ b/include/linux/headset_sprd_sc2723.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2012 Spreadtrum Communications Inc.
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __HEADSET_SPRD_SC2723_H__
+#define __HEADSET_SPRD_SC2723_H__
+#include <linux/switch.h>
+#include <linux/input.h>
+#include <linux/platform_device.h>
+
+enum {
+ BIT_HEADSET_OUT = 0,
+ BIT_HEADSET_MIC = (1 << 0),
+ BIT_HEADSET_NO_MIC = (1 << 1),
+};
+
+struct headset_buttons {
+ int adc_min;
+ int adc_max;
+ int code;
+ unsigned int type; /* input event type (EV_KEY, EV_SW, EV_ABS) */
+};
+
+struct sprd_headset_platform_data {
+ int gpio_switch;
+ int gpio_detect;
+ int gpio_button;
+ int gpio_detect_mic;
+ int irq_trigger_level_detect;
+ int irq_trigger_level_button;
+ int irq_trigger_level_detect_mic;
+ int adc_threshold_3pole_detect;
+ int adc_threshold_4pole_detect;
+ int irq_threshold_buttont;
+ int voltage_headmicbias;
+ struct headset_buttons *headset_buttons;
+ int nbuttons;
+ int (*external_headmicbias_power_on)(int);
+};
+
+struct sprd_headset {
+ int headphone;
+ int type;
+ int irq_detect;
+ int irq_button;
+ int irq_detect_mic;
+ struct sprd_headset_platform_data *platform_data;
+ struct switch_dev sdev;
+ struct input_dev *input_dev;
+ struct delayed_work work_detect;
+ struct workqueue_struct *detect_work_queue;
+ struct work_struct work_button;
+ struct workqueue_struct *button_work_queue;
+};
+#endif