acpi: Add IORT helper functions
[coreboot2.git] / src / drivers / i2c / cs35l53 / chip.h
blob93905c255ff454ec77101a576102df080ca20b76
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef __DRIVERS_I2C_CS35L53_CHIP_H__
4 #define __DRIVERS_I2C_CS35L53_CHIP_H__
6 #include <acpi/acpi_device.h>
8 #define CS35L53_MAX_GPIOS 2
10 enum cs35l53_boost_type {
11 INTERNAL_BOOST = 0,
12 EXTERNAL_BOOST = 1,
15 enum cs35l53_boost_ind_nanohenrys {
16 BOOST_IND_1000_NH = 1000,
17 BOOST_IND_1200_NH = 1200,
18 BOOST_IND_1500_NH = 1500,
19 BOOST_IND_2200_NH = 2200,
22 enum cs35l53_asp_sdout_hiz {
23 ASP_SDOUT_LOGIC0_UNUSED_LOGIC0_DISABLED = 0,
24 ASP_SDOUT_HIZ_UNUSED_LOGIC0_DISABLED = 1,
25 ASP_SDOUT_LOGIC0_UNUSED_HIZ_DISABLED = 2,
26 ASP_SDOUT_HIZ_UNUSED_HIZ_DISABLED = 3,
29 enum cs35l53_gpio1_src {
30 GPIO1_SRC_HIGH_IMPEDANCE = 0,
31 GPIO1_SRC_GPIO = 1,
32 GPIO1_SRC_SYNC = 2,
33 GPIO1_SRC_MCLK_INPUT = 3,
36 enum cs35l53_gpio2_src {
37 GPIO2_SRC_HIGH_IMPEDANCE = 0,
38 GPIO2_SRC_GPIO = 1,
39 GPIO2_SRC_OPEN_DRAIN = 2,
40 GPIO2_SRC_MCLK_INPUT = 3,
41 GPIO2_SRC_PUSH_PULL_INTB = 4,
42 GPIO2_SRC_PUSH_PULL_INT = 5,
46 * Cirrus Logic CS35L53 Audio Codec devicetree bindings
47 * linux/Documentation/devicetree/bindings/sound/cirrus,cs35l53.yaml
49 struct drivers_i2c_cs35l53_config {
50 const char *name; /* ACPI Device Name */
52 const char *sub; /* SUB ID to uniquely identify system */
54 /* Device Description */
55 const char *desc;
57 /* Identifier for chips */
58 uint32_t uid;
60 /* Interrupt configuration */
61 struct acpi_irq irq;
63 /* Use GPIO based interrupt instead of PIRQ */
64 struct acpi_gpio irq_gpio;
66 /* Use GPIO based reset gpio */
67 struct acpi_gpio reset_gpio;
69 /* I2C Bus Frequency in Hertz (default 400kHz) */
70 unsigned int bus_speed;
72 /* Define cs35l53 parameters */
74 * cirrus,boost-type : Configures the type of Boost being used.
75 * Internal boost requires boost-peak-milliamp, boost-ind-nanohenry and
76 * boost-cap-microfarad.
77 * External Boost must have GPIO1 as GPIO output. GPIO1 will be set high to
78 * enable boost voltage.
80 enum cs35l53_boost_type boost_type;
83 * cirrus,boost-peak-milliamp : Boost-converter peak current limit in mA.
84 * Configures the peak current by monitoring the current through the boost FET.
85 * Range starts at 1600 mA and goes to a maximum of 4500 mA with increments
86 * of 50 mA. See section 4.3.6 of the datasheet for details.
88 unsigned int boost_peak_milliamp;
91 * cirrus,boost-ind-nanohenry : Boost inductor value, expressed in nH. Valid
92 * values include 1000, 1200, 1500 and 2200.
94 enum cs35l53_boost_ind_nanohenrys boost_ind_nanohenry;
97 * cirrus,boost-cap-microfarad : Total equivalent boost capacitance on the VBST
98 * and VAMP pins, derated at 11 volts DC. The value must be rounded to the
99 * nearest integer and expressed in uF.
101 unsigned int boost_cap_microfarad;
104 * cirrus,asp-sdout-hiz : Audio serial port SDOUT Hi-Z control. Sets the Hi-Z
105 * configuration for SDOUT pin of amplifier.
106 * 0 = Logic 0 during unused slots, and while all transmit channels disabled
107 * 1 = Hi-Z during unused slots but logic 0 while all transmit channels disabled
108 * 2 = Logic 0 during unused slots, but Hi-Z while all transmit channels disabled
109 * 3 = Hi-Z during unused slots and while all transmit channels disabled
111 enum cs35l53_asp_sdout_hiz asp_sdout_hiz;
114 * cirrus,gpio1-polarity-invert : Boolean which specifies whether the GPIO1
115 * level is inverted.
117 bool gpio1_polarity_invert;
120 * cirrus,gpio2-polarity-invert : Boolean which specifies whether the GPIO2
121 * level is inverted.
123 bool gpio2_polarity_invert;
126 * cirrus,gpio1-output-enable : Boolean which specifies whether the GPIO1 pin
127 * is configured as an output.
129 bool gpio1_output_enable;
132 * cirrus,gpio2-output-enable : Boolean which specifies whether the GPIO2 pin
133 * is configured as an output.
135 bool gpio2_output_enable;
138 * cirrus,gpio1-src-select : Configures the function of the GPIO1 pin.
139 * GPIO1:
140 * 0 = High Impedance (Default)
141 * 1 = GPIO
142 * 2 = Sync
143 * 3 = MCLK input
145 enum cs35l53_gpio1_src gpio1_src_select;
148 * cirrus,gpio2-src-select : Configures the function of the GPIO2 pin.
149 * GPIO2:
150 * 0 = High Impedance (Default)
151 * 1 = GPIO
152 * 2 = Open Drain INTB
153 * 3 = MCLK input
154 * 4 = Push-pull INTB (active low)
155 * 5 = Push-pull INT (active high)
157 enum cs35l53_gpio2_src gpio2_src_select;
160 #endif /* __DRIVERS_I2C_CS35L53_CHIP_H__ */