soc/intel/ptl: Update ME specification version to 21
[coreboot.git] / src / drivers / i2c / nau8825 / chip.h
blobe47f466e1d423449e61ec6aa392ec0dc246dab43
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef __DRIVERS_I2C_NAU8825_CHIP_H__
4 #define __DRIVERS_I2C_NAU8825_CHIP_H__
6 #include <acpi/acpi_device.h>
8 #define NAU8825_MAX_BUTTONS 8
11 * Nuvoton NAU8825 audio codec devicetree bindings
12 * linux/Documentation/devicetree/bindings/sound/nau8825.txt
14 struct drivers_i2c_nau8825_config {
15 /* Interrupt configuration */
16 struct acpi_irq irq;
17 struct acpi_gpio irq_gpio;
19 /* I2C Bus Frequency in Hertz (default 400kHz) */
20 unsigned int bus_speed;
22 /* Enable jack detection via JKDET pin */
23 unsigned int jkdet_enable;
25 /* Enable JKDET pin pull if set, otherwise high impedance state */
26 unsigned int jkdet_pull_enable;
28 /* Pull-up JKDET pin if set, otherwise pull down */
29 unsigned int jkdet_pull_up;
31 /* JKDET pin polarity, 0 => active high, 1 => active low */
32 unsigned int jkdet_polarity;
35 * VREF Impedance selection
36 * 0 - Open
37 * 1 - 25 kOhm
38 * 2 - 125 kOhm
39 * 3 - 2.5 kOhm
41 unsigned int vref_impedance;
43 /* Button impedance measurement hysteresis */
44 unsigned int sar_hysteresis;
47 * Reference voltage for button impedance measurement and micbias
48 * 0 - VDDA
49 * 1 - VDDA
50 * 2 - VDDA * 1.1
51 * 3 - VDDA * 1.2
52 * 4 - VDDA * 1.3
53 * 5 - VDDA * 1.4
54 * 6 - VDDA * 1.53
55 * 7 - VDDA * 1.53
57 unsigned int micbias_voltage;
58 unsigned int sar_voltage;
61 * SAR compare time
62 * 0 - 500 ns
63 * 1 - 1 us
64 * 2 - 2 us
65 * 3 - 4 us
67 unsigned int sar_compare_time;
70 * SAR sampling time
71 * 0 - 2 us
72 * 1 - 4 us
73 * 2 - 8 us
74 * 3 - 16 us
76 unsigned int sar_sampling_time;
79 * Button short key press debounce time
80 * 0 - 30 ms
81 * 1 - 50 ms
82 * 2 - 100 ms
83 * 3 - 30 ms
85 unsigned int short_key_debounce;
87 /* Debounce time 2^(n+2) ms (0-7) for jack insert */
88 unsigned int jack_insert_debounce;
90 /* Debounce time 2^(n+2) ms (0-7) for jack eject */
91 unsigned int jack_eject_debounce;
93 /* Number of buttons supported, up to 8 */
94 unsigned int sar_threshold_num;
97 * Impedance threshold for each button, up to 8
98 * SAR = 255 * micbias_voltage / sar_voltage * R / (2000 + R)
99 * R is Button impedance
101 uint64_t sar_threshold[NAU8825_MAX_BUTTONS];
103 /* Make the drive strength of ADCOUT IO PIN strong if set.
104 * Otherwise, the drive keeps normal strength.
106 bool adcout_ds;
109 #endif /* __DRIVERS_I2C_NAU8825_CHIP_H__ */