<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/include/linux/mfd/ti_am335x_tscadc.h, branch linux-5.2.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.2.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-5.2.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2018-12-03T11:33:20Z</updated>
<entry>
<title>iio: adc: ti_am335x_tscadc: Improve accuracy of measurement</title>
<updated>2018-12-03T11:33:20Z</updated>
<author>
<name>Vignesh R</name>
<email>vigneshr@ti.com</email>
</author>
<published>2018-12-03T08:01:18Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4b3ab9372ffa569827c8f7b7ffc7b69ba544a3bd'/>
<id>urn:sha1:4b3ab9372ffa569827c8f7b7ffc7b69ba544a3bd</id>
<content type='text'>
When performing single ended measurements with TSCADC, its recommended
to set negative input (SEL_INM_SWC_3_0) of ADC step to ADC's VREFN in the
corresponding STEP_CONFIGx register.

Also, the positive(SEL_RFP_SWC_2_0) and negative(SEL_RFM_SWC_1_0)
reference voltage for ADC step needs to be set to VREFP and VREFN
respectively in STEP_CONFIGx register.
Without these changes, there may be variation of as much as ~2% in the
ADC's digital output which is bad for precise measurement.

Signed-off-by: Vignesh R &lt;vigneshr@ti.com&gt;
Acked-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>drivers: iio: ti_am335x_adc: add dma support</title>
<updated>2016-11-05T17:32:05Z</updated>
<author>
<name>Mugunthan V N</name>
<email>mugunthanvnm@ti.com</email>
</author>
<published>2016-10-05T09:04:41Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f438b9da75eb80eb6c4095a5b75324cc9a7f0570'/>
<id>urn:sha1:f438b9da75eb80eb6c4095a5b75324cc9a7f0570</id>
<content type='text'>
This patch adds the required pieces to ti_am335x_adc driver for
DMA support

Signed-off-by: Mugunthan V N &lt;mugunthanvnm@ti.com&gt;
Reviewed-by: Peter Ujfalusi &lt;peter.ujfalusi@ti.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
</entry>
<entry>
<title>mfd: ti_am335x_tscadc: store physical address</title>
<updated>2016-11-05T17:30:51Z</updated>
<author>
<name>Mugunthan V N</name>
<email>mugunthanvnm@ti.com</email>
</author>
<published>2016-10-05T09:04:40Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c9329d8638cfa1a86faf4fb8bd4922a3d9c6c437'/>
<id>urn:sha1:c9329d8638cfa1a86faf4fb8bd4922a3d9c6c437</id>
<content type='text'>
store the physical address of the device in its priv to use it
for DMA addressing in the client drivers.

Signed-off-by: Mugunthan V N &lt;mugunthanvnm@ti.com&gt;
Acked-for-MFD-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
</entry>
<entry>
<title>iio: adc: ti_am335x_adc: Increase timeout value waiting for ADC sample</title>
<updated>2016-08-21T18:48:31Z</updated>
<author>
<name>Vignesh R</name>
<email>vigneshr@ti.com</email>
</author>
<published>2016-08-17T12:13:01Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7175cce1c3f1d8c8840d2004f78f96a3904249b5'/>
<id>urn:sha1:7175cce1c3f1d8c8840d2004f78f96a3904249b5</id>
<content type='text'>
Now that open delay and sample delay for each channel is configurable
via DT, the default IDLE_TIMEOUT value is not enough as this is
calculated based on hardcoded macros. This results in driver returning
EBUSY sometimes. Fix this by increasing the timeout
value based on maximum value possible to open delay and sample delays
for each channel.

Fixes: 5dc11e810676e ("iio: adc: ti_am335x_adc: make sample delay, open delay, averaging DT parameters")
Signed-off-by: Vignesh R &lt;vigneshr@ti.com&gt;
Acked-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Cc: &lt;Stable@vger.kernel.org&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
</entry>
<entry>
<title>mfd: ti_am335x_tscadc: Rename regmap_tscadc to regmap</title>
<updated>2016-06-29T09:14:39Z</updated>
<author>
<name>Andrew F. Davis</name>
<email>afd@ti.com</email>
</author>
<published>2016-06-08T15:54:35Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=0d3a7cce3e8bc5c060b1f038984c10cb70289e1d'/>
<id>urn:sha1:0d3a7cce3e8bc5c060b1f038984c10cb70289e1d</id>
<content type='text'>
The regmap structure pointer is named regmap_tscadc, this is not
consistent with other drivers and is redundant, it also contributes
to several checkpatch warnings involving long lines. Rename this.

Signed-off-by: Andrew F. Davis &lt;afd@ti.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>mfd: ti_am335x_tscadc: Remove unwanted reg_se_cache save</title>
<updated>2015-03-03T16:41:15Z</updated>
<author>
<name>Vignesh R</name>
<email>vigneshr@ti.com</email>
</author>
<published>2015-01-07T05:49:36Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=b10848e6f9fa7638fc0713695a12c0735ffb52b7'/>
<id>urn:sha1:b10848e6f9fa7638fc0713695a12c0735ffb52b7</id>
<content type='text'>
In one shot mode, sequencer automatically disables all enabled steps at
the end of each cycle. (both ADC steps and TSC steps) Hence these steps
need not be saved in reg_se_cache for clearing these steps at a later
stage.
Also, when ADC wakes up Sequencer should not be busy executing any of the
config steps except for the charge step. Previously charge step was 1 ADC
clock cycle and hence it was ignored.
TSC steps are always disabled at the end of each conversion cycle, hence
there is no need to explicitly disable TSC steps by writing 0 to REG_SE.

Signed-off-by: Vignesh R &lt;vigneshr@ti.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>Input: ti_am335x_tsc - remove udelay in interrupt handler</title>
<updated>2015-02-03T19:50:38Z</updated>
<author>
<name>Brad Griffis</name>
<email>bgriffis@ti.com</email>
</author>
<published>2015-02-03T19:44:12Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=344d635b9a41b19837ccf8083a99ea688027019c'/>
<id>urn:sha1:344d635b9a41b19837ccf8083a99ea688027019c</id>
<content type='text'>
TSC interrupt handler had udelay to avoid reporting of false pen-up
interrupt to user space. This patch implements workaround suggesting in
Advisory 1.0.31 of silicon errata for am335x, thus eliminating udelay and
touchscreen lag. This also improves performance of touchscreen and
eliminates sudden jump of cursor at touch release.

IDLECONFIG and CHARGECONFIG registers are to be configured with same values
in order to eliminate false pen-up events. This workaround may result in
false pen-down to be detected, hence considerable charge step delay needs
to be added. The charge delay is set to 0xB000 (in terms of ADC clock
cycles) by default.

TSC steps are disabled at the end of every sampling cycle and EOS bit is
set. Once the EOS bit is set, the TSC steps need to be re-enabled to begin
next sampling cycle.

Signed-off-by: Brad Griffis &lt;bgriffis@ti.com&gt;
[vigneshr@ti.com: Ported the patch from v3.12 to v3.19rc1]
Signed-off-by: Vignesh R &lt;vigneshr@ti.com&gt;
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>mfd: ti_am335x_tscadc: Update logic in CTRL register for 5-wire TS</title>
<updated>2014-09-26T07:24:03Z</updated>
<author>
<name>Jeff Lance</name>
<email>j-lance1@ti.com</email>
</author>
<published>2014-09-04T17:01:57Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=f0933a60d1902c918249d11fb6d9a5ffd581ef5b'/>
<id>urn:sha1:f0933a60d1902c918249d11fb6d9a5ffd581ef5b</id>
<content type='text'>
The logic in AFE_Pen_Ctrl bitmask in the CTRL register is different for five
wire versus four or eight wire touschscreens. This patch should fix this for
five-wire touch screens. There should be no change needed here for four and
eight wire tousch screens.

Signed-off-by: Jeff Lance &lt;j-lance1@ti.com&gt;
[bigeasy: keep the change mfd only]
Signed-off-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>mfd: input: iio: ti_amm335x: Rework TSC/ADC synchronization</title>
<updated>2014-01-07T08:45:00Z</updated>
<author>
<name>Sebastian Andrzej Siewior</name>
<email>bigeasy@linutronix.de</email>
</author>
<published>2013-12-19T15:28:31Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7ca6740cd1cd410828a01151a044b51910d06eff'/>
<id>urn:sha1:7ca6740cd1cd410828a01151a044b51910d06eff</id>
<content type='text'>
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 &amp; 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
&amp; 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 &lt;bigeasy@linutronix.de&gt;
Acked-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
<entry>
<title>mfd: ti_am335x_tscadc: Don't read back REG_SE</title>
<updated>2014-01-07T08:41:15Z</updated>
<author>
<name>Sebastian Andrzej Siewior</name>
<email>bigeasy@linutronix.de</email>
</author>
<published>2013-12-19T15:28:29Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7e170c6e4f7501bea900aa66b2b27a6ce5001e25'/>
<id>urn:sha1:7e170c6e4f7501bea900aa66b2b27a6ce5001e25</id>
<content type='text'>
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 &lt;bigeasy@linutronix.de&gt;
Acked-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Acked-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
</content>
</entry>
</feed>
