从snd_kcontrol获取名称-Linux内核声音驱动程序

发布于 2025-02-12 13:59:46 字数 780 浏览 3 评论 0原文

我声明了这样的内容:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

简单气质女生网名 2025-02-19 13:59:46

回答我自己的问题,因为我找出答案并认为这对他人可能很有用。

使用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 returns EXAMPLE_NAME in my example case, which is what I was looking for.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文