[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230607170009.9458-2-giorgi.marco.96@disroot.org>
Date: Wed, 7 Jun 2023 19:00:08 +0200
From: Marco Giorgi <giorgi.marco.96@...root.org>
To: netdev@...r.kernel.org
Cc: krzysztof.kozlowski@...aro.org,
u.kleine-koenig@...gutronix.de,
davem@...emloft.net,
michael@...le.cc,
kuba@...nel.org,
linux-kernel@...r.kernel.org,
Marco Giorgi <giorgi.marco.96@...root.org>
Subject: [PATCH RFC net 1/2] nfc: nxp-nci: Fix i2c read on ThinkPad hardware
Add the IRQ GPIO configuration.
Signed-off-by: Marco Giorgi <giorgi.marco.96@...root.org>
---
drivers/nfc/nxp-nci/i2c.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
index d4c299be7949..4ba26a958258 100644
--- a/drivers/nfc/nxp-nci/i2c.c
+++ b/drivers/nfc/nxp-nci/i2c.c
@@ -35,6 +35,7 @@ struct nxp_nci_i2c_phy {
struct gpio_desc *gpiod_en;
struct gpio_desc *gpiod_fw;
+ struct gpio_desc *gpiod_irq;
int hard_fault; /*
* < 0 if hardware error occurred (e.g. i2c err)
@@ -254,10 +255,12 @@ static irqreturn_t nxp_nci_i2c_irq_thread_fn(int irq, void *phy_id)
return IRQ_NONE;
}
+static const struct acpi_gpio_params irq_gpios = { 0, 0, false };
static const struct acpi_gpio_params firmware_gpios = { 1, 0, false };
static const struct acpi_gpio_params enable_gpios = { 2, 0, false };
static const struct acpi_gpio_mapping acpi_nxp_nci_gpios[] = {
+ { "irq-gpios", &irq_gpios, 1 },
{ "enable-gpios", &enable_gpios, 1 },
{ "firmware-gpios", &firmware_gpios, 1 },
{ }
@@ -286,6 +289,12 @@ static int nxp_nci_i2c_probe(struct i2c_client *client)
if (r)
dev_dbg(dev, "Unable to add GPIO mapping table\n");
+ phy->gpiod_irq = devm_gpiod_get(dev, "irq", GPIOD_IN);
+ if (IS_ERR(phy->gpiod_irq)) {
+ nfc_err(dev, "Failed to get IRQ gpio\n");
+ return PTR_ERR(phy->gpiod_irq);
+ }
+
phy->gpiod_en = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW);
if (IS_ERR(phy->gpiod_en)) {
nfc_err(dev, "Failed to get EN gpio\n");
--
2.41.0
Powered by blists - more mailing lists