diff options
author | Christophe Ricard <christophe.ricard@gmail.com> | 2016-04-30 03:12:39 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2016-05-03 19:31:07 -0400 |
commit | 27420fec40e22cb3ff04bcef654110eb2ef37620 (patch) | |
tree | 66fb845d597bd806e96cbb2786ac4488b30b1a34 /drivers/nfc/st-nci/spi.c | |
parent | bd9d523257832ecf999acb0c312f1ee1a22ed4b0 (diff) |
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/spi.c')
-rw-r--r-- | drivers/nfc/st-nci/spi.c | 17 |
1 files changed, 13 insertions, 4 deletions
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 | } |