Lines Matching refs:device
21 static int snd_i2c_bit_sendbytes(struct snd_i2c_device *device,
23 static int snd_i2c_bit_readbytes(struct snd_i2c_device *device,
37 struct snd_i2c_device *device; in snd_i2c_bus_free() local
42 device = snd_i2c_device(bus->devices.next); in snd_i2c_bus_free()
43 snd_i2c_device_free(device); in snd_i2c_bus_free()
59 static int snd_i2c_bus_dev_free(struct snd_device *device) in snd_i2c_bus_dev_free() argument
61 struct snd_i2c_bus *bus = device->device_data; in snd_i2c_bus_dev_free()
102 struct snd_i2c_device *device; in snd_i2c_device_create() local
107 device = kzalloc(sizeof(*device), GFP_KERNEL); in snd_i2c_device_create()
108 if (device == NULL) in snd_i2c_device_create()
110 device->addr = addr; in snd_i2c_device_create()
111 strlcpy(device->name, name, sizeof(device->name)); in snd_i2c_device_create()
112 list_add_tail(&device->list, &bus->devices); in snd_i2c_device_create()
113 device->bus = bus; in snd_i2c_device_create()
114 *rdevice = device; in snd_i2c_device_create()
120 int snd_i2c_device_free(struct snd_i2c_device *device) in snd_i2c_device_free() argument
122 if (device->bus) in snd_i2c_device_free()
123 list_del(&device->list); in snd_i2c_device_free()
124 if (device->private_free) in snd_i2c_device_free()
125 device->private_free(device); in snd_i2c_device_free()
126 kfree(device); in snd_i2c_device_free()
132 int snd_i2c_sendbytes(struct snd_i2c_device *device, unsigned char *bytes, int count) in snd_i2c_sendbytes() argument
134 return device->bus->ops->sendbytes(device, bytes, count); in snd_i2c_sendbytes()
139 int snd_i2c_readbytes(struct snd_i2c_device *device, unsigned char *bytes, int count) in snd_i2c_readbytes() argument
141 return device->bus->ops->readbytes(device, bytes, count); in snd_i2c_readbytes()
261 static int snd_i2c_bit_sendbytes(struct snd_i2c_device *device, in snd_i2c_bit_sendbytes() argument
264 struct snd_i2c_bus *bus = device->bus; in snd_i2c_bit_sendbytes()
267 if (device->flags & SND_I2C_DEVICE_ADDRTEN) in snd_i2c_bit_sendbytes()
270 err = snd_i2c_bit_sendbyte(bus, device->addr << 1); in snd_i2c_bit_sendbytes()
287 static int snd_i2c_bit_readbytes(struct snd_i2c_device *device, in snd_i2c_bit_readbytes() argument
290 struct snd_i2c_bus *bus = device->bus; in snd_i2c_bit_readbytes()
293 if (device->flags & SND_I2C_DEVICE_ADDRTEN) in snd_i2c_bit_readbytes()
296 err = snd_i2c_bit_sendbyte(bus, (device->addr << 1) | 1); in snd_i2c_bit_readbytes()