All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergio Paracuellos <sergio.paracuellos@gmail.com>
To: gregkh@linuxfoundation.org
Cc: ryder.lee@mediatek.com, driverdev-devel@linuxdriverproject.org,
	weijie.gao@mediatek.com, gerg@kernel.org, neil@brown.name
Subject: [PATCH v2 5/5] staging: mt7621-pci: release gpios after pci initialization
Date: Wed, 11 Mar 2020 19:58:08 +0100	[thread overview]
Message-ID: <20200311185808.29166-6-sergio.paracuellos@gmail.com> (raw)
In-Reply-To: <20200311185808.29166-1-sergio.paracuellos@gmail.com>

R3G's LEDs fail to initialize because one of them uses GPIO8
Hence, release the GPIO resources after PCIe initialization.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/mt7621-pci/pci-mt7621.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c
index 0880a21f2620..8399e4629e38 100644
--- a/drivers/staging/mt7621-pci/pci-mt7621.c
+++ b/drivers/staging/mt7621-pci/pci-mt7621.c
@@ -482,6 +482,14 @@ static void mt7621_pcie_reset_ep_deassert(struct mt7621_pcie *pcie)
 	mdelay(PERST_DELAY_US);
 }
 
+static void mt7621_pcie_release_gpios(struct mt7621_pcie *pcie)
+{
+	struct mt7621_pcie_port *port;
+
+	list_for_each_entry(port, &pcie->ports, list)
+		gpiod_put(port->gpio_rst);
+}
+
 static void mt7621_pcie_init_ports(struct mt7621_pcie *pcie)
 {
 	struct device *dev = pcie->dev;
@@ -706,6 +714,8 @@ static int mt7621_pci_probe(struct platform_device *pdev)
 		return err;
 	}
 
+	mt7621_pcie_release_gpios(pcie);
+
 	return 0;
 }
 
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  parent reply	other threads:[~2020-03-11 18:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11 18:58 [PATCH v2 0/5] staging: mt7621-pci: re-do reset boot process Sergio Paracuellos
2020-03-11 18:58 ` [PATCH v2 1/5] staging: mt7621-pci: use gpios for properly reset Sergio Paracuellos
2020-03-11 18:58 ` [PATCH v2 2/5] staging: mt7621-pci: change value for 'PERST_DELAY_US' Sergio Paracuellos
2020-03-11 18:58 ` [PATCH v2 3/5] staging: mt7621-dts: make use of 'reset-gpios' property for pci Sergio Paracuellos
2020-03-11 18:58 ` [PATCH v2 4/5] staging: mt7621-pci: bindings: update doc accordly to last changes Sergio Paracuellos
2020-03-11 18:58 ` Sergio Paracuellos [this message]
2020-03-12  4:56 ` [PATCH v2 0/5] staging: mt7621-pci: re-do reset boot process Greg Ungerer
2020-03-12  6:29   ` Sergio Paracuellos

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=20200311185808.29166-6-sergio.paracuellos@gmail.com \
    --to=sergio.paracuellos@gmail.com \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gerg@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=neil@brown.name \
    --cc=ryder.lee@mediatek.com \
    --cc=weijie.gao@mediatek.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 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.