diff options
author | Christophe Ricard <christophe.ricard@gmail.com> | 2016-04-30 03:12:38 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2016-05-03 19:29:57 -0400 |
commit | bd9d523257832ecf999acb0c312f1ee1a22ed4b0 (patch) | |
tree | 54e1fb0f58c0f0f832e2904247d5675d8b6ee92e /drivers/nfc | |
parent | 2a196975058f94e184464b13b52d86752bccbbd4 (diff) |
nfc: st21nfca: set is_ese_present and is_uicc_present properly
When they're present, set is_ese_present and set is_uicc_present
to the value describe in their package description.
So far is_ese_present and is_uicc_present was set to true if their
property was present.
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/st21nfca/i2c.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/nfc/st21nfca/i2c.c b/drivers/nfc/st21nfca/i2c.c index 179c0b8edf8d..a3153a30be5d 100644 --- a/drivers/nfc/st21nfca/i2c.c +++ b/drivers/nfc/st21nfca/i2c.c | |||
@@ -510,6 +510,7 @@ static int st21nfca_hci_i2c_acpi_request_resources(struct i2c_client *client) | |||
510 | const struct acpi_device_id *id; | 510 | const struct acpi_device_id *id; |
511 | struct gpio_desc *gpiod_ena; | 511 | struct gpio_desc *gpiod_ena; |
512 | struct device *dev; | 512 | struct device *dev; |
513 | u8 tmp; | ||
513 | 514 | ||
514 | if (!client) | 515 | if (!client) |
515 | return -EINVAL; | 516 | return -EINVAL; |
@@ -533,10 +534,18 @@ static int st21nfca_hci_i2c_acpi_request_resources(struct i2c_client *client) | |||
533 | 534 | ||
534 | phy->irq_polarity = irq_get_trigger_type(client->irq); | 535 | phy->irq_polarity = irq_get_trigger_type(client->irq); |
535 | 536 | ||
536 | phy->se_status.is_ese_present = | 537 | phy->se_status.is_ese_present = false; |
537 | device_property_present(dev, "ese-present"); | 538 | phy->se_status.is_uicc_present = false; |
538 | phy->se_status.is_uicc_present = | 539 | |
539 | device_property_present(dev, "uicc-present"); | 540 | if (device_property_present(dev, "ese-present")) { |
541 | device_property_read_u8(dev, "ese-present", &tmp); | ||
542 | phy->se_status.is_ese_present = tmp; | ||
543 | } | ||
544 | |||
545 | if (device_property_present(dev, "uicc-present")) { | ||
546 | device_property_read_u8(dev, "uicc-present", &tmp); | ||
547 | phy->se_status.is_uicc_present = tmp; | ||
548 | } | ||
540 | 549 | ||
541 | return 0; | 550 | return 0; |
542 | } | 551 | } |