linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] add support for Allwinner SoCs ADC
@ 2016-06-28  8:45 Quentin Schulz
  2016-06-28  8:18 ` [PATCH 1/3] mfd: " Quentin Schulz
                   ` (3 more replies)
  0 siblings, 4 replies; 24+ messages in thread
From: Quentin Schulz @ 2016-06-28  8:45 UTC (permalink / raw)
  To: jdelvare, linux, jic23, knaack.h, lars, pmeerw, maxime.ripard,
	wens, lee.jones
  Cc: Quentin Schulz, linux-kernel, linux-hwmon, linux-iio,
	linux-arm-kernel, thomas.petazzoni, antoine.tenart

The Allwinner SoCs all have an ADC that can also act as a touchscreen controller
and a thermal sensor. The first four channels can be used either for the ADC or
the touchscreen and the fifth channel is used for the thermal sensor. We
currently have a driver for the two latter functions in
drivers/input/touchscreen/sun4i-ts.c but we don't have access to the ADC feature
at all.

This adds initial support for Allwinner SoCs ADC with all features. Yet, the
touchscreen is not implemented but will be added later. To switch between
touchscreen and ADC modes, you need to poke few bits in registers and
(de)activate an interrupt (pen-up).
A MFD is provided to let the input driver activate the pen-up interrupt through
virtual interrupt, poke few bits via regmap and read data from the ADC driver
while both (and iio_hwmon) are probed by the MFD.

There exists slight modifications between the different SoCs ADC like the
address of some registers and the scale and offset to apply to thermal sensor
raw values. These modifications are done by drivers on different
platform_device_id passed by the MFD when probing subdrivers.

This also modifies iio-hwmon to allow probe deferring when no iio channel is
found. Currently when no iio channel is found, the probing of iio-hwmon fails.
This is problematic when iio-hwmon probes before the iio driver could register
iio channels to share.

Quentin Schulz (3):
  mfd: add support for Allwinner SoCs ADC
  iio: adc: add support for Allwinner SoCs ADC
  hwmon: iio_hwmon: defer probe when no channel is found

 drivers/hwmon/iio_hwmon.c           |   5 +-
 drivers/iio/adc/Kconfig             |  12 ++
 drivers/iio/adc/Makefile            |   1 +
 drivers/iio/adc/sunxi-gpadc-iio.c   | 371 ++++++++++++++++++++++++++++++++++++
 drivers/mfd/Kconfig                 |  14 ++
 drivers/mfd/Makefile                |   2 +
 drivers/mfd/sunxi-gpadc-mfd.c       | 188 ++++++++++++++++++
 include/linux/mfd/sunxi-gpadc-mfd.h |  14 ++
 8 files changed, 606 insertions(+), 1 deletion(-)
 create mode 100644 drivers/iio/adc/sunxi-gpadc-iio.c
 create mode 100644 drivers/mfd/sunxi-gpadc-mfd.c
 create mode 100644 include/linux/mfd/sunxi-gpadc-mfd.h

-- 
2.5.0

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2016-07-05  7:40 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-28  8:45 [PATCH 0/3] add support for Allwinner SoCs ADC Quentin Schulz
2016-06-28  8:18 ` [PATCH 1/3] mfd: " Quentin Schulz
2016-06-28  8:30   ` Antoine Tenart
2016-06-28  8:51   ` Antoine Tenart
2016-07-03 11:17   ` Jonathan Cameron
2016-07-03 16:49     ` Lars-Peter Clausen
2016-07-03 17:38       ` Guenter Roeck
2016-06-28  8:18 ` [PATCH 2/3] iio: adc: " Quentin Schulz
2016-06-28  8:32   ` Antoine Tenart
2016-07-03 11:54   ` Jonathan Cameron
2016-07-03 12:48     ` Jonathan Cameron
2016-07-03 15:43     ` Guenter Roeck
2016-07-04  7:26       ` Quentin Schulz
2016-07-04 16:29         ` Guenter Roeck
2016-07-05  7:40           ` Quentin Schulz
2016-06-28  8:18 ` [PATCH 3/3] hwmon: iio_hwmon: defer probe when no channel is found Quentin Schulz
2016-06-30  3:47   ` [3/3] " Guenter Roeck
2016-06-30 13:59     ` Jonathan Cameron
2016-06-30 14:49       ` Lars-Peter Clausen
2016-06-30 14:51       ` Guenter Roeck
2016-07-03 10:47         ` Jonathan Cameron
2016-07-03 15:48           ` Guenter Roeck
2016-06-29  3:28 ` [PATCH 0/3] add support for Allwinner SoCs ADC Chen-Yu Tsai
2016-07-01  9:45   ` Quentin Schulz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).