Lines Matching refs:nid
80 ssize_t (*show)(struct hdac_device *codec, hda_nid_t nid,
82 ssize_t (*store)(struct hdac_device *codec, hda_nid_t nid,
90 int nid; in get_codec_nid() local
93 ret = kstrtoint(kobj->name, 16, &nid); in get_codec_nid()
97 return nid; in get_codec_nid()
106 int nid; in widget_attr_show() local
110 nid = get_codec_nid(kobj, &codec); in widget_attr_show()
111 if (nid < 0) in widget_attr_show()
112 return nid; in widget_attr_show()
113 return wid_attr->show(codec, nid, wid_attr, buf); in widget_attr_show()
122 int nid; in widget_attr_store() local
126 nid = get_codec_nid(kobj, &codec); in widget_attr_store()
127 if (nid < 0) in widget_attr_store()
128 return nid; in widget_attr_store()
129 return wid_attr->store(codec, nid, wid_attr, buf, count); in widget_attr_store()
152 static ssize_t caps_show(struct hdac_device *codec, hda_nid_t nid, in caps_show() argument
155 return sprintf(buf, "0x%08x\n", get_wcaps(codec, nid)); in caps_show()
158 static ssize_t pin_caps_show(struct hdac_device *codec, hda_nid_t nid, in pin_caps_show() argument
161 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN) in pin_caps_show()
164 snd_hdac_read_parm(codec, nid, AC_PAR_PIN_CAP)); in pin_caps_show()
167 static ssize_t pin_cfg_show(struct hdac_device *codec, hda_nid_t nid, in pin_cfg_show() argument
172 if (get_wcaps_type(get_wcaps(codec, nid)) != AC_WID_PIN) in pin_cfg_show()
174 if (snd_hdac_read(codec, nid, AC_VERB_GET_CONFIG_DEFAULT, 0, &val)) in pin_cfg_show()
179 static bool has_pcm_cap(struct hdac_device *codec, hda_nid_t nid) in has_pcm_cap() argument
181 if (nid == codec->afg || nid == codec->mfg) in has_pcm_cap()
183 switch (get_wcaps_type(get_wcaps(codec, nid))) { in has_pcm_cap()
192 static ssize_t pcm_caps_show(struct hdac_device *codec, hda_nid_t nid, in pcm_caps_show() argument
195 if (!has_pcm_cap(codec, nid)) in pcm_caps_show()
198 snd_hdac_read_parm(codec, nid, AC_PAR_PCM)); in pcm_caps_show()
201 static ssize_t pcm_formats_show(struct hdac_device *codec, hda_nid_t nid, in pcm_formats_show() argument
204 if (!has_pcm_cap(codec, nid)) in pcm_formats_show()
207 snd_hdac_read_parm(codec, nid, AC_PAR_STREAM)); in pcm_formats_show()
210 static ssize_t amp_in_caps_show(struct hdac_device *codec, hda_nid_t nid, in amp_in_caps_show() argument
213 if (nid != codec->afg && !(get_wcaps(codec, nid) & AC_WCAP_IN_AMP)) in amp_in_caps_show()
216 snd_hdac_read_parm(codec, nid, AC_PAR_AMP_IN_CAP)); in amp_in_caps_show()
219 static ssize_t amp_out_caps_show(struct hdac_device *codec, hda_nid_t nid, in amp_out_caps_show() argument
222 if (nid != codec->afg && !(get_wcaps(codec, nid) & AC_WCAP_OUT_AMP)) in amp_out_caps_show()
225 snd_hdac_read_parm(codec, nid, AC_PAR_AMP_OUT_CAP)); in amp_out_caps_show()
228 static ssize_t power_caps_show(struct hdac_device *codec, hda_nid_t nid, in power_caps_show() argument
231 if (nid != codec->afg && !(get_wcaps(codec, nid) & AC_WCAP_POWER)) in power_caps_show()
234 snd_hdac_read_parm(codec, nid, AC_PAR_POWER_STATE)); in power_caps_show()
237 static ssize_t gpio_caps_show(struct hdac_device *codec, hda_nid_t nid, in gpio_caps_show() argument
241 snd_hdac_read_parm(codec, nid, AC_PAR_GPIO_CAP)); in gpio_caps_show()
244 static ssize_t connections_show(struct hdac_device *codec, hda_nid_t nid, in connections_show() argument
251 nconns = snd_hdac_get_connections(codec, nid, list, ARRAY_SIZE(list)); in connections_show()
330 static int add_widget_node(struct kobject *parent, hda_nid_t nid, in add_widget_node() argument
340 err = kobject_add(kobj, parent, "%02x", nid); in add_widget_node()
357 hda_nid_t nid; in widget_tree_create() local
372 for (i = 0, nid = codec->start_nid; i < codec->num_nodes; i++, nid++) { in widget_tree_create()
373 err = add_widget_node(tree->root, nid, &widget_node_group, in widget_tree_create()