Lines Matching refs:phy

48 static void fdp_nci_i2c_reset(struct fdp_i2c_phy *phy)  in fdp_nci_i2c_reset()  argument
51 gpiod_set_value_cansleep(phy->power_gpio, FDP_POWER_OFF); in fdp_nci_i2c_reset()
53 gpiod_set_value_cansleep(phy->power_gpio, FDP_POWER_ON); in fdp_nci_i2c_reset()
59 struct fdp_i2c_phy *phy = phy_id; in fdp_nci_i2c_enable() local
61 dev_dbg(&phy->i2c_dev->dev, "%s\n", __func__); in fdp_nci_i2c_enable()
62 fdp_nci_i2c_reset(phy); in fdp_nci_i2c_enable()
69 struct fdp_i2c_phy *phy = phy_id; in fdp_nci_i2c_disable() local
71 dev_dbg(&phy->i2c_dev->dev, "%s\n", __func__); in fdp_nci_i2c_disable()
72 fdp_nci_i2c_reset(phy); in fdp_nci_i2c_disable()
100 struct fdp_i2c_phy *phy = phy_id; in fdp_nci_i2c_write() local
101 struct i2c_client *client = phy->i2c_dev; in fdp_nci_i2c_write()
104 if (phy->hard_fault != 0) in fdp_nci_i2c_write()
105 return phy->hard_fault; in fdp_nci_i2c_write()
122 phy->hard_fault = r; in fdp_nci_i2c_write()
140 static int fdp_nci_i2c_read(struct fdp_i2c_phy *phy, struct sk_buff **skb) in fdp_nci_i2c_read() argument
145 struct i2c_client *client = phy->i2c_dev; in fdp_nci_i2c_read()
152 len = phy->next_read_size; in fdp_nci_i2c_read()
173 phy->next_read_size = 5; in fdp_nci_i2c_read()
179 phy->next_read_size = (tmp[2] << 8) + tmp[3] + 3; in fdp_nci_i2c_read()
181 phy->next_read_size = FDP_NCI_I2C_MIN_PAYLOAD; in fdp_nci_i2c_read()
208 struct fdp_i2c_phy *phy = phy_id; in fdp_nci_i2c_irq_thread_fn() local
213 client = phy->i2c_dev; in fdp_nci_i2c_irq_thread_fn()
216 if (!phy || irq != phy->i2c_dev->irq) { in fdp_nci_i2c_irq_thread_fn()
221 r = fdp_nci_i2c_read(phy, &skb); in fdp_nci_i2c_irq_thread_fn()
229 fdp_nci_recv_frame(phy->ndev, skb); in fdp_nci_i2c_irq_thread_fn()
287 struct fdp_i2c_phy *phy; in fdp_nci_i2c_probe() local
301 phy = devm_kzalloc(dev, sizeof(struct fdp_i2c_phy), in fdp_nci_i2c_probe()
303 if (!phy) in fdp_nci_i2c_probe()
306 phy->i2c_dev = client; in fdp_nci_i2c_probe()
307 phy->next_read_size = FDP_NCI_I2C_MIN_PAYLOAD; in fdp_nci_i2c_probe()
308 i2c_set_clientdata(client, phy); in fdp_nci_i2c_probe()
318 FDP_I2C_DRIVER_NAME, phy); in fdp_nci_i2c_probe()
326 phy->power_gpio = devm_gpiod_get(dev, FDP_DP_POWER_GPIO_NAME, in fdp_nci_i2c_probe()
329 if (IS_ERR(phy->power_gpio)) { in fdp_nci_i2c_probe()
331 return PTR_ERR(phy->power_gpio); in fdp_nci_i2c_probe()
339 r = fdp_nci_probe(phy, &i2c_phy_ops, &phy->ndev, in fdp_nci_i2c_probe()
353 struct fdp_i2c_phy *phy = i2c_get_clientdata(client); in fdp_nci_i2c_remove() local
357 fdp_nci_remove(phy->ndev); in fdp_nci_i2c_remove()
358 fdp_nci_i2c_disable(phy); in fdp_nci_i2c_remove()