devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleksandr Kozaruk <oleksandr.kozaruk@ti.com>
To: tony@atomide.com, benoit.cousson@linaro.org, rnayak@ti.com,
	peter.ujfalusi@ti.com, kishon@ti.com, jic23@cam.ac.uk,
	grant.likely@linaro.org, rob.herring@calxeda.com,
	lars@metafoo.de, sameo@linux.intel.com, ch.naveen@samsung.com,
	poeschel@lemonage.de, milo.kim@ti.com, balajitk@ti.com,
	gg@slimlogic.co.uk
Cc: linux-iio@vger.kernel.org, devicetree-discuss@lists.ozlabs.org,
	linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 0/2] TWL6030, TWL6032 GPADC driver
Date: Tue, 16 Jul 2013 14:47:32 +0300	[thread overview]
Message-ID: <1373975254-23764-1-git-send-email-oleksandr.kozaruk@ti.com> (raw)

Hello,

v4 - addressed comments: fixed style violation, bug in freeing memory,
     added comments explaining calibration method, removed test network
     channels from exposing to userspace, error handling for 
     wait_for_complition
v3 - fixed compiler warning
v2 - the driver put in drivers/iio, and
converted using iio facilities as suggested by Graeme.

TWL603[02] GPADC is used to measure battery voltage,
battery temperature, battery presence ID, and could
be used to measure twl603[02] die temperature.
This is used on TI blaze, blaze tablet platforms.

The TWL6030/TWL6032 is a PMIC that has a GPADC with 17/19
channels respectively. Some channels have current
source and are used for measuring voltage drop
on resistive load for detecting battery ID resistance,
or measuring voltage drop on NTC resistors for external
temperature measurements, other channels measure voltage,
(i.e. battery voltage), and have inbuilt voltage dividers,
thus, capable to scale voltage. Some channels are dedicated
for measuring die temperature.

Some channels could be calibrated in 2 points, having
offsets from ideal values in trim registers.

The difference between GPADC in TWL6030 and TWL6032:
- 10 bit vs 12 bit ADC;
- 17 vs 19 channels;
- channels have different purpose(i. e. battery voltage
  channel 8 vs channel 18);
- trim values are interpreted differently.

The driver is derived from git://git.omapzoom.org/kernel/omap.git
The original driver's authors and contributors are Balaji T K,
Graeme Gregory, Ambresh K, Girish S Ghongdemath.

The changes to the original driver:
- device tree adaptation;
- drop ioctl support - never been used;
- unified measurement method for both devices;
- get rid of "if (device == X)" code style to data driven;
- drop polling end of conversion and use interrupt instead;
- iio framework is used

Tested with on blaze tablet 2 with OMAP4430(twl6030), and
OMAP4470(twl6032) SOMs.

The patches were tested against 3.10-rc7

Oleksandr Kozaruk (2):
  ARM: dts: twl: Add GPADC data to device tree
  iio: twl6030-gpadc: TWL6030, TWL6032 GPADC driver

 arch/arm/boot/dts/twl6030.dtsi  |    6 +
 drivers/iio/adc/Kconfig         |   14 +
 drivers/iio/adc/Makefile        |    1 +
 drivers/iio/adc/twl6030-gpadc.c | 1008 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 1029 insertions(+)
 create mode 100644 drivers/iio/adc/twl6030-gpadc.c

-- 
1.8.1.2

             reply	other threads:[~2013-07-16 11:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-16 11:47 Oleksandr Kozaruk [this message]
2013-07-16 11:47 ` [PATCH v4 1/2] ARM: dts: twl: Add GPADC data to device tree Oleksandr Kozaruk
2013-07-16 11:47 ` [PATCH v4 2/2] iio: twl6030-gpadc: TWL6030, TWL6032 GPADC driver Oleksandr Kozaruk
  -- strict thread matches above, loose matches on Subject: below --
2013-07-16 11:27 [PATCH v4 0/2] " Oleksandr Kozaruk

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=1373975254-23764-1-git-send-email-oleksandr.kozaruk@ti.com \
    --to=oleksandr.kozaruk@ti.com \
    --cc=balajitk@ti.com \
    --cc=benoit.cousson@linaro.org \
    --cc=ch.naveen@samsung.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=gg@slimlogic.co.uk \
    --cc=grant.likely@linaro.org \
    --cc=jic23@cam.ac.uk \
    --cc=kishon@ti.com \
    --cc=lars@metafoo.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=milo.kim@ti.com \
    --cc=peter.ujfalusi@ti.com \
    --cc=poeschel@lemonage.de \
    --cc=rnayak@ti.com \
    --cc=rob.herring@calxeda.com \
    --cc=sameo@linux.intel.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).