/* Compose a 32bit command word to be sent to the HD-audio controller  */
static unsigned int make_codec_cmd(struct hda_codec *codec, hda_nid_t nid, int direct, unsigned int verb, unsigned int parm)
/* Compose a 32bit command word to be sent to the HD-audio controller  */
static unsigned int make_codec_cmd(struct hda_codec *codec, hda_nid_t nid, int direct, unsigned int verb, unsigned int parm)
{
	u32 val;
	if ((codec->addr & ~0xf) || (direct & ~1) || (nid & ~0x7f) ||
	    (verb & ~0xfff) || (parm & ~0xffff)) {
		printk(KERN_ERR "hda-codec: out of range cmd %x:%x:%x:%x:%x\n",
		       codec->addr, direct, nid, verb, parm);
		return ~0;
	}
	val = (u32)codec->addr << 28;
	val |= (u32)direct << 27;
	val |= (u32)nid << 20;
	val |= verb << 8;
	val |= parm;
	return val;
}