Lines Matching +full:tcs +full:- +full:config
1 // SPDX-License-Identifier: GPL-2.0-or-later
6 * https://raw.githubusercontent.com/oasis-tcs/virtio-spec/master/virtio-i2c.tex
23 * struct virtio_i2c - virtio I2C data
35 * struct virtio_i2c_req - the virtio I2C request structure
54 complete(&req->completion); in virtio_i2c_msg_done()
70 * Only 7-bit mode supported for this moment. For the address in virtio_i2c_prepare_reqs()
78 if (i != num - 1) in virtio_i2c_prepare_reqs()
119 wait_for_completion(&req->completion); in virtio_i2c_complete_reqs()
121 if (!failed && req->in_hdr.status != VIRTIO_I2C_MSG_OK) in virtio_i2c_complete_reqs()
137 struct virtqueue *vq = vi->vq; in virtio_i2c_xfer()
143 return -ENOMEM; in virtio_i2c_xfer()
169 vdev->config->del_vqs(vdev); in virtio_i2c_del_vqs()
174 struct virtio_device *vdev = vi->vdev; in virtio_i2c_setup_vqs()
176 vi->vq = virtio_find_single_vq(vdev, virtio_i2c_msg_done, "msg"); in virtio_i2c_setup_vqs()
177 return PTR_ERR_OR_ZERO(vi->vq); in virtio_i2c_setup_vqs()
196 dev_err(&vdev->dev, "Zero-length request feature is mandatory\n"); in virtio_i2c_probe()
197 return -EINVAL; in virtio_i2c_probe()
200 vi = devm_kzalloc(&vdev->dev, sizeof(*vi), GFP_KERNEL); in virtio_i2c_probe()
202 return -ENOMEM; in virtio_i2c_probe()
204 vdev->priv = vi; in virtio_i2c_probe()
205 vi->vdev = vdev; in virtio_i2c_probe()
211 vi->adap.owner = THIS_MODULE; in virtio_i2c_probe()
212 snprintf(vi->adap.name, sizeof(vi->adap.name), in virtio_i2c_probe()
213 "i2c_virtio at virtio bus %d", vdev->index); in virtio_i2c_probe()
214 vi->adap.algo = &virtio_algorithm; in virtio_i2c_probe()
215 vi->adap.dev.parent = &vdev->dev; in virtio_i2c_probe()
216 vi->adap.dev.of_node = vdev->dev.of_node; in virtio_i2c_probe()
217 i2c_set_adapdata(&vi->adap, vi); in virtio_i2c_probe()
223 ACPI_COMPANION_SET(&vi->adap.dev, ACPI_COMPANION(vdev->dev.parent)); in virtio_i2c_probe()
225 ret = i2c_add_adapter(&vi->adap); in virtio_i2c_probe()
234 struct virtio_i2c *vi = vdev->priv; in virtio_i2c_remove()
236 i2c_del_adapter(&vi->adap); in virtio_i2c_remove()
254 return virtio_i2c_setup_vqs(vdev->priv); in virtio_i2c_restore()