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