coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
chip.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <acpi/acpi_device.h>
4 
5 #define NAU8825_MAX_BUTTONS 8
6 
7 /*
8  * Nuvoton NAU8825 audio codec devicetree bindings
9  * linux/Documentation/devicetree/bindings/sound/nau8825.txt
10  */
12  /* Interrupt configuration */
13  struct acpi_irq irq;
14  struct acpi_gpio irq_gpio;
15 
16  /* I2C Bus Frequency in Hertz (default 400kHz) */
17  unsigned int bus_speed;
18 
19  /* Enable jack detection via JKDET pin */
20  unsigned int jkdet_enable;
21 
22  /* Enable JKDET pin pull if set, otherwise high impedance state */
23  unsigned int jkdet_pull_enable;
24 
25  /* Pull-up JKDET pin if set, otherwise pull down */
26  unsigned int jkdet_pull_up;
27 
28  /* JKDET pin polarity, 0 => active high, 1 => active low */
29  unsigned int jkdet_polarity;
30 
31  /*
32  * VREF Impedance selection
33  * 0 - Open
34  * 1 - 25 kOhm
35  * 2 - 125 kOhm
36  * 3 - 2.5 kOhm
37  */
38  unsigned int vref_impedance;
39 
40  /* Button impedance measurement hysteresis */
41  unsigned int sar_hysteresis;
42 
43  /*
44  * Reference voltage for button impedance measurement and micbias
45  * 0 - VDDA
46  * 1 - VDDA
47  * 2 - VDDA * 1.1
48  * 3 - VDDA * 1.2
49  * 4 - VDDA * 1.3
50  * 5 - VDDA * 1.4
51  * 6 - VDDA * 1.53
52  * 7 - VDDA * 1.53
53  */
54  unsigned int micbias_voltage;
55  unsigned int sar_voltage;
56 
57  /*
58  * SAR compare time
59  * 0 - 500 ns
60  * 1 - 1 us
61  * 2 - 2 us
62  * 3 - 4 us
63  */
64  unsigned int sar_compare_time;
65 
66  /*
67  * SAR sampling time
68  * 0 - 2 us
69  * 1 - 4 us
70  * 2 - 8 us
71  * 3 - 16 us
72  */
73  unsigned int sar_sampling_time;
74 
75  /*
76  * Button short key press debounce time
77  * 0 - 30 ms
78  * 1 - 50 ms
79  * 2 - 100 ms
80  * 3 - 30 ms
81  */
82  unsigned int short_key_debounce;
83 
84  /* Debounce time 2^(n+2) ms (0-7) for jack insert */
85  unsigned int jack_insert_debounce;
86 
87  /* Debounce time 2^(n+2) ms (0-7) for jack eject */
88  unsigned int jack_eject_debounce;
89 
90  /* Number of buttons supported, up to 8 */
91  unsigned int sar_threshold_num;
92 
93  /*
94  * Impedance threshold for each button, up to 8
95  * SAR = 255 * micbias_voltage / sar_voltage * R / (2000 + R)
96  * R is Button impedance
97  */
99 };
#define NAU8825_MAX_BUTTONS
Definition: chip.h:5
unsigned long long uint64_t
Definition: stdint.h:17
unsigned int jkdet_polarity
Definition: chip.h:29
unsigned int jack_eject_debounce
Definition: chip.h:88
unsigned int jkdet_enable
Definition: chip.h:20
unsigned int sar_sampling_time
Definition: chip.h:73
unsigned int micbias_voltage
Definition: chip.h:54
unsigned int vref_impedance
Definition: chip.h:38
unsigned int jkdet_pull_enable
Definition: chip.h:23
struct acpi_irq irq
Definition: chip.h:13
struct acpi_gpio irq_gpio
Definition: chip.h:14
unsigned int jkdet_pull_up
Definition: chip.h:26
unsigned int sar_hysteresis
Definition: chip.h:41
unsigned int sar_compare_time
Definition: chip.h:64
uint64_t sar_threshold[NAU8825_MAX_BUTTONS]
Definition: chip.h:98
unsigned int short_key_debounce
Definition: chip.h:82
unsigned int bus_speed
Definition: chip.h:17
unsigned int sar_voltage
Definition: chip.h:55
unsigned int jack_insert_debounce
Definition: chip.h:85
unsigned int sar_threshold_num
Definition: chip.h:91