Skip to content

Commit 97d642e

Browse files
linuswjic23
authored andcommitted
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 <[email protected]> Cc: Minkyu Kang <[email protected]> Cc: Paweł Chmiel <[email protected]> Cc: Jonathan Bakker <[email protected]> Cc: Oskar Andero <[email protected]> Cc: Dmitry Torokhov <[email protected]> Tested-by: Jonathan Bakker <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent a2ff6e0 commit 97d642e

File tree

4 files changed

+804
-0
lines changed

4 files changed

+804
-0
lines changed

MAINTAINERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15060,6 +15060,14 @@ W: http://www.ibm.com/developerworks/linux/linux390/
1506015060
S: Supported
1506115061
F: net/smc/
1506215062

15063+
SHARP GP2AP002A00F/GP2AP002S00F SENSOR DRIVER
15064+
M: Linus Walleij <[email protected]>
15065+
15066+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git
15067+
S: Maintained
15068+
F: drivers/iio/light/gp2ap002.c
15069+
F: Documentation/devicetree/bindings/iio/light/sharp,gp2ap002.yaml
15070+
1506315071
SHARP RJ54N1CB0C SENSOR DRIVER
1506415072
M: Jacopo Mondi <[email protected]>
1506515073

drivers/iio/light/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,17 @@ config IIO_CROS_EC_LIGHT_PROX
159159
To compile this driver as a module, choose M here:
160160
the module will be called cros_ec_light_prox.
161161

162+
config GP2AP002
163+
tristate "Sharp GP2AP002 Proximity/ALS sensor"
164+
depends on I2C
165+
select REGMAP
166+
help
167+
Say Y here if you have a Sharp GP2AP002 proximity/ALS combo-chip
168+
hooked to an I2C bus.
169+
170+
To compile this driver as a module, choose M here: the
171+
module will be called gp2ap002.
172+
162173
config GP2AP020A00F
163174
tristate "Sharp GP2AP020A00F Proximity/ALS sensor"
164175
depends on I2C

drivers/iio/light/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ obj-$(CONFIG_CM3323) += cm3323.o
1818
obj-$(CONFIG_CM3605) += cm3605.o
1919
obj-$(CONFIG_CM36651) += cm36651.o
2020
obj-$(CONFIG_IIO_CROS_EC_LIGHT_PROX) += cros_ec_light_prox.o
21+
obj-$(CONFIG_GP2AP002) += gp2ap002.o
2122
obj-$(CONFIG_GP2AP020A00F) += gp2ap020a00f.o
2223
obj-$(CONFIG_HID_SENSOR_ALS) += hid-sensor-als.o
2324
obj-$(CONFIG_HID_SENSOR_PROX) += hid-sensor-prox.o

0 commit comments

Comments
 (0)