Lines Matching refs:oxfw
17 static int oxfw_mute_command(struct snd_oxfw *oxfw, bool *value, in oxfw_mute_command() argument
38 buf[4] = oxfw->device_info->mute_fb_id; /* function block ID */ in oxfw_mute_command()
49 err = fcp_avc_transaction(oxfw->unit, buf, 11, buf, 11, 0x3fe); in oxfw_mute_command()
53 dev_err(&oxfw->unit->device, "short FCP response\n"); in oxfw_mute_command()
58 dev_err(&oxfw->unit->device, "mute command failed\n"); in oxfw_mute_command()
73 static int oxfw_volume_command(struct snd_oxfw *oxfw, s16 *value, in oxfw_volume_command() argument
96 buf[4] = oxfw->device_info->volume_fb_id; /* function block ID */ in oxfw_volume_command()
110 err = fcp_avc_transaction(oxfw->unit, buf, 12, buf, 12, 0x3fe); in oxfw_volume_command()
114 dev_err(&oxfw->unit->device, "short FCP response\n"); in oxfw_volume_command()
119 dev_err(&oxfw->unit->device, "volume command failed\n"); in oxfw_volume_command()
137 struct snd_oxfw *oxfw = control->private_data; in oxfw_mute_get() local
139 value->value.integer.value[0] = !oxfw->mute; in oxfw_mute_get()
147 struct snd_oxfw *oxfw = control->private_data; in oxfw_mute_put() local
153 if (mute == oxfw->mute) in oxfw_mute_put()
156 err = oxfw_mute_command(oxfw, &mute, CTL_WRITE); in oxfw_mute_put()
159 oxfw->mute = mute; in oxfw_mute_put()
167 struct snd_oxfw *oxfw = control->private_data; in oxfw_volume_info() local
170 info->count = oxfw->device_info->mixer_channels; in oxfw_volume_info()
171 info->value.integer.min = oxfw->volume_min; in oxfw_volume_info()
172 info->value.integer.max = oxfw->volume_max; in oxfw_volume_info()
182 struct snd_oxfw *oxfw = control->private_data; in oxfw_volume_get() local
185 for (i = 0; i < oxfw->device_info->mixer_channels; ++i) in oxfw_volume_get()
186 value->value.integer.value[channel_map[i]] = oxfw->volume[i]; in oxfw_volume_get()
194 struct snd_oxfw *oxfw = control->private_data; in oxfw_volume_put() local
200 for (i = 0; i < oxfw->device_info->mixer_channels; ++i) { in oxfw_volume_put()
201 if (value->value.integer.value[i] < oxfw->volume_min || in oxfw_volume_put()
202 value->value.integer.value[i] > oxfw->volume_max) in oxfw_volume_put()
210 for (i = 0; i < oxfw->device_info->mixer_channels; ++i) in oxfw_volume_put()
212 oxfw->volume[i]) in oxfw_volume_put()
218 for (i = 0; i <= oxfw->device_info->mixer_channels; ++i) { in oxfw_volume_put()
221 err = oxfw_volume_command(oxfw, &volume, i, in oxfw_volume_put()
227 oxfw->volume[i - 1] = volume; in oxfw_volume_put()
233 int snd_oxfw_create_mixer(struct snd_oxfw *oxfw) in snd_oxfw_create_mixer() argument
254 err = oxfw_volume_command(oxfw, &oxfw->volume_min, in snd_oxfw_create_mixer()
258 err = oxfw_volume_command(oxfw, &oxfw->volume_max, in snd_oxfw_create_mixer()
263 err = oxfw_mute_command(oxfw, &oxfw->mute, CTL_READ); in snd_oxfw_create_mixer()
267 first_ch = oxfw->device_info->mixer_channels == 1 ? 0 : 1; in snd_oxfw_create_mixer()
268 for (i = 0; i < oxfw->device_info->mixer_channels; ++i) { in snd_oxfw_create_mixer()
269 err = oxfw_volume_command(oxfw, &oxfw->volume[i], in snd_oxfw_create_mixer()
276 err = snd_ctl_add(oxfw->card, in snd_oxfw_create_mixer()
277 snd_ctl_new1(&controls[i], oxfw)); in snd_oxfw_create_mixer()