mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-12-01 13:44:03 +02:00
242 lines
7.8 KiB
Diff
242 lines
7.8 KiB
Diff
--- a/include/sound/soc.h
|
|
+++ b/include/sound/soc.h
|
|
@@ -215,10 +215,10 @@ void snd_soc_jack_free_gpios(struct snd_
|
|
#endif
|
|
|
|
/* codec register bit access */
|
|
-int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg,
|
|
- unsigned short mask, unsigned short value);
|
|
-int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned short reg,
|
|
- unsigned short mask, unsigned short value);
|
|
+int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned int reg,
|
|
+ unsigned int mask, unsigned int value);
|
|
+int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned int reg,
|
|
+ unsigned int mask, unsigned int value);
|
|
|
|
int snd_soc_new_ac97_codec(struct snd_soc_codec *codec,
|
|
struct snd_ac97_bus_ops *ops, int num);
|
|
@@ -492,8 +492,8 @@ struct soc_mixer_control {
|
|
|
|
/* enumerated kcontrol */
|
|
struct soc_enum {
|
|
- unsigned short reg;
|
|
- unsigned short reg2;
|
|
+ unsigned int reg;
|
|
+ unsigned int reg2;
|
|
unsigned char shift_l;
|
|
unsigned char shift_r;
|
|
unsigned int max;
|
|
--- a/sound/soc/soc-core.c
|
|
+++ b/sound/soc/soc-core.c
|
|
@@ -500,8 +500,8 @@ static int soc_pcm_hw_params(struct snd_
|
|
if (cpu_dai->ops->hw_params) {
|
|
ret = cpu_dai->ops->hw_params(substream, params, cpu_dai);
|
|
if (ret < 0) {
|
|
- printk(KERN_ERR "asoc: interface %s hw params failed\n",
|
|
- cpu_dai->name);
|
|
+ printk(KERN_ERR "asoc: interface %s hw params failed: %d\n",
|
|
+ cpu_dai->name, ret);
|
|
goto interface_err;
|
|
}
|
|
}
|
|
@@ -842,7 +842,7 @@ static void snd_soc_instantiate_card(str
|
|
* DAIs currently; we can't do this per link since some AC97
|
|
* codecs have non-AC97 DAIs.
|
|
*/
|
|
- if (!ac97)
|
|
+ if (!ac97) {
|
|
for (i = 0; i < card->num_links; i++) {
|
|
found = 0;
|
|
list_for_each_entry(dai, &dai_list, list)
|
|
@@ -856,6 +856,7 @@ static void snd_soc_instantiate_card(str
|
|
return;
|
|
}
|
|
}
|
|
+ }
|
|
|
|
/* Note that we do not current check for codec components */
|
|
|
|
@@ -1263,11 +1264,11 @@ EXPORT_SYMBOL_GPL(snd_soc_free_ac97_code
|
|
*
|
|
* Returns 1 for change else 0.
|
|
*/
|
|
-int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg,
|
|
- unsigned short mask, unsigned short value)
|
|
+int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned int reg,
|
|
+ unsigned int mask, unsigned int value)
|
|
{
|
|
int change;
|
|
- unsigned short old, new;
|
|
+ unsigned int old, new;
|
|
|
|
mutex_lock(&io_mutex);
|
|
old = snd_soc_read(codec, reg);
|
|
@@ -1293,11 +1294,11 @@ EXPORT_SYMBOL_GPL(snd_soc_update_bits);
|
|
*
|
|
* Returns 1 for change else 0.
|
|
*/
|
|
-int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned short reg,
|
|
- unsigned short mask, unsigned short value)
|
|
+int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned int reg,
|
|
+ unsigned int mask, unsigned int value)
|
|
{
|
|
int change;
|
|
- unsigned short old, new;
|
|
+ unsigned int old, new;
|
|
|
|
mutex_lock(&io_mutex);
|
|
old = snd_soc_read(codec, reg);
|
|
@@ -1586,7 +1587,7 @@ int snd_soc_get_enum_double(struct snd_k
|
|
{
|
|
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
|
|
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
|
|
- unsigned short val, bitmask;
|
|
+ unsigned int val, bitmask;
|
|
|
|
for (bitmask = 1; bitmask < e->max; bitmask <<= 1)
|
|
;
|
|
@@ -1615,8 +1616,8 @@ int snd_soc_put_enum_double(struct snd_k
|
|
{
|
|
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
|
|
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
|
|
- unsigned short val;
|
|
- unsigned short mask, bitmask;
|
|
+ unsigned int val;
|
|
+ unsigned int mask, bitmask;
|
|
|
|
for (bitmask = 1; bitmask < e->max; bitmask <<= 1)
|
|
;
|
|
@@ -1652,7 +1653,7 @@ int snd_soc_get_value_enum_double(struct
|
|
{
|
|
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
|
|
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
|
|
- unsigned short reg_val, val, mux;
|
|
+ unsigned int reg_val, val, mux;
|
|
|
|
reg_val = snd_soc_read(codec, e->reg);
|
|
val = (reg_val >> e->shift_l) & e->mask;
|
|
@@ -1691,8 +1692,8 @@ int snd_soc_put_value_enum_double(struct
|
|
{
|
|
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
|
|
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
|
|
- unsigned short val;
|
|
- unsigned short mask;
|
|
+ unsigned int val;
|
|
+ unsigned int mask;
|
|
|
|
if (ucontrol->value.enumerated.item[0] > e->max - 1)
|
|
return -EINVAL;
|
|
@@ -1852,7 +1853,7 @@ int snd_soc_put_volsw(struct snd_kcontro
|
|
int max = mc->max;
|
|
unsigned int mask = (1 << fls(max)) - 1;
|
|
unsigned int invert = mc->invert;
|
|
- unsigned short val, val2, val_mask;
|
|
+ unsigned int val, val2, val_mask;
|
|
|
|
val = (ucontrol->value.integer.value[0] & mask);
|
|
if (invert)
|
|
@@ -1958,7 +1959,7 @@ int snd_soc_put_volsw_2r(struct snd_kcon
|
|
unsigned int mask = (1 << fls(max)) - 1;
|
|
unsigned int invert = mc->invert;
|
|
int err;
|
|
- unsigned short val, val2, val_mask;
|
|
+ unsigned int val, val2, val_mask;
|
|
|
|
val_mask = mask << shift;
|
|
val = (ucontrol->value.integer.value[0] & mask);
|
|
@@ -2050,7 +2051,7 @@ int snd_soc_put_volsw_s8(struct snd_kcon
|
|
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
|
|
unsigned int reg = mc->reg;
|
|
int min = mc->min;
|
|
- unsigned short val;
|
|
+ unsigned int val;
|
|
|
|
val = (ucontrol->value.integer.value[0]+min) & 0xff;
|
|
val |= ((ucontrol->value.integer.value[1]+min) & 0xff) << 8;
|
|
@@ -2251,6 +2252,7 @@ int snd_soc_register_dai(struct snd_soc_
|
|
if (!dai->ops)
|
|
dai->ops = &null_dai_ops;
|
|
|
|
+
|
|
INIT_LIST_HEAD(&dai->list);
|
|
|
|
mutex_lock(&client_mutex);
|
|
--- a/sound/soc/soc-dapm.c
|
|
+++ b/sound/soc/soc-dapm.c
|
|
@@ -268,7 +268,7 @@ static int dapm_connect_mixer(struct snd
|
|
static int dapm_update_bits(struct snd_soc_dapm_widget *widget)
|
|
{
|
|
int change, power;
|
|
- unsigned short old, new;
|
|
+ unsigned int old, new;
|
|
struct snd_soc_codec *codec = widget->codec;
|
|
|
|
/* check for valid widgets */
|
|
@@ -1246,7 +1246,6 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_add_route
|
|
/**
|
|
* snd_soc_dapm_new_widgets - add new dapm widgets
|
|
* @codec: audio codec
|
|
- *
|
|
* Checks the codec for any new dapm widgets and creates them if found.
|
|
*
|
|
* Returns 0 for success.
|
|
@@ -1336,7 +1335,8 @@ int snd_soc_dapm_get_volsw(struct snd_kc
|
|
|
|
ucontrol->value.integer.value[0] =
|
|
(snd_soc_read(widget->codec, reg) >> shift) & mask;
|
|
- if (shift != rshift)
|
|
+
|
|
+ if (shift != rshift)
|
|
ucontrol->value.integer.value[1] =
|
|
(snd_soc_read(widget->codec, reg) >> rshift) & mask;
|
|
if (invert) {
|
|
@@ -1372,7 +1372,7 @@ int snd_soc_dapm_put_volsw(struct snd_kc
|
|
int max = mc->max;
|
|
unsigned int mask = (1 << fls(max)) - 1;
|
|
unsigned int invert = mc->invert;
|
|
- unsigned short val, val2, val_mask;
|
|
+ unsigned int val, val2, val_mask;
|
|
int ret;
|
|
|
|
val = (ucontrol->value.integer.value[0] & mask);
|
|
@@ -1436,7 +1436,7 @@ int snd_soc_dapm_get_enum_double(struct
|
|
{
|
|
struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
|
|
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
|
|
- unsigned short val, bitmask;
|
|
+ unsigned int val, bitmask;
|
|
|
|
for (bitmask = 1; bitmask < e->max; bitmask <<= 1)
|
|
;
|
|
@@ -1464,8 +1464,8 @@ int snd_soc_dapm_put_enum_double(struct
|
|
{
|
|
struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
|
|
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
|
|
- unsigned short val, mux;
|
|
- unsigned short mask, bitmask;
|
|
+ unsigned int val, mux;
|
|
+ unsigned int mask, bitmask;
|
|
int ret = 0;
|
|
|
|
for (bitmask = 1; bitmask < e->max; bitmask <<= 1)
|
|
@@ -1523,7 +1523,7 @@ int snd_soc_dapm_get_value_enum_double(s
|
|
{
|
|
struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
|
|
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
|
|
- unsigned short reg_val, val, mux;
|
|
+ unsigned int reg_val, val, mux;
|
|
|
|
reg_val = snd_soc_read(widget->codec, e->reg);
|
|
val = (reg_val >> e->shift_l) & e->mask;
|
|
@@ -1563,8 +1563,8 @@ int snd_soc_dapm_put_value_enum_double(s
|
|
{
|
|
struct snd_soc_dapm_widget *widget = snd_kcontrol_chip(kcontrol);
|
|
struct soc_enum *e = (struct soc_enum *)kcontrol->private_value;
|
|
- unsigned short val, mux;
|
|
- unsigned short mask;
|
|
+ unsigned int val, mux;
|
|
+ unsigned int mask;
|
|
int ret = 0;
|
|
|
|
if (ucontrol->value.enumerated.item[0] > e->max - 1)
|