从snd_kcontrol获取名称-Linux内核声音驱动程序
我声明了这样的内容:
SOC_SINGLE_EXT("EXAMPLE_NAME", SND_SOC_NOPM, 0, 1, 0,
example_get, example_put),
with:
static int example_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
struct struct_priv *my_struct = snd_soc_component_get_drvdata(component);
return 0;
}
如何在example> example_get
中获取名称example_name
?我也浏览了snd_kcontrol
struct和snd_soc_component
一个,但是snd_kcontrol
似乎没有名称和snd_soc_component-&gton ; name
不是我想要的。
有人知道吗?
I declare something like this:
SOC_SINGLE_EXT("EXAMPLE_NAME", SND_SOC_NOPM, 0, 1, 0,
example_get, example_put),
with:
static int example_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_soc_component *component = snd_soc_kcontrol_component(kcontrol);
struct struct_priv *my_struct = snd_soc_component_get_drvdata(component);
return 0;
}
How do I fetch the name EXAMPLE_NAME
in example_get
? I looked through the snd_kcontrol
struct and the snd_soc_component
one too, but snd_kcontrol
doesn't seem to have a name and snd_soc_component->name
isn't what I want.
Anyone idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
回答我自己的问题,因为我找出答案并认为这对他人可能很有用。
使用
kcontrol-> id.name
是我需要的。在我的示例情况下,这是我要寻找的内容,返回example_name
。Answering my own question since I figured out the answer and thought it might be useful to others.
Using
kcontrol->id.name
is what I needed. This returnsEXAMPLE_NAME
in my example case, which is what I was looking for.