Lines Matching refs:drv_data
25 static int nfcmrvl_i2c_read(struct nfcmrvl_i2c_drv_data *drv_data, in nfcmrvl_i2c_read() argument
32 ret = i2c_master_recv(drv_data->i2c, (u8 *)&nci_hdr, NCI_CTRL_HDR_SIZE); in nfcmrvl_i2c_read()
34 nfc_err(&drv_data->i2c->dev, "cannot read NCI header\n"); in nfcmrvl_i2c_read()
38 *skb = nci_skb_alloc(drv_data->priv->ndev, in nfcmrvl_i2c_read()
48 ret = i2c_master_recv(drv_data->i2c, in nfcmrvl_i2c_read()
53 nfc_err(&drv_data->i2c->dev, in nfcmrvl_i2c_read()
66 struct nfcmrvl_i2c_drv_data *drv_data = drv_data_ptr; in nfcmrvl_i2c_int_irq_thread_fn() local
70 if (!drv_data->priv) in nfcmrvl_i2c_int_irq_thread_fn()
73 if (test_bit(NFCMRVL_PHY_ERROR, &drv_data->priv->flags)) in nfcmrvl_i2c_int_irq_thread_fn()
76 ret = nfcmrvl_i2c_read(drv_data, &skb); in nfcmrvl_i2c_int_irq_thread_fn()
80 set_bit(NFCMRVL_PHY_ERROR, &drv_data->priv->flags); in nfcmrvl_i2c_int_irq_thread_fn()
84 nfc_err(&drv_data->i2c->dev, "read failed %d\n", ret); in nfcmrvl_i2c_int_irq_thread_fn()
87 if (nfcmrvl_nci_recv_frame(drv_data->priv, skb) < 0) in nfcmrvl_i2c_int_irq_thread_fn()
88 nfc_err(&drv_data->i2c->dev, "corrupted RX packet\n"); in nfcmrvl_i2c_int_irq_thread_fn()
96 struct nfcmrvl_i2c_drv_data *drv_data = priv->drv_data; in nfcmrvl_i2c_nci_open() local
98 if (!drv_data) in nfcmrvl_i2c_nci_open()
112 struct nfcmrvl_i2c_drv_data *drv_data = priv->drv_data; in nfcmrvl_i2c_nci_send() local
120 ret = i2c_master_send(drv_data->i2c, skb->data, skb->len); in nfcmrvl_i2c_nci_send()
124 nfc_info(drv_data->dev, "chip may sleep, retry\n"); in nfcmrvl_i2c_nci_send()
126 ret = i2c_master_send(drv_data->i2c, skb->data, skb->len); in nfcmrvl_i2c_nci_send()
131 nfc_err(drv_data->dev, in nfcmrvl_i2c_nci_send()
189 struct nfcmrvl_i2c_drv_data *drv_data; in nfcmrvl_i2c_probe() local
198 drv_data = devm_kzalloc(&client->dev, sizeof(*drv_data), GFP_KERNEL); in nfcmrvl_i2c_probe()
199 if (!drv_data) in nfcmrvl_i2c_probe()
202 drv_data->i2c = client; in nfcmrvl_i2c_probe()
203 drv_data->dev = &client->dev; in nfcmrvl_i2c_probe()
204 drv_data->priv = NULL; in nfcmrvl_i2c_probe()
206 i2c_set_clientdata(client, drv_data); in nfcmrvl_i2c_probe()
218 ret = devm_request_threaded_irq(&drv_data->i2c->dev, pdata->irq, in nfcmrvl_i2c_probe()
221 "nfcmrvl_i2c_int", drv_data); in nfcmrvl_i2c_probe()
223 nfc_err(&drv_data->i2c->dev, in nfcmrvl_i2c_probe()
228 drv_data->priv = nfcmrvl_nci_register_dev(NFCMRVL_PHY_I2C, in nfcmrvl_i2c_probe()
229 drv_data, &i2c_ops, in nfcmrvl_i2c_probe()
230 &drv_data->i2c->dev, pdata); in nfcmrvl_i2c_probe()
232 if (IS_ERR(drv_data->priv)) in nfcmrvl_i2c_probe()
233 return PTR_ERR(drv_data->priv); in nfcmrvl_i2c_probe()
235 drv_data->priv->support_fw_dnld = true; in nfcmrvl_i2c_probe()
242 struct nfcmrvl_i2c_drv_data *drv_data = i2c_get_clientdata(client); in nfcmrvl_i2c_remove() local
244 nfcmrvl_nci_unregister_dev(drv_data->priv); in nfcmrvl_i2c_remove()