Lines Matching refs:device

35 static int snd_i2c_bit_sendbytes(struct snd_i2c_device *device,
37 static int snd_i2c_bit_readbytes(struct snd_i2c_device *device,
51 struct snd_i2c_device *device; in snd_i2c_bus_free() local
56 device = snd_i2c_device(bus->devices.next); in snd_i2c_bus_free()
57 snd_i2c_device_free(device); in snd_i2c_bus_free()
73 static int snd_i2c_bus_dev_free(struct snd_device *device) in snd_i2c_bus_dev_free() argument
75 struct snd_i2c_bus *bus = device->device_data; in snd_i2c_bus_dev_free()
116 struct snd_i2c_device *device; in snd_i2c_device_create() local
121 device = kzalloc(sizeof(*device), GFP_KERNEL); in snd_i2c_device_create()
122 if (device == NULL) in snd_i2c_device_create()
124 device->addr = addr; in snd_i2c_device_create()
125 strlcpy(device->name, name, sizeof(device->name)); in snd_i2c_device_create()
126 list_add_tail(&device->list, &bus->devices); in snd_i2c_device_create()
127 device->bus = bus; in snd_i2c_device_create()
128 *rdevice = device; in snd_i2c_device_create()
134 int snd_i2c_device_free(struct snd_i2c_device *device) in snd_i2c_device_free() argument
136 if (device->bus) in snd_i2c_device_free()
137 list_del(&device->list); in snd_i2c_device_free()
138 if (device->private_free) in snd_i2c_device_free()
139 device->private_free(device); in snd_i2c_device_free()
140 kfree(device); in snd_i2c_device_free()
146 int snd_i2c_sendbytes(struct snd_i2c_device *device, unsigned char *bytes, int count) in snd_i2c_sendbytes() argument
148 return device->bus->ops->sendbytes(device, bytes, count); in snd_i2c_sendbytes()
153 int snd_i2c_readbytes(struct snd_i2c_device *device, unsigned char *bytes, int count) in snd_i2c_readbytes() argument
155 return device->bus->ops->readbytes(device, bytes, count); in snd_i2c_readbytes()
275 static int snd_i2c_bit_sendbytes(struct snd_i2c_device *device, in snd_i2c_bit_sendbytes() argument
278 struct snd_i2c_bus *bus = device->bus; in snd_i2c_bit_sendbytes()
281 if (device->flags & SND_I2C_DEVICE_ADDRTEN) in snd_i2c_bit_sendbytes()
284 err = snd_i2c_bit_sendbyte(bus, device->addr << 1); in snd_i2c_bit_sendbytes()
301 static int snd_i2c_bit_readbytes(struct snd_i2c_device *device, in snd_i2c_bit_readbytes() argument
304 struct snd_i2c_bus *bus = device->bus; in snd_i2c_bit_readbytes()
307 if (device->flags & SND_I2C_DEVICE_ADDRTEN) in snd_i2c_bit_readbytes()
310 err = snd_i2c_bit_sendbyte(bus, (device->addr << 1) | 1); in snd_i2c_bit_readbytes()