acpi: Add IORT helper functions
[coreboot2.git] / src / drivers / i2c / sx9310 / chip.h
blob3dcbcc4c1505cf42d0613d4342930b8f347b11cd
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef __DRIVERS_I2C_SX9310_CHIP_H__
4 #define __DRIVERS_I2C_SX9310_CHIP_H__
6 #include <acpi/acpi_device.h>
7 #include <device/i2c_simple.h>
9 #define MAX_COMBINED_SENSORS_ENTRIES 4
11 enum sx9310_resolution {
12 SX9310_COARSEST = 1,
13 SX9310_VERY_COARSE,
14 SX9310_COARSE,
15 SX9310_MEDIUM_COARSE,
16 SX9310_MEDIUM,
17 SX9310_FINE,
18 SX9310_VERY_FINE,
19 SX9310_FINEST,
22 struct drivers_i2c_sx9310_config {
23 /* Device Description */
24 const char *desc;
26 /* ACPI _UID */
27 unsigned int uid;
29 /* Bus speed in Hz, default is I2C_SPEED_FAST */
30 enum i2c_speed speed;
32 /* Use GPIO-based interrupt instead of IO-APIC */
33 struct acpi_gpio irq_gpio;
35 /* IO-APIC interrupt */
36 struct acpi_irq irq;
39 * Registers definition in the kernel source tree at:
40 * Documentation/devicetree/bindings/iio/proximity/semtech,sx9310.yaml
43 /* When true, cs0 is the ground. 0 [default] is false. */
44 uint32_t cs0_ground;
46 /* Sensor used for start-up proximity detection: Default 0. */
47 uint32_t startup_sensor;
49 /* Raw Proximity filter strength: When not set, disabled. */
50 uint32_t proxraw_strength;
52 /* Average Proximity filter strength: When not set, disabled. */
53 uint32_t avg_pos_strength;
56 * List of which sensors are combined and represented by CS3.
57 * Could be standalone (3) or combination of 0, 1, 2, 3.
58 * Driver default: CS0 + CS1.
60 uint32_t combined_sensors_count;
61 uint32_t combined_sensors[MAX_COMBINED_SENSORS_ENTRIES];
63 /* Capacitance measure resolution. Driver default: "finest". */
64 enum sx9310_resolution resolution;
67 #endif /* __DRIVERS_I2C_SX9310_CHIP_H__ */