All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Burton <paul.burton@imgtec.com>
To: <netdev@vger.kernel.org>
Cc: Tobias Klauser <tklauser@distanz.ch>,
	"David S . Miller" <davem@davemloft.net>,
	Jarod Wilson <jarod@redhat.com>, <linux-mips@linux-mips.org>,
	Eric Dumazet <edumazet@google.com>,
	Paul Burton <paul.burton@imgtec.com>
Subject: [PATCH v3 1/7] net: pch_gbe: Mark Minnow PHY reset GPIO active low
Date: Fri, 2 Jun 2017 16:40:36 -0700	[thread overview]
Message-ID: <20170602234042.22782-2-paul.burton@imgtec.com> (raw)
In-Reply-To: <20170602234042.22782-1-paul.burton@imgtec.com>

The Minnow PHY reset GPIO is set to 0 to enter reset & 1 to leave reset
- that is, it is an active low GPIO. In order to allow for the code to
be made more generic by further patches, indicate to the GPIO subsystem
that the GPIO is active low & invert the values it is set to such that
they reflect logically whether the device is being reset or not.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jarod Wilson <jarod@redhat.com>
Cc: Tobias Klauser <tklauser@distanz.ch>
Cc: linux-mips@linux-mips.org
Cc: netdev@vger.kernel.org
---

Changes in v3: None
Changes in v2: None

 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
index 5ae9681a2da7..d38198718005 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
@@ -2696,7 +2696,8 @@ static int pch_gbe_probe(struct pci_dev *pdev,
  */
 static int pch_gbe_minnow_platform_init(struct pci_dev *pdev)
 {
-	unsigned long flags = GPIOF_DIR_OUT | GPIOF_INIT_HIGH | GPIOF_EXPORT;
+	unsigned long flags = GPIOF_DIR_OUT | GPIOF_INIT_LOW |
+		GPIOF_EXPORT | GPIOF_ACTIVE_LOW;
 	unsigned gpio = MINNOW_PHY_RESET_GPIO;
 	int ret;
 
@@ -2708,10 +2709,10 @@ static int pch_gbe_minnow_platform_init(struct pci_dev *pdev)
 		return ret;
 	}
 
-	gpio_set_value(gpio, 0);
-	usleep_range(1250, 1500);
 	gpio_set_value(gpio, 1);
 	usleep_range(1250, 1500);
+	gpio_set_value(gpio, 0);
+	usleep_range(1250, 1500);
 
 	return ret;
 }
-- 
2.13.0

WARNING: multiple messages have this Message-ID (diff)
From: Paul Burton <paul.burton@imgtec.com>
To: netdev@vger.kernel.org
Cc: Tobias Klauser <tklauser@distanz.ch>,
	"David S . Miller" <davem@davemloft.net>,
	Jarod Wilson <jarod@redhat.com>,
	linux-mips@linux-mips.org, Eric Dumazet <edumazet@google.com>,
	Paul Burton <paul.burton@imgtec.com>
Subject: [PATCH v3 1/7] net: pch_gbe: Mark Minnow PHY reset GPIO active low
Date: Fri, 2 Jun 2017 16:40:36 -0700	[thread overview]
Message-ID: <20170602234042.22782-2-paul.burton@imgtec.com> (raw)
Message-ID: <20170602234036.Fs1ocR-2MEcMgvTp-0vqg0CiOThtoxrtPqq9XtzopjQ@z> (raw)
In-Reply-To: <20170602234042.22782-1-paul.burton@imgtec.com>

The Minnow PHY reset GPIO is set to 0 to enter reset & 1 to leave reset
- that is, it is an active low GPIO. In order to allow for the code to
be made more generic by further patches, indicate to the GPIO subsystem
that the GPIO is active low & invert the values it is set to such that
they reflect logically whether the device is being reset or not.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jarod Wilson <jarod@redhat.com>
Cc: Tobias Klauser <tklauser@distanz.ch>
Cc: linux-mips@linux-mips.org
Cc: netdev@vger.kernel.org
---

Changes in v3: None
Changes in v2: None

 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
index 5ae9681a2da7..d38198718005 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
@@ -2696,7 +2696,8 @@ static int pch_gbe_probe(struct pci_dev *pdev,
  */
 static int pch_gbe_minnow_platform_init(struct pci_dev *pdev)
 {
-	unsigned long flags = GPIOF_DIR_OUT | GPIOF_INIT_HIGH | GPIOF_EXPORT;
+	unsigned long flags = GPIOF_DIR_OUT | GPIOF_INIT_LOW |
+		GPIOF_EXPORT | GPIOF_ACTIVE_LOW;
 	unsigned gpio = MINNOW_PHY_RESET_GPIO;
 	int ret;
 
@@ -2708,10 +2709,10 @@ static int pch_gbe_minnow_platform_init(struct pci_dev *pdev)
 		return ret;
 	}
 
-	gpio_set_value(gpio, 0);
-	usleep_range(1250, 1500);
 	gpio_set_value(gpio, 1);
 	usleep_range(1250, 1500);
+	gpio_set_value(gpio, 0);
+	usleep_range(1250, 1500);
 
 	return ret;
 }
-- 
2.13.0

  reply	other threads:[~2017-06-02 23:41 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-02 23:40 [PATCH v3 0/7] net: pch_gbe: Fixes & MIPS support Paul Burton
2017-06-02 23:40 ` Paul Burton
2017-06-02 23:40 ` Paul Burton [this message]
2017-06-02 23:40   ` [PATCH v3 1/7] net: pch_gbe: Mark Minnow PHY reset GPIO active low Paul Burton
2017-06-02 23:40 ` [PATCH v3 2/7] net: pch_gbe: Pull PHY GPIO handling out of Minnow code Paul Burton
2017-06-02 23:40   ` Paul Burton
2017-06-03 17:52   ` Andrew Lunn
2017-06-05 17:21     ` Paul Burton
2017-06-05 17:21       ` Paul Burton
2017-06-05 18:43       ` Andrew Lunn
     [not found] ` <20170602234042.22782-1-paul.burton-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2017-06-02 23:40   ` [PATCH v3 3/7] dt-bindings: net: Document Intel pch_gbe binding Paul Burton
2017-06-02 23:40     ` Paul Burton
2017-06-02 23:40     ` Paul Burton
2017-06-02 23:40     ` Paul Burton
2017-06-02 23:40 ` [PATCH v3 4/7] net: pch_gbe: Add device tree support Paul Burton
2017-06-02 23:40   ` Paul Burton
2017-06-03  6:36   ` kbuild test robot
2017-06-03  6:36     ` kbuild test robot
2017-06-03  6:36   ` [PATCH] net: pch_gbe: fix err_cast.cocci warnings kbuild test robot
2017-06-03  6:36     ` kbuild test robot
2017-06-02 23:40 ` [PATCH v3 5/7] net: pch_gbe: Always reset PHY along with MAC Paul Burton
2017-06-02 23:40   ` Paul Burton
2017-06-02 23:40 ` [PATCH v3 6/7] net: pch_gbe: Allow longer for resets Paul Burton
2017-06-02 23:40   ` Paul Burton
2017-06-06 14:10   ` Marcin Nowakowski
2017-06-06 14:10     ` Marcin Nowakowski
2017-06-02 23:40 ` [PATCH v3 7/7] net: pch_gbe: Allow build on MIPS platforms Paul Burton
2017-06-02 23:40   ` Paul Burton
2017-06-05 17:31 ` [PATCH v4 0/7] net: pch_gbe: Fixes & MIPS support Paul Burton
2017-06-05 17:31   ` Paul Burton
2017-06-05 17:31   ` [PATCH v4 1/7] net: pch_gbe: Mark Minnow PHY reset GPIO active low Paul Burton
2017-06-05 17:31     ` Paul Burton
2017-06-05 17:31   ` [PATCH v4 2/7] net: pch_gbe: Pull PHY GPIO handling out of Minnow code Paul Burton
2017-06-05 17:31     ` Paul Burton
2017-06-05 18:55     ` Andrew Lunn
     [not found]   ` <20170605173136.10795-1-paul.burton-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2017-06-05 17:31     ` [PATCH v4 3/7] dt-bindings: net: Document Intel pch_gbe binding Paul Burton
2017-06-05 17:31       ` Paul Burton
2017-06-05 17:31       ` Paul Burton
2017-06-05 17:31       ` Paul Burton
     [not found]       ` <20170605173136.10795-4-paul.burton-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2017-06-05 18:45         ` Sergei Shtylyov
2017-06-05 18:45           ` Sergei Shtylyov
2017-06-09 13:21         ` Rob Herring
2017-06-09 13:21           ` Rob Herring
2017-06-05 17:31   ` [PATCH v4 4/7] net: pch_gbe: Add device tree support Paul Burton
2017-06-05 17:31     ` Paul Burton
2017-06-05 18:54     ` Andrew Lunn
2017-06-05 17:31   ` [PATCH v4 5/7] net: pch_gbe: Always reset PHY along with MAC Paul Burton
2017-06-05 17:31     ` Paul Burton
2017-06-05 17:31   ` [PATCH v4 6/7] net: pch_gbe: Allow longer for resets Paul Burton
2017-06-05 17:31     ` Paul Burton
2017-06-05 17:31   ` [PATCH v4 7/7] net: pch_gbe: Allow build on MIPS platforms Paul Burton
2017-06-05 17:31     ` Paul Burton

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=20170602234042.22782-2-paul.burton@imgtec.com \
    --to=paul.burton@imgtec.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jarod@redhat.com \
    --cc=linux-mips@linux-mips.org \
    --cc=netdev@vger.kernel.org \
    --cc=tklauser@distanz.ch \
    /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 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.