/* snd_hda_ctl_add() checks the control subdev id field whether #HDA_SUBDEV_NID_FLAG bit is set. If set (and @nid is zero), the lower bits value is taken as the NID to assign.  */
int snd_hda_ctl_add(struct hda_codec *codec, hda_nid_t nid, struct snd_kcontrol *kctl)
/* snd_hda_ctl_add() checks the control subdev id field whether #HDA_SUBDEV_NID_FLAG bit is set. If set (and @nid is zero), the lower bits value is taken as the NID to assign.  */
int snd_hda_ctl_add(struct hda_codec *codec, hda_nid_t nid, struct snd_kcontrol *kctl)
{
	int err;
	struct hda_nid_item *item;
	if (kctl->id.subdevice & HDA_SUBDEV_NID_FLAG) {
		if (nid == 0)
			nid = kctl->id.subdevice & 0xffff;
		kctl->id.subdevice = 0;
	}
	err = snd_ctl_add(codec->bus->card, kctl);
	if (err < 0)
		return err;
	item = snd_array_new(&codec->mixers);
	if (!item)
		return -ENOMEM;
	item->kctl = kctl;
	item->nid = nid;
	return 0;
}