aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nfc
diff options
context:
space:
mode:
authorChristophe Ricard <christophe.ricard@gmail.com>2015-12-23 17:45:25 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2015-12-29 13:06:22 -0500
commitbe103b714e4e6ad7316b0cb9b9d473ddedaf4ad6 (patch)
tree1d4df970dc5db4831709555fd2625f9b9fcab7eb /drivers/nfc
parent7be4fb643ef2d1058b897ba9dbe17bf5ced04391 (diff)
nfc: nxp-nci: Remove i2c client gpio irq configuration
gpio irq is already configured by the core i2c layers when reaching the probe function. Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/nfc')
-rw-r--r--drivers/nfc/nxp-nci/i2c.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
index c71adc3254df..11520f472f98 100644
--- a/drivers/nfc/nxp-nci/i2c.c
+++ b/drivers/nfc/nxp-nci/i2c.c
@@ -52,7 +52,6 @@ struct nxp_nci_i2c_phy {
52 52
53 unsigned int gpio_en; 53 unsigned int gpio_en;
54 unsigned int gpio_fw; 54 unsigned int gpio_fw;
55 unsigned int gpio_irq;
56 55
57 int hard_fault; /* 56 int hard_fault; /*
58 * < 0 if hardware error occurred (e.g. i2c err) 57 * < 0 if hardware error occurred (e.g. i2c err)
@@ -292,39 +291,24 @@ static int nxp_nci_i2c_parse_devtree(struct i2c_client *client)
292 } 291 }
293 phy->gpio_fw = r; 292 phy->gpio_fw = r;
294 293
295 r = irq_of_parse_and_map(pp, 0);
296 if (r < 0) {
297 nfc_err(&client->dev, "Unable to get irq, error: %d\n", r);
298 return r;
299 }
300 client->irq = r;
301
302 return 0; 294 return 0;
303} 295}
304 296
305static int nxp_nci_i2c_acpi_config(struct nxp_nci_i2c_phy *phy) 297static int nxp_nci_i2c_acpi_config(struct nxp_nci_i2c_phy *phy)
306{ 298{
307 struct i2c_client *client = phy->i2c_dev; 299 struct i2c_client *client = phy->i2c_dev;
308 struct gpio_desc *gpiod_en, *gpiod_fw, *gpiod_irq; 300 struct gpio_desc *gpiod_en, *gpiod_fw;
309 301
310 gpiod_en = devm_gpiod_get_index(&client->dev, NULL, 2, GPIOD_OUT_LOW); 302 gpiod_en = devm_gpiod_get_index(&client->dev, NULL, 2, GPIOD_OUT_LOW);
311 gpiod_fw = devm_gpiod_get_index(&client->dev, NULL, 1, GPIOD_OUT_LOW); 303 gpiod_fw = devm_gpiod_get_index(&client->dev, NULL, 1, GPIOD_OUT_LOW);
312 gpiod_irq = devm_gpiod_get_index(&client->dev, NULL, 0, GPIOD_IN);
313 304
314 if (IS_ERR(gpiod_en) || IS_ERR(gpiod_fw) || IS_ERR(gpiod_irq)) { 305 if (IS_ERR(gpiod_en) || IS_ERR(gpiod_fw)) {
315 nfc_err(&client->dev, "No GPIOs\n"); 306 nfc_err(&client->dev, "No GPIOs\n");
316 return -EINVAL; 307 return -EINVAL;
317 } 308 }
318 309
319 client->irq = gpiod_to_irq(gpiod_irq);
320 if (client->irq < 0) {
321 nfc_err(&client->dev, "No IRQ\n");
322 return -EINVAL;
323 }
324
325 phy->gpio_en = desc_to_gpio(gpiod_en); 310 phy->gpio_en = desc_to_gpio(gpiod_en);
326 phy->gpio_fw = desc_to_gpio(gpiod_fw); 311 phy->gpio_fw = desc_to_gpio(gpiod_fw);
327 phy->gpio_irq = desc_to_gpio(gpiod_irq);
328 312
329 return 0; 313 return 0;
330} 314}
@@ -363,7 +347,6 @@ static int nxp_nci_i2c_probe(struct i2c_client *client,
363 } else if (pdata) { 347 } else if (pdata) {
364 phy->gpio_en = pdata->gpio_en; 348 phy->gpio_en = pdata->gpio_en;
365 phy->gpio_fw = pdata->gpio_fw; 349 phy->gpio_fw = pdata->gpio_fw;
366 client->irq = pdata->irq;
367 } else if (ACPI_HANDLE(&client->dev)) { 350 } else if (ACPI_HANDLE(&client->dev)) {
368 r = nxp_nci_i2c_acpi_config(phy); 351 r = nxp_nci_i2c_acpi_config(phy);
369 if (r < 0) 352 if (r < 0)