drivers/mipi: Add support for KD_KD110N11_51IE panel
[coreboot2.git] / src / drivers / i2c / cs42l42 / chip.h
blob61e02136672a543f6e6dcacebcf5f47a5a366917
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef __DRIVERS_I2C_CS42L42_CHIP_H__
4 #define __DRIVERS_I2C_CS42L42_CHIP_H__
6 #include <acpi/acpi_device.h>
8 enum cs42l42_ts_dbnc_rise {
9 RISE_DEB_0_MS = 0,
10 RISE_DEB_125_MS = 1,
11 RISE_DEB_250_MS = 2,
12 RISE_DEB_500_MS = 3,
13 RISE_DEB_750_MS = 4,
14 RISE_DEB_1000_MS = 5,
15 RISE_DEB_1250_MS = 6,
16 RISE_DEB_1500_MS = 7,
19 enum cs42l42_ts_dbnc_fall {
20 FALL_DEB_0_MS = 0,
21 FALL_DEB_125_MS = 1,
22 FALL_DEB_250_MS = 2,
23 FALL_DEB_500_MS = 3,
24 FALL_DEB_750_MS = 4,
25 FALL_DEB_1000_MS = 5,
26 FALL_DEB_1250_MS = 6,
27 FALL_DEB_1500_MS = 7,
30 enum cs42l42_hs_bias_ramp_rate {
31 HSBIAS_RAMP_FAST_RISE_SLOW_FALL = 0,
32 HSBIAS_RAMP_FAST = 1,
33 HSBIAS_RAMP_SLOW = 2,
34 HSBIAS_RAMP_SLOWEST = 3,
38 * Cirrus Logic CS42L42 Audio Codec devicetree bindings
39 * linux/Documentation/devicetree/bindings/sound/cs42l42.txt
41 struct drivers_i2c_cs42l42_config {
42 /* Interrupt configuration */
43 struct acpi_irq irq;
45 /* Use GPIO based interrupt instead of PIRQ */
46 struct acpi_gpio irq_gpio;
48 /* Use GPIO based reset gpio */
49 struct acpi_gpio reset_gpio;
51 /* I2C Bus Frequency in Hertz (default 400kHz) */
52 unsigned int bus_speed;
54 /* Define cs42L42 parameters */
56 * cirrus,ts-inv : Boolean property. For jacks that invert the tip sense
57 * polarity. Normal jacks will short tip sense pin to HS1 when headphones are
58 * plugged in and leave tip sense floating when not plugged in. Inverting jacks
59 * short tip sense when unplugged and float when plugged in.
60 * false = Non-inverted
61 * true = Inverted
62 * Default = Non-inverted
64 bool ts_inv;
66 * cirrus,ts-dbnc-rise : Debounce the rising edge of TIP_SENSE_PLUG. With no
67 * debounce, the tip sense pin might be noisy on a plug event.
68 * Default = RISE_DEB_1000_MS
70 enum cs42l42_ts_dbnc_rise ts_dbnc_rise;
72 * cirrus,ts-dbnc-fall : Debounce the falling edge of TIP_SENSE_UNPLUG.
73 * With no debounce, the tip sense pin might be noisy on an unplug event.
74 * Default = FALL_DEB_1000_MS
76 enum cs42l42_ts_dbnc_fall ts_dbnc_fall;
78 * cirrus,btn-det-init-dbnce : This sets how long the driver sleeps after
79 * enabling button detection interrupts. After auto-detection and before
80 * servicing button interrupts, the HS bias needs time to settle. If you
81 * don't wait, there is possibility for erroneous button interrupt.
82 * Value in ms, 0 - 200.
83 * Default = 100ms
85 unsigned int btn_det_init_dbnce;
87 * cirrus,btn-det-event-dbnce : This sets how long the driver delays after
88 * receiving a button press interrupt. With level detect interrupts, you want
89 * to wait a small amount of time to make sure the button press is making a
90 * clean connection with the bias resistors.
91 * Value in ms, 0 - 20.
92 * Default = 10ms
94 unsigned int btn_det_event_dbnce;
96 * cirrus,bias-lvls : For a level-detect headset button scheme, each button
97 * will bias the mic pin to a certain voltage. To determine which button was
98 * pressed, the driver will compare this biased voltage to sequential,
99 * decreasing voltages and will stop when a comparator is tripped,
100 * indicating a comparator voltage < bias voltage. This value represents a
101 * percentage of the internally generated HS bias voltage. For different
102 * hardware setups, a designer might want to tweak this. This is an array of
103 * descending values for the comparator voltage.
104 * Array of 4 values
105 * Each 0-63
106 * < x1 x2 x3 x4 >
107 * Default = < 15 8 4 1>
109 uint64_t bias_lvls[4];
110 /* headset bias ramp rate */
111 enum cs42l42_hs_bias_ramp_rate hs_bias_ramp_rate;
113 * cirrus,hs-bias-sense-disable: This is boolean property. If present the
114 * HSBIAS sense is disabled. Configures HSBIAS output current sense through
115 * the external 2.21-k resistor. HSBIAS_SENSE is hardware feature to reduce
116 * the potential pop noise during the headset plug out slowly. But on some
117 * platforms ESD voltage will affect it causing test to fail, especially
118 * with CTIA headset type. For different hardware setups, a designer might
119 * want to tweak default behavior.
121 bool hs_bias_sense_disable;
124 #endif /* __DRIVERS_I2C_CS42L42_CHIP_H__ */