All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/7] NFC: trf7970a: Fixups & convert to desc-based GPIO
@ 2017-01-20 19:17 Mark Greer
       [not found] ` <20170120191745.29255-1-mgreer-luAo+O/VEmrlveNOaEYElw@public.gmane.org>
  2017-04-25  0:19   ` Mark Greer
  0 siblings, 2 replies; 12+ messages in thread
From: Mark Greer @ 2017-01-20 19:17 UTC (permalink / raw)
  To: Samuel Ortiz, Lauro Ramos Venancio, Aloisio Almeida Jr
  Cc: linux-nfc-hn68Rpc1hR1g9hUCZPvPmw,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Mark Greer

These trf7970a driver patches do the following things:
 - a couple minor fixups
 - allow EN2 to not be managed by the driver (e.g., when its tied low by
   hardware
 - convert the driver to use the descriptor-based GPIO interface
 - remove support for 'vin-voltage-override' DT property
 - change the DTS example to indicate that EN and EN2 are active high GPIOs
 - add Mark Greer as the maintainer of the trf7970a driver

Based on k.o. 44b4b46 (Merge tag 'armsoc-fixes' of
git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc)

v2->v3:
 - Removed "[PATCH v2 5/7] NFC: trf7970a: Clean up coding style issues"
   because it will make merging patches from Geoff Lansberry and others
   hard to apply.  I will resubmit once those patches have been merged
   or rejected.
 - Added a patch to remove 'vin-voltage-override' DT property support as
   proper DT regulator set up makes it unnecessary.

v1->v2:
 - Commit description fixups only; no functional changes.

Mark Greer (7):
  NFC: trf7970a: Don't de-assert EN2 unless it was asserted
  NFC: trf7970a: Don't manage EN2 when not specified in DT
  NFC: trf7970a: Convert to descriptor based GPIO interface
  NFC: trf7970a: Remove useless comment
  NFC: trf7970a: Remove support for 'vin-voltage-override' DT property
  NFC: trf7970a: Enable pins are active high not active low
  MAINTAINERS: NFC: trf7970a: Add Mark Greer as maintainer

 .../devicetree/bindings/net/nfc/trf7970a.txt       |  6 +-
 MAINTAINERS                                        |  7 ++
 drivers/nfc/Kconfig                                |  2 +-
 drivers/nfc/trf7970a.c                             | 75 +++++++++-------------
 4 files changed, 40 insertions(+), 50 deletions(-)

-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v3 1/7] NFC: trf7970a: Don't de-assert EN2 unless it was asserted
       [not found] ` <20170120191745.29255-1-mgreer-luAo+O/VEmrlveNOaEYElw@public.gmane.org>
@ 2017-01-20 19:17   ` Mark Greer
  2017-01-20 19:17   ` [PATCH v3 2/7] NFC: trf7970a: Don't manage EN2 when not specified in DT Mark Greer
                     ` (6 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Mark Greer @ 2017-01-20 19:17 UTC (permalink / raw)
  To: Samuel Ortiz, Lauro Ramos Venancio, Aloisio Almeida Jr
  Cc: linux-nfc-hn68Rpc1hR1g9hUCZPvPmw,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Mark Greer

When the trf7970a part has the bug related to 'en2-rf-quirk',
the GPIO connected to the EN2 pin will not be asserted by the
driver when powering up so it shouldn't be de-asserted when
powering down.

Signed-off-by: Mark Greer <mgreer-luAo+O/VEmrlveNOaEYElw@public.gmane.org>
---
 drivers/nfc/trf7970a.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c
index 26c9dbbccb0c..92f3cf3e012a 100644
--- a/drivers/nfc/trf7970a.c
+++ b/drivers/nfc/trf7970a.c
@@ -1914,7 +1914,9 @@ static int trf7970a_power_down(struct trf7970a *trf)
 	}
 
 	gpio_set_value(trf->en_gpio, 0);
-	gpio_set_value(trf->en2_gpio, 0);
+
+	if (!(trf->quirks & TRF7970A_QUIRK_EN2_MUST_STAY_LOW))
+		gpio_set_value(trf->en2_gpio, 0);
 
 	ret = regulator_disable(trf->regulator);
 	if (ret)
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v3 2/7] NFC: trf7970a: Don't manage EN2 when not specified in DT
       [not found] ` <20170120191745.29255-1-mgreer-luAo+O/VEmrlveNOaEYElw@public.gmane.org>
  2017-01-20 19:17   ` [PATCH v3 1/7] NFC: trf7970a: Don't de-assert EN2 unless it was asserted Mark Greer
@ 2017-01-20 19:17   ` Mark Greer
  2017-01-20 19:17   ` [PATCH v3 3/7] NFC: trf7970a: Convert to descriptor based GPIO interface Mark Greer
                     ` (5 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Mark Greer @ 2017-01-20 19:17 UTC (permalink / raw)
  To: Samuel Ortiz, Lauro Ramos Venancio, Aloisio Almeida Jr
  Cc: linux-nfc-hn68Rpc1hR1g9hUCZPvPmw,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Mark Greer

Currently, the trf7970a driver assumes that there is a GPIO
connected to the EN2 pin of the trf7970a part; however, that
may not always be the case.  Some boards may tie EN2 low and
not connect it to a GPIO.  Support these configurations by making
the driver ignore EN2 when the second entry in the 'ti,enable-gpios'
DT property is missing (i.e., the one that specifies the GPIO for
EN2).

Signed-off-by: Mark Greer <mgreer-luAo+O/VEmrlveNOaEYElw@public.gmane.org>
---
 drivers/nfc/trf7970a.c | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c
index 92f3cf3e012a..0c0567adefcb 100644
--- a/drivers/nfc/trf7970a.c
+++ b/drivers/nfc/trf7970a.c
@@ -1884,7 +1884,8 @@ static int trf7970a_power_up(struct trf7970a *trf)
 
 	usleep_range(5000, 6000);
 
-	if (!(trf->quirks & TRF7970A_QUIRK_EN2_MUST_STAY_LOW)) {
+	if (gpio_is_valid(trf->en2_gpio) &&
+	    !(trf->quirks & TRF7970A_QUIRK_EN2_MUST_STAY_LOW)) {
 		gpio_set_value(trf->en2_gpio, 1);
 		usleep_range(1000, 2000);
 	}
@@ -1915,7 +1916,8 @@ static int trf7970a_power_down(struct trf7970a *trf)
 
 	gpio_set_value(trf->en_gpio, 0);
 
-	if (!(trf->quirks & TRF7970A_QUIRK_EN2_MUST_STAY_LOW))
+	if (gpio_is_valid(trf->en2_gpio) &&
+	    !(trf->quirks & TRF7970A_QUIRK_EN2_MUST_STAY_LOW))
 		gpio_set_value(trf->en2_gpio, 0);
 
 	ret = regulator_disable(trf->regulator);
@@ -2018,7 +2020,7 @@ static int trf7970a_probe(struct spi_device *spi)
 	if (of_property_read_bool(np, "irq-status-read-quirk"))
 		trf->quirks |= TRF7970A_QUIRK_IRQ_STATUS_READ;
 
-	/* There are two enable pins - both must be present */
+	/* There are two enable pins - only EN must be present in DT */
 	trf->en_gpio = of_get_named_gpio(np, "ti,enable-gpios", 0);
 	if (!gpio_is_valid(trf->en_gpio)) {
 		dev_err(trf->dev, "No EN GPIO property\n");
@@ -2033,21 +2035,21 @@ static int trf7970a_probe(struct spi_device *spi)
 	}
 
 	trf->en2_gpio = of_get_named_gpio(np, "ti,enable-gpios", 1);
-	if (!gpio_is_valid(trf->en2_gpio)) {
-		dev_err(trf->dev, "No EN2 GPIO property\n");
-		return trf->en2_gpio;
-	}
+	if (gpio_is_valid(trf->en2_gpio)) {
+		ret = devm_gpio_request_one(trf->dev, trf->en2_gpio,
+					    GPIOF_DIR_OUT | GPIOF_INIT_LOW,
+					    "trf7970a EN2");
+		if (ret) {
+			dev_err(trf->dev, "Can't request EN2 GPIO: %d\n", ret);
+			return ret;
+		}
 
-	ret = devm_gpio_request_one(trf->dev, trf->en2_gpio,
-			GPIOF_DIR_OUT | GPIOF_INIT_LOW, "trf7970a EN2");
-	if (ret) {
-		dev_err(trf->dev, "Can't request EN2 GPIO: %d\n", ret);
-		return ret;
+		if (of_property_read_bool(np, "en2-rf-quirk"))
+			trf->quirks |= TRF7970A_QUIRK_EN2_MUST_STAY_LOW;
+	} else {
+		dev_err(trf->dev, "No EN2 GPIO property - ignoring EN2\n");
 	}
 
-	if (of_property_read_bool(np, "en2-rf-quirk"))
-		trf->quirks |= TRF7970A_QUIRK_EN2_MUST_STAY_LOW;
-
 	ret = devm_request_threaded_irq(trf->dev, spi->irq, NULL,
 			trf7970a_irq, IRQF_TRIGGER_RISING | IRQF_ONESHOT,
 			"trf7970a", trf);
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v3 3/7] NFC: trf7970a: Convert to descriptor based GPIO interface
       [not found] ` <20170120191745.29255-1-mgreer-luAo+O/VEmrlveNOaEYElw@public.gmane.org>
  2017-01-20 19:17   ` [PATCH v3 1/7] NFC: trf7970a: Don't de-assert EN2 unless it was asserted Mark Greer
  2017-01-20 19:17   ` [PATCH v3 2/7] NFC: trf7970a: Don't manage EN2 when not specified in DT Mark Greer
@ 2017-01-20 19:17   ` Mark Greer
  2017-01-20 19:17   ` [PATCH v3 4/7] NFC: trf7970a: Remove useless comment Mark Greer
                     ` (4 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Mark Greer @ 2017-01-20 19:17 UTC (permalink / raw)
  To: Samuel Ortiz, Lauro Ramos Venancio, Aloisio Almeida Jr
  Cc: linux-nfc-hn68Rpc1hR1g9hUCZPvPmw,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Mark Greer

The trf7970a driver uses the deprecated integer-based GPIO consumer
interface so convert it to use the new descriptor-based GPIO
consumer interface.

Signed-off-by: Mark Greer <mgreer-luAo+O/VEmrlveNOaEYElw@public.gmane.org>
---
 drivers/nfc/Kconfig    |  2 +-
 drivers/nfc/trf7970a.c | 54 ++++++++++++++++++++------------------------------
 2 files changed, 23 insertions(+), 33 deletions(-)

diff --git a/drivers/nfc/Kconfig b/drivers/nfc/Kconfig
index 9d2369269abf..4deacbada74d 100644
--- a/drivers/nfc/Kconfig
+++ b/drivers/nfc/Kconfig
@@ -18,7 +18,7 @@ config NFC_WILINK
 
 config NFC_TRF7970A
 	tristate "Texas Instruments TRF7970a NFC driver"
-	depends on SPI && NFC_DIGITAL
+	depends on SPI && NFC_DIGITAL && GPIOLIB
 	help
 	  This option enables the NFC driver for Texas Instruments' TRF7970a
 	  device. Such device supports 5 different protocols: ISO14443A,
diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c
index 0c0567adefcb..bd3d9a09da0d 100644
--- a/drivers/nfc/trf7970a.c
+++ b/drivers/nfc/trf7970a.c
@@ -20,9 +20,8 @@
 #include <linux/nfc.h>
 #include <linux/skbuff.h>
 #include <linux/delay.h>
-#include <linux/gpio.h>
+#include <linux/gpio/consumer.h>
 #include <linux/of.h>
-#include <linux/of_gpio.h>
 #include <linux/spi/spi.h>
 #include <linux/regulator/consumer.h>
 
@@ -448,8 +447,8 @@ struct trf7970a {
 	u8				tx_cmd;
 	bool				issue_eof;
 	bool				adjust_resp_len;
-	int				en2_gpio;
-	int				en_gpio;
+	struct gpio_desc		*en_gpiod;
+	struct gpio_desc		*en2_gpiod;
 	struct mutex			lock;
 	unsigned int			timeout;
 	bool				ignore_timeout;
@@ -1884,13 +1883,13 @@ static int trf7970a_power_up(struct trf7970a *trf)
 
 	usleep_range(5000, 6000);
 
-	if (gpio_is_valid(trf->en2_gpio) &&
+	if (trf->en2_gpiod &&
 	    !(trf->quirks & TRF7970A_QUIRK_EN2_MUST_STAY_LOW)) {
-		gpio_set_value(trf->en2_gpio, 1);
+		gpiod_set_value_cansleep(trf->en2_gpiod, 1);
 		usleep_range(1000, 2000);
 	}
 
-	gpio_set_value(trf->en_gpio, 1);
+	gpiod_set_value_cansleep(trf->en_gpiod, 1);
 
 	usleep_range(20000, 21000);
 
@@ -1914,11 +1913,11 @@ static int trf7970a_power_down(struct trf7970a *trf)
 		return -EBUSY;
 	}
 
-	gpio_set_value(trf->en_gpio, 0);
+	gpiod_set_value_cansleep(trf->en_gpiod, 0);
 
-	if (gpio_is_valid(trf->en2_gpio) &&
+	if (trf->en2_gpiod &&
 	    !(trf->quirks & TRF7970A_QUIRK_EN2_MUST_STAY_LOW))
-		gpio_set_value(trf->en2_gpio, 0);
+		gpiod_set_value_cansleep(trf->en2_gpiod, 0);
 
 	ret = regulator_disable(trf->regulator);
 	if (ret)
@@ -2021,33 +2020,24 @@ static int trf7970a_probe(struct spi_device *spi)
 		trf->quirks |= TRF7970A_QUIRK_IRQ_STATUS_READ;
 
 	/* There are two enable pins - only EN must be present in DT */
-	trf->en_gpio = of_get_named_gpio(np, "ti,enable-gpios", 0);
-	if (!gpio_is_valid(trf->en_gpio)) {
+	trf->en_gpiod = devm_gpiod_get_index(trf->dev, "ti,enable", 0,
+					     GPIOD_OUT_LOW);
+	if (IS_ERR(trf->en_gpiod)) {
 		dev_err(trf->dev, "No EN GPIO property\n");
-		return trf->en_gpio;
+		return PTR_ERR(trf->en_gpiod);
 	}
 
-	ret = devm_gpio_request_one(trf->dev, trf->en_gpio,
-			GPIOF_DIR_OUT | GPIOF_INIT_LOW, "trf7970a EN");
-	if (ret) {
-		dev_err(trf->dev, "Can't request EN GPIO: %d\n", ret);
-		return ret;
-	}
-
-	trf->en2_gpio = of_get_named_gpio(np, "ti,enable-gpios", 1);
-	if (gpio_is_valid(trf->en2_gpio)) {
-		ret = devm_gpio_request_one(trf->dev, trf->en2_gpio,
-					    GPIOF_DIR_OUT | GPIOF_INIT_LOW,
-					    "trf7970a EN2");
-		if (ret) {
-			dev_err(trf->dev, "Can't request EN2 GPIO: %d\n", ret);
-			return ret;
-		}
-
+	trf->en2_gpiod = devm_gpiod_get_index_optional(trf->dev, "ti,enable", 1,
+						       GPIOD_OUT_LOW);
+	if (!trf->en2_gpiod) {
+		dev_err(trf->dev, "No EN2 GPIO property - ignoring EN2\n");
+	} else if (IS_ERR(trf->en2_gpiod)) {
+		dev_err(trf->dev, "Error getting EN2 GPIO property: %ld\n",
+			PTR_ERR(trf->en2_gpiod));
+		return PTR_ERR(trf->en2_gpiod);
+	} else {
 		if (of_property_read_bool(np, "en2-rf-quirk"))
 			trf->quirks |= TRF7970A_QUIRK_EN2_MUST_STAY_LOW;
-	} else {
-		dev_err(trf->dev, "No EN2 GPIO property - ignoring EN2\n");
 	}
 
 	ret = devm_request_threaded_irq(trf->dev, spi->irq, NULL,
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v3 4/7] NFC: trf7970a: Remove useless comment
       [not found] ` <20170120191745.29255-1-mgreer-luAo+O/VEmrlveNOaEYElw@public.gmane.org>
                     ` (2 preceding siblings ...)
  2017-01-20 19:17   ` [PATCH v3 3/7] NFC: trf7970a: Convert to descriptor based GPIO interface Mark Greer
@ 2017-01-20 19:17   ` Mark Greer
  2017-01-20 19:17   ` [PATCH v3 5/7] NFC: trf7970a: Remove support for 'vin-voltage-override' DT property Mark Greer
                     ` (3 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Mark Greer @ 2017-01-20 19:17 UTC (permalink / raw)
  To: Samuel Ortiz, Lauro Ramos Venancio, Aloisio Almeida Jr
  Cc: linux-nfc-hn68Rpc1hR1g9hUCZPvPmw,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Mark Greer

The last entry in the trf7970a_of_match[] table must be an empty
entry to demarcate the end of the table.  Currently, there is a
comment indicating this but it is obvious so remove the comment.

Signed-off-by: Mark Greer <mgreer-luAo+O/VEmrlveNOaEYElw@public.gmane.org>
---
 drivers/nfc/trf7970a.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c
index bd3d9a09da0d..6fd85be49365 100644
--- a/drivers/nfc/trf7970a.c
+++ b/drivers/nfc/trf7970a.c
@@ -2211,7 +2211,7 @@ static const struct dev_pm_ops trf7970a_pm_ops = {
 
 static const struct of_device_id trf7970a_of_match[] = {
 	{ .compatible = "ti,trf7970a", },
-	{ /* sentinel */ },
+	{},
 };
 MODULE_DEVICE_TABLE(of, trf7970a_of_match);
 
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v3 5/7] NFC: trf7970a: Remove support for 'vin-voltage-override' DT property
       [not found] ` <20170120191745.29255-1-mgreer-luAo+O/VEmrlveNOaEYElw@public.gmane.org>
                     ` (3 preceding siblings ...)
  2017-01-20 19:17   ` [PATCH v3 4/7] NFC: trf7970a: Remove useless comment Mark Greer
@ 2017-01-20 19:17   ` Mark Greer
       [not found]     ` <20170120191745.29255-6-mgreer-luAo+O/VEmrlveNOaEYElw@public.gmane.org>
  2017-01-20 19:17   ` [PATCH v3 6/7] NFC: trf7970a: Enable pins are active high not active low Mark Greer
                     ` (2 subsequent siblings)
  7 siblings, 1 reply; 12+ messages in thread
From: Mark Greer @ 2017-01-20 19:17 UTC (permalink / raw)
  To: Samuel Ortiz, Lauro Ramos Venancio, Aloisio Almeida Jr
  Cc: linux-nfc-hn68Rpc1hR1g9hUCZPvPmw,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Mark Greer

The 'vin-voltage-override' DT property is used by the trf7970a
driver to override the voltage presented to the driver by the
regulator subsystem.  This is unnecessary as properly specifying
the regulator chain via DT properties will accomplish the same
thing.  Therefore, remove support for 'vin-voltage-override'.

Signed-off-by: Mark Greer <mgreer-luAo+O/VEmrlveNOaEYElw@public.gmane.org>
---
 Documentation/devicetree/bindings/net/nfc/trf7970a.txt |  2 --
 drivers/nfc/trf7970a.c                                 | 11 +----------
 2 files changed, 1 insertion(+), 12 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/nfc/trf7970a.txt b/Documentation/devicetree/bindings/net/nfc/trf7970a.txt
index 32b35a07abe4..07008d334536 100644
--- a/Documentation/devicetree/bindings/net/nfc/trf7970a.txt
+++ b/Documentation/devicetree/bindings/net/nfc/trf7970a.txt
@@ -13,7 +13,6 @@ Optional SoC Specific Properties:
 - pinctrl-names: Contains only one value - "default".
 - pintctrl-0: Specifies the pin control groups used for this controller.
 - autosuspend-delay: Specify autosuspend delay in milliseconds.
-- vin-voltage-override: Specify voltage of VIN pin in microvolts.
 - irq-status-read-quirk: Specify that the trf7970a being used has the
   "IRQ Status Read" erratum.
 - en2-rf-quirk: Specify that the trf7970a being used has the "EN2 RF"
@@ -38,7 +37,6 @@ Example (for ARM-based BeagleBone with TRF7970A on SPI1):
 		ti,enable-gpios = <&gpio2 2 GPIO_ACTIVE_LOW>,
 				  <&gpio2 5 GPIO_ACTIVE_LOW>;
 		vin-supply = <&ldo3_reg>;
-		vin-voltage-override = <5000000>;
 		autosuspend-delay = <30000>;
 		irq-status-read-quirk;
 		en2-rf-quirk;
diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c
index 6fd85be49365..bc3c71daaea5 100644
--- a/drivers/nfc/trf7970a.c
+++ b/drivers/nfc/trf7970a.c
@@ -1979,12 +1979,6 @@ static int trf7970a_get_autosuspend_delay(struct device_node *np)
 	return autosuspend_delay;
 }
 
-static int trf7970a_get_vin_voltage_override(struct device_node *np,
-		u32 *vin_uvolts)
-{
-	return of_property_read_u32(np, "vin-voltage-override", vin_uvolts);
-}
-
 static int trf7970a_probe(struct spi_device *spi)
 {
 	struct device_node *np = spi->dev.of_node;
@@ -2064,10 +2058,7 @@ static int trf7970a_probe(struct spi_device *spi)
 		goto err_destroy_lock;
 	}
 
-	ret = trf7970a_get_vin_voltage_override(np, &uvolts);
-	if (ret)
-		uvolts = regulator_get_voltage(trf->regulator);
-
+	uvolts = regulator_get_voltage(trf->regulator);
 	if (uvolts > 4000000)
 		trf->chip_status_ctrl = TRF7970A_CHIP_STATUS_VRS5_3;
 
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v3 6/7] NFC: trf7970a: Enable pins are active high not active low
       [not found] ` <20170120191745.29255-1-mgreer-luAo+O/VEmrlveNOaEYElw@public.gmane.org>
                     ` (4 preceding siblings ...)
  2017-01-20 19:17   ` [PATCH v3 5/7] NFC: trf7970a: Remove support for 'vin-voltage-override' DT property Mark Greer
@ 2017-01-20 19:17   ` Mark Greer
  2017-01-20 19:17   ` [PATCH v3 7/7] MAINTAINERS: NFC: trf7970a: Add Mark Greer as maintainer Mark Greer
  2017-04-18 22:26   ` [PATCH v3 0/7] NFC: trf7970a: Fixups & convert to desc-based GPIO Mark Greer
  7 siblings, 0 replies; 12+ messages in thread
From: Mark Greer @ 2017-01-20 19:17 UTC (permalink / raw)
  To: Samuel Ortiz, Lauro Ramos Venancio, Aloisio Almeida Jr
  Cc: linux-nfc-hn68Rpc1hR1g9hUCZPvPmw,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Mark Greer

The example DTS code for the trf7970a sets the GPIOs for the EN
and EN2 pins to active low when they are really active high so
correct the error.

Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Signed-off-by: Mark Greer <mgreer-luAo+O/VEmrlveNOaEYElw@public.gmane.org>
---
 Documentation/devicetree/bindings/net/nfc/trf7970a.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/nfc/trf7970a.txt b/Documentation/devicetree/bindings/net/nfc/trf7970a.txt
index 07008d334536..28e9247d8a97 100644
--- a/Documentation/devicetree/bindings/net/nfc/trf7970a.txt
+++ b/Documentation/devicetree/bindings/net/nfc/trf7970a.txt
@@ -34,8 +34,8 @@ Example (for ARM-based BeagleBone with TRF7970A on SPI1):
 		spi-max-frequency = <2000000>;
 		interrupt-parent = <&gpio2>;
 		interrupts = <14 0>;
-		ti,enable-gpios = <&gpio2 2 GPIO_ACTIVE_LOW>,
-				  <&gpio2 5 GPIO_ACTIVE_LOW>;
+		ti,enable-gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>,
+				  <&gpio2 5 GPIO_ACTIVE_HIGH>;
 		vin-supply = <&ldo3_reg>;
 		autosuspend-delay = <30000>;
 		irq-status-read-quirk;
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v3 7/7] MAINTAINERS: NFC: trf7970a: Add Mark Greer as maintainer
       [not found] ` <20170120191745.29255-1-mgreer-luAo+O/VEmrlveNOaEYElw@public.gmane.org>
                     ` (5 preceding siblings ...)
  2017-01-20 19:17   ` [PATCH v3 6/7] NFC: trf7970a: Enable pins are active high not active low Mark Greer
@ 2017-01-20 19:17   ` Mark Greer
  2017-04-18 22:26   ` [PATCH v3 0/7] NFC: trf7970a: Fixups & convert to desc-based GPIO Mark Greer
  7 siblings, 0 replies; 12+ messages in thread
From: Mark Greer @ 2017-01-20 19:17 UTC (permalink / raw)
  To: Samuel Ortiz, Lauro Ramos Venancio, Aloisio Almeida Jr
  Cc: linux-nfc-hn68Rpc1hR1g9hUCZPvPmw,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Mark Greer

Add Mark Greer as the maintainer of the trf7970a NFC driver.

Signed-off-by: Mark Greer <mgreer-luAo+O/VEmrlveNOaEYElw@public.gmane.org>
---
 MAINTAINERS | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 26edd832c64e..5622d190ae1d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -10902,6 +10902,13 @@ F:	include/linux/power/bq27xxx_battery.h
 F:	drivers/power/supply/bq27xxx_battery.c
 F:	drivers/power/supply/bq27xxx_battery_i2c.c
 
+TI TRF7970A NFC DRIVER
+M:	Mark Greer <mgreer-luAo+O/VEmrlveNOaEYElw@public.gmane.org>
+L:	linux-nfc-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org (moderated for non-subscribers)
+S:	Supported
+F:	drivers/nfc/trf7970a.c
+F:	Documentation/devicetree/bindings/net/nfc/trf7970a.txt
+
 TIMEKEEPING, CLOCKSOURCE CORE, NTP, ALARMTIMER
 M:	John Stultz <john.stultz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
 M:	Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v3 5/7] NFC: trf7970a: Remove support for 'vin-voltage-override' DT property
       [not found]     ` <20170120191745.29255-6-mgreer-luAo+O/VEmrlveNOaEYElw@public.gmane.org>
@ 2017-01-23 16:26       ` Rob Herring
  0 siblings, 0 replies; 12+ messages in thread
From: Rob Herring @ 2017-01-23 16:26 UTC (permalink / raw)
  To: Mark Greer
  Cc: Samuel Ortiz, Lauro Ramos Venancio, Aloisio Almeida Jr,
	linux-nfc-hn68Rpc1hR1g9hUCZPvPmw,
	devicetree-u79uwXL29TY76Z2rM5mHXA

On Fri, Jan 20, 2017 at 12:17:43PM -0700, Mark Greer wrote:
> The 'vin-voltage-override' DT property is used by the trf7970a
> driver to override the voltage presented to the driver by the
> regulator subsystem.  This is unnecessary as properly specifying
> the regulator chain via DT properties will accomplish the same
> thing.  Therefore, remove support for 'vin-voltage-override'.
> 
> Signed-off-by: Mark Greer <mgreer-luAo+O/VEmrlveNOaEYElw@public.gmane.org>
> ---
>  Documentation/devicetree/bindings/net/nfc/trf7970a.txt |  2 --
>  drivers/nfc/trf7970a.c                                 | 11 +----------
>  2 files changed, 1 insertion(+), 12 deletions(-)

Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v3 0/7] NFC: trf7970a: Fixups & convert to desc-based GPIO
       [not found] ` <20170120191745.29255-1-mgreer-luAo+O/VEmrlveNOaEYElw@public.gmane.org>
                     ` (6 preceding siblings ...)
  2017-01-20 19:17   ` [PATCH v3 7/7] MAINTAINERS: NFC: trf7970a: Add Mark Greer as maintainer Mark Greer
@ 2017-04-18 22:26   ` Mark Greer
  7 siblings, 0 replies; 12+ messages in thread
From: Mark Greer @ 2017-04-18 22:26 UTC (permalink / raw)
  To: Samuel Ortiz, Lauro Ramos Venancio, Aloisio Almeida Jr
  Cc: linux-nfc-hn68Rpc1hR1g9hUCZPvPmw,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Mark Greer

On Fri, Jan 20, 2017 at 12:17:38PM -0700, Mark Greer wrote:
> These trf7970a driver patches do the following things:
>  - a couple minor fixups
>  - allow EN2 to not be managed by the driver (e.g., when its tied low by
>    hardware
>  - convert the driver to use the descriptor-based GPIO interface
>  - remove support for 'vin-voltage-override' DT property
>  - change the DTS example to indicate that EN and EN2 are active high GPIOs
>  - add Mark Greer as the maintainer of the trf7970a driver
> 
> Based on k.o. 44b4b46 (Merge tag 'armsoc-fixes' of
> git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc)
> 
> v2->v3:
>  - Removed "[PATCH v2 5/7] NFC: trf7970a: Clean up coding style issues"
>    because it will make merging patches from Geoff Lansberry and others
>    hard to apply.  I will resubmit once those patches have been merged
>    or rejected.
>  - Added a patch to remove 'vin-voltage-override' DT property support as
>    proper DT regulator set up makes it unnecessary.
> 
> v1->v2:
>  - Commit description fixups only; no functional changes.
> 
> Mark Greer (7):
>   NFC: trf7970a: Don't de-assert EN2 unless it was asserted
>   NFC: trf7970a: Don't manage EN2 when not specified in DT
>   NFC: trf7970a: Convert to descriptor based GPIO interface
>   NFC: trf7970a: Remove useless comment
>   NFC: trf7970a: Remove support for 'vin-voltage-override' DT property
>   NFC: trf7970a: Enable pins are active high not active low
>   MAINTAINERS: NFC: trf7970a: Add Mark Greer as maintainer
> 
>  .../devicetree/bindings/net/nfc/trf7970a.txt       |  6 +-
>  MAINTAINERS                                        |  7 ++
>  drivers/nfc/Kconfig                                |  2 +-
>  drivers/nfc/trf7970a.c                             | 75 +++++++++-------------
>  4 files changed, 40 insertions(+), 50 deletions(-)
> 
> -- 
> 2.11.0

Ping?
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v3 0/7] NFC: trf7970a: Fixups & convert to desc-based GPIO
       [not found] ` <20170120191745.29255-1-mgreer-luAo+O/VEmrlveNOaEYElw@public.gmane.org>
@ 2017-04-25  0:19   ` Mark Greer
  2017-01-20 19:17   ` [PATCH v3 2/7] NFC: trf7970a: Don't manage EN2 when not specified in DT Mark Greer
                     ` (6 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Mark Greer @ 2017-04-25  0:19 UTC (permalink / raw)
  To: Samuel Ortiz; +Cc: linux-nfc, devicetree, Mark Greer, linux-wireless

[-CC: Lauro Ramos Venancio <lauro.venancio@openbossa.org> and
 Aloisio Almeida Jr <aloisio.almeida@openbossa.org>]
[+CC: linux-wireless]

On Fri, Jan 20, 2017 at 12:17:38PM -0700, Mark Greer wrote:
> These trf7970a driver patches do the following things:
>  - a couple minor fixups
>  - allow EN2 to not be managed by the driver (e.g., when its tied low by
>    hardware
>  - convert the driver to use the descriptor-based GPIO interface
>  - remove support for 'vin-voltage-override' DT property
>  - change the DTS example to indicate that EN and EN2 are active high GPIOs
>  - add Mark Greer as the maintainer of the trf7970a driver
> 
> Based on k.o. 44b4b46 (Merge tag 'armsoc-fixes' of
> git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc)
> 
> v2->v3:
>  - Removed "[PATCH v2 5/7] NFC: trf7970a: Clean up coding style issues"
>    because it will make merging patches from Geoff Lansberry and others
>    hard to apply.  I will resubmit once those patches have been merged
>    or rejected.
>  - Added a patch to remove 'vin-voltage-override' DT property support as
>    proper DT regulator set up makes it unnecessary.
> 
> v1->v2:
>  - Commit description fixups only; no functional changes.
> 
> Mark Greer (7):
>   NFC: trf7970a: Don't de-assert EN2 unless it was asserted
>   NFC: trf7970a: Don't manage EN2 when not specified in DT
>   NFC: trf7970a: Convert to descriptor based GPIO interface
>   NFC: trf7970a: Remove useless comment
>   NFC: trf7970a: Remove support for 'vin-voltage-override' DT property
>   NFC: trf7970a: Enable pins are active high not active low
>   MAINTAINERS: NFC: trf7970a: Add Mark Greer as maintainer
> 
>  .../devicetree/bindings/net/nfc/trf7970a.txt       |  6 +-
>  MAINTAINERS                                        |  7 ++
>  drivers/nfc/Kconfig                                |  2 +-
>  drivers/nfc/trf7970a.c                             | 75 +++++++++-------------
>  4 files changed, 40 insertions(+), 50 deletions(-)


I've already mentioned this to Samuel privately but for everyone's sake,
I will respin this series because some patches that cause conflicts have
been accepted.  I will also add some patches that I have made in the
interim.  I apologize for the churn.

Mark
--

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

* Re: [PATCH v3 0/7] NFC: trf7970a: Fixups & convert to desc-based GPIO
@ 2017-04-25  0:19   ` Mark Greer
  0 siblings, 0 replies; 12+ messages in thread
From: Mark Greer @ 2017-04-25  0:19 UTC (permalink / raw)
  To: Samuel Ortiz
  Cc: linux-nfc-hn68Rpc1hR1g9hUCZPvPmw,
	devicetree-u79uwXL29TY76Z2rM5mHXA, Mark Greer,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA

[-CC: Lauro Ramos Venancio <lauro.venancio-430g2QfJUUCGglJvpFV4uA@public.gmane.org> and
 Aloisio Almeida Jr <aloisio.almeida-430g2QfJUUCGglJvpFV4uA@public.gmane.org>]
[+CC: linux-wireless]

On Fri, Jan 20, 2017 at 12:17:38PM -0700, Mark Greer wrote:
> These trf7970a driver patches do the following things:
>  - a couple minor fixups
>  - allow EN2 to not be managed by the driver (e.g., when its tied low by
>    hardware
>  - convert the driver to use the descriptor-based GPIO interface
>  - remove support for 'vin-voltage-override' DT property
>  - change the DTS example to indicate that EN and EN2 are active high GPIOs
>  - add Mark Greer as the maintainer of the trf7970a driver
> 
> Based on k.o. 44b4b46 (Merge tag 'armsoc-fixes' of
> git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc)
> 
> v2->v3:
>  - Removed "[PATCH v2 5/7] NFC: trf7970a: Clean up coding style issues"
>    because it will make merging patches from Geoff Lansberry and others
>    hard to apply.  I will resubmit once those patches have been merged
>    or rejected.
>  - Added a patch to remove 'vin-voltage-override' DT property support as
>    proper DT regulator set up makes it unnecessary.
> 
> v1->v2:
>  - Commit description fixups only; no functional changes.
> 
> Mark Greer (7):
>   NFC: trf7970a: Don't de-assert EN2 unless it was asserted
>   NFC: trf7970a: Don't manage EN2 when not specified in DT
>   NFC: trf7970a: Convert to descriptor based GPIO interface
>   NFC: trf7970a: Remove useless comment
>   NFC: trf7970a: Remove support for 'vin-voltage-override' DT property
>   NFC: trf7970a: Enable pins are active high not active low
>   MAINTAINERS: NFC: trf7970a: Add Mark Greer as maintainer
> 
>  .../devicetree/bindings/net/nfc/trf7970a.txt       |  6 +-
>  MAINTAINERS                                        |  7 ++
>  drivers/nfc/Kconfig                                |  2 +-
>  drivers/nfc/trf7970a.c                             | 75 +++++++++-------------
>  4 files changed, 40 insertions(+), 50 deletions(-)


I've already mentioned this to Samuel privately but for everyone's sake,
I will respin this series because some patches that cause conflicts have
been accepted.  I will also add some patches that I have made in the
interim.  I apologize for the churn.

Mark
--

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

end of thread, other threads:[~2017-04-25  0:26 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-20 19:17 [PATCH v3 0/7] NFC: trf7970a: Fixups & convert to desc-based GPIO Mark Greer
     [not found] ` <20170120191745.29255-1-mgreer-luAo+O/VEmrlveNOaEYElw@public.gmane.org>
2017-01-20 19:17   ` [PATCH v3 1/7] NFC: trf7970a: Don't de-assert EN2 unless it was asserted Mark Greer
2017-01-20 19:17   ` [PATCH v3 2/7] NFC: trf7970a: Don't manage EN2 when not specified in DT Mark Greer
2017-01-20 19:17   ` [PATCH v3 3/7] NFC: trf7970a: Convert to descriptor based GPIO interface Mark Greer
2017-01-20 19:17   ` [PATCH v3 4/7] NFC: trf7970a: Remove useless comment Mark Greer
2017-01-20 19:17   ` [PATCH v3 5/7] NFC: trf7970a: Remove support for 'vin-voltage-override' DT property Mark Greer
     [not found]     ` <20170120191745.29255-6-mgreer-luAo+O/VEmrlveNOaEYElw@public.gmane.org>
2017-01-23 16:26       ` Rob Herring
2017-01-20 19:17   ` [PATCH v3 6/7] NFC: trf7970a: Enable pins are active high not active low Mark Greer
2017-01-20 19:17   ` [PATCH v3 7/7] MAINTAINERS: NFC: trf7970a: Add Mark Greer as maintainer Mark Greer
2017-04-18 22:26   ` [PATCH v3 0/7] NFC: trf7970a: Fixups & convert to desc-based GPIO Mark Greer
2017-04-25  0:19 ` Mark Greer
2017-04-25  0:19   ` Mark Greer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.