ASoC: Remove support for reg_access_defaults
No users of reg_access_defaults are left and new drivers are going to use regmap for this, so support for it can be removed. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
parent
272b98c645
commit
175ee39e8f
3 changed files with 0 additions and 96 deletions
|
@ -403,12 +403,6 @@ int snd_soc_cache_write(struct snd_soc_codec *codec,
|
||||||
unsigned int reg, unsigned int value);
|
unsigned int reg, unsigned int value);
|
||||||
int snd_soc_cache_read(struct snd_soc_codec *codec,
|
int snd_soc_cache_read(struct snd_soc_codec *codec,
|
||||||
unsigned int reg, unsigned int *value);
|
unsigned int reg, unsigned int *value);
|
||||||
int snd_soc_default_volatile_register(struct snd_soc_codec *codec,
|
|
||||||
unsigned int reg);
|
|
||||||
int snd_soc_default_readable_register(struct snd_soc_codec *codec,
|
|
||||||
unsigned int reg);
|
|
||||||
int snd_soc_default_writable_register(struct snd_soc_codec *codec,
|
|
||||||
unsigned int reg);
|
|
||||||
int snd_soc_platform_read(struct snd_soc_platform *platform,
|
int snd_soc_platform_read(struct snd_soc_platform *platform,
|
||||||
unsigned int reg);
|
unsigned int reg);
|
||||||
int snd_soc_platform_write(struct snd_soc_platform *platform,
|
int snd_soc_platform_write(struct snd_soc_platform *platform,
|
||||||
|
@ -541,22 +535,6 @@ int snd_soc_get_strobe(struct snd_kcontrol *kcontrol,
|
||||||
int snd_soc_put_strobe(struct snd_kcontrol *kcontrol,
|
int snd_soc_put_strobe(struct snd_kcontrol *kcontrol,
|
||||||
struct snd_ctl_elem_value *ucontrol);
|
struct snd_ctl_elem_value *ucontrol);
|
||||||
|
|
||||||
/**
|
|
||||||
* struct snd_soc_reg_access - Describes whether a given register is
|
|
||||||
* readable, writable or volatile.
|
|
||||||
*
|
|
||||||
* @reg: the register number
|
|
||||||
* @read: whether this register is readable
|
|
||||||
* @write: whether this register is writable
|
|
||||||
* @vol: whether this register is volatile
|
|
||||||
*/
|
|
||||||
struct snd_soc_reg_access {
|
|
||||||
u16 reg;
|
|
||||||
u16 read;
|
|
||||||
u16 write;
|
|
||||||
u16 vol;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct snd_soc_jack_pin - Describes a pin to update based on jack detection
|
* struct snd_soc_jack_pin - Describes a pin to update based on jack detection
|
||||||
*
|
*
|
||||||
|
@ -760,8 +738,6 @@ struct snd_soc_codec_driver {
|
||||||
short reg_cache_step;
|
short reg_cache_step;
|
||||||
short reg_word_size;
|
short reg_word_size;
|
||||||
const void *reg_cache_default;
|
const void *reg_cache_default;
|
||||||
short reg_access_size;
|
|
||||||
const struct snd_soc_reg_access *reg_access_default;
|
|
||||||
enum snd_soc_compress_type compress_type;
|
enum snd_soc_compress_type compress_type;
|
||||||
|
|
||||||
/* codec bias level */
|
/* codec bias level */
|
||||||
|
|
|
@ -275,66 +275,3 @@ int snd_soc_cache_sync(struct snd_soc_codec *codec)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(snd_soc_cache_sync);
|
EXPORT_SYMBOL_GPL(snd_soc_cache_sync);
|
||||||
|
|
||||||
static int snd_soc_get_reg_access_index(struct snd_soc_codec *codec,
|
|
||||||
unsigned int reg)
|
|
||||||
{
|
|
||||||
const struct snd_soc_codec_driver *codec_drv;
|
|
||||||
unsigned int min, max, index;
|
|
||||||
|
|
||||||
codec_drv = codec->driver;
|
|
||||||
min = 0;
|
|
||||||
max = codec_drv->reg_access_size - 1;
|
|
||||||
do {
|
|
||||||
index = (min + max) / 2;
|
|
||||||
if (codec_drv->reg_access_default[index].reg == reg)
|
|
||||||
return index;
|
|
||||||
if (codec_drv->reg_access_default[index].reg < reg)
|
|
||||||
min = index + 1;
|
|
||||||
else
|
|
||||||
max = index;
|
|
||||||
} while (min <= max);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int snd_soc_default_volatile_register(struct snd_soc_codec *codec,
|
|
||||||
unsigned int reg)
|
|
||||||
{
|
|
||||||
int index;
|
|
||||||
|
|
||||||
if (reg >= codec->driver->reg_cache_size)
|
|
||||||
return 1;
|
|
||||||
index = snd_soc_get_reg_access_index(codec, reg);
|
|
||||||
if (index < 0)
|
|
||||||
return 0;
|
|
||||||
return codec->driver->reg_access_default[index].vol;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL_GPL(snd_soc_default_volatile_register);
|
|
||||||
|
|
||||||
int snd_soc_default_readable_register(struct snd_soc_codec *codec,
|
|
||||||
unsigned int reg)
|
|
||||||
{
|
|
||||||
int index;
|
|
||||||
|
|
||||||
if (reg >= codec->driver->reg_cache_size)
|
|
||||||
return 1;
|
|
||||||
index = snd_soc_get_reg_access_index(codec, reg);
|
|
||||||
if (index < 0)
|
|
||||||
return 0;
|
|
||||||
return codec->driver->reg_access_default[index].read;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL_GPL(snd_soc_default_readable_register);
|
|
||||||
|
|
||||||
int snd_soc_default_writable_register(struct snd_soc_codec *codec,
|
|
||||||
unsigned int reg)
|
|
||||||
{
|
|
||||||
int index;
|
|
||||||
|
|
||||||
if (reg >= codec->driver->reg_cache_size)
|
|
||||||
return 1;
|
|
||||||
index = snd_soc_get_reg_access_index(codec, reg);
|
|
||||||
if (index < 0)
|
|
||||||
return 0;
|
|
||||||
return codec->driver->reg_access_default[index].write;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL_GPL(snd_soc_default_writable_register);
|
|
||||||
|
|
|
@ -4224,15 +4224,6 @@ int snd_soc_register_codec(struct device *dev,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (codec_drv->reg_access_size && codec_drv->reg_access_default) {
|
|
||||||
if (!codec->volatile_register)
|
|
||||||
codec->volatile_register = snd_soc_default_volatile_register;
|
|
||||||
if (!codec->readable_register)
|
|
||||||
codec->readable_register = snd_soc_default_readable_register;
|
|
||||||
if (!codec->writable_register)
|
|
||||||
codec->writable_register = snd_soc_default_writable_register;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < num_dai; i++) {
|
for (i = 0; i < num_dai; i++) {
|
||||||
fixup_codec_formats(&dai_drv[i].playback);
|
fixup_codec_formats(&dai_drv[i].playback);
|
||||||
fixup_codec_formats(&dai_drv[i].capture);
|
fixup_codec_formats(&dai_drv[i].capture);
|
||||||
|
|
Loading…
Reference in a new issue