linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Balbi <felipe.balbi@linux.intel.com>
To: William Breathitt Gray <vilhelm.gray@gmail.com>
Cc: linux-iio@vger.kernel.org, Felipe Balbi <felipe.balbi@linux.intel.com>
Subject: [RFC/PATCH 1/2] counter: add support for Quadrature x4 with swapped inputs
Date: Thu, 19 Sep 2019 11:03:04 +0300	[thread overview]
Message-ID: <20190919080305.960198-1-felipe.balbi@linux.intel.com> (raw)
In-Reply-To: <20190917114403.GA8368@icarus>

Some Quadrature Encoders can swap phase inputs A and B
internally. This new function will allow drivers to configure input
swap mode.

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
---
 drivers/counter/counter.c | 3 ++-
 include/linux/counter.h   | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/counter/counter.c b/drivers/counter/counter.c
index 106bc7180cd8..b818ae9e85f2 100644
--- a/drivers/counter/counter.c
+++ b/drivers/counter/counter.c
@@ -823,7 +823,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 a061cdcdef7c..860769250f89 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.23.0


  parent reply	other threads:[~2019-09-19  8:03 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-16  9:34 [RFC/PATCH] counter: introduce support for Intel QEP Encoder Felipe Balbi
2019-09-17 11:46 ` William Breathitt Gray
2019-09-17 12:07   ` Felipe Balbi
2019-09-17 13:02     ` William Breathitt Gray
2019-09-19  8:03   ` Felipe Balbi [this message]
2019-09-19  8:03     ` [RFC/PATCHv2 2/2] " Felipe Balbi
2019-09-22 23:35       ` William Breathitt Gray
2019-09-24  9:46         ` Felipe Balbi
2019-09-24 11:32           ` William Breathitt Gray
2019-09-24 11:35             ` Felipe Balbi
2019-10-01  9:32               ` [PATCH v3 1/2] counter: add support for Quadrature x4 with swapped inputs Felipe Balbi
2019-10-01  9:32                 ` [PATCH v3 2/2] counter: introduce support for Intel QEP Encoder Felipe Balbi
2019-10-02 18:11                   ` William Breathitt Gray
2019-10-02 16:37                 ` [PATCH v3 1/2] counter: add support for Quadrature x4 with swapped inputs William Breathitt Gray
2019-10-03 12:38             ` [RFC/PATCHv2 2/2] counter: introduce support for Intel QEP Encoder Jonathan Cameron
2019-09-24 21:46         ` David Lechner
2019-09-28 21:33           ` William Breathitt Gray
2019-09-30  5:22             ` Felipe Balbi
2019-10-02  0:34               ` William Breathitt Gray
2019-10-03 13:14                 ` Jonathan Cameron
2019-10-16 20:20                   ` William Breathitt Gray
2019-10-17 12:29                     ` Jonathan Cameron
2019-09-24 11:37     ` [RFC/PATCH 1/2] counter: add support for Quadrature x4 with swapped inputs William Breathitt Gray

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=20190919080305.960198-1-felipe.balbi@linux.intel.com \
    --to=felipe.balbi@linux.intel.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=vilhelm.gray@gmail.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 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).