summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/adau1761.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-11-19 18:29:05 +0100
committerMark Brown <broonie@kernel.org>2014-11-20 10:55:34 +0100
commitd48b088e3ec45eeccf0fce0b75378e41428f47e9 (patch)
tree2a81e6d82c6aeeaf35620938f4079d290748b4bf /sound/soc/codecs/adau1761.c
parentASoC: sigmadsp: Drop support support SIGMA_ACTION_DELAY (diff)
downloadlinux-d48b088e3ec45eeccf0fce0b75378e41428f47e9.tar.xz
linux-d48b088e3ec45eeccf0fce0b75378e41428f47e9.zip
ASoC: sigmadsp: Restructure in preparation for fw v2 support
The v2 file format of the SigmaDSP takes a more declarative style compared to the imperative style of the v1 format. In addition some features that are supported with v2 require the driver to keep state around for the firmware. This requires a bit of restructuring of both the firmware loader itself and the drivers making use of the firmware loader. Instead of loading and executing the firmware in place when the DSP is configured the firmware is now loaded at driver probe time. This is required since the new firmware format will in addition to the firmware data itself contain meta information describing the firmware and its requirements and capabilities. Those will for example be used to restrict the supported samplerates advertised by the driver to userspace to the list of samplerates supported for the firmware. This only does the restructuring required by the v2 format, but does not yet add support for the new format itself. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/adau1761.c')
-rw-r--r--sound/soc/codecs/adau1761.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/sound/soc/codecs/adau1761.c b/sound/soc/codecs/adau1761.c
index 5518ebd6947c..0ae1501f3c11 100644
--- a/sound/soc/codecs/adau1761.c
+++ b/sound/soc/codecs/adau1761.c
@@ -698,11 +698,6 @@ static int adau1761_codec_probe(struct snd_soc_codec *codec)
ARRAY_SIZE(adau1761_dapm_routes));
if (ret)
return ret;
-
- ret = adau17x1_load_firmware(adau, codec->dev,
- ADAU1761_FIRMWARE);
- if (ret)
- dev_warn(codec->dev, "Failed to firmware\n");
}
ret = adau17x1_add_routes(codec);
@@ -771,16 +766,20 @@ int adau1761_probe(struct device *dev, struct regmap *regmap,
enum adau17x1_type type, void (*switch_mode)(struct device *dev))
{
struct snd_soc_dai_driver *dai_drv;
+ const char *firmware_name;
int ret;
- ret = adau17x1_probe(dev, regmap, type, switch_mode);
- if (ret)
- return ret;
-
- if (type == ADAU1361)
+ if (type == ADAU1361) {
dai_drv = &adau1361_dai_driver;
- else
+ firmware_name = NULL;
+ } else {
dai_drv = &adau1761_dai_driver;
+ firmware_name = ADAU1761_FIRMWARE;
+ }
+
+ ret = adau17x1_probe(dev, regmap, type, switch_mode, firmware_name);
+ if (ret)
+ return ret;
return snd_soc_register_codec(dev, &adau1761_codec_driver, dai_drv, 1);
}