/* * Machine driver for EVAL-ADAV801 and EVAL-ADAV803 on Analog Devices bfin * evaluation boards. * * Copyright 2011 Analog Devices Inc. * Author: Lars-Peter Clausen * * Licensed under the GPL-2 or later. */ #include #include #include #include #include #include #include "../codecs/adav80x.h" static const struct snd_soc_dapm_widget bfin_eval_adav80x_dapm_widgets[] = { SND_SOC_DAPM_LINE("Line Out", NULL), SND_SOC_DAPM_LINE("Line In", NULL), }; static const struct snd_soc_dapm_route bfin_eval_adav80x_dapm_routes[] = { { "Line Out", NULL, "VOUTL" }, { "Line Out", NULL, "VOUTR" }, { "VINL", NULL, "Line In" }, { "VINR", NULL, "Line In" }, }; static int bfin_eval_adav80x_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *codec_dai = rtd->codec_dai; int ret; ret = snd_soc_dai_set_pll(codec_dai, ADAV80X_PLL1, ADAV80X_PLL_SRC_XTAL, 27000000, params_rate(params) * 256); if (ret) return ret; ret = snd_soc_dai_set_sysclk(codec_dai, ADAV80X_CLK_PLL1, params_rate(params) * 256, SND_SOC_CLOCK_IN); return ret; } static int bfin_eval_adav80x_codec_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_dai *codec_dai = rtd->codec_dai; snd_soc_dai_set_sysclk(codec_dai, ADAV80X_CLK_SYSCLK1, 0, SND_SOC_CLOCK_OUT); snd_soc_dai_set_sysclk(codec_dai, ADAV80X_CLK_SYSCLK2, 0, SND_SOC_CLOCK_OUT); snd_soc_dai_set_sysclk(codec_dai, ADAV80X_CLK_SYSCLK3, 0, SND_SOC_CLOCK_OUT); snd_soc_dai_set_sysclk(codec_dai, ADAV80X_CLK_XTAL, 2700000, 0); return 0; } static struct snd_soc_ops bfin_eval_adav80x_ops = { .hw_params = bfin_eval_adav80x_hw_params, }; static struct snd_soc_dai_link bfin_eval_adav80x_dais[] = { { .name = "adav80x", .stream_name = "ADAV80x HiFi", .cpu_dai_name = "bfin-i2s.0", .codec_dai_name = "adav80x-hifi", .platform_name = "bfin-i2s-pcm-audio", .init = bfin_eval_adav80x_codec_init, .ops = &bfin_eval_adav80x_ops, .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM, }, }; static struct snd_soc_card bfin_eval_adav80x = { .name = "bfin-eval-adav80x", .owner = THIS_MODULE, .dai_link = bfin_eval_adav80x_dais, .num_links = ARRAY_SIZE(bfin_eval_adav80x_dais), .dapm_widgets = bfin_eval_adav80x_dapm_widgets, .num_dapm_widgets = ARRAY_SIZE(bfin_eval_adav80x_dapm_widgets), .dapm_routes = bfin_eval_adav80x_dapm_routes, .num_dapm_routes = ARRAY_SIZE(bfin_eval_adav80x_dapm_routes), }; enum bfin_eval_adav80x_type { BFIN_EVAL_ADAV801, BFIN_EVAL_ADAV803, }; static int bfin_eval_adav80x_probe(struct platform_device *pdev) { struct snd_soc_card *card = &bfin_eval_adav80x; const char *codec_name; switch (platform_get_device_id(pdev)->driver_data) { case BFIN_EVAL_ADAV801: codec_name = "spi0.1"; break; case BFIN_EVAL_ADAV803: codec_name = "adav803.0-0034"; break; default: return -EINVAL; } bfin_eval_adav80x_dais[0].codec_name = codec_name; card->dev = &pdev->dev; return devm_snd_soc_register_card(&pdev->dev, &bfin_eval_adav80x); } static const struct platform_device_id bfin_eval_adav80x_ids[] = { { "bfin-eval-adav801", BFIN_EVAL_ADAV801 }, { "bfin-eval-adav803", BFIN_EVAL_ADAV803 }, { }, }; MODULE_DEVICE_TABLE(platform, bfin_eval_adav80x_ids); static struct platform_driver bfin_eval_adav80x_driver = { .driver = { .name = "bfin-eval-adav80x", .pm = &snd_soc_pm_ops, }, .probe = bfin_eval_adav80x_probe, .id_table = bfin_eval_adav80x_ids, }; module_platform_driver(bfin_eval_adav80x_driver); MODULE_AUTHOR("Lars-Peter Clausen "); MODULE_DESCRIPTION("ALSA SoC bfin adav80x driver"); MODULE_LICENSE("GPL"); ='30'>30space:mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2017-02-01 17:45:02 +0000
committerIngo Molnar <mingo@kernel.org>2017-02-01 21:17:49 +0100
commitc8f325a59cfc718d13a50fbc746ed9b415c25e92 (patch)
treed53fbdac9d0781e39a13b2ac6b2bd258cf3b4140 /net/sched/act_connmark.c
parentbf29bddf0417a4783da3b24e8c9e017ac649326f (diff)
efi/fdt: Avoid FDT manipulation after ExitBootServices()
Some AArch64 UEFI implementations disable the MMU in ExitBootServices(), after which unaligned accesses to RAM are no longer supported. Commit: abfb7b686a3e ("efi/libstub/arm*: Pass latest memory map to the kernel") fixed an issue in the memory map handling of the stub FDT code, but inadvertently created an issue with such firmware, by moving some of the FDT manipulation to after the invocation of ExitBootServices(). Given that the stub's libfdt implementation uses the ordinary, accelerated string functions, which rely on hardware handling of unaligned accesses, manipulating the FDT with the MMU off may result in alignment faults. So fix the situation by moving the update_fdt_memmap() call into the callback function invoked by efi_exit_boot_services() right before it calls the ExitBootServices() UEFI service (which is arguably a better place for it anyway) Note that disabling the MMU in ExitBootServices() is not compliant with the UEFI spec, and carries great risk due to the fact that switching from cached to uncached memory accesses halfway through compiler generated code (i.e., involving a stack) can never be done in a way that is architecturally safe. Fixes: abfb7b686a3e ("efi/libstub/arm*: Pass latest memory map to the kernel") Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Riku Voipio <riku.voipio@linaro.org> Cc: <stable@vger.kernel.org> Cc: mark.rutland@arm.com Cc: linux-efi@vger.kernel.org Cc: matt@codeblueprint.co.uk Cc: leif.lindholm@linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1485971102-23330-2-git-send-email-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'net/sched/act_connmark.c')