History log of /openbmc/linux/drivers/iio/adc/ti_am335x_adc.c (Results 101 – 125 of 130)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 36eb8cc2 01-Sep-2014 Paul Gortmaker <paul.gortmaker@windriver.com>

iio: delete non-required instances of include <linux/init.h>

None of these files are actually using any __init type directives
and hence don't need to include <linux/init.h>. Most are j

iio: delete non-required instances of include <linux/init.h>

None of these files are actually using any __init type directives
and hence don't need to include <linux/init.h>. Most are just a
left over from __devinit and __cpuinit removal, or simply due to
code getting copied from one driver to the next.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


Revision tags: v3.17-rc1, v3.16, v3.16-rc7, v3.16-rc6, v3.16-rc5, v3.16-rc4, v3.16-rc3, v3.16-rc2, v3.16-rc1, v3.15, v3.15-rc8, v3.15-rc7, v3.15-rc6, v3.15-rc5, v3.15-rc4, v3.15-rc3, v3.15-rc2, v3.15-rc1, v3.14, v3.14-rc8, v3.14-rc7, v3.14-rc6, v3.14-rc5, v3.14-rc4, v3.14-rc3, v3.14-rc2, v3.14-rc1, v3.13, v3.13-rc8, v3.13-rc7, v3.13-rc6, v3.13-rc5
# 7ca6740c 19-Dec-2013 Sebastian Andrzej Siewior <bigeasy@linutronix.de>

mfd: input: iio: ti_amm335x: Rework TSC/ADC synchronization

The ADC driver always programs all possible ADC values and discards
them except for the value IIO asked for. On the am335x-evm

mfd: input: iio: ti_amm335x: Rework TSC/ADC synchronization

The ADC driver always programs all possible ADC values and discards
them except for the value IIO asked for. On the am335x-evm the driver
programs four values and it takes 500us to gather them. Reducing the number
of conversations down to the (required) one also reduces the busy loop down
to 125us.

This leads to another error, namely the FIFOCOUNT register is sometimes
(like one out of 10 attempts) not updated in time leading to EBUSY.
The next read has the FIFOCOUNT register updated.
Checking for the ADCSTAT register for being idle isn't a good choice either.
The problem is that if TSC is used at the same time, the HW completes the
conversation for ADC *and* before the driver noticed it, the HW begins to
perform a TSC conversation and so the driver never seen the HW idle. The
next time we would have two values in the FIFO but since the driver reads
everything we always see the current one.
So instead of polling for the IDLE bit in ADCStatus register, we should
check the FIFOCOUNT register. It should be one instead of zero because we
request one value.

This change in turn leads to another error. Sometimes if TSC & ADC are
used together the TSC starts generating interrupts even if nobody
actually touched the touchscreen. The interrupts seem valid because TSC's
FIFO is filled with values for each channel of the TSC. This condition stops
after a few ADC reads but will occur again. Not good.

On top of this (even without the changes I just mentioned) there is a ADC
& TSC lockup condition which was reported to me by Jeff Lance including the
following test case:
A busy loop of "cat /sys/bus/iio/devices/iio\:device0/in_voltage4_raw"
and a mug on touch screen. With this setup, the hardware will lockup after
something between 20 minutes and it could take up to a couple of hours.
During that lockup, the ADCSTAT register says 0x30 (or 0x70) which means
STEP_ID = IDLE and FSM_BUSY = yes. That means the hardware says that it is
idle and busy at the same time which is an invalid condition.

For all this reasons I decided to rework this TSC/ADC part and add a
handshake / synchronization here:
First the ADC signals that it needs the HW and writes a 0 mask into the
SE register. The HW (if active) will complete the current conversation
and become idle. The TSC driver will gather the values from the FIFO
(woken up by an interrupt) and won't "enable" another conversation.
Instead it will wake up the ADC driver which is already waiting. The ADC
driver will start "its" conversation and once it is done, it will
enable the TSC steps so the TSC will work again.

After this rework I haven't observed the lockup so far. Plus the busy
loop has been reduced from 500us to 125us.

The continues-read mode remains unchanged.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

show more ...


# 3954b7bf 19-Dec-2013 Sebastian Andrzej Siewior <bigeasy@linutronix.de>

mfd: ti_am335x: Drop am335x_tsc_se_update() from resume path

The update of the SE register in MFD doesn't look right as it has
nothing to do with it. The better place to do it is in TSC

mfd: ti_am335x: Drop am335x_tsc_se_update() from resume path

The update of the SE register in MFD doesn't look right as it has
nothing to do with it. The better place to do it is in TSC driver (which
is already doing it) and in the ADC driver which needs this only in the
continues mode.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

show more ...


# 7e170c6e 19-Dec-2013 Sebastian Andrzej Siewior <bigeasy@linutronix.de>

mfd: ti_am335x_tscadc: Don't read back REG_SE

The purpose of reg_se_cache has been defeated. It should avoid the
read-back of the register to avoid the latency and the fact that the

mfd: ti_am335x_tscadc: Don't read back REG_SE

The purpose of reg_se_cache has been defeated. It should avoid the
read-back of the register to avoid the latency and the fact that the
bits are reset to 0 after the individual conversation took place.

The reason why this is required like this to work, is that read-back of
the register removes the bits of the ADC so they do not start another
conversation after the register is re-written from the TSC side for the
update.
To avoid the not required read-back I introduce a "set once" variant which
does not update the cache mask. After the conversation completes, the
bit is removed from the SE register anyway and we don't plan a new
conversation "any time soon". The current set function is renamed to
set_cache to distinguish the two operations.
This is a small preparation for a larger sync-rework.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

show more ...


# fb7f8ce3 19-Dec-2013 Sebastian Andrzej Siewior <bigeasy@linutronix.de>

iio: ti_am335x_adc: Adjust the closing bracket in tiadc_read_raw()

It somehow looks like the ending bracket belongs to the if statement but
it does belong to the while loop. This patch m

iio: ti_am335x_adc: Adjust the closing bracket in tiadc_read_raw()

It somehow looks like the ending bracket belongs to the if statement but
it does belong to the while loop. This patch moves the bracket where it
belongs.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

show more ...


Revision tags: v3.13-rc4, v3.13-rc3, v3.13-rc2, v3.13-rc1, v3.12, v3.12-rc7
# fe26980e 24-Oct-2013 Lars-Peter Clausen <lars@metafoo.de>

iio: adc: ti_am335x_adc: avoid double free of buffer.

The driver is missing the iio_buffer_attach() call. As such it will attempt
to free the buffer twice on removal.

Introduced

iio: adc: ti_am335x_adc: avoid double free of buffer.

The driver is missing the iio_buffer_attach() call. As such it will attempt
to free the buffer twice on removal.

Introduced in commit 9e69c9 ("iio: Add reference counting for buffers").

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


# de06b344 21-Oct-2013 Sachin Kamat <sachin.kamat@linaro.org>

iio: adc: ti_am335x_adc: Remove redundant of_match_ptr

ti_adc_dt_ids is always compiled in. Hence of_match_ptr is not
needed.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.or

iio: adc: ti_am335x_adc: Remove redundant of_match_ptr

ti_adc_dt_ids is always compiled in. Hence of_match_ptr is not
needed.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


Revision tags: v3.12-rc6
# 24adaf79 14-Oct-2013 Lars-Peter Clausen <lars@metafoo.de>

iio:ti_am335x: Remove redundant call to iio_sw_buffer_preenable()

The equivalent of iio_sw_buffer_preenable() is now done in the IIO buffer
core, so there is no need to do this from the

iio:ti_am335x: Remove redundant call to iio_sw_buffer_preenable()

The equivalent of iio_sw_buffer_preenable() is now done in the IIO buffer
core, so there is no need to do this from the driver anymore.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Zubair Lutfullah <zubair.lutfullah@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


Revision tags: v3.12-rc5, v3.12-rc4, v3.12-rc3, v3.12-rc2
# 074b6a8d 22-Sep-2013 Zubair Lutfullah <zubair.lutfullah@gmail.com>

iio: ti_am335x_adc: cleanup error case

Driver is functional without this error case. Cleaned up.

Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com>
Signed-off-by: Jona

iio: ti_am335x_adc: cleanup error case

Driver is functional without this error case. Cleaned up.

Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


# a77d0209 22-Sep-2013 Zubair Lutfullah <zubair.lutfullah@gmail.com>

iio: ti_am335x_adc: cleanup trigger related code

Trigger related headers and variables are not needed
as driver is now based on INDIO_BUFFER_HARDWARE mode

Signed-off-by: Zubair

iio: ti_am335x_adc: cleanup trigger related code

Trigger related headers and variables are not needed
as driver is now based on INDIO_BUFFER_HARDWARE mode

Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


# 98c08cf4 22-Sep-2013 Zubair Lutfullah <zubair.lutfullah@gmail.com>

iio: ti_am335x_adc: fix static in function header

Static is missing in function header. Corrected.

Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com>
Reported-by: kbui

iio: ti_am335x_adc: fix static in function header

Static is missing in function header. Corrected.

Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


# ca9a5638 19-Sep-2013 Zubair Lutfullah <zubair.lutfullah@gmail.com>

iio: ti_am335x_adc: Add continuous sampling support

Previously the driver had only one-shot reading functionality.
This patch adds continuous sampling support to the driver.

Con

iio: ti_am335x_adc: Add continuous sampling support

Previously the driver had only one-shot reading functionality.
This patch adds continuous sampling support to the driver.

Continuous sampling starts when buffer is enabled.
HW IRQ wakes worker thread that pushes samples to userspace.
Sampling stops when buffer is disabled by userspace.

Patil Rachna (TI) laid the ground work for ADC HW register access.
Russ Dill (TI) fixed bugs in the driver relevant to FIFOs and IRQs.

I fixed channel scanning so multiple ADC channels can be read
simultaneously and pushed to userspace.
Restructured the driver to fit IIO ABI.
And added INDIO_BUFFER_HARDWARE mode.

Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


# 0f6fc7d5 19-Sep-2013 Zubair Lutfullah <zubair.lutfullah@gmail.com>

iio: ti_am335x_adc: optimize memory usage

12 bit ADC data is stored in 32 bits of storage.
Change from u32 to u16 to reduce wasted memory.

Signed-off-by: Zubair Lutfullah <zubai

iio: ti_am335x_adc: optimize memory usage

12 bit ADC data is stored in 32 bits of storage.
Change from u32 to u16 to reduce wasted memory.

Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


# fbf8d710 12-Aug-2013 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Merge 3.11-rc5 into staging-next

We want the staging fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


Revision tags: v3.12-rc1, v3.11, v3.11-rc7, v3.11-rc6, v3.11-rc5, v3.11-rc4, v3.11-rc3
# a0648130 23-Jul-2013 Sachin Kamat <sachin.kamat@linaro.org>

iio: adc: ti_am335x_adc: Use devm_iio_device_alloc

Using devm_iio_device_alloc makes code simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Rachna Patil <rachna

iio: adc: ti_am335x_adc: Use devm_iio_device_alloc

Using devm_iio_device_alloc makes code simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Rachna Patil <rachna@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


Revision tags: v3.11-rc2
# b1451e54 20-Jul-2013 Patil, Rachna <rachna@ti.com>

iio: ti_am335x_adc: Fix wrong samples received on 1st read

Previously we tried to read data form ADC even before ADC sequencer
finished sampling. This led to wrong samples.
We now wa

iio: ti_am335x_adc: Fix wrong samples received on 1st read

Previously we tried to read data form ADC even before ADC sequencer
finished sampling. This led to wrong samples.
We now wait on ADC status register idle bit to be set.

Signed-off-by: Patil, Rachna <rachna@ti.com>
Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


# 78077256 17-Jul-2013 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Merge tag 'iio-fixes-for-3.11a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus

Jonathan writes:

The first round of IIO fixes for the 3.11 cycle.

Merge tag 'iio-fixes-for-3.11a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus

Jonathan writes:

The first round of IIO fixes for the 3.11 cycle.

This set is larger than I would like, partly due to my lack of review
time in the weeks before the merge window and partly because a
couple of large drivers and the subsystem as a whole seem to be
getting a lot more exposure and testing recently.

1) A long term bug in trigger handling gave a double free of the device.

2) Wrong return value handling means offsets are ignored in
iio_convert_raw_to_processed_unlocked.

3) The iio_channel_has_info utility function was incorrectly updated
during the recent info_mask split, this is now fixed.

4) mxs-lradc has a couple of little fixes.

5) A couple of missing .driver_module entries meant that drivers
could be removed from underneath their users.

6) Error path fixes for ad7303 and lis3l02dq.

7) The scale value for presure in the lps331ap driver was out by
a factor of 100.

show more ...


Revision tags: v3.11-rc1
# bc93aa76 05-Jul-2013 Wei Yongjun <yongjun_wei@trendmicro.com.cn>

iio: ti_am335x_adc: add missing .driver_module to struct iio_info

Add missing .driver_module of struct iio_info. This prevents the
module from being removed from underneath its users.

iio: ti_am335x_adc: add missing .driver_module to struct iio_info

Add missing .driver_module of struct iio_info. This prevents the
module from being removed from underneath its users.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

show more ...


Revision tags: v3.10, v3.10-rc7, v3.10-rc6, v3.10-rc5, v3.10-rc4
# 1460c152 29-May-2013 Sebastian Andrzej Siewior <bigeasy@linutronix.de>

iio: ti_am335x_adc: check if we found the value

Usually we get all the values we wanted but it is possible, that te ADC
unit is busy performing the conversation for the HW events. In tha

iio: ti_am335x_adc: check if we found the value

Usually we get all the values we wanted but it is possible, that te ADC
unit is busy performing the conversation for the HW events. In that case
-EBUSY is returned and the user may re-call the function.

Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

show more ...


# 18926ede 29-May-2013 Sebastian Andrzej Siewior <bigeasy@linutronix.de>

iio: ti_am335x_adc: Allow to specify input line

The TSC part allows to specify the input lines. The IIO part assumes
that it usues always the last few, that means if IIO has adc-channels

iio: ti_am335x_adc: Allow to specify input line

The TSC part allows to specify the input lines. The IIO part assumes
that it usues always the last few, that means if IIO has adc-channels
set to 2 it will use channel 6 and 7. However it might make sense to use
only 6.
This patch changes the device property (which was introduced recently
and was never in an official release) in a way that the user can specify
which of the AIN lines should be used. In Addition to this, the name is
now AINx where x is the channel number i.e. for AIN6 we would have 6.
Prior this, it always started counting at 0 which is confusing. In
addition to this, it also checks for correct step number during reading
and does not rely on proper FIFO depth.

Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

show more ...


# 8c896308 29-May-2013 Sebastian Andrzej Siewior <bigeasy@linutronix.de>

input: ti_am335x_adc: use only FIFO0 and clean up a little

The driver programs a threshold of "coordinate_readouts" say 5. The
REG_FIFO0THR registers says it should it be programmed to "

input: ti_am335x_adc: use only FIFO0 and clean up a little

The driver programs a threshold of "coordinate_readouts" say 5. The
REG_FIFO0THR registers says it should it be programmed to "threshold
minus one". The driver does not expect just 5 coordinates but 5 * 2 + 2.
Multiplied by two because 5 for X and 5 for Y and plus 2 because we have
two Z.
The whole thing kind of works because It reads the 5 coordinates for X
and Y from FIFO0 and FIFO1 and the last element in each FIFO is ignored
within the loop and read later.
Nothing guaranties that FIFO1 is ready by the time it is read. In fact I
could see that that FIFO1 reaturns for Y channels 8,9, 10, 12, 6 and for
Y channel 7 for Z. The problem is that channel 7 and channel 12 got
somehow mixed up.
The other Problem is that FIFO1 is also used by the IIO part leading to
wrong results if both (tsc & adc) are used.

The patch tries to clean up the whole thing a little:
- Remove the +1 and -1 in REG_STEPCONFIG, REG_STEPDELAY and its counter
part in the for loop. This is just confusing.

- Use only FIFO0 in TSC. The fifo has space for 64 entries so should be
fine.

- Read the whole FIFO in one function and check the channel.

- in case we dawdle around, make sure we only read a multiple of our
coordinate set. On the second interrupt we will cleanup the remaining
enties.

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

show more ...


# 9f99928f 27-May-2013 Sebastian Andrzej Siewior <bigeasy@linutronix.de>

mfd: iio: ti_am335x_adc: rename device from tiadc to TI-am335x-adc

TI-adc reads a little better compared to tiadc. And if we add am335x to
it then we have the same naming scheme as the t

mfd: iio: ti_am335x_adc: rename device from tiadc to TI-am335x-adc

TI-adc reads a little better compared to tiadc. And if we add am335x to
it then we have the same naming scheme as the tsc side.

Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

show more ...


Revision tags: v3.10-rc3, v3.10-rc2, v3.10-rc1, v3.9, v3.9-rc8, v3.9-rc7, v3.9-rc6, v3.9-rc5, v3.9-rc4, v3.9-rc3, v3.9-rc2, v3.9-rc1, v3.8, v3.8-rc7, v3.8-rc6, v3.8-rc5, v3.8-rc4, v3.8-rc3, v3.8-rc2, v3.8-rc1, v3.7, v3.7-rc8, v3.7-rc7, v3.7-rc6, v3.7-rc5, v3.7-rc4, v3.7-rc3, v3.7-rc2, v3.7-rc1
# c80df483 13-Oct-2012 Pantelis Antoniou <panto@antoniou-consulting.com>

iio: ti_tscadc: provide datasheet_name and scan_type

This patch provides the members "datasheet_name" and scan_type. This is
the remaining part of the earlier patch where I (bigeasy) rem

iio: ti_tscadc: provide datasheet_name and scan_type

This patch provides the members "datasheet_name" and scan_type. This is
the remaining part of the earlier patch where I (bigeasy) removed iio_map
because it is now supplied by the device tree. It also static names as
suggested by Jonathan.

Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

show more ...


# 0ead4fb2 21-May-2013 Sebastian Andrzej Siewior <bigeasy@linutronix.de>

iio: ti_am335x_adc: remove platform_data support

This patch removes access to platform data mfd_tscadc_board because the
platform is DT only.

Acked-by: Jonathan Cameron <jic23@k

iio: ti_am335x_adc: remove platform_data support

This patch removes access to platform data mfd_tscadc_board because the
platform is DT only.

Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

show more ...


# 6f39ac4e 23-Jan-2013 Patil, Rachna <rachna@ti.com>

iio: ti_am335x_adc: Add DT support

Add DT support for client ADC driver.

Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Patil, Rachna <rachna@ti.com>
Signed-of

iio: ti_am335x_adc: Add DT support

Add DT support for client ADC driver.

Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Patil, Rachna <rachna@ti.com>
Signed-off-by: Pantelis Antoniou <panto@antoniou-consulting.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

show more ...


123456