xref: /OK3568_Linux_fs/kernel/drivers/headset_observe/rk_headset.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef RK_HEADSET_H
3 #define RK_HEADSET_H
4 
5 #define HEADSET_IN_HIGH 0x00000001
6 #define HEADSET_IN_LOW  0x00000000
7 
8 #define HOOK_DOWN_HIGH 0x00000001
9 #define HOOK_DOWN_LOW  0x00000000
10 
11 struct rk_headset_pdata {
12 	/* heaset about */
13 	unsigned int headset_gpio;
14 	/* Headphones into the state level */
15 	unsigned int headset_insert_type;
16 	/* hook about */
17 	unsigned int hook_gpio;
18 	/* Hook key down status */
19 	unsigned int hook_down_type;
20 #ifdef CONFIG_MODEM_MIC_SWITCH
21 	/* mic about */
22 	unsigned int mic_switch_gpio;
23 	unsigned int hp_mic_io_value;
24 	unsigned int main_mic_io_value;
25 #endif
26 	struct iio_channel *chan;
27 	int headset_wakeup;
28 };
29 
30 #define HOOK_KEY_CODE KEY_MEDIA
31 
32 int rk_headset_probe(struct platform_device *pdev,
33 		     struct rk_headset_pdata *pdata);
34 int rk_headset_adc_probe(struct platform_device *pdev,
35 			 struct rk_headset_pdata *pdata);
36 int rk_headset_adc_suspend(struct platform_device *pdev, pm_message_t state);
37 int rk_headset_adc_resume(struct platform_device *pdev);
38 #endif
39