status = vchi_msg_dequeue(instance->vchi_handle,
&m, sizeof(m), &msg_len, VCHI_FLAGS_NONE);
if (m.type == VC_AUDIO_MSG_TYPE_RESULT) {
- instance->result = m.u.result.success;
+ instance->result = m.result.success;
complete(&instance->msg_avail_comp);
} else if (m.type == VC_AUDIO_MSG_TYPE_COMPLETE) {
- if (m.u.complete.cookie1 != VC_AUDIO_WRITE_COOKIE1 ||
- m.u.complete.cookie2 != VC_AUDIO_WRITE_COOKIE2)
+ if (m.complete.cookie1 != VC_AUDIO_WRITE_COOKIE1 ||
+ m.complete.cookie2 != VC_AUDIO_WRITE_COOKIE2)
dev_err(instance->dev, "invalid cookie\n");
else
bcm2835_playback_fifo(instance->alsa_stream,
- m.u.complete.count);
+ m.complete.count);
} else {
dev_err(instance->dev, "unexpected callback type=%d\n", m.type);
}
struct vc_audio_msg m = {};
m.type = VC_AUDIO_MSG_TYPE_CONTROL;
- m.u.control.dest = chip->dest;
+ m.control.dest = chip->dest;
if (!chip->mute)
- m.u.control.volume = CHIP_MIN_VOLUME;
+ m.control.volume = CHIP_MIN_VOLUME;
else
- m.u.control.volume = alsa2chip(chip->volume);
+ m.control.volume = alsa2chip(chip->volume);
return bcm2835_audio_send_msg(alsa_stream->instance, &m, true);
}
{
struct vc_audio_msg m = {
.type = VC_AUDIO_MSG_TYPE_CONFIG,
- .u.config.channels = channels,
- .u.config.samplerate = samplerate,
- .u.config.bps = bps,
+ .config.channels = channels,
+ .config.samplerate = samplerate,
+ .config.bps = bps,
};
int err;
{
struct vc_audio_msg m = {
.type = VC_AUDIO_MSG_TYPE_STOP,
- .u.stop.draining = 1,
+ .stop.draining = 1,
};
return bcm2835_audio_send_msg(alsa_stream->instance, &m, false);
struct bcm2835_audio_instance *instance = alsa_stream->instance;
struct vc_audio_msg m = {
.type = VC_AUDIO_MSG_TYPE_WRITE,
- .u.write.count = size,
- .u.write.max_packet = instance->max_packet,
- .u.write.cookie1 = VC_AUDIO_WRITE_COOKIE1,
- .u.write.cookie2 = VC_AUDIO_WRITE_COOKIE2,
+ .write.count = size,
+ .write.max_packet = instance->max_packet,
+ .write.cookie1 = VC_AUDIO_WRITE_COOKIE1,
+ .write.cookie2 = VC_AUDIO_WRITE_COOKIE2,
};
unsigned int count;
int err, status;