devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: linux-gpio@vger.kernel.org
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Alexandre Courbot <gnurou@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	cphealy@gmail.com, Andrey Smirnov <andrew.smirnov@gmail.com>
Subject: [PATCH 04/13] gpio-sx150x: Replace 'io_polarity' with DT binding
Date: Mon, 17 Oct 2016 07:26:59 -0700	[thread overview]
Message-ID: <1476714428-11264-5-git-send-email-andrew.smirnov@gmail.com> (raw)
In-Reply-To: <1476714428-11264-1-git-send-email-andrew.smirnov@gmail.com>

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 drivers/gpio/gpio-sx150x.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/gpio/gpio-sx150x.c b/drivers/gpio/gpio-sx150x.c
index e01afd8..9b62133 100644
--- a/drivers/gpio/gpio-sx150x.c
+++ b/drivers/gpio/gpio-sx150x.c
@@ -100,11 +100,6 @@ struct sx150x_device_data {
  *                 bit at position n will enable the pull-down for the IO at
  *                 the corresponding offset.  For chips with fewer than
  *                 16 IO pins, high-end bits are ignored.
- * @io_polarity: A bit-mask which enables polarity inversion for each IO line
- *               in the expander.  Setting the bit at position n inverts
- *               the polarity of that IO line, while clearing it results
- *               in normal polarity. For chips with fewer than 16 IO pins,
- *               high-end bits are ignored.
  * @reset_during_probe: If set to true, the driver will trigger a full
  *                      reset of the chip at the beginning of the probe
  *                      in order to place it in a known state.
@@ -113,7 +108,6 @@ struct sx150x_platform_data {
 	bool     oscio_is_gpo;
 	u16      io_pullup_ena;
 	u16      io_pulldn_ena;
-	u16      io_polarity;
 	bool     reset_during_probe;
 };
 
@@ -654,9 +648,15 @@ static int sx150x_init_hw(struct sx150x_chip *chip,
 		return err;
 
 	if (chip->dev_cfg->model == SX150X_789) {
+		u32 io_polarity = 0;
+
+		of_property_read_u32(chip->client->dev.of_node,
+				     "semtech,io-polarity",
+				     &io_polarity);
+
 		err = sx150x_init_io(chip,
-				chip->dev_cfg->pri.x789.reg_polarity,
-				pdata->io_polarity);
+				     chip->dev_cfg->pri.x789.reg_polarity,
+				     (u16)io_polarity);
 		if (err < 0)
 			return err;
 	} else if (chip->dev_cfg->model == SX150X_456) {
-- 
2.5.5


  parent reply	other threads:[~2016-10-17 14:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-17 14:26 [PATCH 00/13] Revamp Semtech SX150x driver Andrey Smirnov
2016-10-17 14:26 ` [PATCH 01/13] gpio-sx150x: Remove 'gpio_base' from pdata Andrey Smirnov
     [not found] ` <1476714428-11264-1-git-send-email-andrew.smirnov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-10-17 14:26   ` [PATCH 02/13] gpio-sx150x: Remove 'irq_summary' parameter Andrey Smirnov
2016-10-17 14:27   ` [PATCH 13/13] gpio-sx150x: Pass device type in DT match table Andrey Smirnov
2016-10-17 14:26 ` [PATCH 03/13] gpio-sx150x: Remove 'irq_base' parameter Andrey Smirnov
2016-10-17 14:26 ` Andrey Smirnov [this message]
2016-10-17 14:27 ` [PATCH 05/13] bindings: gpio-sx150x: Document "semtech,io-polarity" binding Andrey Smirnov
2016-10-18 16:23   ` Rob Herring
2016-10-17 14:27 ` [PATCH 06/13] gpio-sx150x: Replace "io_pull*_ena" with DT bindings Andrey Smirnov
2016-10-17 14:27 ` [PATCH 07/13] bindings: gpio-sx150x: Document "semtech,io-pull*" bindings Andrey Smirnov
2016-10-18 16:25   ` Rob Herring
2016-10-17 14:27 ` [PATCH 08/13] gpio-sx150x: Replace 'reset_during_probe" with DT binding Andrey Smirnov
2016-10-17 14:27 ` [PATCH 09/13] bindings: gpio-sx150x: Document "semtech,reset-during-probe" bindings Andrey Smirnov
2016-10-17 14:27 ` [PATCH 10/13] gpio-sx150x: Replace 'oscio_is_gpio' with DT binding Andrey Smirnov
2016-10-17 14:27 ` [PATCH 11/13] bindings: gpio-sx150x: Document "semtech,oscio-is-gpo" binding Andrey Smirnov
2016-10-17 14:27 ` [PATCH 12/13] gpio-sx150x: Remove struct sx150x_platform_data Andrey Smirnov

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=1476714428-11264-5-git-send-email-andrew.smirnov@gmail.com \
    --to=andrew.smirnov@gmail.com \
    --cc=cphealy@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gnurou@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@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;
as well as URLs for NNTP newsgroup(s).