Commit 97d642e2 authored by Linus Walleij's avatar Linus Walleij Committed by Jonathan Cameron

iio: light: Add a driver for Sharp GP2AP002x00F

This driver handles two different Sharp sensors that have been
proposed for merging to the mainline kernel over the years, and
already has a limited proximity-only driver in the input
subsystem.

These components are completely different from the confusingly
similarly named Sharp GP2AP020A00F, for which we have a driver
in drivers/iio/light/gp2ap020a00f.c

The two components GP2AP002A00F and GP2AP002S00F are
distinctively different but similar: they share the same set of
registers but differ slightly in the I2C protocol.

Instead of the approach by the previous input driver, we create
a combined IIO proximity and light sensor driver.

The plan is to merge this driver and delete the input driver.

The pieces for the driver are picked all over the place after
researching and grepping through a few different vendor trees
and driver submissions.

We merge it under the light sensors because:

- It has similarities with the Capella CM3605 light sensor and
  proximity driver which is there.

- It is related to the GP2AP020A00F driver which is also there.

This driver was tested with the Samsung GT-S7710 mobile phone
which has the GP2AP002S00F proximity sensor mounted.

The suspend/resume cycle will disable the interrupt from the
sensor. If someone would desire to use this interrupt for
wakeup, the driver will need modifications.

Cc: Stephan Gerhold <stephan@gerhold.net>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
Cc: Jonathan Bakker <xc-racer2@live.ca>
Cc: Oskar Andero <oskar.andero@gmail.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Tested-by: default avatarJonathan Bakker <xc-racer2@live.ca>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent a2ff6e03
...@@ -15060,6 +15060,14 @@ W: http://www.ibm.com/developerworks/linux/linux390/ ...@@ -15060,6 +15060,14 @@ W: http://www.ibm.com/developerworks/linux/linux390/
S: Supported S: Supported
F: net/smc/ F: net/smc/
SHARP GP2AP002A00F/GP2AP002S00F SENSOR DRIVER
M: Linus Walleij <linus.walleij@linaro.org>
L: linux-iio@vger.kernel.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git
S: Maintained
F: drivers/iio/light/gp2ap002.c
F: Documentation/devicetree/bindings/iio/light/sharp,gp2ap002.yaml
SHARP RJ54N1CB0C SENSOR DRIVER SHARP RJ54N1CB0C SENSOR DRIVER
M: Jacopo Mondi <jacopo@jmondi.org> M: Jacopo Mondi <jacopo@jmondi.org>
L: linux-media@vger.kernel.org L: linux-media@vger.kernel.org
......
...@@ -159,6 +159,17 @@ config IIO_CROS_EC_LIGHT_PROX ...@@ -159,6 +159,17 @@ config IIO_CROS_EC_LIGHT_PROX
To compile this driver as a module, choose M here: To compile this driver as a module, choose M here:
the module will be called cros_ec_light_prox. the module will be called cros_ec_light_prox.
config GP2AP002
tristate "Sharp GP2AP002 Proximity/ALS sensor"
depends on I2C
select REGMAP
help
Say Y here if you have a Sharp GP2AP002 proximity/ALS combo-chip
hooked to an I2C bus.
To compile this driver as a module, choose M here: the
module will be called gp2ap002.
config GP2AP020A00F config GP2AP020A00F
tristate "Sharp GP2AP020A00F Proximity/ALS sensor" tristate "Sharp GP2AP020A00F Proximity/ALS sensor"
depends on I2C depends on I2C
......
...@@ -18,6 +18,7 @@ obj-$(CONFIG_CM3323) += cm3323.o ...@@ -18,6 +18,7 @@ obj-$(CONFIG_CM3323) += cm3323.o
obj-$(CONFIG_CM3605) += cm3605.o obj-$(CONFIG_CM3605) += cm3605.o
obj-$(CONFIG_CM36651) += cm36651.o obj-$(CONFIG_CM36651) += cm36651.o
obj-$(CONFIG_IIO_CROS_EC_LIGHT_PROX) += cros_ec_light_prox.o obj-$(CONFIG_IIO_CROS_EC_LIGHT_PROX) += cros_ec_light_prox.o
obj-$(CONFIG_GP2AP002) += gp2ap002.o
obj-$(CONFIG_GP2AP020A00F) += gp2ap020a00f.o obj-$(CONFIG_GP2AP020A00F) += gp2ap020a00f.o
obj-$(CONFIG_HID_SENSOR_ALS) += hid-sensor-als.o obj-$(CONFIG_HID_SENSOR_ALS) += hid-sensor-als.o
obj-$(CONFIG_HID_SENSOR_PROX) += hid-sensor-prox.o obj-$(CONFIG_HID_SENSOR_PROX) += hid-sensor-prox.o
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment