Lines Matching refs:phy
64 struct st_nci_spi_phy *phy = phy_id; in st_nci_spi_enable() local
66 gpio_set_value(phy->gpio_reset, 0); in st_nci_spi_enable()
68 gpio_set_value(phy->gpio_reset, 1); in st_nci_spi_enable()
71 if (phy->ndlc->powered == 0 && phy->irq_active == 0) { in st_nci_spi_enable()
72 enable_irq(phy->spi_dev->irq); in st_nci_spi_enable()
73 phy->irq_active = true; in st_nci_spi_enable()
81 struct st_nci_spi_phy *phy = phy_id; in st_nci_spi_disable() local
83 disable_irq_nosync(phy->spi_dev->irq); in st_nci_spi_disable()
84 phy->irq_active = false; in st_nci_spi_disable()
95 struct st_nci_spi_phy *phy = phy_id; in st_nci_spi_write() local
96 struct spi_device *dev = phy->spi_dev; in st_nci_spi_write()
106 if (phy->ndlc->hard_fault != 0) in st_nci_spi_write()
107 return phy->ndlc->hard_fault; in st_nci_spi_write()
123 ndlc_recv(phy->ndlc, skb_rx); in st_nci_spi_write()
138 static int st_nci_spi_read(struct st_nci_spi_phy *phy, in st_nci_spi_read() argument
144 struct spi_device *dev = phy->spi_dev; in st_nci_spi_read()
157 phy->ndlc->hard_fault = 1; in st_nci_spi_read()
192 struct st_nci_spi_phy *phy = phy_id; in st_nci_irq_thread_fn() local
197 if (!phy || !phy->ndlc || irq != phy->spi_dev->irq) { in st_nci_irq_thread_fn()
202 dev = phy->spi_dev; in st_nci_irq_thread_fn()
205 if (phy->ndlc->hard_fault) in st_nci_irq_thread_fn()
208 if (!phy->ndlc->powered) { in st_nci_irq_thread_fn()
209 st_nci_spi_disable(phy); in st_nci_irq_thread_fn()
213 r = st_nci_spi_read(phy, &skb); in st_nci_irq_thread_fn()
217 ndlc_recv(phy->ndlc, skb); in st_nci_irq_thread_fn()
231 struct st_nci_spi_phy *phy = spi_get_drvdata(dev); in st_nci_spi_of_request_resources() local
255 phy->gpio_reset = gpio; in st_nci_spi_of_request_resources()
257 phy->irq_polarity = irq_get_trigger_type(dev->irq); in st_nci_spi_of_request_resources()
259 phy->se_status.is_ese_present = in st_nci_spi_of_request_resources()
261 phy->se_status.is_uicc_present = in st_nci_spi_of_request_resources()
276 struct st_nci_spi_phy *phy = spi_get_drvdata(dev); in st_nci_spi_request_resources() local
286 phy->gpio_reset = pdata->gpio_reset; in st_nci_spi_request_resources()
287 phy->irq_polarity = pdata->irq_polarity; in st_nci_spi_request_resources()
290 phy->gpio_reset, GPIOF_OUT_INIT_HIGH, "clf_reset"); in st_nci_spi_request_resources()
296 phy->se_status.is_ese_present = pdata->is_ese_present; in st_nci_spi_request_resources()
297 phy->se_status.is_uicc_present = pdata->is_uicc_present; in st_nci_spi_request_resources()
304 struct st_nci_spi_phy *phy; in st_nci_spi_probe() local
318 phy = devm_kzalloc(&dev->dev, sizeof(struct st_nci_spi_phy), in st_nci_spi_probe()
320 if (!phy) in st_nci_spi_probe()
323 phy->spi_dev = dev; in st_nci_spi_probe()
325 spi_set_drvdata(dev, phy); in st_nci_spi_probe()
347 r = ndlc_probe(phy, &spi_phy_ops, &dev->dev, in st_nci_spi_probe()
349 &phy->ndlc, &phy->se_status); in st_nci_spi_probe()
355 phy->irq_active = true; in st_nci_spi_probe()
358 phy->irq_polarity | IRQF_ONESHOT, in st_nci_spi_probe()
359 ST_NCI_SPI_DRIVER_NAME, phy); in st_nci_spi_probe()
368 struct st_nci_spi_phy *phy = spi_get_drvdata(dev); in st_nci_spi_remove() local
372 ndlc_remove(phy->ndlc); in st_nci_spi_remove()