2021-05-02 13:59:30

by Tomasz Duszynski

[permalink] [raw]
Subject: [PATCH v2 0/3] iio: sps30: add support for serial interface

One can communicate with sensor either over i2c or serial interface.
This series add support for the latter. And in order to do that existing
codebase needs to be separated into core and interface specific
components.

v2:
- simplify Kconfig by hiding core component selection
- export symbols as GPL compatible
- drop excessive ops wrappers
- rework ops to use __be32
- rework polling for measurements, sensor produces measurements within
1s so instead of polling just wait 1s
- simplify frame ready condition (serial)
- don't mix char with unsigned version
- calculate checksum during frame validation (serial)
- uncomment return status in frame validation (serial)
- pass part name to probe instead of KBUILD_MODNAME

Tomasz Duszynski (3):
iio: sps30: separate core and interface specific code
iio: sps30: add support for serial interface
dt-bindings: iio: chemical: sps30: update binding with serial example

.../iio/chemical/sensirion,sps30.yaml | 7 +-
MAINTAINERS | 2 +
drivers/iio/chemical/Kconfig | 27 +-
drivers/iio/chemical/Makefile | 2 +
drivers/iio/chemical/sps30.c | 269 ++---------
drivers/iio/chemical/sps30.h | 35 ++
drivers/iio/chemical/sps30_i2c.c | 251 ++++++++++
drivers/iio/chemical/sps30_serial.c | 428 ++++++++++++++++++
8 files changed, 794 insertions(+), 227 deletions(-)
create mode 100644 drivers/iio/chemical/sps30.h
create mode 100644 drivers/iio/chemical/sps30_i2c.c
create mode 100644 drivers/iio/chemical/sps30_serial.c

--
2.31.1


2021-05-02 13:59:30

by Tomasz Duszynski

[permalink] [raw]
Subject: [PATCH v2 3/3] dt-bindings: iio: chemical: sps30: update binding with serial example

sps30 has gained support for serial communication so add example to the
binding file. While at it remove reg property from list of required
properties because it's no-op in case of serial communication.

Signed-off-by: Tomasz Duszynski <[email protected]>
---
.../devicetree/bindings/iio/chemical/sensirion,sps30.yaml | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/iio/chemical/sensirion,sps30.yaml b/Documentation/devicetree/bindings/iio/chemical/sensirion,sps30.yaml
index a93d1972a5c2..967500b7e773 100644
--- a/Documentation/devicetree/bindings/iio/chemical/sensirion,sps30.yaml
+++ b/Documentation/devicetree/bindings/iio/chemical/sensirion,sps30.yaml
@@ -22,7 +22,6 @@ properties:

required:
- compatible
- - reg

additionalProperties: false

@@ -37,5 +36,11 @@ examples:
reg = <0x69>;
};
};
+ - |
+ serial {
+ air-pollution-sensor {
+ compatible = "sensirion,sps30";
+ };
+ };

...
--
2.31.1