From 8e4bff4cab0ddac6060645b0715210484d02ff40 Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Wed, 30 Aug 2017 08:25:59 +0000 Subject: Initial file dump from open source release --- include/linux/headset_sprd_sc2723.h | 64 +++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 include/linux/headset_sprd_sc2723.h (limited to 'include/linux/headset_sprd_sc2723.h') 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 +#include +#include + +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 -- cgit v1.3.1