Skip to content

Commit

Permalink
iio:proximity:sx9310: Extract common Semtech sensor logic
Browse files Browse the repository at this point in the history
Before adding new Semtech sensors, move common logic to all Semtech SAR
sensor in its own file:
- interface with IIO subsystem,
- interrupt management,
- channel access conrol,
- event processing.

The change adds a bidirectional interface between sx93xx and sx_common.

The change is quite mechanical, as the impacted functions are moved
and renamed.

Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Link: https://lore.kernel.org/r/20220101203817.290512-3-gwendal@chromium.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
  • Loading branch information
Gwendal Grignou authored and Jonathan Cameron committed Jan 23, 2022
1 parent fc5d805 commit caa8ce7
Show file tree
Hide file tree
Showing 5 changed files with 843 additions and 605 deletions.
6 changes: 6 additions & 0 deletions drivers/iio/proximity/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,17 @@ config SRF04
To compile this driver as a module, choose M here: the
module will be called srf04.

config SX_COMMON
tristate
help
Common Semtech proximity sensor code.

config SX9310
tristate "SX9310/SX9311 Semtech proximity sensor"
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
select REGMAP_I2C
select SX_COMMON
depends on I2C
help
Say Y here to build a driver for Semtech's SX9310/SX9311 capacitive
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/proximity/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ obj-$(CONFIG_RFD77402) += rfd77402.o
obj-$(CONFIG_SRF04) += srf04.o
obj-$(CONFIG_SRF08) += srf08.o
obj-$(CONFIG_SX9310) += sx9310.o
obj-$(CONFIG_SX_COMMON) += sx_common.o
obj-$(CONFIG_SX9500) += sx9500.o
obj-$(CONFIG_VCNL3020) += vcnl3020.o
obj-$(CONFIG_VL53L0X_I2C) += vl53l0x-i2c.o
Expand Down
Loading

0 comments on commit caa8ce7

Please sign in to comment.