On 29/03/17 22:26, Rob Herring wrote: > On Thu, Mar 23, 2017 at 08:38:42PM -0700, Tony Lindgren wrote: >> On Motorola phones like droid 4 there is a custom CPCAP PMIC. This PMIC >> has ADCs that are used for battery charging and USB PHY VBUS and ID pin >> detection. >> >> Unfortunately the only documentation for this ADC seems to be the >> Motorola mapphone Linux kernel tree. I have tested that reading raw and >> scaled values works, but I have not used the timed sampling that the ADC >> seems to support. >> >> Let's add a minimal support for it so we can eventually provide IIO >> channels for the related battery charging and USB PHY drivers. >> >> Cc: devicetree@xxxxxxxxxxxxxxx >> Cc: Marcel Partap <mpartap@xxxxxxx> >> Cc: Michael Scott <michael.scott@xxxxxxxxxx> >> Cc: Sebastian Reichel <sre@xxxxxxxxxx> >> Signed-off-by: Tony Lindgren <tony@xxxxxxxxxxx> >> --- >> >> Changes since v2: >> >> - Simplify things further by using channel based indexing and >> remove more drivers specific enumerations >> >> Changes since v1: >> >> - Fix numerous issues pointed out by Peter Meerwald-Stadler >> <pmeerw@xxxxxxxxxx> and Jonathan Cameron <jic23@xxxxxxxxxx> >> >> - Simplify things further by limiting read functions to a >> single channel instead of a bank and got rid of the driver >> specific cpcap_adc_conv_type in favor of IIO generic types >> >> --- >> .../devicetree/bindings/iio/adc/cpcap-adc.txt | 18 + > > Acked-by: Rob Herring <robh@xxxxxxxxxx> Been long enough now that I'm happy to take this. Thanks for looking at the bindings Rob! Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Jonathan > >> drivers/iio/adc/Kconfig | 11 + >> drivers/iio/adc/Makefile | 1 + >> drivers/iio/adc/cpcap-adc.c | 1007 ++++++++++++++++++++ >> 4 files changed, 1037 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/iio/adc/cpcap-adc.txt >> create mode 100644 drivers/iio/adc/cpcap-adc.c > -- > To unsubscribe from this list: send the line "unsubscribe linux-iio" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html