Lines Matching refs:drv_data

39 static int nfcmrvl_i2c_read(struct nfcmrvl_i2c_drv_data *drv_data,  in nfcmrvl_i2c_read()  argument
46 ret = i2c_master_recv(drv_data->i2c, (u8 *)&nci_hdr, NCI_CTRL_HDR_SIZE); in nfcmrvl_i2c_read()
48 nfc_err(&drv_data->i2c->dev, "cannot read NCI header\n"); in nfcmrvl_i2c_read()
53 nfc_err(&drv_data->i2c->dev, "invalid packet payload size\n"); in nfcmrvl_i2c_read()
57 *skb = nci_skb_alloc(drv_data->priv->ndev, in nfcmrvl_i2c_read()
67 ret = i2c_master_recv(drv_data->i2c, in nfcmrvl_i2c_read()
72 nfc_err(&drv_data->i2c->dev, in nfcmrvl_i2c_read()
85 struct nfcmrvl_i2c_drv_data *drv_data = drv_data_ptr; in nfcmrvl_i2c_int_irq_thread_fn() local
89 if (!drv_data->priv) in nfcmrvl_i2c_int_irq_thread_fn()
92 if (test_bit(NFCMRVL_PHY_ERROR, &drv_data->priv->flags)) in nfcmrvl_i2c_int_irq_thread_fn()
95 ret = nfcmrvl_i2c_read(drv_data, &skb); in nfcmrvl_i2c_int_irq_thread_fn()
99 set_bit(NFCMRVL_PHY_ERROR, &drv_data->priv->flags); in nfcmrvl_i2c_int_irq_thread_fn()
103 nfc_err(&drv_data->i2c->dev, "read failed %d\n", ret); in nfcmrvl_i2c_int_irq_thread_fn()
106 if (nfcmrvl_nci_recv_frame(drv_data->priv, skb) < 0) in nfcmrvl_i2c_int_irq_thread_fn()
107 nfc_err(&drv_data->i2c->dev, "corrupted RX packet\n"); in nfcmrvl_i2c_int_irq_thread_fn()
115 struct nfcmrvl_i2c_drv_data *drv_data = priv->drv_data; in nfcmrvl_i2c_nci_open() local
117 if (!drv_data) in nfcmrvl_i2c_nci_open()
131 struct nfcmrvl_i2c_drv_data *drv_data = priv->drv_data; in nfcmrvl_i2c_nci_send() local
137 ret = i2c_master_send(drv_data->i2c, skb->data, skb->len); in nfcmrvl_i2c_nci_send()
141 nfc_info(drv_data->dev, "chip may sleep, retry\n"); in nfcmrvl_i2c_nci_send()
143 ret = i2c_master_send(drv_data->i2c, skb->data, skb->len); in nfcmrvl_i2c_nci_send()
148 nfc_err(drv_data->dev, in nfcmrvl_i2c_nci_send()
201 struct nfcmrvl_i2c_drv_data *drv_data; in nfcmrvl_i2c_probe() local
211 drv_data = devm_kzalloc(&client->dev, sizeof(*drv_data), GFP_KERNEL); in nfcmrvl_i2c_probe()
212 if (!drv_data) in nfcmrvl_i2c_probe()
215 drv_data->i2c = client; in nfcmrvl_i2c_probe()
216 drv_data->dev = &client->dev; in nfcmrvl_i2c_probe()
217 drv_data->priv = NULL; in nfcmrvl_i2c_probe()
219 i2c_set_clientdata(client, drv_data); in nfcmrvl_i2c_probe()
231 ret = devm_request_threaded_irq(&drv_data->i2c->dev, pdata->irq, in nfcmrvl_i2c_probe()
234 "nfcmrvl_i2c_int", drv_data); in nfcmrvl_i2c_probe()
236 nfc_err(&drv_data->i2c->dev, in nfcmrvl_i2c_probe()
241 drv_data->priv = nfcmrvl_nci_register_dev(NFCMRVL_PHY_I2C, in nfcmrvl_i2c_probe()
242 drv_data, &i2c_ops, in nfcmrvl_i2c_probe()
243 &drv_data->i2c->dev, pdata); in nfcmrvl_i2c_probe()
245 if (IS_ERR(drv_data->priv)) in nfcmrvl_i2c_probe()
246 return PTR_ERR(drv_data->priv); in nfcmrvl_i2c_probe()
248 drv_data->priv->support_fw_dnld = true; in nfcmrvl_i2c_probe()
255 struct nfcmrvl_i2c_drv_data *drv_data = i2c_get_clientdata(client); in nfcmrvl_i2c_remove() local
257 nfcmrvl_nci_unregister_dev(drv_data->priv); in nfcmrvl_i2c_remove()