All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Syne <john3909@gmail.com>
To: Lee Jones <lee.jones@linaro.org>
Cc: Mugunthan V N <mugunthanvnm@ti.com>,
	linux-iio@vger.kernel.org, Tony Lindgren <tony@atomide.com>,
	Jonathan Cameron <jic23@kernel.org>, Vignesh R <vigneshr@ti.com>,
	linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Sekhar Nori <nsekhar@ti.com>,
	Peter Ujfalusi <peter.ujfalusi@ti.com>
Subject: Re: [PATCH] drivers: mfd: ti_am335x_tscadc: increase ADC ref clock to 24MHz
Date: Wed, 26 Oct 2016 12:33:18 -0700	[thread overview]
Message-ID: <5F10EC3A-7164-4798-91ED-D2CFEE9A9AAD@gmail.com> (raw)
In-Reply-To: <20161026084811.GI8574@dell>

[-- Attachment #1: Type: text/plain, Size: 4674 bytes --]


> On Oct 26, 2016, at 1:48 AM, Lee Jones <lee.jones@linaro.org> wrote:
> 
> On Tue, 25 Oct 2016, John Syne wrote:
>>> On Oct 24, 2016, at 11:38 PM, Lee Jones <lee.jones@linaro.org> wrote:
>>> On Mon, 24 Oct 2016, John Syne wrote:
>>>>> On Oct 24, 2016, at 11:01 PM, John Syne <john3909@gmail.com> wrote:
>>>>>> On Oct 24, 2016, at 10:52 PM, Mugunthan V N <mugunthanvnm@ti.com> wrote:
>>>>>> 
>>>>>> On Tuesday 25 October 2016 02:28 AM, John Syne wrote:
>>>>>>>>> On Oct 23, 2016, at 11:02 PM, Mugunthan V N <mugunthanvnm@ti.com> wrote:
>>>>>>>>> 
>>>>>>>>> Increase ADC reference clock from 3MHz to 24MHz so that the
>>>>>>>>> sampling rates goes up from 100K samples per second to 800K
>>>>>>>>> samples per second on AM335x and AM437x SoC.
>>>>>>>>> 
>>>>>>>>> Also increase opendelay for touchscreen configuration to
>>>>>>>>> equalize the increase in ADC reference clock frequency,
>>>>>>>>> which results in the same amount touch events reported via
>>>>>>>>> evtest on AM335x GP EVM.
>>>>>>>>> 
>>>>>>>>> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
>>>>>>>>> ---
>>>>>>>>> 
>>>>>>>>> This patch depends on ADC DMA patch series [1]
>>>>>>>>> 
>>>>>>>>> Without DMA support, when ADC ref clock is set at 24MHz, I am
>>>>>>>>> seeing fifo overflow as CPU is not able to pull the ADC samples.
>>>>>>>>> This answers that DMA support is must for ADC to consume the
>>>>>>>>> samples generated at 24MHz with no open, step delay or
>>>>>>>>> averaging with patch [2].
>>>>>>>>> 
>>>>>>>>> Measured the performance with the iio_generic_buffer with the
>>>>>>>>> patch [3] applied
>>>>>>>>> 
>>>>>>>>> [1] - http://www.spinics.net/lists/devicetree/msg145045.html
>>>>>>>>> [2] - http://pastebin.ubuntu.com/23357935/
>>>>>>>>> [3] - http://pastebin.ubuntu.com/23357939/
>>>>>>>>> 
>>>>>>>>> ---
>>>>>>>>> include/linux/mfd/ti_am335x_tscadc.h | 4 ++--
>>>>>>>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>>>>>>>> 
>>>>>>>>> diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h
>>>>>>>>> index b9a53e0..96c4207 100644
>>>>>>>>> --- a/include/linux/mfd/ti_am335x_tscadc.h
>>>>>>>>> +++ b/include/linux/mfd/ti_am335x_tscadc.h
>>>>>>>>> @@ -90,7 +90,7 @@
>>>>>>>>> /* Delay register */
>>>>>>>>> #define STEPDELAY_OPEN_MASK	(0x3FFFF << 0)
>>>>>>>>> #define STEPDELAY_OPEN(val)	((val) << 0)
>>>>>>>>> -#define STEPCONFIG_OPENDLY	STEPDELAY_OPEN(0x098)
>>>>>>> Wouldn’t this be better to add this to the devicetree?
>>>>>>> 
>>>>>>> 	ti,chan-step-avg = <0x16 0x16 0x16 0x16 0x16 0x16 0x16>;
>>>>>>> 	ti,chan-step-opendelay = <0x500 0x500 0x500 0x500 0x500 0x500 0x500>;
>>>>>>> 	ti,chan-step-sampledelay = <0x0 0x0 0x0 0x0 0x0 0x0 0x0>;
>>>>>> 
>>>>>> For a touch screen, there is not need to change in these parameter
>>>>>> settings, so my opinion is to keep it as is. Or am I missing something?
>>>>> I was thinking that if you are using this driver as an ADC, you may want the flexibility to make these changes in the DT. I’m doing this by connecting sensors to the ADC inputs. I’m not using this driver for a touchscreen. 
>>>> 
>>>> Here is a DT overlay were this gets using on the BeagleBoneBlack.  
>>>> 
>>>> https://github.com/RobertCNelson/bb.org-overlays/blob/master/src/arm/BB-ADC-00A0.dts
>>>> 
>>>> Besides, these DT features are already implemented in the driver so it is just a matter of adding these entries to the am33xx.dtsi & am4372.dtsi, which you modified in this patch series.
>>> 
>>> This looks like configuration, no?
>>> 
>>> DT should be used to describe the hardware.
>> You may be right, but how is this different to setting the baud rate on a serial channel or sampling rate on a audio channel? Looking through the DT, there are many configuration settings, so I’m not sure what is the correct way to handle this. Surely it is better to handle this in DT vs hard coding these settings?
> 
> I think setting the UART baud rate is also an invalid DT entry.
> 
> It's okay to list all of the options in DT, but to actually select
> one, that should be done either in userspace or as a kernel option.
> Perhaps as a Kconfig selection.
Yeah, this has been inconsistent for a long time. My only point was that these DT parameters had already been implemented in the ti_am335x_adc KM and I thought that this was better than hard coding these settings. I defer to the domain experts to decide the best way forward. 

Regards,
John
> 
> -- 
> Lee Jones
> Linaro STMicroelectronics Landing Team Lead
> Linaro.org <http://linaro.org/> │ Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog


[-- Attachment #2: Type: text/html, Size: 14941 bytes --]

  reply	other threads:[~2016-10-26 19:33 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-24  6:02 [PATCH] drivers: mfd: ti_am335x_tscadc: increase ADC ref clock to 24MHz Mugunthan V N
2016-10-24  6:02 ` Mugunthan V N
2016-10-24  6:02 ` Mugunthan V N
2016-10-24 20:58 ` John Syne
2016-10-24 20:58   ` John Syne
2016-10-24 20:58   ` John Syne
2016-10-25  5:52   ` Mugunthan V N
2016-10-25  5:52     ` Mugunthan V N
2016-10-25  5:52     ` Mugunthan V N
2016-10-25  6:01     ` John Syne
2016-10-25  6:01       ` John Syne
2016-10-25  6:01       ` John Syne
2016-10-25  6:16       ` John Syne
2016-10-25  6:16         ` John Syne
2016-10-25  6:16         ` John Syne
2016-10-25  6:37         ` Vignesh R
2016-10-25  6:37           ` Vignesh R
2016-10-25  6:37           ` Vignesh R
2016-10-25 15:39           ` John Syne
2016-10-25 15:39             ` John Syne
2016-10-25 15:39             ` John Syne
2016-10-25 15:39             ` John Syne
2016-10-25  6:38         ` Lee Jones
2016-10-25  6:38           ` Lee Jones
2016-10-25  6:38           ` Lee Jones
2016-10-25 15:47           ` John Syne
2016-10-25 15:47             ` John Syne
2016-10-25 15:47             ` John Syne
2016-10-25 15:47             ` John Syne
2016-10-26  8:48             ` Lee Jones
2016-10-26  8:48               ` Lee Jones
2016-10-26 19:33               ` John Syne [this message]
2016-10-27 21:14               ` John Syne
2016-10-27 21:17               ` John Syne
2016-10-27 21:17                 ` John Syne
2016-10-27 21:17                 ` John Syne
2016-10-31 11:39                 ` Vignesh R
2016-10-31 11:39                   ` Vignesh R
2016-10-31 11:39                   ` Vignesh R
2016-11-09 23:53                   ` John Syne
2016-11-09 23:53                     ` John Syne
2016-11-09 23:53                     ` John Syne
2016-11-10  5:07                     ` Vignesh R
2016-11-10  5:07                       ` Vignesh R
2016-11-10  5:07                       ` Vignesh R
2016-11-10  5:07                       ` Vignesh R
2016-11-11  3:30                       ` John Syne
2016-11-11  3:30                         ` John Syne
2016-11-11  3:30                         ` John Syne
2016-11-11  3:30                         ` John Syne
2016-11-11  6:17                         ` Vignesh R
2016-11-11  6:17                           ` Vignesh R
2016-11-11  6:17                           ` Vignesh R
2016-11-11  6:17                           ` Vignesh R
2016-10-27 11:20 ` Mugunthan V N
2016-10-27 11:20   ` Mugunthan V N
2016-10-27 11:20   ` Mugunthan V N

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=5F10EC3A-7164-4798-91ED-D2CFEE9A9AAD@gmail.com \
    --to=john3909@gmail.com \
    --cc=jic23@kernel.org \
    --cc=lee.jones@linaro.org \
    --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=mugunthanvnm@ti.com \
    --cc=nsekhar@ti.com \
    --cc=peter.ujfalusi@ti.com \
    --cc=tony@atomide.com \
    --cc=vigneshr@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.