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 */
18 /* Bus speed in Hz, default is I2C_SPEED_FAST */
21 /* Use GPIO-based interrupt instead of IO-APIC */
22 struct acpi_gpio irq_gpio
;
24 /* IO-APIC interrupt */
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)
37 For instance, CS0 measured, CS1 shield and CS2 ground is [1, 2, 3]
47 Same as ph0-pin for phase 1.
53 Same as ph0-pin for phase 2.
59 Same as ph0-pin for phase 3.
64 semtech,ph01-resolution:
65 enum: [8, 16, 32, 64, 128, 256, 512, 1024]
67 Capacitance measurement resolution. For phase 0 and 1.
68 Higher the number, higher the resolution.
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:
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:
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]
112 Average positive filter strength. A value of 0 represents off and
113 UINT_MAX (4294967295) represents infinite. Other values
116 uint64_t avg_pos_strength
;
119 semtech,cs-idle-sleep:
121 State of CS pins during sleep mode and idle time.
127 const char *cs_idle_sleep
;
130 semtech,int-comp-resistor:
132 Internal resistor setting for compensation.
139 const char *int_comp_resistor
;
142 semtech,input-precharge-resistor-ohms:
148 Pre-charge input resistance in Ohm.
150 uint64_t input_precharge_resistor_ohms
;
153 semtech,input-analog-gain:
157 Defines the input antenna analog gain
163 uint64_t input_analog_gain
;
165 #if CONFIG(DRIVERS_I2C_SX9324_SUPPORT_LEGACY_LINUX_DRIVER)
166 #include "registers.h"
172 #endif /* __DRIVERS_I2C_SX9324_CHIP_H__ */