/* @regs: HDA registers @group_nid: Group node ID to check  */
static uint find_beep_node_in_group(struct hda_regs *regs, uint group_nid)
/* @regs: HDA registers @group_nid: Group node ID to check  */
static uint find_beep_node_in_group(struct hda_regs *regs, uint group_nid)
{
	uint node_count = 0;
	uint current_nid = 0;
	uint response;
	uint end_nid;
	int ret;
	ret = get_subnode_info(regs, group_nid, &node_count, &current_nid);
	if (ret < 0)
		return 0;
	end_nid = current_nid + node_count;
	while (current_nid < end_nid) {
		ret = exec_verb(regs,
				hda_verb(current_nid, HDA_VERB_GET_PARAMS,
					 GET_PARAMS_AUDIO_WIDGET_CAPS),
				&response);
		if (ret < 0) {
			printf("Audio: Error reading widget caps\n");
			return 0;
		}
		if ((response & AUDIO_WIDGET_TYPE_M) >> AUDIO_WIDGET_TYPE_S ==
		    AUDIO_WIDGET_TYPE_BEEP)
			return current_nid;
		current_nid++;
	}
	return 0;
}