aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/sound/soc.h24
-rw-r--r--sound/soc/soc-cache.c63
-rw-r--r--sound/soc/soc-core.c9
3 files changed, 0 insertions, 96 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index d22cb0a06feb..447278a3b3e6 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -403,12 +403,6 @@ int snd_soc_cache_write(struct snd_soc_codec *codec,
403 unsigned int reg, unsigned int value); 403 unsigned int reg, unsigned int value);
404int snd_soc_cache_read(struct snd_soc_codec *codec, 404int snd_soc_cache_read(struct snd_soc_codec *codec,
405 unsigned int reg, unsigned int *value); 405 unsigned int reg, unsigned int *value);
406int snd_soc_default_volatile_register(struct snd_soc_codec *codec,
407 unsigned int reg);
408int snd_soc_default_readable_register(struct snd_soc_codec *codec,
409 unsigned int reg);
410int snd_soc_default_writable_register(struct snd_soc_codec *codec,
411 unsigned int reg);
412int snd_soc_platform_read(struct snd_soc_platform *platform, 406int snd_soc_platform_read(struct snd_soc_platform *platform,
413 unsigned int reg); 407 unsigned int reg);
414int snd_soc_platform_write(struct snd_soc_platform *platform, 408int snd_soc_platform_write(struct snd_soc_platform *platform,
@@ -542,22 +536,6 @@ int snd_soc_put_strobe(struct snd_kcontrol *kcontrol,
542 struct snd_ctl_elem_value *ucontrol); 536 struct snd_ctl_elem_value *ucontrol);
543 537
544/** 538/**
545 * struct snd_soc_reg_access - Describes whether a given register is
546 * readable, writable or volatile.
547 *
548 * @reg: the register number
549 * @read: whether this register is readable
550 * @write: whether this register is writable
551 * @vol: whether this register is volatile
552 */
553struct snd_soc_reg_access {
554 u16 reg;
555 u16 read;
556 u16 write;
557 u16 vol;
558};
559
560/**
561 * struct snd_soc_jack_pin - Describes a pin to update based on jack detection 539 * struct snd_soc_jack_pin - Describes a pin to update based on jack detection
562 * 540 *
563 * @pin: name of the pin to update 541 * @pin: name of the pin to update
@@ -760,8 +738,6 @@ struct snd_soc_codec_driver {
760 short reg_cache_step; 738 short reg_cache_step;
761 short reg_word_size; 739 short reg_word_size;
762 const void *reg_cache_default; 740 const void *reg_cache_default;
763 short reg_access_size;
764 const struct snd_soc_reg_access *reg_access_default;
765 enum snd_soc_compress_type compress_type; 741 enum snd_soc_compress_type compress_type;
766 742
767 /* codec bias level */ 743 /* codec bias level */
diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c
index e72f55428f0b..eaa898f8d808 100644
--- a/sound/soc/soc-cache.c
+++ b/sound/soc/soc-cache.c
@@ -275,66 +275,3 @@ int snd_soc_cache_sync(struct snd_soc_codec *codec)
275 return ret; 275 return ret;
276} 276}
277EXPORT_SYMBOL_GPL(snd_soc_cache_sync); 277EXPORT_SYMBOL_GPL(snd_soc_cache_sync);
278
279static int snd_soc_get_reg_access_index(struct snd_soc_codec *codec,
280 unsigned int reg)
281{
282 const struct snd_soc_codec_driver *codec_drv;
283 unsigned int min, max, index;
284
285 codec_drv = codec->driver;
286 min = 0;
287 max = codec_drv->reg_access_size - 1;
288 do {
289 index = (min + max) / 2;
290 if (codec_drv->reg_access_default[index].reg == reg)
291 return index;
292 if (codec_drv->reg_access_default[index].reg < reg)
293 min = index + 1;
294 else
295 max = index;
296 } while (min <= max);
297 return -1;
298}
299
300int snd_soc_default_volatile_register(struct snd_soc_codec *codec,
301 unsigned int reg)
302{
303 int index;
304
305 if (reg >= codec->driver->reg_cache_size)
306 return 1;
307 index = snd_soc_get_reg_access_index(codec, reg);
308 if (index < 0)
309 return 0;
310 return codec->driver->reg_access_default[index].vol;
311}
312EXPORT_SYMBOL_GPL(snd_soc_default_volatile_register);
313
314int snd_soc_default_readable_register(struct snd_soc_codec *codec,
315 unsigned int reg)
316{
317 int index;
318
319 if (reg >= codec->driver->reg_cache_size)
320 return 1;
321 index = snd_soc_get_reg_access_index(codec, reg);
322 if (index < 0)
323 return 0;
324 return codec->driver->reg_access_default[index].read;
325}
326EXPORT_SYMBOL_GPL(snd_soc_default_readable_register);
327
328int snd_soc_default_writable_register(struct snd_soc_codec *codec,
329 unsigned int reg)
330{
331 int index;
332
333 if (reg >= codec->driver->reg_cache_size)
334 return 1;
335 index = snd_soc_get_reg_access_index(codec, reg);
336 if (index < 0)
337 return 0;
338 return codec->driver->reg_access_default[index].write;
339}
340EXPORT_SYMBOL_GPL(snd_soc_default_writable_register);
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 4d0561312f3b..f5ec301603d8 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -4224,15 +4224,6 @@ int snd_soc_register_codec(struct device *dev,
4224 } 4224 }
4225 } 4225 }
4226 4226
4227 if (codec_drv->reg_access_size && codec_drv->reg_access_default) {
4228 if (!codec->volatile_register)
4229 codec->volatile_register = snd_soc_default_volatile_register;
4230 if (!codec->readable_register)
4231 codec->readable_register = snd_soc_default_readable_register;
4232 if (!codec->writable_register)
4233 codec->writable_register = snd_soc_default_writable_register;
4234 }
4235
4236 for (i = 0; i < num_dai; i++) { 4227 for (i = 0; i < num_dai; i++) {
4237 fixup_codec_formats(&dai_drv[i].playback); 4228 fixup_codec_formats(&dai_drv[i].playback);
4238 fixup_codec_formats(&dai_drv[i].capture); 4229 fixup_codec_formats(&dai_drv[i].capture);