diff options
author | Peter Ujfalusi <peter.ujfalusi@nokia.com> | 2009-01-08 06:34:29 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-01-08 08:09:52 -0500 |
commit | 741555568f8ba307c626019787c412f4386cafdc (patch) | |
tree | 6d1d8683d13d838e9eeb87899718b8ba5a1fddc4 /sound/soc/soc-core.c | |
parent | 227b4dc6432d271eecd0ff0aefe6f0897ec47397 (diff) |
ASoC: Merge the soc_value_enum to soc_enum struct
Merge the recently introduced soc_value_enum structure to the soc_enum.
The value based enums are still handled separately from the normal enum types,
but with the merge some of the newly introduced functions can be removed.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r-- | sound/soc/soc-core.c | 37 |
1 files changed, 2 insertions, 35 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 6cbe7e82f238..55fdb4abb179 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -1585,37 +1585,6 @@ int snd_soc_put_enum_double(struct snd_kcontrol *kcontrol, | |||
1585 | EXPORT_SYMBOL_GPL(snd_soc_put_enum_double); | 1585 | EXPORT_SYMBOL_GPL(snd_soc_put_enum_double); |
1586 | 1586 | ||
1587 | /** | 1587 | /** |
1588 | * snd_soc_info_value_enum_double - semi enumerated double mixer info callback | ||
1589 | * @kcontrol: mixer control | ||
1590 | * @uinfo: control element information | ||
1591 | * | ||
1592 | * Callback to provide information about a double semi enumerated | ||
1593 | * mixer control. | ||
1594 | * | ||
1595 | * Semi enumerated mixer: the enumerated items are referred as values. Can be | ||
1596 | * used for handling bitfield coded enumeration for example. | ||
1597 | * | ||
1598 | * Returns 0 for success. | ||
1599 | */ | ||
1600 | int snd_soc_info_value_enum_double(struct snd_kcontrol *kcontrol, | ||
1601 | struct snd_ctl_elem_info *uinfo) | ||
1602 | { | ||
1603 | struct soc_value_enum *e = (struct soc_value_enum *) | ||
1604 | kcontrol->private_value; | ||
1605 | |||
1606 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | ||
1607 | uinfo->count = e->shift_l == e->shift_r ? 1 : 2; | ||
1608 | uinfo->value.enumerated.items = e->max; | ||
1609 | |||
1610 | if (uinfo->value.enumerated.item > e->max - 1) | ||
1611 | uinfo->value.enumerated.item = e->max - 1; | ||
1612 | strcpy(uinfo->value.enumerated.name, | ||
1613 | e->texts[uinfo->value.enumerated.item]); | ||
1614 | return 0; | ||
1615 | } | ||
1616 | EXPORT_SYMBOL_GPL(snd_soc_info_value_enum_double); | ||
1617 | |||
1618 | /** | ||
1619 | * snd_soc_get_value_enum_double - semi enumerated double mixer get callback | 1588 | * snd_soc_get_value_enum_double - semi enumerated double mixer get callback |
1620 | * @kcontrol: mixer control | 1589 | * @kcontrol: mixer control |
1621 | * @ucontrol: control element information | 1590 | * @ucontrol: control element information |
@@ -1631,8 +1600,7 @@ int snd_soc_get_value_enum_double(struct snd_kcontrol *kcontrol, | |||
1631 | struct snd_ctl_elem_value *ucontrol) | 1600 | struct snd_ctl_elem_value *ucontrol) |
1632 | { | 1601 | { |
1633 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 1602 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); |
1634 | struct soc_value_enum *e = (struct soc_value_enum *) | 1603 | struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; |
1635 | kcontrol->private_value; | ||
1636 | unsigned short reg_val, val, mux; | 1604 | unsigned short reg_val, val, mux; |
1637 | 1605 | ||
1638 | reg_val = snd_soc_read(codec, e->reg); | 1606 | reg_val = snd_soc_read(codec, e->reg); |
@@ -1671,8 +1639,7 @@ int snd_soc_put_value_enum_double(struct snd_kcontrol *kcontrol, | |||
1671 | struct snd_ctl_elem_value *ucontrol) | 1639 | struct snd_ctl_elem_value *ucontrol) |
1672 | { | 1640 | { |
1673 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 1641 | struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); |
1674 | struct soc_value_enum *e = (struct soc_value_enum *) | 1642 | struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; |
1675 | kcontrol->private_value; | ||
1676 | unsigned short val; | 1643 | unsigned short val; |
1677 | unsigned short mask; | 1644 | unsigned short mask; |
1678 | 1645 | ||