|
@@ -3343,7 +3343,7 @@ int snd_soc_get_xr_sx(struct snd_kcontrol *kcontrol,
|
|
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
|
|
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
|
|
unsigned int regbase = mc->regbase;
|
|
unsigned int regbase = mc->regbase;
|
|
unsigned int regcount = mc->regcount;
|
|
unsigned int regcount = mc->regcount;
|
|
- unsigned int regwshift = codec->driver->reg_word_size * BITS_PER_BYTE;
|
|
|
|
|
|
+ unsigned int regwshift = codec->val_bytes * BITS_PER_BYTE;
|
|
unsigned int regwmask = (1<<regwshift)-1;
|
|
unsigned int regwmask = (1<<regwshift)-1;
|
|
unsigned int invert = mc->invert;
|
|
unsigned int invert = mc->invert;
|
|
unsigned long mask = (1UL<<mc->nbits)-1;
|
|
unsigned long mask = (1UL<<mc->nbits)-1;
|
|
@@ -3389,7 +3389,7 @@ int snd_soc_put_xr_sx(struct snd_kcontrol *kcontrol,
|
|
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
|
|
struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
|
|
unsigned int regbase = mc->regbase;
|
|
unsigned int regbase = mc->regbase;
|
|
unsigned int regcount = mc->regcount;
|
|
unsigned int regcount = mc->regcount;
|
|
- unsigned int regwshift = codec->driver->reg_word_size * BITS_PER_BYTE;
|
|
|
|
|
|
+ unsigned int regwshift = codec->val_bytes * BITS_PER_BYTE;
|
|
unsigned int regwmask = (1<<regwshift)-1;
|
|
unsigned int regwmask = (1<<regwshift)-1;
|
|
unsigned int invert = mc->invert;
|
|
unsigned int invert = mc->invert;
|
|
unsigned long mask = (1UL<<mc->nbits)-1;
|
|
unsigned long mask = (1UL<<mc->nbits)-1;
|
|
@@ -4292,6 +4292,7 @@ int snd_soc_register_codec(struct device *dev,
|
|
codec->dev = dev;
|
|
codec->dev = dev;
|
|
codec->driver = codec_drv;
|
|
codec->driver = codec_drv;
|
|
codec->num_dai = num_dai;
|
|
codec->num_dai = num_dai;
|
|
|
|
+ codec->val_bytes = codec_drv->reg_word_size;
|
|
mutex_init(&codec->mutex);
|
|
mutex_init(&codec->mutex);
|
|
|
|
|
|
for (i = 0; i < num_dai; i++) {
|
|
for (i = 0; i < num_dai; i++) {
|