From: Paul Burton <paul.burton@imgtec.com>
To: <linux-mips@linux-mips.org>, Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Burton <paul.burton@imgtec.com>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH v2 2/6] net: pch_gbe: Mark Minnow PHY reset GPIO active low
Date: Wed, 3 Feb 2016 12:02:40 +0000 [thread overview]
Message-ID: <1454500964-6256-3-git-send-email-paul.burton@imgtec.com> (raw)
In-Reply-To: <1454500964-6256-1-git-send-email-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>
---
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 3b98b263b..fde4c11 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
@@ -2717,7 +2717,8 @@ err_free_netdev:
*/
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;
@@ -2729,10 +2730,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.7.0
next prev parent reply other threads:[~2016-02-03 12:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-03 12:02 [PATCH v2 0/6] pch_gbe fixes for Imagination Technologies MIPS Boston Paul Burton
2016-02-03 12:02 ` [PATCH v2 1/6] net: pch_gbe: Allow build on MIPS platforms Paul Burton
2016-02-03 12:02 ` Paul Burton [this message]
2016-02-03 12:02 ` [PATCH v2 3/6] net: pch_gbe: Pull PHY GPIO handling out of Minnow code Paul Burton
2016-02-03 14:36 ` kbuild test robot
2016-02-03 12:02 ` [PATCH v2 4/6] net: pch_gbe: Always reset PHY along with MAC Paul Burton
2016-02-03 12:02 ` [PATCH v2 5/6] net: pch_gbe: Add device tree support Paul Burton
2016-02-03 12:02 ` [PATCH v2 6/6] net: pch_gbe: Allow longer for resets Paul Burton
2016-02-03 16:51 ` David Laight
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=1454500964-6256-3-git-send-email-paul.burton@imgtec.com \
--to=paul.burton@imgtec.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=netdev@vger.kernel.org \
--cc=ralf@linux-mips.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
all inboxes | Powered by JetHome®