summaryrefslogtreecommitdiffstats
path: root/include/sound/soc.h
Commit message (Collapse)AuthorAgeFilesLines
*-. Merge remote-tracking branches 'asoc/topic/gpio' and 'asoc/topic/intel' into ↵Mark Brown2014-06-031-2/+20
|\ \ | | | | | | | | | asoc-next
| * | ASoC: jack: Fix multiple definition of `snd_soc_jack_add_gpiods'Jarkko Nikula2014-05-271-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit f025d3b9c64e ("ASoC: jack: Add support for GPIO descriptor defined jack pins") caused build error when CONFIG_GPIOLIB is not set: sound/include/sound/soc.h:470: multiple definition of `snd_soc_jack_add_gpiods' sound/soc/soc-core.o:sound/include/sound/soc.h:470: first defined here make[2]: *** [sound/soc/snd-soc-core.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [sound/soc] Error 2 make: *** [sound] Error 2 Fix this by marking snd_soc_jack_add_gpiods() as static inline in soc.h. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | ASoC: jack: Clarify GPIO descriptor lookup in struct snd_soc_jack_gpio docJarkko Nikula2014-05-271-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clarify struct snd_soc_jack_gpio documentation for the idx and name fields. Because name is passed as connection ID to gpiod_get_index() when using GPIO descriptor defined jack pins it is not only used as a label in debugfs but also as function name lookup in systems that support functions names for GPIOs. Clarify also idx since the index is within the function of the GPIO consumer device and not within the device itself only. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | ASoC: jack: Add support for GPIO descriptor defined jack pinsJarkko Nikula2014-05-261-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow jack GPIO pins be defined also using GPIO descriptor-based interface in addition to legacy GPIO numbers. This is done by adding two new fields to struct snd_soc_jack_gpio: idx and gpiod_dev. Legacy GPIO numbers are used only when GPIO consumer device gpiod_dev is NULL and otherwise idx is the descriptor index within the GPIO consumer device. New function snd_soc_jack_add_gpiods() is added for typical cases where all GPIO descriptor jack pins belong to same GPIO consumer device. For other cases the caller must set the gpiod_dev in struct snd_soc_jack_gpio before calling snd_soc_jack_add_gpios(). Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | ASoC: jack: Basic GPIO descriptor conversionJarkko Nikula2014-05-261-0/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | This patch does basic GPIO descriptor conversion to soc-jack. Even the GPIOs are still passed and requested using legacy GPIO numbers the driver internals are converted to use GPIO descriptor API. Motivation for this is to prepare soc-jack so that it will allow registering jack GPIO pins using both GPIO descriptors and legacy GPIO numbers. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | Merge remote-tracking branch 'asoc/topic/core' into asoc-nextMark Brown2014-06-031-0/+27
|\ \
| * | ASoC: Add helper functions to cast from DAPM context to CODEC/platformLars-Peter Clausen2014-06-011-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is useful if we have a pointer to a DAPM context and know that it is a CODEC or platform DAPM context and want to get a pointer to the CODEC or platform. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
| | |
| \ \
*-. \ \ Merge remote-tracking branches 'asoc/topic/rt5651', 'asoc/topic/samsung', ↵Mark Brown2014-05-221-1/+3
|\ \ \ \ | | |_|/ | |/| | | | | | 'asoc/topic/sgtl5000', 'asoc/topic/sh', 'asoc/topic/simple', 'asoc/topic/sirf', 'asoc/topic/sta350' and 'asoc/topic/tlv320dac33' into asoc-next
| | * | ASoC: core: Update snd_soc_of_parse_daifmt() interfaceJyri Sarha2014-04-231-1/+3
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds struct device_node **bitclkmaster and struct device_node **framemaster function parameters. With the new syntax bitclock-master and frame-master properties can explicitly indicate the dai-link bit-clock and frame masters with a phandle. This patch also makes the minimal changes to simple-card for it to work with the updated snd_soc_of_parse_daifmt(). Simple-card appears to be the only user of snd_soc_of_parse_daifmt() for now. Signed-off-by: Jyri Sarha <jsarha@ti.com> Acked-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mark Brown <broonie@linaro.org>
| | |
| \ \
*-. \ \ Merge remote-tracking branches 'asoc/topic/cs42l56', 'asoc/topic/cs42xx8' ↵Mark Brown2014-05-221-0/+2
|\ \ \ \ | | |/ / | |/| | | | | | and 'asoc/topic/davinci' into asoc-next
| | * | ASoC: Add resource managed snd_soc_register_platform()Peter Ujfalusi2014-04-181-0/+2
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | Simplify error handling and remove repetitive (and rarely executed) code for unregistration by providing a devm_snd_soc_register_platform() platform. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | | Merge remote-tracking branch 'asoc/topic/enum' into asoc-nextMark Brown2014-05-221-2/+0
|\ \ \
| * | | ASoC: Remove deprecated ENUM/MUX macrosLars-Peter Clausen2014-04-141-2/+0
| |/ / | | | | | | | | | | | | | | | | | | | | | Since there are no users left, we can remove the deprecated ENUM and MUX macros which are just alias for other macros. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* | | Merge remote-tracking branch 'asoc/topic/dt' into asoc-nextMark Brown2014-05-221-1/+12
|\ \ \ | |_|/ |/| |
| * | ASoC: dt: Allow Aux Codecs to be specified using DTSebastian Reichel2014-05-011-1/+12
| |/ | | | | | | | | | | | | | | | | | | | | | | This patch adds support for specifying auxiliary codecs and codec configuration via device tree phandles. This change adds new fields to snd_soc_aux_dev and snd_soc_codec_conf and adds support for the changes to SoC core methods. Signed-off-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Sebastian Reichel <sre@kernel.org> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: Remove unused num_dai field from CODECLars-Peter Clausen2014-05-071-1/+0
| | | | | | | | | | | | | | | | Commit d191bd8de8 ("ASoC: snd_soc_codec includes snd_soc_component") removed the last user of the num_dai field. Also remove the field itself. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: Remove unused 'list' field form cardLars-Peter Clausen2014-05-071-1/+0
| | | | | | | | | | | | | | | | | | The global card list was removed in commit b19e6e7b7 ("ASoC: core: Use driver core probe deferral"). The 'list' field of the snd_soc_card struct has been unused since then. This patch removes the field. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: Remove card's DAI listLars-Peter Clausen2014-05-071-2/+0
| | | | | | | | | | | | | | | | | | Commit f0fba2ad1 ("ASoC: multi-component - ASoC Multi-Component Support") added a per card list that keeps track of all the DAIs that have been registered with the card, but the list has never been used. This patch removes it again. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* | Merge branch 'topic/component' of ↵Mark Brown2014-05-071-10/+44
|\ \ | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-core
| * | ASoC: Move standard kcontrol helpers to the component levelLars-Peter Clausen2014-04-221-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | After moving the IO layer inside ASoC to the component level we can now easily move the standard control helpers also to the component level. This allows to reuse the same standard helper control implementations for other components. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | ASoC: Move IO abstraction to the component levelLars-Peter Clausen2014-04-221-7/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently have two very similar IO abstractions in ASoC, one for CODECs, the other for platforms. Moving this to the component level will allow us to unify those two. It will also enable us to move the standard kcontrol helpers as well as DAPM support to the component level. The new component level abstraction layer is primarily build around regmap. There is a per component pointer for the regmap instance for the underlying device. There are four new function snd_soc_component_read(), snd_soc_component_write(), snd_soc_component_update_bits() and snd_soc_component_update_bits_async(). They have the same signature as their regmap counter-part and will internally forward the call one-to-one to regmap. If the component it not using regmap it will fallback to using the custom IO callbacks. This is done to be able to support drivers that haven't been converted to regmap yet, but it is expected that this will eventually be removed in the future once all component drivers have been converted to regmap. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
| | |
| | \
| | \
| | \
| *---. \ Merge branches 'topic/sta350', 'topic/core', 'topic/dapm' and 'topic/cache' ↵Mark Brown2014-04-221-5/+6
| |\ \ \ \ | | | |_|/ | | |/| | | | | | | of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-component
| | | | * ASoC: core: Move the default regmap I/O setting to snd_soc_register_codec()Xiubo Li2014-04-141-0/+1
| | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the default regmap I/O setting to snd_soc_register_codec() while the CODEC is initialising, which will be called by CODEC driver device probe(), and then we can make XXX_set_cache_io() go away entirely from each CODEC ASoC probe. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | | ASoC: Fix snd_soc_kcontrol_platform() return typeLars-Peter Clausen2014-04-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This should obviously be snd_soc_platform * and not snd_soc_codec * Fixes: f6272ff8a5f4 ("ASoC: Add snd_soc_kcontrol_platform() helper function") Reported-by: kbuild test robot <fengguang.wu@intel.com> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* | | | ASoC: add SND_SOC_BYTES_EXTVinod Koul2014-05-021-0/+13
| |_|/ |/| | | | | | | | | | | | | | | | | | | | we need _EXT version for SND_SOC_BYTES so that DSPs can use this to pass data for DSP modules Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | | ASoC: Change return type of snd_soc_write() to intLars-Peter Clausen2014-04-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The CODEC's write callback can return a negative error code, make sure to pass that on correctly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* | | Merge branch 'topic/component' of ↵Mark Brown2014-04-141-14/+45
|\| | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-core Conflicts: sound/soc/soc-core.c
| * | ASoC: Let snd_soc_platform subclass snd_soc_componentLars-Peter Clausen2014-04-141-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is an increasing amount of code that is very similar between platforms, CODECS and other components. Making platforms a component will allow us to share this code. For now the patch just adds component and component_driver fields to the platform and platform_driver structs and registers the platform as a component. Followup patches will be used to consolidate code between the different types of components. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | ASoC: Track which components have been registered with ↵Lars-Peter Clausen2014-04-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | snd_soc_register_component() snd_soc_unregister_component() takes the parent device of the component as a parameter and then looks up the component based on this. This is a problem if multiple components are registered for the same parent device. Currently drivers do not do this, but some drivers register a CPU DAI component and a platform for the same parent device. This will become a problem once platforms are also made components. To make sure that snd_soc_unregister_component() will not accidentally unregister the platform in such a case only consider components that were registered with snd_soc_register_component(). This is only meant as short term stopgap solution to be able to continue componentisation. Long term we'll need something different. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | ASoC: Remove IO register modifier callbacksLars-Peter Clausen2014-04-141-14/+0
| | | | | | | | | | | | | | | | | | | | | | | | There are no ASoC drivers left that use them and new drivers are supposed to use regmap for this. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | ASoC: Add snd_soc_kcontrol_platform() helper functionLars-Peter Clausen2014-04-141-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For platform controls snd_kcontrol_chip() currently returns a pointer to the platform that registered the control. With the upcoming consolidation of platform and CODEC controls this will change. Prepare for this by introducing the snd_soc_kcontrol_platform() helper function that will hide the implementation details of how the platform for a control can be obtained. This will allow us to change this easily in the future. The patch also updates all platforms to use this new helper function. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | ASoC: Add snd_soc_kcontrol_codec() helper functionLars-Peter Clausen2014-04-141-0/+14
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | For CODEC controls snd_kcontrol_chip() currently returns a pointer to the CODEC that registered the control. With the upcoming consolidation of platform and CODEC controls this will change. Prepare for this by introducing the snd_soc_kcontrol_codec() helper function that will hide the implementation details of how the CODEC for a control can be obtained. This will allow us to change this easily in the future. The patch also updates all CODEC drivers to use the new helper function. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* / ASoC: core: Allow snd_soc_update_bits use 32 bits registerBard Liao2014-04-141-3/+3
|/ | | | | | | | Change reg's type from unsigned short to unsigned int. So that we can use 32 bits reg value in snd_soc_update_bits. Signed-off-by: Bard Liao <bardliao@realtek.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* Merge remote-tracking branch 'asoc/topic/core' into asoc-nextMark Brown2014-03-231-0/+13
|\
| * ASoC: Add helper function to cast component back to CODECLars-Peter Clausen2014-03-191-0/+13
| | | | | | | | | | | | | | | | | | Add a helper function to cast back from a component struct to the CODEC struct it is embedded in. This is useful in situations where we know that a certain component is a CODEC and want to get access to some CODEC specific properties. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* | Merge remote-tracking branch 'asoc/topic/jack' into asoc-nextMark Brown2014-03-131-1/+2
|\ \
| * | ASoC: add data field into snd_soc_jack_gpioxiangxiao2014-02-241-1/+2
| | | | | | | | | | | | | | | | | | | | | so callback could get the context data as needed Signed-off-by: xiangxiao <xiaoxiang@xiaomi.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | | Merge remote-tracking branch 'asoc/topic/io' into asoc-nextMark Brown2014-03-131-9/+1
|\ \ \
| * | | ASoC: io: New signature for snd_soc_codec_set_cache_io()Xiubo Li2014-03-111-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that all users have been converted to regmap and the config.reg_bits and config.val_bits can be setted by each user through regmap core API. So these two params are redundant here. Since the only control type that left is SND_SOC_REGMAP, so remove it. Drop the control params and add struct regmap *regmap to simplify the code. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| | | |
| | \ \
| *-. \ \ Merge branches 'topic/ad193x', 'topic/tlv320aic23', 'topic/tlv320aic32x4', ↵Mark Brown2014-03-111-0/+15
| |\ \ \ \ | | | |/ / | | |/| | | | | | | 'topic/wm8991', 'fix/si476x' and 'fix/88pm860' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-io
| * | | | ASoC: io: Remove hw_read() operationMark Brown2014-03-041-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now no longer have any users of hw_read() in the kernel so remove the code in order to prevent any new users being added. Users should be using regmap. Signed-off-by: Mark Brown <broonie@linaro.org>
| * | | | ASoC: io: Remove SND_SOC_I2CMark Brown2014-02-231-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that all users have been converted to regmap we can eliminate the ASoC level wrapper for I2C I/O reducing the amount of duplicated functionality. Signed-off-by: Mark Brown <broonie@linaro.org>
| * | | | ASoC: io: Remove SPI supportMark Brown2014-02-161-1/+0
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | All ASoC CODEC drivers that use SPI have now been converted to use regmap so we can delete SND_SOC_SPI, preventing any new users being added. Signed-off-by: Mark Brown <broonie@linaro.org>
| | | |
| \ \ \
*-. \ \ \ Merge remote-tracking branches 'asoc/topic/ml26124', 'asoc/topic/of', ↵Mark Brown2014-03-121-0/+5
|\ \ \ \ \ | | |/ / / | |/| | | | | | | | 'asoc/topic/omap', 'asoc/topic/pxa' and 'asoc/topic/rcar' into asoc-next
| | * | | ASoC: core: add TDM slot parsing from DT supportsXiubo Li2014-02-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For some CPU/CODEC DAI devices the TDM slot infomation maybe needed. This patch adds the slot parsing from DT supports. TDM slot properties: dai-tdm-slot-num : Number of slots in use. dai-tdm-slot-width : Width in bits for each slot. For instance: dai-tdm-slot-num = <2>; dai-tdm-slot-width = <8>; And for each spcified driver, there could be one .of_xlate_tdm_slot_mask() to specify a explicit mapping of the channels and the slots. If it's absent the default snd_soc_of_xlate_tdm_slot_mask() will be used to generating the tx and rx masks. For snd_soc_of_xlate_tdm_slot_mask(), the tx and rx masks will use a 1 bit for an active slot as default, and the default active bits are at the LSB of the masks. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
| | * | | ASoC: add snd_soc_of_parse_audio_simple_widgets for DTXiubo Li2014-02-101-0/+2
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds snd_soc_of_parse_audio_simple_widgets() and supports below style of widgets name on DT: "template-wname", "user supplied wname" For instance: simple-audio-widgets = "Microphone", "Microphone Jack", "Line", "Line In Jack", "Line", "Line Out Jack", "Headphone", "Headphone Jack", "Speaker", "Speaker External"; The "template-wname" currently includes: "Microphone", "Line", "Headphone" and "Speaker". Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | | | Merge remote-tracking branch 'asoc/topic/enum' into asoc-nextMark Brown2014-03-121-26/+60
|\ \ \ \
| * \ \ \ Merge branch 'topic/pcm' of ↵Mark Brown2014-03-061-2/+20
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-enum Conflicts: include/sound/soc.h
| * | | | | ASoC: Add macros for defining virtual enumsLars-Peter Clausen2014-03-011-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the upcoming consolidation of normal MUXs and virtual MUXs we need to be able to distinguish between enums with and without a backing register at the enum level. Use the same approach as used for virtual mixer controls by setting the reg field of the enum to SND_SOC_NOPM for enums without a backing register. This patch adds a set of helper macros that can be used to define such enums. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
| * | | | | ASoC: Consolidate enum and value enum controlsLars-Peter Clausen2014-03-011-9/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementations for enum and value enum controls are almost identical. The only difference is that the value enum uses an additional look-up table to map the control value to the register value, while the enum control uses a direct mapping. Enums and value enums can easily be distinguished at runtime, for value enums the values field of the snd_soc_enum struct contains the look-up table, while for enums it is NULL. This patch adds two new small helper functions called snd_soc_enum_item_to_val() and snd_soc_enum_val_to_item() which map between register value and control item. If the items field of the snd_soc_enum struct is NULL the function will do a direct mapping otherwise they'll use the look-up table to do the mapping. Using these small helper functions it is possible to use the same kcontrol handlers for both enums and value enums. The functions are added a inline functions in soc.h so they can also be used by the DAPM code to accomplish similar consolidation. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>