Skip to content

iio: Add a ChromeOS EC MKBP proximity driver

Stephen Boyd linux-devicetree linux-iio lkml 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest3 patches 5 repliesIn review
  2. v53 patches 4 repliesSuperseded
  3. v43 patches 6 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v33 patches4 repliesSuperseded
v23 patches0 repliesSuperseded
v13 patches14 repliesSuperseded

Changes in v6 from the cover letter

* Picked up RB tag from Rob
* Track state of switch and only push event if it's different

Patches in v6 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3platform/chrome: cros_ec: Add SW_FRONT_PROXIMITY MKBP defineinclude/linux/platform_data/cros_ec_commands.h+1 -00 replies
2/3dt-bindings: iio: Add cros ec proximity yaml docDocumentation/devicetree/bindings/iio/proximity/google,cros-ec-mkbp-proximity.yaml Documentation/devicetree/bindings/mfd/google,cros-ec.yaml+44 -00 replies
3/3iio: proximity: Add a ChromeOS EC MKBP proximity driverdrivers/iio/proximity/Kconfig drivers/iio/proximity/Makefile drivers/iio/proximity/cros_ec_mkbp_proximity.c+283 -05 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchEnric Balletbo i SerraRob HerringGwendal Grignou
1/3A-b
2/3R-b
3/3R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v6 thread

Cover letter [PATCH v6 0/3] iio: Add a ChromeOS EC MKBP proximity driver

This is a different approach to [1] where I tried to add this proximity sensor logic to the input subsystem. Instead, we'll take the approach of making a small IIO proximity driver that parses the EC switch bitmap to find out if the front proximity sensor is detecting something or not. This allows us to treat proximity sensors as IIO devices all the time in userspace instead of handling this switch on the EC via the input subsystem and then other proximity sensors via IIO.

I propose this is all merged through IIO subsystem. Please ack the first patch so it can be merged that way.

Changes from v5:
* Picked up RB tag from Rob
* Track state of switch and only push event if it's different

Changes from v4:
* Reduced binding and moved proximity node to mfd spi example
* Dropped of_match_ptr()

Changes from v3:
* Added SPI and cros-ec wrapper nodes to yaml example
* Ignore notifier registration return code that is always zero

Changes from v2:
* Check iio clock and use IIO time if not boottime

Changes from v1:
* Driver moved location
* Put mkbp everywhere
* Fixed up DT binding to not fail and make sure is a child of cros-ec
* Simplified logic for sending a message
* Dropped CONFIG_OF usage
* Sorted includes

[1] https://lore.kernel.org/r/[email protected]

Cc Dmitry Torokhov <[email protected]>
Cc Benson Leung <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Douglas Anderson <[email protected]>
Cc Gwendal Grignou <[email protected]>
Cc Rob Herring <[email protected]>
Cc Enric Balletbo i Serra <[email protected]>

Stephen Boyd (3):
platform/chrome: cros_ec: Add SW_FRONT_PROXIMITY MKBP define
dt-bindings: iio: Add cros ec proximity yaml doc
iio: proximity: Add a ChromeOS EC MKBP proximity driver

 .../google,cros-ec-mkbp-proximity.yaml        |  37 +++
 .../bindings/mfd/google,cros-ec.yaml          |   7 +
 drivers/iio/proximity/Kconfig                 |  11 +
 drivers/iio/proximity/Makefile                |   1 +
 .../iio/proximity/cros_ec_mkbp_proximity.c    | 271 ++++++++++++++++++
 .../linux/platform_data/cros_ec_commands.h    |   1 +
 6 files changed, 328 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/proximity/google,cros-ec-mkbp-proximity.yaml
 create mode 100644 drivers/iio/proximity/cros_ec_mkbp_proximity.c

base-commit: 19c329f6808995b142b3966301f217c831e7cf31

Signature · 1 line
https://chromeos.dev