mbox series

[RFC,v2,0/2] Enable using multiple kcontrol types in a widget

Message ID 20210113152540.2116439-1-jaska.uimonen@linux.intel.com (mailing list archive)
Headers show
Series Enable using multiple kcontrol types in a widget | expand

Message

Jaska Uimonen Jan. 13, 2021, 3:25 p.m. UTC
Hi,

I'm requesting comments to this small series to enable multiple
different kcontrol types for a single widget.

Currently asoc allows to define and parse multiple same type kcontrols
for single widget. So you can have for example two volume controls in a
widget but not for example one byte and one enum control. I personally
had this kind of use case where I wanted to set filter coefficients with
bytes and something else with an enum in one processing widget.

I don't have that good perspective on the asoc history on this part so I
don't know is there some reason for the existing logic or is it just ok
to change it like in this series. I've been told some drivers use
virtual widget for this kind of situation, so they define two widget's
(one virtual) with separate controls, but in reality bind the controls
into the same component in lower level. Or can we just actually use
separate types in one widget?

First patch is changing the kcontrol_type uint in dapm widget to a
pointer to hold an array of kcontrol types and then creating these
different types in a loop in dapm widget load. Second patch is me
utilizing this in sof driver.

Changes since v1:
- don't add kcontrol type to core i.e. to kcontrol and kcontrol_news
- extend existing dapm widget kcontrol_type into holding an array of
  types

Jaska Uimonen (2):
  ASoC: soc-dapm: enable use of multiple control types
  ASoC: SOF: topology: use individual kcontrol types

 include/sound/soc-topology.h |   2 +-
 sound/soc/soc-topology.c     | 466 +++++++++++++++++------------------
 sound/soc/sof/topology.c     |  13 +-
 3 files changed, 232 insertions(+), 249 deletions(-)