diff mbox

[RFT,2/5] iio: mxs-lradc: move TS config into suitable function

Message ID 1460648909-2657-3-git-send-email-stefan.wahren@i2se.com (mailing list archive)
State New, archived
Headers show

Commit Message

Stefan Wahren April 14, 2016, 3:48 p.m. UTC
This patch moves the touchscreen type configuration into
a more suitable function. Btw this simplifies PM ops later.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
 drivers/iio/adc/mxs-lradc.c |   21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

Comments

Marek Vasut April 14, 2016, 8:01 p.m. UTC | #1
On 04/14/2016 05:48 PM, Stefan Wahren wrote:
> This patch moves the touchscreen type configuration into
> a more suitable function. Btw this simplifies PM ops later.
> 
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>

Looks OK

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

> ---
>  drivers/iio/adc/mxs-lradc.c |   21 +++++++++++----------
>  1 file changed, 11 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/iio/adc/mxs-lradc.c b/drivers/iio/adc/mxs-lradc.c
> index 0576953..7118fca 100644
> --- a/drivers/iio/adc/mxs-lradc.c
> +++ b/drivers/iio/adc/mxs-lradc.c
> @@ -686,6 +686,17 @@ static void mxs_lradc_prepare_pressure(struct mxs_lradc *lradc)
>  
>  static void mxs_lradc_enable_touch_detection(struct mxs_lradc *lradc)
>  {
> +	/* Configure the touchscreen type */
> +	if (lradc->soc == IMX28_LRADC) {
> +		mxs_lradc_reg_clear(lradc, LRADC_CTRL0_MX28_TOUCH_SCREEN_TYPE,
> +				    LRADC_CTRL0);
> +
> +		if (lradc->use_touchscreen == MXS_LRADC_TOUCHSCREEN_5WIRE)
> +			mxs_lradc_reg_set(lradc,
> +					  LRADC_CTRL0_MX28_TOUCH_SCREEN_TYPE,
> +					  LRADC_CTRL0);
> +	}
> +
>  	mxs_lradc_setup_touch_detection(lradc);
>  
>  	lradc->cur_plate = LRADC_TOUCH;
> @@ -1491,16 +1502,6 @@ static int mxs_lradc_hw_init(struct mxs_lradc *lradc)
>  	mxs_lradc_reg_wrt(lradc, 0, LRADC_DELAY(2));
>  	mxs_lradc_reg_wrt(lradc, 0, LRADC_DELAY(3));
>  
> -	/* Configure the touchscreen type */
> -	if (lradc->soc == IMX28_LRADC) {
> -		mxs_lradc_reg_clear(lradc, LRADC_CTRL0_MX28_TOUCH_SCREEN_TYPE,
> -				    LRADC_CTRL0);
> -
> -	if (lradc->use_touchscreen == MXS_LRADC_TOUCHSCREEN_5WIRE)
> -		mxs_lradc_reg_set(lradc, LRADC_CTRL0_MX28_TOUCH_SCREEN_TYPE,
> -				  LRADC_CTRL0);
> -	}
> -
>  	/* Start internal temperature sensing. */
>  	mxs_lradc_reg_wrt(lradc, 0, LRADC_CTRL2);
>  
>
Jonathan Cameron April 17, 2016, 10:13 a.m. UTC | #2
On 14/04/16 21:01, Marek Vasut wrote:
> On 04/14/2016 05:48 PM, Stefan Wahren wrote:
>> This patch moves the touchscreen type configuration into
>> a more suitable function. Btw this simplifies PM ops later.
>>
>> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> 
> Looks OK
> 
> Reviewed-by: Marek Vasut <marex@denx.de>
Please do CC Dmitry and linux-input on any patches 'touching' the
touchscreen parts of the driver.  I'm happy this one is simple
enough to apply anyway, but best to make sure everyone is in the
loop.

Something a little odd happened when applying the patch.  Automerging
failed so I did it by hand. Not sure what had changed!

Anyhow, please sanity check I haven't messed it up.

Applied to the togreg branch of iio.git - initially pushed out as
testing for the autobuilders to play with it.

Thanks,


Jonathan
> 
>> ---
>>  drivers/iio/adc/mxs-lradc.c |   21 +++++++++++----------
>>  1 file changed, 11 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/iio/adc/mxs-lradc.c b/drivers/iio/adc/mxs-lradc.c
>> index 0576953..7118fca 100644
>> --- a/drivers/iio/adc/mxs-lradc.c
>> +++ b/drivers/iio/adc/mxs-lradc.c
>> @@ -686,6 +686,17 @@ static void mxs_lradc_prepare_pressure(struct mxs_lradc *lradc)
>>  
>>  static void mxs_lradc_enable_touch_detection(struct mxs_lradc *lradc)
>>  {
>> +	/* Configure the touchscreen type */
>> +	if (lradc->soc == IMX28_LRADC) {
>> +		mxs_lradc_reg_clear(lradc, LRADC_CTRL0_MX28_TOUCH_SCREEN_TYPE,
>> +				    LRADC_CTRL0);
>> +
>> +		if (lradc->use_touchscreen == MXS_LRADC_TOUCHSCREEN_5WIRE)
>> +			mxs_lradc_reg_set(lradc,
>> +					  LRADC_CTRL0_MX28_TOUCH_SCREEN_TYPE,
>> +					  LRADC_CTRL0);
>> +	}
>> +
>>  	mxs_lradc_setup_touch_detection(lradc);
>>  
>>  	lradc->cur_plate = LRADC_TOUCH;
>> @@ -1491,16 +1502,6 @@ static int mxs_lradc_hw_init(struct mxs_lradc *lradc)
>>  	mxs_lradc_reg_wrt(lradc, 0, LRADC_DELAY(2));
>>  	mxs_lradc_reg_wrt(lradc, 0, LRADC_DELAY(3));
>>  
>> -	/* Configure the touchscreen type */
>> -	if (lradc->soc == IMX28_LRADC) {
>> -		mxs_lradc_reg_clear(lradc, LRADC_CTRL0_MX28_TOUCH_SCREEN_TYPE,
>> -				    LRADC_CTRL0);
>> -
>> -	if (lradc->use_touchscreen == MXS_LRADC_TOUCHSCREEN_5WIRE)
>> -		mxs_lradc_reg_set(lradc, LRADC_CTRL0_MX28_TOUCH_SCREEN_TYPE,
>> -				  LRADC_CTRL0);
>> -	}
>> -
>>  	/* Start internal temperature sensing. */
>>  	mxs_lradc_reg_wrt(lradc, 0, LRADC_CTRL2);
>>  
>>
> 
>
Dmitry Torokhov April 17, 2016, 12:19 p.m. UTC | #3
On Sun, Apr 17, 2016 at 11:13:49AM +0100, Jonathan Cameron wrote:
> On 14/04/16 21:01, Marek Vasut wrote:
> > On 04/14/2016 05:48 PM, Stefan Wahren wrote:
> >> This patch moves the touchscreen type configuration into
> >> a more suitable function. Btw this simplifies PM ops later.
> >>
> >> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> > 
> > Looks OK
> > 
> > Reviewed-by: Marek Vasut <marex@denx.de>
> Please do CC Dmitry and linux-input on any patches 'touching' the
> touchscreen parts of the driver.  I'm happy this one is simple
> enough to apply anyway, but best to make sure everyone is in the
> loop.

FWIW:

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

> 
> Something a little odd happened when applying the patch.  Automerging
> failed so I did it by hand. Not sure what had changed!
> 
> Anyhow, please sanity check I haven't messed it up.
> 
> Applied to the togreg branch of iio.git - initially pushed out as
> testing for the autobuilders to play with it.
> 
> Thanks,
> 
> 
> Jonathan
> > 
> >> ---
> >>  drivers/iio/adc/mxs-lradc.c |   21 +++++++++++----------
> >>  1 file changed, 11 insertions(+), 10 deletions(-)
> >>
> >> diff --git a/drivers/iio/adc/mxs-lradc.c b/drivers/iio/adc/mxs-lradc.c
> >> index 0576953..7118fca 100644
> >> --- a/drivers/iio/adc/mxs-lradc.c
> >> +++ b/drivers/iio/adc/mxs-lradc.c
> >> @@ -686,6 +686,17 @@ static void mxs_lradc_prepare_pressure(struct mxs_lradc *lradc)
> >>  
> >>  static void mxs_lradc_enable_touch_detection(struct mxs_lradc *lradc)
> >>  {
> >> +	/* Configure the touchscreen type */
> >> +	if (lradc->soc == IMX28_LRADC) {
> >> +		mxs_lradc_reg_clear(lradc, LRADC_CTRL0_MX28_TOUCH_SCREEN_TYPE,
> >> +				    LRADC_CTRL0);
> >> +
> >> +		if (lradc->use_touchscreen == MXS_LRADC_TOUCHSCREEN_5WIRE)
> >> +			mxs_lradc_reg_set(lradc,
> >> +					  LRADC_CTRL0_MX28_TOUCH_SCREEN_TYPE,
> >> +					  LRADC_CTRL0);
> >> +	}
> >> +
> >>  	mxs_lradc_setup_touch_detection(lradc);
> >>  
> >>  	lradc->cur_plate = LRADC_TOUCH;
> >> @@ -1491,16 +1502,6 @@ static int mxs_lradc_hw_init(struct mxs_lradc *lradc)
> >>  	mxs_lradc_reg_wrt(lradc, 0, LRADC_DELAY(2));
> >>  	mxs_lradc_reg_wrt(lradc, 0, LRADC_DELAY(3));
> >>  
> >> -	/* Configure the touchscreen type */
> >> -	if (lradc->soc == IMX28_LRADC) {
> >> -		mxs_lradc_reg_clear(lradc, LRADC_CTRL0_MX28_TOUCH_SCREEN_TYPE,
> >> -				    LRADC_CTRL0);
> >> -
> >> -	if (lradc->use_touchscreen == MXS_LRADC_TOUCHSCREEN_5WIRE)
> >> -		mxs_lradc_reg_set(lradc, LRADC_CTRL0_MX28_TOUCH_SCREEN_TYPE,
> >> -				  LRADC_CTRL0);
> >> -	}
> >> -
> >>  	/* Start internal temperature sensing. */
> >>  	mxs_lradc_reg_wrt(lradc, 0, LRADC_CTRL2);
> >>  
> >>
> > 
> > 
>
Stefan Wahren April 18, 2016, 6:26 a.m. UTC | #4
Am 17.04.2016 um 12:13 schrieb Jonathan Cameron:
> On 14/04/16 21:01, Marek Vasut wrote:
>> On 04/14/2016 05:48 PM, Stefan Wahren wrote:
>>> This patch moves the touchscreen type configuration into
>>> a more suitable function. Btw this simplifies PM ops later.
>>>
>>> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
>> Looks OK
>>
>> Reviewed-by: Marek Vasut <marex@denx.de>
> Please do CC Dmitry and linux-input on any patches 'touching' the
> touchscreen parts of the driver.  I'm happy this one is simple
> enough to apply anyway, but best to make sure everyone is in the
> loop.
>
> Something a little odd happened when applying the patch.  Automerging
> failed so I did it by hand. Not sure what had changed!
>
> Anyhow, please sanity check I haven't messed it up.

Everything is fine. There was a indention conflict between Ksenija's and
my patch.

>
> Applied to the togreg branch of iio.git - initially pushed out as
> testing for the autobuilders to play with it.
>
> Thanks,
>
>
> Jonathan
diff mbox

Patch

diff --git a/drivers/iio/adc/mxs-lradc.c b/drivers/iio/adc/mxs-lradc.c
index 0576953..7118fca 100644
--- a/drivers/iio/adc/mxs-lradc.c
+++ b/drivers/iio/adc/mxs-lradc.c
@@ -686,6 +686,17 @@  static void mxs_lradc_prepare_pressure(struct mxs_lradc *lradc)
 
 static void mxs_lradc_enable_touch_detection(struct mxs_lradc *lradc)
 {
+	/* Configure the touchscreen type */
+	if (lradc->soc == IMX28_LRADC) {
+		mxs_lradc_reg_clear(lradc, LRADC_CTRL0_MX28_TOUCH_SCREEN_TYPE,
+				    LRADC_CTRL0);
+
+		if (lradc->use_touchscreen == MXS_LRADC_TOUCHSCREEN_5WIRE)
+			mxs_lradc_reg_set(lradc,
+					  LRADC_CTRL0_MX28_TOUCH_SCREEN_TYPE,
+					  LRADC_CTRL0);
+	}
+
 	mxs_lradc_setup_touch_detection(lradc);
 
 	lradc->cur_plate = LRADC_TOUCH;
@@ -1491,16 +1502,6 @@  static int mxs_lradc_hw_init(struct mxs_lradc *lradc)
 	mxs_lradc_reg_wrt(lradc, 0, LRADC_DELAY(2));
 	mxs_lradc_reg_wrt(lradc, 0, LRADC_DELAY(3));
 
-	/* Configure the touchscreen type */
-	if (lradc->soc == IMX28_LRADC) {
-		mxs_lradc_reg_clear(lradc, LRADC_CTRL0_MX28_TOUCH_SCREEN_TYPE,
-				    LRADC_CTRL0);
-
-	if (lradc->use_touchscreen == MXS_LRADC_TOUCHSCREEN_5WIRE)
-		mxs_lradc_reg_set(lradc, LRADC_CTRL0_MX28_TOUCH_SCREEN_TYPE,
-				  LRADC_CTRL0);
-	}
-
 	/* Start internal temperature sensing. */
 	mxs_lradc_reg_wrt(lradc, 0, LRADC_CTRL2);