summaryrefslogtreecommitdiffstats
path: root/drivers/nfc/st-nci/i2c.c
diff options
context:
space:
mode:
authorChristophe Ricard <christophe.ricard@gmail.com>2016-04-30 09:12:39 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2016-05-04 01:31:07 +0200
commit27420fec40e22cb3ff04bcef654110eb2ef37620 (patch)
tree66fb845d597bd806e96cbb2786ac4488b30b1a34 /drivers/nfc/st-nci/i2c.c
parentnfc: st21nfca: set is_ese_present and is_uicc_present properly (diff)
downloadlinux-27420fec40e22cb3ff04bcef654110eb2ef37620.tar.xz
linux-27420fec40e22cb3ff04bcef654110eb2ef37620.zip
nfc: st-nci: 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/st-nci/i2c.c')
-rw-r--r--drivers/nfc/st-nci/i2c.c17
1 files changed, 13 insertions, 4 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)
const struct acpi_device_id *id;
struct gpio_desc *gpiod_reset;
struct device *dev;
+ u8 tmp;
if (!client)
return -EINVAL;
@@ -237,10 +238,18 @@ static int st_nci_i2c_acpi_request_resources(struct i2c_client *client)
phy->irq_polarity = irq_get_trigger_type(client->irq);
- phy->se_status.is_ese_present =
- device_property_present(dev, "ese-present");
- phy->se_status.is_uicc_present =
- device_property_present(dev, "uicc-present");
+ phy->se_status.is_ese_present = false;
+ phy->se_status.is_uicc_present = false;
+
+ if (device_property_present(dev, "ese-present")) {
+ device_property_read_u8(dev, "ese-present", &tmp);
+ phy->se_status.is_ese_present = tmp;
+ }
+
+ if (device_property_present(dev, "uicc-present")) {
+ device_property_read_u8(dev, "uicc-present", &tmp);
+ phy->se_status.is_uicc_present = tmp;
+ }
return 0;
}