diff options
-rw-r--r-- | drivers/nfc/st-nci/i2c.c | 17 | ||||
-rw-r--r-- | drivers/nfc/st-nci/spi.c | 17 |
2 files changed, 26 insertions, 8 deletions
diff --git a/drivers/nfc/st-nci/i2c.c b/drivers/nfc/st-nci/i2c.c index 6645972377af..a6a1977e57c5 100644 --- a/drivers/nfc/st-nci/i2c.c +++ b/drivers/nfc/st-nci/i2c.c | |||
@@ -214,6 +214,7 @@ static int st_nci_i2c_acpi_request_resources(struct i2c_client *client) | |||
214 | const struct acpi_device_id *id; | 214 | const struct acpi_device_id *id; |
215 | struct gpio_desc *gpiod_reset; | 215 | struct gpio_desc *gpiod_reset; |
216 | struct device *dev; | 216 | struct device *dev; |
217 | u8 tmp; | ||
217 | 218 | ||
218 | if (!client) | 219 | if (!client) |
219 | return -EINVAL; | 220 | return -EINVAL; |
@@ -237,10 +238,18 @@ static int st_nci_i2c_acpi_request_resources(struct i2c_client *client) | |||
237 | 238 | ||
238 | phy->irq_polarity = irq_get_trigger_type(client->irq); | 239 | phy->irq_polarity = irq_get_trigger_type(client->irq); |
239 | 240 | ||
240 | phy->se_status.is_ese_present = | 241 | phy->se_status.is_ese_present = false; |
241 | device_property_present(dev, "ese-present"); | 242 | phy->se_status.is_uicc_present = false; |
242 | phy->se_status.is_uicc_present = | 243 | |
243 | device_property_present(dev, "uicc-present"); | 244 | if (device_property_present(dev, "ese-present")) { |
245 | device_property_read_u8(dev, "ese-present", &tmp); | ||
246 | phy->se_status.is_ese_present = tmp; | ||
247 | } | ||
248 | |||
249 | if (device_property_present(dev, "uicc-present")) { | ||
250 | device_property_read_u8(dev, "uicc-present", &tmp); | ||
251 | phy->se_status.is_uicc_present = tmp; | ||
252 | } | ||
244 | 253 | ||
245 | return 0; | 254 | return 0; |
246 | } | 255 | } |
diff --git a/drivers/nfc/st-nci/spi.c b/drivers/nfc/st-nci/spi.c index e015015c5dc9..51a863f0a987 100644 --- a/drivers/nfc/st-nci/spi.c +++ b/drivers/nfc/st-nci/spi.c | |||
@@ -229,6 +229,7 @@ static int st_nci_spi_acpi_request_resources(struct spi_device *spi_dev) | |||
229 | const struct acpi_device_id *id; | 229 | const struct acpi_device_id *id; |
230 | struct gpio_desc *gpiod_reset; | 230 | struct gpio_desc *gpiod_reset; |
231 | struct device *dev; | 231 | struct device *dev; |
232 | u8 tmp; | ||
232 | 233 | ||
233 | if (!spi_dev) | 234 | if (!spi_dev) |
234 | return -EINVAL; | 235 | return -EINVAL; |
@@ -252,10 +253,18 @@ static int st_nci_spi_acpi_request_resources(struct spi_device *spi_dev) | |||
252 | 253 | ||
253 | phy->irq_polarity = irq_get_trigger_type(spi_dev->irq); | 254 | phy->irq_polarity = irq_get_trigger_type(spi_dev->irq); |
254 | 255 | ||
255 | phy->se_status.is_ese_present = | 256 | phy->se_status.is_ese_present = false; |
256 | device_property_present(dev, "ese-present"); | 257 | phy->se_status.is_uicc_present = false; |
257 | phy->se_status.is_uicc_present = | 258 | |
258 | device_property_present(dev, "uicc-present"); | 259 | if (device_property_present(dev, "ese-present")) { |
260 | device_property_read_u8(dev, "ese-present", &tmp); | ||
261 | tmp = phy->se_status.is_ese_present; | ||
262 | } | ||
263 | |||
264 | if (device_property_present(dev, "uicc-present")) { | ||
265 | device_property_read_u8(dev, "uicc-present", &tmp); | ||
266 | tmp = phy->se_status.is_uicc_present; | ||
267 | } | ||
259 | 268 | ||
260 | return 0; | 269 | return 0; |
261 | } | 270 | } |