diff options
author | Christophe Ricard <christophe.ricard@gmail.com> | 2015-12-23 17:45:26 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2015-12-29 13:06:23 -0500 |
commit | 97b69788971de8af994ba570d56c455e79eaf35e (patch) | |
tree | 1446097beb21b146ed8ab2f0d7efe7a600dba9cb /drivers/nfc | |
parent | be103b714e4e6ad7316b0cb9b9d473ddedaf4ad6 (diff) |
nfc: pn544: 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/pn544/i2c.c | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/drivers/nfc/pn544/i2c.c b/drivers/nfc/pn544/i2c.c index 534c79fee1b7..76c318444304 100644 --- a/drivers/nfc/pn544/i2c.c +++ b/drivers/nfc/pn544/i2c.c | |||
@@ -166,7 +166,6 @@ struct pn544_i2c_phy { | |||
166 | struct nfc_hci_dev *hdev; | 166 | struct nfc_hci_dev *hdev; |
167 | 167 | ||
168 | unsigned int gpio_en; | 168 | unsigned int gpio_en; |
169 | unsigned int gpio_irq; | ||
170 | unsigned int gpio_fw; | 169 | unsigned int gpio_fw; |
171 | unsigned int en_polarity; | 170 | unsigned int en_polarity; |
172 | 171 | ||
@@ -879,9 +878,8 @@ static int pn544_hci_i2c_acpi_request_resources(struct i2c_client *client) | |||
879 | { | 878 | { |
880 | struct pn544_i2c_phy *phy = i2c_get_clientdata(client); | 879 | struct pn544_i2c_phy *phy = i2c_get_clientdata(client); |
881 | const struct acpi_device_id *id; | 880 | const struct acpi_device_id *id; |
882 | struct gpio_desc *gpiod_en, *gpiod_irq, *gpiod_fw; | 881 | struct gpio_desc *gpiod_en, *gpiod_fw; |
883 | struct device *dev; | 882 | struct device *dev; |
884 | int ret; | ||
885 | 883 | ||
886 | if (!client) | 884 | if (!client) |
887 | return -EINVAL; | 885 | return -EINVAL; |
@@ -914,27 +912,6 @@ static int pn544_hci_i2c_acpi_request_resources(struct i2c_client *client) | |||
914 | 912 | ||
915 | phy->gpio_fw = desc_to_gpio(gpiod_fw); | 913 | phy->gpio_fw = desc_to_gpio(gpiod_fw); |
916 | 914 | ||
917 | /* Get IRQ GPIO */ | ||
918 | gpiod_irq = devm_gpiod_get_index(dev, PN544_GPIO_NAME_IRQ, 0, | ||
919 | GPIOD_IN); | ||
920 | if (IS_ERR(gpiod_irq)) { | ||
921 | nfc_err(dev, "Unable to get IRQ GPIO\n"); | ||
922 | return -ENODEV; | ||
923 | } | ||
924 | |||
925 | phy->gpio_irq = desc_to_gpio(gpiod_irq); | ||
926 | |||
927 | /* Map the pin to an IRQ */ | ||
928 | ret = gpiod_to_irq(gpiod_irq); | ||
929 | if (ret < 0) { | ||
930 | nfc_err(dev, "Fail pin IRQ mapping\n"); | ||
931 | return ret; | ||
932 | } | ||
933 | |||
934 | nfc_info(dev, "GPIO resource, no:%d irq:%d\n", | ||
935 | desc_to_gpio(gpiod_irq), ret); | ||
936 | client->irq = ret; | ||
937 | |||
938 | return 0; | 915 | return 0; |
939 | } | 916 | } |
940 | 917 | ||
@@ -994,15 +971,6 @@ static int pn544_hci_i2c_of_request_resources(struct i2c_client *client) | |||
994 | goto err_gpio_fw; | 971 | goto err_gpio_fw; |
995 | } | 972 | } |
996 | 973 | ||
997 | /* IRQ */ | ||
998 | ret = irq_of_parse_and_map(pp, 0); | ||
999 | if (ret < 0) { | ||
1000 | nfc_err(&client->dev, | ||
1001 | "Unable to get irq, error: %d\n", ret); | ||
1002 | goto err_gpio_fw; | ||
1003 | } | ||
1004 | client->irq = ret; | ||
1005 | |||
1006 | return 0; | 974 | return 0; |
1007 | 975 | ||
1008 | err_gpio_fw: | 976 | err_gpio_fw: |
@@ -1065,7 +1033,6 @@ static int pn544_hci_i2c_probe(struct i2c_client *client, | |||
1065 | 1033 | ||
1066 | phy->gpio_en = pdata->get_gpio(NFC_GPIO_ENABLE); | 1034 | phy->gpio_en = pdata->get_gpio(NFC_GPIO_ENABLE); |
1067 | phy->gpio_fw = pdata->get_gpio(NFC_GPIO_FW_RESET); | 1035 | phy->gpio_fw = pdata->get_gpio(NFC_GPIO_FW_RESET); |
1068 | phy->gpio_irq = pdata->get_gpio(NFC_GPIO_IRQ); | ||
1069 | /* Using ACPI */ | 1036 | /* Using ACPI */ |
1070 | } else if (ACPI_HANDLE(&client->dev)) { | 1037 | } else if (ACPI_HANDLE(&client->dev)) { |
1071 | r = pn544_hci_i2c_acpi_request_resources(client); | 1038 | r = pn544_hci_i2c_acpi_request_resources(client); |