mb/google/brya: Create rull variant
[coreboot2.git] / src / drivers / i2c / sx9324 / chip.h
blob47910fb7a02c9bab875f53bee9f1098d17a09a65
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef __DRIVERS_I2C_SX9324_CHIP_H__
4 #define __DRIVERS_I2C_SX9324_CHIP_H__
6 #include <acpi/acpi_device.h>
7 #include <device/i2c_simple.h>
9 #define REGISTER(NAME) uint8_t NAME
11 struct drivers_i2c_sx9324_config {
12 /* Device Description */
13 const char *desc;
15 /* ACPI _UID */
16 unsigned int uid;
18 /* Bus speed in Hz, default is I2C_SPEED_FAST */
19 enum i2c_speed speed;
21 /* Use GPIO-based interrupt instead of IO-APIC */
22 struct acpi_gpio irq_gpio;
24 /* IO-APIC interrupt */
25 struct acpi_irq irq;
28 semtech,ph0-pin:
29 description: |
30 Array of 3 entries. Index represent the id of the CS pin.
31 Value indicates how each CS pin is used during phase 0.
32 Each of the 3 pins have the following value -
33 0 : unused (high impedance)
34 1 : measured input
35 2 : dynamic shield
36 3 : grounded.
37 For instance, CS0 measured, CS1 shield and CS2 ground is [1, 2, 3]
38 items:
39 enum: [ 0, 1, 2, 3 ]
40 minItems: 3
41 maxItems: 3
43 uint64_t ph0_pin[3];
46 semtech,ph1-pin:
47 Same as ph0-pin for phase 1.
49 uint64_t ph1_pin[3];
52 semtech,ph2-pin:
53 Same as ph0-pin for phase 2.
55 uint64_t ph2_pin[3];
58 semtech,ph3-pin:
59 Same as ph0-pin for phase 3.
61 uint64_t ph3_pin[3];
64 semtech,ph01-resolution:
65 enum: [8, 16, 32, 64, 128, 256, 512, 1024]
66 description:
67 Capacitance measurement resolution. For phase 0 and 1.
68 Higher the number, higher the resolution.
69 default: 128
71 uint64_t ph01_resolution;
74 semtech,ph23-resolution:
75 Same as ph01-resolution for phase 2 and 3.
77 uint64_t ph23_resolution;
80 semtech,startup-sensor:
81 enum: [0, 1, 2, 3]
82 default: 0
83 description: |
84 Phase used for start-up proximity detection.
85 It is used when we enable a phase to remove static offset and measure
86 only capacitance changes introduced by the user.
88 uint64_t startup_sensor;
91 semtech,ph01-proxraw-strength:
92 minimum: 0
93 maximum: 7
94 default: 1
95 description:
96 PROXRAW filter strength for phase 0 and 1. A value of 0 represents off,
97 and other values represent 1-1/2^N.
99 uint64_t ph01_proxraw_strength;
102 semtech,ph23-proxraw-strength:
103 Same as proxraw-strength01, for phase 2 and 3.
105 uint64_t ph23_proxraw_strength;
108 semtech,avg-pos-strength:
109 enum: [0, 16, 64, 128, 256, 512, 1024, 4294967295]
110 default: 16
111 description: |
112 Average positive filter strength. A value of 0 represents off and
113 UINT_MAX (4294967295) represents infinite. Other values
114 represent 1-1/N.
116 uint64_t avg_pos_strength;
119 semtech,cs-idle-sleep:
120 description:
121 State of CS pins during sleep mode and idle time.
122 enum:
123 - hi-z
124 - gnd
125 - vdd
127 const char *cs_idle_sleep;
130 semtech,int-comp-resistor:
131 description:
132 Internal resistor setting for compensation.
133 enum:
134 - lowest
135 - low
136 - high
137 - highest
139 const char *int_comp_resistor;
142 semtech,input-precharge-resistor-ohms:
143 default: 4000
144 multipleOf: 2000
145 minimum: 0
146 maximum: 30000
147 description:
148 Pre-charge input resistance in Ohm.
150 uint64_t input_precharge_resistor_ohms;
153 semtech,input-analog-gain:
154 minimum: 0
155 maximum: 3
156 description: |
157 Defines the input antenna analog gain
158 0: x1.247
159 1: x1 (default)
160 2: x0.768
161 3: x0.552
163 uint64_t input_analog_gain;
165 #if CONFIG(DRIVERS_I2C_SX9324_SUPPORT_LEGACY_LINUX_DRIVER)
166 #include "registers.h"
167 #endif
170 #undef REGISTER
172 #endif /* __DRIVERS_I2C_SX9324_CHIP_H__ */