xref: /linux/include/linux/platform_data/adau17x1.h (revision ca55b2fef3a9373fcfc30f82fd26bc7fccbda732)
1 /*
2  * Driver for ADAU1761/ADAU1461/ADAU1761/ADAU1961/ADAU1781/ADAU1781 codecs
3  *
4  * Copyright 2011-2014 Analog Devices Inc.
5  * Author: Lars-Peter Clausen <lars@metafoo.de>
6  *
7  * Licensed under the GPL-2 or later.
8  */
9 
10 #ifndef __LINUX_PLATFORM_DATA_ADAU17X1_H__
11 #define __LINUX_PLATFORM_DATA_ADAU17X1_H__
12 
13 /**
14  * enum adau17x1_micbias_voltage - Microphone bias voltage
15  * @ADAU17X1_MICBIAS_0_90_AVDD: 0.9 * AVDD
16  * @ADAU17X1_MICBIAS_0_65_AVDD: 0.65 * AVDD
17  */
18 enum adau17x1_micbias_voltage {
19 	ADAU17X1_MICBIAS_0_90_AVDD = 0,
20 	ADAU17X1_MICBIAS_0_65_AVDD = 1,
21 };
22 
23 /**
24  * enum adau1761_digmic_jackdet_pin_mode - Configuration of the JACKDET/MICIN pin
25  * @ADAU1761_DIGMIC_JACKDET_PIN_MODE_NONE: Disable the pin
26  * @ADAU1761_DIGMIC_JACKDET_PIN_MODE_DIGMIC: Configure the pin for usage as
27  *   digital microphone input.
28  * @ADAU1761_DIGMIC_JACKDET_PIN_MODE_JACKDETECT: Configure the pin for jack
29  *  insertion detection.
30  */
31 enum adau1761_digmic_jackdet_pin_mode {
32 	ADAU1761_DIGMIC_JACKDET_PIN_MODE_NONE,
33 	ADAU1761_DIGMIC_JACKDET_PIN_MODE_DIGMIC,
34 	ADAU1761_DIGMIC_JACKDET_PIN_MODE_JACKDETECT,
35 };
36 
37 /**
38  * adau1761_jackdetect_debounce_time - Jack insertion detection debounce time
39  * @ADAU1761_JACKDETECT_DEBOUNCE_5MS: 5 milliseconds
40  * @ADAU1761_JACKDETECT_DEBOUNCE_10MS: 10 milliseconds
41  * @ADAU1761_JACKDETECT_DEBOUNCE_20MS: 20 milliseconds
42  * @ADAU1761_JACKDETECT_DEBOUNCE_40MS: 40 milliseconds
43  */
44 enum adau1761_jackdetect_debounce_time {
45 	ADAU1761_JACKDETECT_DEBOUNCE_5MS = 0,
46 	ADAU1761_JACKDETECT_DEBOUNCE_10MS = 1,
47 	ADAU1761_JACKDETECT_DEBOUNCE_20MS = 2,
48 	ADAU1761_JACKDETECT_DEBOUNCE_40MS = 3,
49 };
50 
51 /**
52  * enum adau1761_output_mode - Output mode configuration
53  * @ADAU1761_OUTPUT_MODE_HEADPHONE: Headphone output
54  * @ADAU1761_OUTPUT_MODE_HEADPHONE_CAPLESS: Capless headphone output
55  * @ADAU1761_OUTPUT_MODE_LINE: Line output
56  */
57 enum adau1761_output_mode {
58 	ADAU1761_OUTPUT_MODE_HEADPHONE,
59 	ADAU1761_OUTPUT_MODE_HEADPHONE_CAPLESS,
60 	ADAU1761_OUTPUT_MODE_LINE,
61 };
62 
63 /**
64  * struct adau1761_platform_data - ADAU1761 Codec driver platform data
65  * @input_differential: If true the input pins will be configured in
66  *  differential mode.
67  * @lineout_mode: Output mode for the LOUT/ROUT pins
68  * @headphone_mode: Output mode for the LHP/RHP pins
69  * @digmic_jackdetect_pin_mode: JACKDET/MICIN pin configuration
70  * @jackdetect_debounce_time: Jack insertion detection debounce time.
71  *  Note: This value will only be used, if the JACKDET/MICIN pin is configured
72  *  for jack insertion detection.
73  * @jackdetect_active_low: If true the jack insertion detection is active low.
74  *  Othwise it will be active high.
75  * @micbias_voltage: Microphone voltage bias
76  */
77 struct adau1761_platform_data {
78 	bool input_differential;
79 	enum adau1761_output_mode lineout_mode;
80 	enum adau1761_output_mode headphone_mode;
81 
82 	enum adau1761_digmic_jackdet_pin_mode digmic_jackdetect_pin_mode;
83 
84 	enum adau1761_jackdetect_debounce_time jackdetect_debounce_time;
85 	bool jackdetect_active_low;
86 
87 	enum adau17x1_micbias_voltage micbias_voltage;
88 };
89 
90 /**
91  * struct adau1781_platform_data - ADAU1781 Codec driver platform data
92  * @left_input_differential: If true configure the left input as
93  * differential input.
94  * @right_input_differential: If true configure the right input as differntial
95  *  input.
96  * @use_dmic: If true configure the MIC pins as digital microphone pins instead
97  *  of analog microphone pins.
98  * @micbias_voltage: Microphone voltage bias
99  */
100 struct adau1781_platform_data {
101 	bool left_input_differential;
102 	bool right_input_differential;
103 
104 	bool use_dmic;
105 
106 	enum adau17x1_micbias_voltage micbias_voltage;
107 };
108 
109 #endif
110