* [PATCH] iio: mxs-lradc: Do hardware initialization earlier
@ 2013-03-28 10:13 Alexandre Belloni
2013-03-28 10:24 ` Alexandre Belloni
2013-03-28 11:22 ` Marek Vasut
0 siblings, 2 replies; 5+ messages in thread
From: Alexandre Belloni @ 2013-03-28 10:13 UTC (permalink / raw)
To: linux-arm-kernel
We need to initialize hardware before registering the touchscreen. Else,
we end up setting registers in mxs_lradc_ts_open(), getting called just
after registering the touchscreen with input_register_device() and by
the end of mxs_lradc_probe(), we reset the LRADC block hence losing the
correct configuration.
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: Marek Vasut <marex@denx.de>
---
drivers/staging/iio/adc/mxs-lradc.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
index 55a459b..e927e3f 100644
--- a/drivers/staging/iio/adc/mxs-lradc.c
+++ b/drivers/staging/iio/adc/mxs-lradc.c
@@ -933,6 +933,9 @@ static int mxs_lradc_probe(struct platform_device *pdev)
INIT_WORK(&lradc->ts_work, mxs_lradc_ts_work);
+ /* Configure the hardware. */
+ mxs_lradc_hw_init(lradc);
+
/* Check if touchscreen is enabled in DT. */
ret = of_property_read_u32(node, "fsl,lradc-touchscreen-wires",
&ts_wires);
@@ -995,9 +998,6 @@ static int mxs_lradc_probe(struct platform_device *pdev)
goto err_ts;
}
- /* Configure the hardware. */
- mxs_lradc_hw_init(lradc);
-
return 0;
err_ts:
--
1.7.10.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] iio: mxs-lradc: Do hardware initialization earlier
2013-03-28 10:13 [PATCH] iio: mxs-lradc: Do hardware initialization earlier Alexandre Belloni
@ 2013-03-28 10:24 ` Alexandre Belloni
2013-03-28 11:22 ` Marek Vasut
1 sibling, 0 replies; 5+ messages in thread
From: Alexandre Belloni @ 2013-03-28 10:24 UTC (permalink / raw)
To: linux-arm-kernel
On 28/03/2013 11:13, Alexandre Belloni wrote:
> We need to initialize hardware before registering the touchscreen. Else,
> we end up setting registers in mxs_lradc_ts_open(), getting called just
> after registering the touchscreen with input_register_device() and by
> the end of mxs_lradc_probe(), we reset the LRADC block hence losing the
> correct configuration.
Sorry, I fumbled and forgot my SoB:
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> Cc: Fabio Estevam <fabio.estevam@freescale.com>
> Cc: Jonathan Cameron <jic23@kernel.org>
> Cc: Marek Vasut <marex@denx.de>
> ---
> drivers/staging/iio/adc/mxs-lradc.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
> index 55a459b..e927e3f 100644
> --- a/drivers/staging/iio/adc/mxs-lradc.c
> +++ b/drivers/staging/iio/adc/mxs-lradc.c
> @@ -933,6 +933,9 @@ static int mxs_lradc_probe(struct platform_device *pdev)
>
> INIT_WORK(&lradc->ts_work, mxs_lradc_ts_work);
>
> + /* Configure the hardware. */
> + mxs_lradc_hw_init(lradc);
> +
> /* Check if touchscreen is enabled in DT. */
> ret = of_property_read_u32(node, "fsl,lradc-touchscreen-wires",
> &ts_wires);
> @@ -995,9 +998,6 @@ static int mxs_lradc_probe(struct platform_device *pdev)
> goto err_ts;
> }
>
> - /* Configure the hardware. */
> - mxs_lradc_hw_init(lradc);
> -
> return 0;
>
> err_ts:
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] iio: mxs-lradc: Do hardware initialization earlier
2013-03-28 10:13 [PATCH] iio: mxs-lradc: Do hardware initialization earlier Alexandre Belloni
2013-03-28 10:24 ` Alexandre Belloni
@ 2013-03-28 11:22 ` Marek Vasut
2013-03-28 11:51 ` Alexandre Belloni
1 sibling, 1 reply; 5+ messages in thread
From: Marek Vasut @ 2013-03-28 11:22 UTC (permalink / raw)
To: linux-arm-kernel
Dear Alexandre Belloni,
> We need to initialize hardware before registering the touchscreen. Else,
> we end up setting registers in mxs_lradc_ts_open(), getting called just
> after registering the touchscreen with input_register_device() and by
> the end of mxs_lradc_probe(), we reset the LRADC block hence losing the
> correct configuration.
>
> Cc: Fabio Estevam <fabio.estevam@freescale.com>
> Cc: Jonathan Cameron <jic23@kernel.org>
> Cc: Marek Vasut <marex@denx.de>
> ---
> drivers/staging/iio/adc/mxs-lradc.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/iio/adc/mxs-lradc.c
> b/drivers/staging/iio/adc/mxs-lradc.c index 55a459b..e927e3f 100644
> --- a/drivers/staging/iio/adc/mxs-lradc.c
> +++ b/drivers/staging/iio/adc/mxs-lradc.c
> @@ -933,6 +933,9 @@ static int mxs_lradc_probe(struct platform_device
> *pdev)
>
> INIT_WORK(&lradc->ts_work, mxs_lradc_ts_work);
>
> + /* Configure the hardware. */
> + mxs_lradc_hw_init(lradc);
> +
> /* Check if touchscreen is enabled in DT. */
> ret = of_property_read_u32(node, "fsl,lradc-touchscreen-wires",
Isn't this too early? At least lradc->use_touchscreen is configured only after
you call mxs_lradc_hw_init() in this case, while mxs_lradc_hw_init() uses it's
value.
I think mxs_lradc_hw_init() shall be called just before mxs_lradc_ts_register().
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] iio: mxs-lradc: Do hardware initialization earlier
2013-03-28 11:22 ` Marek Vasut
@ 2013-03-28 11:51 ` Alexandre Belloni
2013-03-28 11:59 ` Marek Vasut
0 siblings, 1 reply; 5+ messages in thread
From: Alexandre Belloni @ 2013-03-28 11:51 UTC (permalink / raw)
To: linux-arm-kernel
On 28/03/2013 12:22, Marek Vasut wrote:
> Dear Alexandre Belloni,
>
>> We need to initialize hardware before registering the touchscreen. Else,
>> we end up setting registers in mxs_lradc_ts_open(), getting called just
>> after registering the touchscreen with input_register_device() and by
>> the end of mxs_lradc_probe(), we reset the LRADC block hence losing the
>> correct configuration.
>>
>> Cc: Fabio Estevam <fabio.estevam@freescale.com>
>> Cc: Jonathan Cameron <jic23@kernel.org>
>> Cc: Marek Vasut <marex@denx.de>
>> ---
>> drivers/staging/iio/adc/mxs-lradc.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/staging/iio/adc/mxs-lradc.c
>> b/drivers/staging/iio/adc/mxs-lradc.c index 55a459b..e927e3f 100644
>> --- a/drivers/staging/iio/adc/mxs-lradc.c
>> +++ b/drivers/staging/iio/adc/mxs-lradc.c
>> @@ -933,6 +933,9 @@ static int mxs_lradc_probe(struct platform_device
>> *pdev)
>>
>> INIT_WORK(&lradc->ts_work, mxs_lradc_ts_work);
>>
>> + /* Configure the hardware. */
>> + mxs_lradc_hw_init(lradc);
>> +
>> /* Check if touchscreen is enabled in DT. */
>> ret = of_property_read_u32(node, "fsl,lradc-touchscreen-wires",
> Isn't this too early? At least lradc->use_touchscreen is configured only after
> you call mxs_lradc_hw_init() in this case, while mxs_lradc_hw_init() uses it's
> value.
>
> I think mxs_lradc_hw_init() shall be called just before mxs_lradc_ts_register().
>
>
That's right, this would break 5 wires touchscreens. I'll fix that.
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] iio: mxs-lradc: Do hardware initialization earlier
2013-03-28 11:51 ` Alexandre Belloni
@ 2013-03-28 11:59 ` Marek Vasut
0 siblings, 0 replies; 5+ messages in thread
From: Marek Vasut @ 2013-03-28 11:59 UTC (permalink / raw)
To: linux-arm-kernel
Dear Alexandre Belloni,
> On 28/03/2013 12:22, Marek Vasut wrote:
> > Dear Alexandre Belloni,
> >
> >> We need to initialize hardware before registering the touchscreen. Else,
> >> we end up setting registers in mxs_lradc_ts_open(), getting called just
> >> after registering the touchscreen with input_register_device() and by
> >> the end of mxs_lradc_probe(), we reset the LRADC block hence losing the
> >> correct configuration.
> >>
> >> Cc: Fabio Estevam <fabio.estevam@freescale.com>
> >> Cc: Jonathan Cameron <jic23@kernel.org>
> >> Cc: Marek Vasut <marex@denx.de>
> >> ---
> >>
> >> drivers/staging/iio/adc/mxs-lradc.c | 6 +++---
> >> 1 file changed, 3 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/staging/iio/adc/mxs-lradc.c
> >> b/drivers/staging/iio/adc/mxs-lradc.c index 55a459b..e927e3f 100644
> >> --- a/drivers/staging/iio/adc/mxs-lradc.c
> >> +++ b/drivers/staging/iio/adc/mxs-lradc.c
> >> @@ -933,6 +933,9 @@ static int mxs_lradc_probe(struct platform_device
> >> *pdev)
> >>
> >> INIT_WORK(&lradc->ts_work, mxs_lradc_ts_work);
> >>
> >> + /* Configure the hardware. */
> >> + mxs_lradc_hw_init(lradc);
> >> +
> >>
> >> /* Check if touchscreen is enabled in DT. */
> >> ret = of_property_read_u32(node, "fsl,lradc-touchscreen-wires",
> >
> > Isn't this too early? At least lradc->use_touchscreen is configured only
> > after you call mxs_lradc_hw_init() in this case, while
> > mxs_lradc_hw_init() uses it's value.
> >
> > I think mxs_lradc_hw_init() shall be called just before
> > mxs_lradc_ts_register().
>
> That's right, this would break 5 wires touchscreens. I'll fix that.
Thanks!
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-03-28 11:59 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-28 10:13 [PATCH] iio: mxs-lradc: Do hardware initialization earlier Alexandre Belloni
2013-03-28 10:24 ` Alexandre Belloni
2013-03-28 11:22 ` Marek Vasut
2013-03-28 11:51 ` Alexandre Belloni
2013-03-28 11:59 ` Marek Vasut
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).