Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 230351
b: refs/heads/master
c: 0d735ea
h: refs/heads/master
i:
  230349: 71516db
  230347: d4aed4a
  230343: 8b76c6c
  230335: 137404e
v: v3
  • Loading branch information
Dimitris Papastamos authored and Mark Brown committed Dec 6, 2010
1 parent 25915a2 commit 116e17b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9545cd85a6dd1cce793b309800d2a03af9a886a8
refs/heads/master: 0d735eaa2c1d80c997fd775b679e36b80b8e85d1
1 change: 1 addition & 0 deletions trunk/include/sound/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ struct snd_soc_ops {

/* SoC cache ops */
struct snd_soc_cache_ops {
const char *name;
enum snd_soc_compress_type id;
int (*init)(struct snd_soc_codec *codec);
int (*exit)(struct snd_soc_codec *codec);
Expand Down
18 changes: 16 additions & 2 deletions trunk/sound/soc/soc-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -1533,6 +1533,7 @@ static int snd_soc_flat_cache_init(struct snd_soc_codec *codec)
static const struct snd_soc_cache_ops cache_types[] = {
{
.id = SND_SOC_FLAT_COMPRESSION,
.name = "flat",
.init = snd_soc_flat_cache_init,
.exit = snd_soc_flat_cache_exit,
.read = snd_soc_flat_cache_read,
Expand All @@ -1541,6 +1542,7 @@ static const struct snd_soc_cache_ops cache_types[] = {
},
{
.id = SND_SOC_LZO_COMPRESSION,
.name = "LZO",
.init = snd_soc_lzo_cache_init,
.exit = snd_soc_lzo_cache_exit,
.read = snd_soc_lzo_cache_read,
Expand All @@ -1549,6 +1551,7 @@ static const struct snd_soc_cache_ops cache_types[] = {
},
{
.id = SND_SOC_RBTREE_COMPRESSION,
.name = "rbtree",
.init = snd_soc_rbtree_cache_init,
.exit = snd_soc_rbtree_cache_exit,
.read = snd_soc_rbtree_cache_read,
Expand All @@ -1573,8 +1576,12 @@ int snd_soc_cache_init(struct snd_soc_codec *codec)
mutex_init(&codec->cache_rw_mutex);
codec->cache_ops = &cache_types[i];

if (codec->cache_ops->init)
if (codec->cache_ops->init) {
if (codec->cache_ops->name)
dev_dbg(codec->dev, "Initializing %s cache for %s codec\n",
codec->cache_ops->name, codec->name);
return codec->cache_ops->init(codec);
}
return -EINVAL;
}

Expand All @@ -1584,8 +1591,12 @@ int snd_soc_cache_init(struct snd_soc_codec *codec)
*/
int snd_soc_cache_exit(struct snd_soc_codec *codec)
{
if (codec->cache_ops && codec->cache_ops->exit)
if (codec->cache_ops && codec->cache_ops->exit) {
if (codec->cache_ops->name)
dev_dbg(codec->dev, "Destroying %s cache for %s codec\n",
codec->cache_ops->name, codec->name);
return codec->cache_ops->exit(codec);
}
return -EINVAL;
}

Expand Down Expand Up @@ -1657,6 +1668,9 @@ int snd_soc_cache_sync(struct snd_soc_codec *codec)
}

if (codec->cache_ops && codec->cache_ops->sync) {
if (codec->cache_ops->name)
dev_dbg(codec->dev, "Syncing %s cache for %s codec\n",
codec->cache_ops->name, codec->name);
ret = codec->cache_ops->sync(codec);
if (!ret)
codec->cache_sync = 0;
Expand Down
3 changes: 0 additions & 3 deletions trunk/sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1742,8 +1742,6 @@ static int snd_soc_init_codec_cache(struct snd_soc_codec *codec,
/* override the compress_type if necessary */
if (compress_type && codec->compress_type != compress_type)
codec->compress_type = compress_type;
dev_dbg(codec->dev, "Cache compress_type for %s is %d\n",
codec->name, codec->compress_type);
ret = snd_soc_cache_init(codec);
if (ret < 0) {
dev_err(codec->dev, "Failed to set cache compression type: %d\n",
Expand All @@ -1754,7 +1752,6 @@ static int snd_soc_init_codec_cache(struct snd_soc_codec *codec,
return 0;
}


static void snd_soc_instantiate_card(struct snd_soc_card *card)
{
struct platform_device *pdev = to_platform_device(card->dev);
Expand Down

0 comments on commit 116e17b

Please sign in to comment.