const struct snd_soc_component_driver *cmpnt_drv,
struct snd_soc_dai_driver *dai_drv, int num_dai);
void snd_soc_unregister_component(struct device *dev);
-int snd_soc_codec_volatile_register(struct snd_soc_codec *codec,
- unsigned int reg);
-int snd_soc_codec_readable_register(struct snd_soc_codec *codec,
- unsigned int reg);
-int snd_soc_codec_writable_register(struct snd_soc_codec *codec,
- unsigned int reg);
int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec,
struct regmap *regmap);
int snd_soc_cache_sync(struct snd_soc_codec *codec);
struct list_head list;
struct list_head card_list;
int num_dai;
- int (*volatile_register)(struct snd_soc_codec *, unsigned int);
- int (*readable_register)(struct snd_soc_codec *, unsigned int);
- int (*writable_register)(struct snd_soc_codec *, unsigned int);
/* runtime */
struct snd_ac97 *ac97; /* for ad-hoc ac97 devices */
/* codec IO */
unsigned int (*read)(struct snd_soc_codec *, unsigned int);
int (*write)(struct snd_soc_codec *, unsigned int, unsigned int);
- int (*display_register)(struct snd_soc_codec *, char *,
- size_t, unsigned int);
- int (*volatile_register)(struct snd_soc_codec *, unsigned int);
- int (*readable_register)(struct snd_soc_codec *, unsigned int);
- int (*writable_register)(struct snd_soc_codec *, unsigned int);
unsigned int reg_cache_size;
short reg_cache_step;
short reg_word_size;
step = codec->driver->reg_cache_step;
for (i = 0; i < codec->driver->reg_cache_size; i += step) {
- if (!snd_soc_codec_readable_register(codec, i))
- continue;
- if (codec->driver->display_register) {
- count += codec->driver->display_register(codec, buf + count,
- PAGE_SIZE - count, i);
- } else {
- /* only support larger than PAGE_SIZE bytes debugfs
- * entries for the default case */
- if (p >= pos) {
- if (total + len >= count - 1)
- break;
- format_register_str(codec, i, buf + total, len);
- total += len;
- }
- p += len;
+ /* only support larger than PAGE_SIZE bytes debugfs
+ * entries for the default case */
+ if (p >= pos) {
+ if (total + len >= count - 1)
+ break;
+ format_register_str(codec, i, buf + total, len);
+ total += len;
}
+ p += len;
}
total = min(total, count - 1);
.remove = soc_remove,
};
-/**
- * snd_soc_codec_volatile_register: Report if a register is volatile.
- *
- * @codec: CODEC to query.
- * @reg: Register to query.
- *
- * Boolean function indiciating if a CODEC register is volatile.
- */
-int snd_soc_codec_volatile_register(struct snd_soc_codec *codec,
- unsigned int reg)
-{
- if (codec->volatile_register)
- return codec->volatile_register(codec, reg);
- else
- return 0;
-}
-EXPORT_SYMBOL_GPL(snd_soc_codec_volatile_register);
-
-/**
- * snd_soc_codec_readable_register: Report if a register is readable.
- *
- * @codec: CODEC to query.
- * @reg: Register to query.
- *
- * Boolean function indicating if a CODEC register is readable.
- */
-int snd_soc_codec_readable_register(struct snd_soc_codec *codec,
- unsigned int reg)
-{
- if (codec->readable_register)
- return codec->readable_register(codec, reg);
- else
- return 1;
-}
-EXPORT_SYMBOL_GPL(snd_soc_codec_readable_register);
-
-/**
- * snd_soc_codec_writable_register: Report if a register is writable.
- *
- * @codec: CODEC to query.
- * @reg: Register to query.
- *
- * Boolean function indicating if a CODEC register is writable.
- */
-int snd_soc_codec_writable_register(struct snd_soc_codec *codec,
- unsigned int reg)
-{
- if (codec->writable_register)
- return codec->writable_register(codec, reg);
- else
- return 1;
-}
-EXPORT_SYMBOL_GPL(snd_soc_codec_writable_register);
-
/**
* snd_soc_new_ac97_codec - initailise AC97 device
* @codec: audio codec
codec->write = codec_drv->write;
codec->read = codec_drv->read;
- codec->volatile_register = codec_drv->volatile_register;
- codec->readable_register = codec_drv->readable_register;
- codec->writable_register = codec_drv->writable_register;
codec->component.ignore_pmdown_time = codec_drv->ignore_pmdown_time;
codec->dapm.bias_level = SND_SOC_BIAS_OFF;
codec->dapm.dev = dev;