Linux Sound subsystem development
 help / color / mirror / Atom feed
* Question about conversion kcontrol to component
@ 2025-04-25  4:16 Kuninori Morimoto
  2025-04-25 15:58 ` Charles Keepax
  0 siblings, 1 reply; 3+ messages in thread
From: Kuninori Morimoto @ 2025-04-25  4:16 UTC (permalink / raw)
  To: linux-sound


Hi ALSA ML

I have noticed that we have similar functions

	snd_soc_kcontrol_component()
	snd_soc_dapm_kcontrol_component()

Both converts snd_kcontrol to snd_soc_component.
I wonder can we merge these ? or which we can use is case-by-case ?

Thank you for your help !!

Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Question about conversion kcontrol to component
  2025-04-25  4:16 Question about conversion kcontrol to component Kuninori Morimoto
@ 2025-04-25 15:58 ` Charles Keepax
  2025-05-07  0:19   ` Kuninori Morimoto
  0 siblings, 1 reply; 3+ messages in thread
From: Charles Keepax @ 2025-04-25 15:58 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: linux-sound

On Fri, Apr 25, 2025 at 04:16:10AM +0000, Kuninori Morimoto wrote:
> 
> Hi ALSA ML
> 
> I have noticed that we have similar functions
> 
> 	snd_soc_kcontrol_component()
> 	snd_soc_dapm_kcontrol_component()
> 
> Both converts snd_kcontrol to snd_soc_component.
> I wonder can we merge these ? or which we can use is case-by-case ?
> 

I think this is case-by-case snd_soc_kcontrol_component() relies on
the component being stored in private_data on the kcontrol, which is
true for all controls added through snd_soc_add_component_controls(),
but not true for DAPM controls which often use private_data for
various internal things and call snd_soc_cnew() directly.

Thanks,
Charles

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Question about conversion kcontrol to component
  2025-04-25 15:58 ` Charles Keepax
@ 2025-05-07  0:19   ` Kuninori Morimoto
  0 siblings, 0 replies; 3+ messages in thread
From: Kuninori Morimoto @ 2025-05-07  0:19 UTC (permalink / raw)
  To: Charles Keepax; +Cc: linux-sound


Hi Charles

Thank you for your reply, and sorry for my late response
(Japan was long holiday which is called as Golden Week).

> > I have noticed that we have similar functions
> > 
> > 	snd_soc_kcontrol_component()
> > 	snd_soc_dapm_kcontrol_component()
> > 
> > Both converts snd_kcontrol to snd_soc_component.
> > I wonder can we merge these ? or which we can use is case-by-case ?
> > 
> 
> I think this is case-by-case snd_soc_kcontrol_component() relies on
> the component being stored in private_data on the kcontrol, which is
> true for all controls added through snd_soc_add_component_controls(),
> but not true for DAPM controls which often use private_data for
> various internal things and call snd_soc_cnew() directly.

OK, thanks. I will investigate about this. Your reply is good hint for it.
I think we want to use same function for it.

Thank you for your help !!

Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-05-07  0:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-25  4:16 Question about conversion kcontrol to component Kuninori Morimoto
2025-04-25 15:58 ` Charles Keepax
2025-05-07  0:19   ` Kuninori Morimoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox