public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: William Breathitt Gray <vilhelm.gray@gmail.com>
To: Jonathan.Cameron@huawei.com,
	Jarkko Nikula <jarkko.nikula@linux.intel.com>
Cc: linux-iio@vger.kernel.org, Felipe Balbi <balbi@kernel.org>
Subject: Re: [PATCH 1/2] counter: Add support for Quadrature x4 with swapped inputs
Date: Fri, 2 Apr 2021 18:06:36 +0900	[thread overview]
Message-ID: <YGbenIXlQpHXs1R3@shinobu> (raw)
In-Reply-To: <20210401153228.2773560-1-jarkko.nikula@linux.intel.com>

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

On Thu, Apr 01, 2021 at 06:32:27PM +0300, Jarkko Nikula wrote:
> Some Quadrature Encoders can swap phase inputs A and B internally. This
> new function will allow drivers to configure input swap mode.
> 
> This was implemented by Felipe Balbi while he was working at Intel.
> 
> Signed-off-by: Felipe Balbi (Intel) <balbi@kernel.org>
> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>

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

> ---
>  Documentation/ABI/testing/sysfs-bus-counter | 4 ++++
>  drivers/counter/counter.c                   | 3 ++-
>  include/linux/counter.h                     | 3 ++-
>  3 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/ABI/testing/sysfs-bus-counter b/Documentation/ABI/testing/sysfs-bus-counter
> index 566bd99fe0a5..8f1e3de88c77 100644
> --- a/Documentation/ABI/testing/sysfs-bus-counter
> +++ b/Documentation/ABI/testing/sysfs-bus-counter
> @@ -146,6 +146,10 @@ Description:
>  			updates	the respective count. Quadrature encoding
>  			determines the direction.
>  
> +		quadrature x4 swapped:
> +			Same as quadrature x4, however Phase A and Phase B
> +			signals are swapped.
> +
>  What:		/sys/bus/counter/devices/counterX/countY/name
>  KernelVersion:	5.2
>  Contact:	linux-iio@vger.kernel.org
> diff --git a/drivers/counter/counter.c b/drivers/counter/counter.c
> index 6a683d086008..11d357245b14 100644
> --- a/drivers/counter/counter.c
> +++ b/drivers/counter/counter.c
> @@ -752,7 +752,8 @@ static const char *const counter_count_function_str[] = {
>  	[COUNTER_COUNT_FUNCTION_QUADRATURE_X1_B] = "quadrature x1 b",
>  	[COUNTER_COUNT_FUNCTION_QUADRATURE_X2_A] = "quadrature x2 a",
>  	[COUNTER_COUNT_FUNCTION_QUADRATURE_X2_B] = "quadrature x2 b",
> -	[COUNTER_COUNT_FUNCTION_QUADRATURE_X4] = "quadrature x4"
> +	[COUNTER_COUNT_FUNCTION_QUADRATURE_X4] = "quadrature x4",
> +	[COUNTER_COUNT_FUNCTION_QUADRATURE_X4_SWAPPED] = "quadrature x4 swapped"
>  };
>  
>  static ssize_t counter_function_show(struct device *dev,
> diff --git a/include/linux/counter.h b/include/linux/counter.h
> index 9dbd5df4cd34..c3b4d263eb22 100644
> --- a/include/linux/counter.h
> +++ b/include/linux/counter.h
> @@ -170,7 +170,8 @@ enum counter_count_function {
>  	COUNTER_COUNT_FUNCTION_QUADRATURE_X1_B,
>  	COUNTER_COUNT_FUNCTION_QUADRATURE_X2_A,
>  	COUNTER_COUNT_FUNCTION_QUADRATURE_X2_B,
> -	COUNTER_COUNT_FUNCTION_QUADRATURE_X4
> +	COUNTER_COUNT_FUNCTION_QUADRATURE_X4,
> +	COUNTER_COUNT_FUNCTION_QUADRATURE_X4_SWAPPED,
>  };
>  
>  /**
> -- 
> 2.30.2
> 

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

      parent reply	other threads:[~2021-04-02  9:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-01 15:32 [PATCH 1/2] counter: Add support for Quadrature x4 with swapped inputs Jarkko Nikula
2021-04-01 15:32 ` [PATCH 2/2] counter: Add support for Intel Quadrature Encoder Peripheral Jarkko Nikula
2021-04-02 10:30   ` William Breathitt Gray
2021-04-07 14:25     ` Jarkko Nikula
2021-04-07 23:42       ` William Breathitt Gray
2021-04-02  9:06 ` William Breathitt Gray [this message]

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=YGbenIXlQpHXs1R3@shinobu \
    --to=vilhelm.gray@gmail.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=balbi@kernel.org \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=linux-iio@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox