diff options
Diffstat (limited to 'include/linux/headset_sprd.h')
| -rw-r--r-- | include/linux/headset_sprd.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/include/linux/headset_sprd.h b/include/linux/headset_sprd.h new file mode 100644 index 00000000..54e9abd8 --- /dev/null +++ b/include/linux/headset_sprd.h @@ -0,0 +1,67 @@ +/* + * 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_H__ +#define __HEADSET_SPRD_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 irq_trigger_level_detect; + int irq_trigger_level_button; + 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; + /* < add by lgd */ + #ifdef CONFIG_CAMERA_POLE_SUPPORT + int raw_type; + #endif + /* add by lgd > */ + int irq_detect; + int irq_button; + 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; + struct platform_device *this_pdev; +}; +#endif |
