@@ -392,10 +392,8 @@ static const char *twl6040_amicr_texts[] =
{"Headset Mic", "Sub Mic", "Aux/FM Right", "Off"};
static const struct soc_enum twl6040_enum[] = {
- SOC_ENUM_SINGLE(TWL6040_REG_MICLCTL, 3,
- ARRAY_SIZE(twl6040_amicl_texts), twl6040_amicl_texts),
- SOC_ENUM_SINGLE(TWL6040_REG_MICRCTL, 3,
- ARRAY_SIZE(twl6040_amicr_texts), twl6040_amicr_texts),
+ SOC_ENUM_SINGLE_CONST(TWL6040_REG_MICLCTL, 3, twl6040_amicl_texts),
+ SOC_ENUM_SINGLE_CONST(TWL6040_REG_MICRCTL, 3, twl6040_amicr_texts),
};
static const char *twl6040_hs_texts[] = {
@@ -403,10 +401,8 @@ static const char *twl6040_hs_texts[] = {
};
static const struct soc_enum twl6040_hs_enum[] = {
- SOC_ENUM_SINGLE(TWL6040_REG_HSLCTL, 5, ARRAY_SIZE(twl6040_hs_texts),
- twl6040_hs_texts),
- SOC_ENUM_SINGLE(TWL6040_REG_HSRCTL, 5, ARRAY_SIZE(twl6040_hs_texts),
- twl6040_hs_texts),
+ SOC_ENUM_SINGLE_CONST(TWL6040_REG_HSLCTL, 5, twl6040_hs_texts),
+ SOC_ENUM_SINGLE_CONST(TWL6040_REG_HSRCTL, 5, twl6040_hs_texts),
};
static const char *twl6040_hf_texts[] = {
@@ -414,10 +410,8 @@ static const char *twl6040_hf_texts[] = {
};
static const struct soc_enum twl6040_hf_enum[] = {
- SOC_ENUM_SINGLE(TWL6040_REG_HFLCTL, 2, ARRAY_SIZE(twl6040_hf_texts),
- twl6040_hf_texts),
- SOC_ENUM_SINGLE(TWL6040_REG_HFRCTL, 2, ARRAY_SIZE(twl6040_hf_texts),
- twl6040_hf_texts),
+ SOC_ENUM_SINGLE_CONST(TWL6040_REG_HFLCTL, 2, twl6040_hf_texts),
+ SOC_ENUM_SINGLE_CONST(TWL6040_REG_HFRCTL, 2, twl6040_hf_texts),
};
static const char *twl6040_vibrapath_texts[] = {
@@ -425,12 +419,8 @@ static const char *twl6040_vibrapath_texts[] = {
};
static const struct soc_enum twl6040_vibra_enum[] = {
- SOC_ENUM_SINGLE(TWL6040_REG_VIBCTLL, 1,
- ARRAY_SIZE(twl6040_vibrapath_texts),
- twl6040_vibrapath_texts),
- SOC_ENUM_SINGLE(TWL6040_REG_VIBCTLR, 1,
- ARRAY_SIZE(twl6040_vibrapath_texts),
- twl6040_vibrapath_texts),
+ SOC_ENUM_SINGLE_CONST(TWL6040_REG_VIBCTLL, 1, twl6040_vibrapath_texts),
+ SOC_ENUM_SINGLE_CONST(TWL6040_REG_VIBCTLR, 1, twl6040_vibrapath_texts),
};
static const struct snd_kcontrol_new amicl_control =
... for improving readability and maintainability. Signed-off-by: Takashi Iwai <tiwai@suse.de> --- sound/soc/codecs/twl6040.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-)