Lines Matching refs:phy
66 struct nxp_nci_i2c_phy *phy = (struct nxp_nci_i2c_phy *) phy_id; in nxp_nci_i2c_set_mode() local
68 gpio_set_value(phy->gpio_fw, (mode == NXP_NCI_MODE_FW) ? 1 : 0); in nxp_nci_i2c_set_mode()
69 gpio_set_value(phy->gpio_en, (mode != NXP_NCI_MODE_COLD) ? 1 : 0); in nxp_nci_i2c_set_mode()
73 phy->hard_fault = 0; in nxp_nci_i2c_set_mode()
81 struct nxp_nci_i2c_phy *phy = phy_id; in nxp_nci_i2c_write() local
82 struct i2c_client *client = phy->i2c_dev; in nxp_nci_i2c_write()
84 if (phy->hard_fault != 0) in nxp_nci_i2c_write()
85 return phy->hard_fault; in nxp_nci_i2c_write()
114 static int nxp_nci_i2c_fw_read(struct nxp_nci_i2c_phy *phy, in nxp_nci_i2c_fw_read() argument
117 struct i2c_client *client = phy->i2c_dev; in nxp_nci_i2c_fw_read()
159 static int nxp_nci_i2c_nci_read(struct nxp_nci_i2c_phy *phy, in nxp_nci_i2c_nci_read() argument
163 struct i2c_client *client = phy->i2c_dev; in nxp_nci_i2c_nci_read()
203 struct nxp_nci_i2c_phy *phy = phy_id; in nxp_nci_i2c_irq_thread_fn() local
210 if (!phy || !phy->ndev) in nxp_nci_i2c_irq_thread_fn()
213 client = phy->i2c_dev; in nxp_nci_i2c_irq_thread_fn()
218 info = nci_get_drvdata(phy->ndev); in nxp_nci_i2c_irq_thread_fn()
225 if (phy->hard_fault != 0) in nxp_nci_i2c_irq_thread_fn()
230 r = nxp_nci_i2c_nci_read(phy, &skb); in nxp_nci_i2c_irq_thread_fn()
233 r = nxp_nci_i2c_fw_read(phy, &skb); in nxp_nci_i2c_irq_thread_fn()
241 phy->hard_fault = r; in nxp_nci_i2c_irq_thread_fn()
250 nci_recv_frame(phy->ndev, skb); in nxp_nci_i2c_irq_thread_fn()
253 nxp_nci_fw_recv_frame(phy->ndev, skb); in nxp_nci_i2c_irq_thread_fn()
271 struct nxp_nci_i2c_phy *phy = i2c_get_clientdata(client); in nxp_nci_i2c_parse_devtree() local
286 phy->gpio_en = r; in nxp_nci_i2c_parse_devtree()
295 phy->gpio_fw = r; in nxp_nci_i2c_parse_devtree()
316 static int nxp_nci_i2c_acpi_config(struct nxp_nci_i2c_phy *phy) in nxp_nci_i2c_acpi_config() argument
318 struct i2c_client *client = phy->i2c_dev; in nxp_nci_i2c_acpi_config()
336 phy->gpio_en = desc_to_gpio(gpiod_en); in nxp_nci_i2c_acpi_config()
337 phy->gpio_fw = desc_to_gpio(gpiod_fw); in nxp_nci_i2c_acpi_config()
338 phy->gpio_irq = desc_to_gpio(gpiod_irq); in nxp_nci_i2c_acpi_config()
346 struct nxp_nci_i2c_phy *phy; in nxp_nci_i2c_probe() local
356 phy = devm_kzalloc(&client->dev, sizeof(struct nxp_nci_i2c_phy), in nxp_nci_i2c_probe()
358 if (!phy) { in nxp_nci_i2c_probe()
363 phy->i2c_dev = client; in nxp_nci_i2c_probe()
364 i2c_set_clientdata(client, phy); in nxp_nci_i2c_probe()
375 phy->gpio_en = pdata->gpio_en; in nxp_nci_i2c_probe()
376 phy->gpio_fw = pdata->gpio_fw; in nxp_nci_i2c_probe()
379 r = nxp_nci_i2c_acpi_config(phy); in nxp_nci_i2c_probe()
389 r = devm_gpio_request_one(&phy->i2c_dev->dev, phy->gpio_en, in nxp_nci_i2c_probe()
394 r = devm_gpio_request_one(&phy->i2c_dev->dev, phy->gpio_fw, in nxp_nci_i2c_probe()
400 r = nxp_nci_probe(phy, &client->dev, &i2c_phy_ops, in nxp_nci_i2c_probe()
401 NXP_NCI_I2C_MAX_PAYLOAD, &phy->ndev); in nxp_nci_i2c_probe()
408 NXP_NCI_I2C_DRIVER_NAME, phy); in nxp_nci_i2c_probe()
418 struct nxp_nci_i2c_phy *phy = i2c_get_clientdata(client); in nxp_nci_i2c_remove() local
420 nxp_nci_remove(phy->ndev); in nxp_nci_i2c_remove()
421 free_irq(client->irq, phy); in nxp_nci_i2c_remove()