From: Mark Brown Date: Thu, 6 Mar 2014 09:07:39 +0000 (+0800) Subject: Merge branch 'topic/pcm' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie... X-Git-Tag: v3.15-rc1~36^2~1^2~5^2~12^2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6af5263ceaffc9d4403592dc81cd3b197702dc69;p=karo-tx-linux.git Merge branch 'topic/pcm' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-enum Conflicts: include/sound/soc.h --- 6af5263ceaffc9d4403592dc81cd3b197702dc69 diff --cc include/sound/soc.h index 08cb677b464b,b14acd8228ab..5710f9e4b43f --- a/include/sound/soc.h +++ b/include/sound/soc.h @@@ -1178,30 -1175,17 +1185,41 @@@ static inline bool snd_soc_volsw_is_ste return 1; } +static inline unsigned int snd_soc_enum_val_to_item(struct soc_enum *e, + unsigned int val) +{ + unsigned int i; + + if (!e->values) + return val; + + for (i = 0; i < e->items; i++) + if (val == e->values[i]) + return i; + + return 0; +} + +static inline unsigned int snd_soc_enum_item_to_val(struct soc_enum *e, + unsigned int item) +{ + if (!e->values) + return item; + + return e->values[item]; +} + + static inline bool snd_soc_component_is_active( + struct snd_soc_component *component) + { + return component->active != 0; + } + + static inline bool snd_soc_codec_is_active(struct snd_soc_codec *codec) + { + return snd_soc_component_is_active(&codec->component); + } + int snd_soc_util_init(void); void snd_soc_util_exit(void);