summaryrefslogtreecommitdiffstats
path: root/src/drivers/i2c/da7219/chip.h
blob: 9afce952c85672bbfd88ed56835953f8950d7e54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/* SPDX-License-Identifier: GPL-2.0-only */
/* This file is part of the coreboot project. */

#include <acpi/acpi_device.h>

/*
 * Dialog Semiconductor DA7219 Audio Codec devicetree bindings
 * linux/Documentation/devicetree/bindings/sound/da7219.txt
 */
struct drivers_i2c_da7219_config {
	/* Interrupt configuration */
	struct acpi_irq irq;

	/* Use GPIO based interrupt instead of PIRQ */
	struct acpi_gpio irq_gpio;

	/* I2C Bus Frequency in Hertz (default 400kHz) */
	unsigned int bus_speed;

	/*
	 * micbias-lvl : Voltage (mV) for Mic Bias
	 * [<1600>, <1800>, <2000>, <2200>, <2400>, <2600>]
	 */
	unsigned int micbias_lvl;

	/*
	 * mic-amp-in-sel : Mic input source type
	 * ["diff", "se_p", "se_n"]
	 */
	const char *mic_amp_in_sel;

	/*
	 * Properties for da7219_aad child node
	 */

	/*
	 * micbias-pulse-lvl : Mic bias higher voltage pulse level (mV)
	 * [<2800>, <2900>]
	 */
	unsigned int micbias_pulse_lvl;

	/*
	 * micbias-pulse-time : Mic bias higher voltage pulse duration (ms)
	 */
	unsigned int micbias_pulse_time;

	/*
	 * btn-cfg : Periodic button press measurements for 4-pole jack (ms)
	 * [<2>, <5>, <10>, <50>, <100>, <200>, <500>]
	 */
	unsigned int btn_cfg;

	/*
	 * mic-det-thr : Impedance threshold for mic detection measurement (Ohms)
	 * [<200>, <500>, <750>, <1000>]
	 */
	unsigned int mic_det_thr;

	/*
	 * jack-ins-deb : Debounce time for jack insertion (ms)
	 * [<5>, <10>, <20>, <50>, <100>, <200>, <500>, <1000>]
	 */
	unsigned int jack_ins_deb;

	/*
	 * jack-det-rate : Jack type detection latency (3/4 pole)
	 * ["32ms_64ms", "64ms_128ms", "128ms_256ms", "256ms_512ms"]
	 */
	const char *jack_det_rate;

	/*
	 * jack-rem-deb : Debounce time for jack removal (ms)
	 * [<1>, <5>, <10>, <20>]
	 */
	unsigned int jack_rem_deb;

	/*
	 * a-d-btn-thr : Impedance threshold between buttons A and D
	 * [0x0 - 0xFF]
	 */
	unsigned int a_d_btn_thr;

	/*
	 * d-b-btn-thr : Impedance threshold between buttons D and B
	 * [0x0 - 0xFF]
	 */
	unsigned int d_b_btn_thr;

	/*
	 * b-c-btn-thr : Impedance threshold between buttons B and C
	 * [0x0 - 0xFF]
	 */
	unsigned int b_c_btn_thr;

	/*
	 * c-mic-btn-thr : Impedance threshold between button C and Mic
	 * [0x0 - 0xFF]
	 */
	unsigned int c_mic_btn_thr;

	/*
	 * btn-avg : Number of 8-bit readings for averaged button measurement
	 * [<1>, <2>, <4>, <8>]
	 */
	unsigned int btn_avg;

	/*
	 * adc-1bit-rpt : Repeat count for 1-bit button measurement
	 * [<1>, <2>, <4>, <8>]
	 */
	unsigned int adc_1bit_rpt;

	/*
	 * mclk-name : Pass the system clk to da7219
	 * ["name of mclk" ]
	 */
	const char *mclk_name;
};