linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] counter:ti-eqep: remove floor
@ 2020-12-14  0:09 David Lechner
  2020-12-14 11:46 ` William Breathitt Gray
  0 siblings, 1 reply; 4+ messages in thread
From: David Lechner @ 2020-12-14  0:09 UTC (permalink / raw)
  To: linux-iio
  Cc: David Lechner, William Breathitt Gray, Jonathan Cameron, linux-kernel

The hardware doesn't support this. QPOSINIT is an initialization value
that is triggered by other things. When the counter overflows, it
always wraps around to zero.

Fixes: f213729f6796 "counter: new TI eQEP driver"
Signed-off-by: David Lechner <david@lechnology.com>
---
 drivers/counter/ti-eqep.c | 35 -----------------------------------
 1 file changed, 35 deletions(-)

diff --git a/drivers/counter/ti-eqep.c b/drivers/counter/ti-eqep.c
index a60aee1a1a29..65df9ef5b5bc 100644
--- a/drivers/counter/ti-eqep.c
+++ b/drivers/counter/ti-eqep.c
@@ -235,36 +235,6 @@ static ssize_t ti_eqep_position_ceiling_write(struct counter_device *counter,
 	return len;
 }
 
-static ssize_t ti_eqep_position_floor_read(struct counter_device *counter,
-					   struct counter_count *count,
-					   void *ext_priv, char *buf)
-{
-	struct ti_eqep_cnt *priv = counter->priv;
-	u32 qposinit;
-
-	regmap_read(priv->regmap32, QPOSINIT, &qposinit);
-
-	return sprintf(buf, "%u\n", qposinit);
-}
-
-static ssize_t ti_eqep_position_floor_write(struct counter_device *counter,
-					    struct counter_count *count,
-					    void *ext_priv, const char *buf,
-					    size_t len)
-{
-	struct ti_eqep_cnt *priv = counter->priv;
-	int err;
-	u32 res;
-
-	err = kstrtouint(buf, 0, &res);
-	if (err < 0)
-		return err;
-
-	regmap_write(priv->regmap32, QPOSINIT, res);
-
-	return len;
-}
-
 static ssize_t ti_eqep_position_enable_read(struct counter_device *counter,
 					    struct counter_count *count,
 					    void *ext_priv, char *buf)
@@ -301,11 +271,6 @@ static struct counter_count_ext ti_eqep_position_ext[] = {
 		.read	= ti_eqep_position_ceiling_read,
 		.write	= ti_eqep_position_ceiling_write,
 	},
-	{
-		.name	= "floor",
-		.read	= ti_eqep_position_floor_read,
-		.write	= ti_eqep_position_floor_write,
-	},
 	{
 		.name	= "enable",
 		.read	= ti_eqep_position_enable_read,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] counter:ti-eqep: remove floor
  2020-12-14  0:09 [PATCH] counter:ti-eqep: remove floor David Lechner
@ 2020-12-14 11:46 ` William Breathitt Gray
  2020-12-14 14:05   ` David Lechner
  0 siblings, 1 reply; 4+ messages in thread
From: William Breathitt Gray @ 2020-12-14 11:46 UTC (permalink / raw)
  To: David Lechner; +Cc: linux-iio, Jonathan Cameron, linux-kernel

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

On Sun, Dec 13, 2020 at 06:09:27PM -0600, David Lechner wrote:
> The hardware doesn't support this. QPOSINIT is an initialization value
> that is triggered by other things. When the counter overflows, it
> always wraps around to zero.
> 
> Fixes: f213729f6796 "counter: new TI eQEP driver"
> Signed-off-by: David Lechner <david@lechnology.com>

Is the QPOSINIT preprocessor define needed at all anymore, or should it also be
removed?

Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>

> ---
>  drivers/counter/ti-eqep.c | 35 -----------------------------------
>  1 file changed, 35 deletions(-)
> 
> diff --git a/drivers/counter/ti-eqep.c b/drivers/counter/ti-eqep.c
> index a60aee1a1a29..65df9ef5b5bc 100644
> --- a/drivers/counter/ti-eqep.c
> +++ b/drivers/counter/ti-eqep.c
> @@ -235,36 +235,6 @@ static ssize_t ti_eqep_position_ceiling_write(struct counter_device *counter,
>  	return len;
>  }
>  
> -static ssize_t ti_eqep_position_floor_read(struct counter_device *counter,
> -					   struct counter_count *count,
> -					   void *ext_priv, char *buf)
> -{
> -	struct ti_eqep_cnt *priv = counter->priv;
> -	u32 qposinit;
> -
> -	regmap_read(priv->regmap32, QPOSINIT, &qposinit);
> -
> -	return sprintf(buf, "%u\n", qposinit);
> -}
> -
> -static ssize_t ti_eqep_position_floor_write(struct counter_device *counter,
> -					    struct counter_count *count,
> -					    void *ext_priv, const char *buf,
> -					    size_t len)
> -{
> -	struct ti_eqep_cnt *priv = counter->priv;
> -	int err;
> -	u32 res;
> -
> -	err = kstrtouint(buf, 0, &res);
> -	if (err < 0)
> -		return err;
> -
> -	regmap_write(priv->regmap32, QPOSINIT, res);
> -
> -	return len;
> -}
> -
>  static ssize_t ti_eqep_position_enable_read(struct counter_device *counter,
>  					    struct counter_count *count,
>  					    void *ext_priv, char *buf)
> @@ -301,11 +271,6 @@ static struct counter_count_ext ti_eqep_position_ext[] = {
>  		.read	= ti_eqep_position_ceiling_read,
>  		.write	= ti_eqep_position_ceiling_write,
>  	},
> -	{
> -		.name	= "floor",
> -		.read	= ti_eqep_position_floor_read,
> -		.write	= ti_eqep_position_floor_write,
> -	},
>  	{
>  		.name	= "enable",
>  		.read	= ti_eqep_position_enable_read,
> -- 
> 2.25.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] counter:ti-eqep: remove floor
  2020-12-14 11:46 ` William Breathitt Gray
@ 2020-12-14 14:05   ` David Lechner
  2020-12-29 18:20     ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: David Lechner @ 2020-12-14 14:05 UTC (permalink / raw)
  To: William Breathitt Gray; +Cc: linux-iio, Jonathan Cameron, linux-kernel

On 12/14/20 5:46 AM, William Breathitt Gray wrote:
> On Sun, Dec 13, 2020 at 06:09:27PM -0600, David Lechner wrote:
>> The hardware doesn't support this. QPOSINIT is an initialization value
>> that is triggered by other things. When the counter overflows, it
>> always wraps around to zero.
>>
>> Fixes: f213729f6796 "counter: new TI eQEP driver"
>> Signed-off-by: David Lechner <david@lechnology.com>
> 
> Is the QPOSINIT preprocessor define needed at all anymore, or should it also be
> removed?

There are already many more defines for registers that are not
used, so I didn't remove it.

> 
> Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
> 
>> ---
>>   drivers/counter/ti-eqep.c | 35 -----------------------------------
>>   1 file changed, 35 deletions(-)
>>
>> diff --git a/drivers/counter/ti-eqep.c b/drivers/counter/ti-eqep.c
>> index a60aee1a1a29..65df9ef5b5bc 100644
>> --- a/drivers/counter/ti-eqep.c
>> +++ b/drivers/counter/ti-eqep.c
>> @@ -235,36 +235,6 @@ static ssize_t ti_eqep_position_ceiling_write(struct counter_device *counter,
>>   	return len;
>>   }
>>   
>> -static ssize_t ti_eqep_position_floor_read(struct counter_device *counter,
>> -					   struct counter_count *count,
>> -					   void *ext_priv, char *buf)
>> -{
>> -	struct ti_eqep_cnt *priv = counter->priv;
>> -	u32 qposinit;
>> -
>> -	regmap_read(priv->regmap32, QPOSINIT, &qposinit);
>> -
>> -	return sprintf(buf, "%u\n", qposinit);
>> -}
>> -
>> -static ssize_t ti_eqep_position_floor_write(struct counter_device *counter,
>> -					    struct counter_count *count,
>> -					    void *ext_priv, const char *buf,
>> -					    size_t len)
>> -{
>> -	struct ti_eqep_cnt *priv = counter->priv;
>> -	int err;
>> -	u32 res;
>> -
>> -	err = kstrtouint(buf, 0, &res);
>> -	if (err < 0)
>> -		return err;
>> -
>> -	regmap_write(priv->regmap32, QPOSINIT, res);
>> -
>> -	return len;
>> -}
>> -
>>   static ssize_t ti_eqep_position_enable_read(struct counter_device *counter,
>>   					    struct counter_count *count,
>>   					    void *ext_priv, char *buf)
>> @@ -301,11 +271,6 @@ static struct counter_count_ext ti_eqep_position_ext[] = {
>>   		.read	= ti_eqep_position_ceiling_read,
>>   		.write	= ti_eqep_position_ceiling_write,
>>   	},
>> -	{
>> -		.name	= "floor",
>> -		.read	= ti_eqep_position_floor_read,
>> -		.write	= ti_eqep_position_floor_write,
>> -	},
>>   	{
>>   		.name	= "enable",
>>   		.read	= ti_eqep_position_enable_read,
>> -- 
>> 2.25.1
>>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] counter:ti-eqep: remove floor
  2020-12-14 14:05   ` David Lechner
@ 2020-12-29 18:20     ` Jonathan Cameron
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2020-12-29 18:20 UTC (permalink / raw)
  To: David Lechner
  Cc: William Breathitt Gray, linux-iio, Jonathan Cameron, linux-kernel

On Mon, 14 Dec 2020 08:05:44 -0600
David Lechner <david@lechnology.com> wrote:

> On 12/14/20 5:46 AM, William Breathitt Gray wrote:
> > On Sun, Dec 13, 2020 at 06:09:27PM -0600, David Lechner wrote:  
> >> The hardware doesn't support this. QPOSINIT is an initialization value
> >> that is triggered by other things. When the counter overflows, it
> >> always wraps around to zero.
> >>
> >> Fixes: f213729f6796 "counter: new TI eQEP driver"
> >> Signed-off-by: David Lechner <david@lechnology.com>  
> > 
> > Is the QPOSINIT preprocessor define needed at all anymore, or should it also be
> > removed?  
> 
> There are already many more defines for registers that are not
> used, so I didn't remove it.
Applied to the fixes-togreg branch of iio.git and marked for stable.

Thanks,

Jonathan

> 
> > 
> > Acked-by: William Breathitt Gray <vilhelm.gray@gmail.com>
> >   
> >> ---
> >>   drivers/counter/ti-eqep.c | 35 -----------------------------------
> >>   1 file changed, 35 deletions(-)
> >>
> >> diff --git a/drivers/counter/ti-eqep.c b/drivers/counter/ti-eqep.c
> >> index a60aee1a1a29..65df9ef5b5bc 100644
> >> --- a/drivers/counter/ti-eqep.c
> >> +++ b/drivers/counter/ti-eqep.c
> >> @@ -235,36 +235,6 @@ static ssize_t ti_eqep_position_ceiling_write(struct counter_device *counter,
> >>   	return len;
> >>   }
> >>   
> >> -static ssize_t ti_eqep_position_floor_read(struct counter_device *counter,
> >> -					   struct counter_count *count,
> >> -					   void *ext_priv, char *buf)
> >> -{
> >> -	struct ti_eqep_cnt *priv = counter->priv;
> >> -	u32 qposinit;
> >> -
> >> -	regmap_read(priv->regmap32, QPOSINIT, &qposinit);
> >> -
> >> -	return sprintf(buf, "%u\n", qposinit);
> >> -}
> >> -
> >> -static ssize_t ti_eqep_position_floor_write(struct counter_device *counter,
> >> -					    struct counter_count *count,
> >> -					    void *ext_priv, const char *buf,
> >> -					    size_t len)
> >> -{
> >> -	struct ti_eqep_cnt *priv = counter->priv;
> >> -	int err;
> >> -	u32 res;
> >> -
> >> -	err = kstrtouint(buf, 0, &res);
> >> -	if (err < 0)
> >> -		return err;
> >> -
> >> -	regmap_write(priv->regmap32, QPOSINIT, res);
> >> -
> >> -	return len;
> >> -}
> >> -
> >>   static ssize_t ti_eqep_position_enable_read(struct counter_device *counter,
> >>   					    struct counter_count *count,
> >>   					    void *ext_priv, char *buf)
> >> @@ -301,11 +271,6 @@ static struct counter_count_ext ti_eqep_position_ext[] = {
> >>   		.read	= ti_eqep_position_ceiling_read,
> >>   		.write	= ti_eqep_position_ceiling_write,
> >>   	},
> >> -	{
> >> -		.name	= "floor",
> >> -		.read	= ti_eqep_position_floor_read,
> >> -		.write	= ti_eqep_position_floor_write,
> >> -	},
> >>   	{
> >>   		.name	= "enable",
> >>   		.read	= ti_eqep_position_enable_read,
> >> -- 
> >> 2.25.1
> >>  
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-29 18:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-14  0:09 [PATCH] counter:ti-eqep: remove floor David Lechner
2020-12-14 11:46 ` William Breathitt Gray
2020-12-14 14:05   ` David Lechner
2020-12-29 18:20     ` Jonathan Cameron

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).