Linux-IIO Archive on
 help / color / Atom feed
From: Stephen Boyd <>
To: Jonathan Cameron <>
	Dmitry Torokhov <>,
	Benson Leung <>,
	Guenter Roeck <>,
	Douglas Anderson <>,
	Gwendal Grignou <>,, Rob Herring <>,
	Enric Balletbo i Serra <>
Subject: [PATCHv5 0/3] iio: Add a ChromeOS EC MKBP proximity driver
Date: Tue,  9 Feb 2021 18:51:39 -0800
Message-ID: <> (raw)

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 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


Cc: Dmitry Torokhov <>
Cc: Benson Leung <>
Cc: Guenter Roeck <>
Cc: Douglas Anderson <>
Cc: Gwendal Grignou <>
Cc: <>
Cc: Rob Herring <>
Cc: Enric Balletbo i Serra <>

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    | 242 ++++++++++++++++++
 .../linux/platform_data/cros_ec_commands.h    |   1 +
 6 files changed, 299 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

             reply index

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-10  2:51 Stephen Boyd [this message]
2021-02-10  2:51 ` [PATCH v5 1/3] platform/chrome: cros_ec: Add SW_FRONT_PROXIMITY MKBP define Stephen Boyd
2021-02-10  2:51 ` [PATCH v5 2/3] dt-bindings: iio: Add cros ec proximity yaml doc Stephen Boyd
2021-02-10 18:44   ` Rob Herring
2021-02-10  2:51 ` [PATCH v5 3/3] iio: proximity: Add a ChromeOS EC MKBP proximity driver Stephen Boyd
2021-02-10  8:29   ` Gwendal Grignou
2021-02-10 17:45     ` Stephen Boyd
2021-02-12 19:22       ` Gwendal Grignou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-IIO Archive on

Archives are clonable:
	git clone --mirror linux-iio/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-iio linux-iio/ \
	public-inbox-index linux-iio

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone