[PATCH 3/4] iio: mxs-lradc: make ADC reads not unschedule touchscreen conversions

Marek Vasut marex at denx.de
Sun Jan 18 00:22:09 UTC 2015


On Saturday, January 17, 2015 at 01:22:10 AM, Kristina Martšenko wrote:
> Reading a channel through sysfs, or starting a buffered capture, can
> occasionally turn off the touchscreen.
> 
> This is because the read_raw() and buffer preenable()/postdisable()
> callbacks unschedule current conversions on all channels. If a delay
> channel happens to schedule a touchscreen conversion at the same time,
> the conversion gets cancelled and the touchscreen sequence stops.
> 
> This is probably related to this note from the reference manual:
> 
> 	"If a delay group schedules channels to be sampled and a manual
> 	write to the schedule field in CTRL0 occurs while the block is
> 	discarding samples, the LRADC will switch to the new schedule
> 	and will not sample the channels that were previously scheduled.
> 	The time window for this to happen is very small and lasts only
> 	while the LRADC is discarding samples."
> 
> So make the callbacks only unschedule conversions for the channels they
> use. This means channel 0 for read_raw() and channels 0-5 for the buffer
> (if the touchscreen is enabled). Since the touchscreen uses different
> channels (6 and 7), it no longer gets turned off.
> 
> This is tested and fixes the issue on i.MX28, but hasn't been tested on
> i.MX23.
> 
> Signed-off-by: Kristina Martšenko <kristina.martsenko at gmail.com>

Reviewed-by: Marek Vasut <marex at denx.de>

Best regards,
Marek Vasut


More information about the devel mailing list