/* Returns 0 if successful, or a negative error code.  */
int snd_hda_queue_unsol_event(struct hda_bus *bus, u32 res, u32 res_ex)
/* Returns 0 if successful, or a negative error code.  */
int snd_hda_queue_unsol_event(struct hda_bus *bus, u32 res, u32 res_ex)
{
	struct hda_bus_unsolicited *unsol;
	unsigned int wp;
	unsol = bus->unsol;
	if (!unsol)
		return 0;
	wp = (unsol->wp + 1) % HDA_UNSOL_QUEUE_SIZE;
	unsol->wp = wp;
	wp <<= 1;
	unsol->queue[wp] = res;
	unsol->queue[wp + 1] = res_ex;
	queue_work(bus->workq, &unsol->work);
	return 0;
}