/* * soc-cache.c -- ASoC register cache helpers * * Copyright 2009 Wolfson Microelectronics PLC. * * Author: Mark Brown * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ #include #include #include int snd_soc_cache_init(struct snd_soc_codec *codec) { const struct snd_soc_codec_driver *codec_drv = codec->driver; size_t reg_size; reg_size = codec_drv->reg_cache_size * codec_drv->reg_word_size; if (!reg_size) return 0; dev_dbg(codec->dev, "ASoC: Initializing cache for %s codec\n", codec->component.name); if (codec_drv->reg_cache_default) codec->reg_cache = kmemdup(codec_drv->reg_cache_default, reg_size, GFP_KERNEL); else codec->reg_cache = kzalloc(reg_size, GFP_KERNEL); if (!codec->reg_cache) return -ENOMEM; return 0; } /* * NOTE: keep in mind that this function might be called * multiple times. */ int snd_soc_cache_exit(struct snd_soc_codec *codec) { dev_dbg(codec->dev, "ASoC: Destroying cache for %s codec\n", codec->component.name); kfree(codec->reg_cache); codec->reg_cache = NULL; return 0; } > net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
path: root/tools/lib
diff options
context:
space:
mode:
authorMarkus Mayer <mmayer@broadcom.com>2016-12-19 12:10:28 -0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-01-27 11:43:49 +0100
commit3c223c19aea85d3dda1416c187915f4a30b04b1f (patch)
tree2d2021f8161db3e9ed38b9a966a225b66dff8e58 /tools/lib
parent9b02c54bc951fca884ba5719f42a27e8240965bf (diff)
cpufreq: brcmstb-avs-cpufreq: properly retrieve P-state upon suspend
The AVS GET_PMAP command does return a P-state along with the P-map information. However, that P-state is the initial P-state when the P-map was first downloaded to AVS. It is *not* the current P-state. Therefore, we explicitly retrieve the P-state using the GET_PSTATE command. Signed-off-by: Markus Mayer <mmayer@broadcom.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'tools/lib')