summaryrefslogtreecommitdiff
path: root/src/drivers/i2c/sx9360/chip.h
diff options
context:
space:
mode:
authorSeunghwan Kim <sh_.kim@samsung.corp-partner.google.com>2021-11-08 15:55:01 +0900
committerTim Wawrzynczak <twawrzynczak@chromium.org>2022-01-19 03:11:57 +0000
commit14a1c2778fda7e4ed25d6cd4aecfb2d4e672dbed (patch)
tree0e8a3334c7b4f831d61bf6ba5c6caa3cb4bda574 /src/drivers/i2c/sx9360/chip.h
parentc8283d70143709ba026d9d56a04f6097aad9ea18 (diff)
driver/i2c: Add sx9360 driver
Add driver for setting up Semtech sx9360 SAR sensor. The driver is based on sx9310.c. The core of the driver is the same, but the bindings are slightly different. Registers are documented in the kernel tree: Documentation/devicetree/bindings/iio/proximity/semtech,sx9360.yaml [https://patchwork.kernel.org/project/linux-iio/patch/20211213024057.3824985-4-gwendal@chromium.org/] Signed-off-by: Seunghwan Kim <sh_.kim@samsung.corp-partner.google.com> Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: I0a912f184e6f3501f894cca24c0d71a2c3087516 Reviewed-on: https://review.coreboot.org/c/coreboot/+/59608 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@mailbox.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'src/drivers/i2c/sx9360/chip.h')
-rw-r--r--src/drivers/i2c/sx9360/chip.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/drivers/i2c/sx9360/chip.h b/src/drivers/i2c/sx9360/chip.h
new file mode 100644
index 0000000000..397ea3f5d2
--- /dev/null
+++ b/src/drivers/i2c/sx9360/chip.h
@@ -0,0 +1,40 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef __DRIVERS_I2C_SX9360_CHIP_H__
+#define __DRIVERS_I2C_SX9360_CHIP_H__
+
+#include <acpi/acpi_device.h>
+#include <device/i2c_simple.h>
+
+struct drivers_i2c_sx9360_config {
+ /* Device Description */
+ const char *desc;
+
+ /* ACPI _UID */
+ unsigned int uid;
+
+ /* Bus speed in Hz, default is I2C_SPEED_FAST */
+ enum i2c_speed speed;
+
+ /* Use GPIO-based interrupt instead of IO-APIC */
+ struct acpi_gpio irq_gpio;
+
+ /* IO-APIC interrupt */
+ struct acpi_irq irq;
+
+ /*
+ * Registers definition in the kernel source tree at:
+ * Documentation/devicetree/bindings/iio/proximity/semtech,sx9360.yaml
+ */
+
+ /* Raw Proximity filter strength: When not set, disabled. */
+ uint32_t proxraw_strength;
+
+ /* Average Proximity filter strength: When not set, disabled. */
+ uint32_t avg_pos_strength;
+
+ /* Capacitance measure resolution. Driver default: 128. */
+ uint32_t resolution;
+};
+
+#endif /* __DRIVERS_I2C_SX9360_CHIP_H__ */