aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2011-07-01 04:52:25 -0400
committerTony Lindgren <tony@atomide.com>2011-07-11 05:08:06 -0400
commit69d042d168ddc683fb51a3c56b90143a1bc49157 (patch)
tree95e5846f4ee06929549cbd4045f3786af4e5475a /arch/arm/plat-omap
parente1d62c9bd8779a8e4a335803f0fced9e614d0a9f (diff)
ASoC: omap: McBSP: fix build breakage on OMAP1
After commits d13586574d373ef40acd4725c9a269daa355e412 ("OMAP: McBSP: implement functional clock switching via clock framework") and cf4c87abe238ec17cd0255b4e21abd949d7f811e ("OMAP: McBSP: implement McBSP CLKR and FSR signal muxing via mach-omap2/mcbsp.c"), any OMAP1 board (such as the AMS Delta) that uses the ASoC McBSP driver will no longer build: sound/built-in.o: In function `omap_mcbsp_dai_set_dai_sysclk': last.c:(.text+0x24ff8): undefined reference to `omap2_mcbsp1_mux_clkr_src' last.c:(.text+0x2500c): undefined reference to `omap2_mcbsp1_mux_fsr_src' make: *** [vmlinux] Error 1 Fix by defining three OMAP1-only dummy functions for omap2_mcbsp1_mux_clkr_src(), omap2_mcbsp1_mux_fsr_src(), and omap2_mcbsp_set_clks_src(). Normally, code that is OMAP SoC-revision-specific like this should go under the arch/arm/*omap* directories, and get abstracted away from drivers via struct platform_data function pointers. This doesn't work in this case since there doesn't appear to be any convenient way to access struct platform_data (or something like it) in the current design of the sound/soc/omap/omap-mcbsp.c driver. Reported by Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> and Tony Lindgren <tony@atomide.com>. Janusz also posted a patch to fix this at: http://www.spinics.net/lists/linux-omap/msg39560.html (among other places), but the following approach seems less dependent on compiler behavior. This patch passes build tests for ams_delta_defconfig and omap2plus_defconfig, but since I don't have an AMS Delta here, I can't boot test it on that platform. Signed-off-by: Paul Walmsley <paul@pwsan.com> Cc: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> Cc: Tony Lindgren <tony@atomide.com> Cc: Jarkko Nikula <jhnikula@gmail.com> Cc: Peter Ujfalusi <peter.ujfalusi@nokia.com> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r--arch/arm/plat-omap/mcbsp.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index 3c1fbdc92468..6c62af108710 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -966,6 +966,33 @@ void omap_mcbsp_stop(unsigned int id, int tx, int rx)
966} 966}
967EXPORT_SYMBOL(omap_mcbsp_stop); 967EXPORT_SYMBOL(omap_mcbsp_stop);
968 968
969/*
970 * The following functions are only required on an OMAP1-only build.
971 * mach-omap2/mcbsp.c contains the real functions
972 */
973#ifndef CONFIG_ARCH_OMAP2PLUS
974int omap2_mcbsp_set_clks_src(u8 id, u8 fck_src_id)
975{
976 WARN(1, "%s: should never be called on an OMAP1-only kernel\n",
977 __func__);
978 return -EINVAL;
979}
980
981void omap2_mcbsp1_mux_clkr_src(u8 mux)
982{
983 WARN(1, "%s: should never be called on an OMAP1-only kernel\n",
984 __func__);
985 return;
986}
987
988void omap2_mcbsp1_mux_fsr_src(u8 mux)
989{
990 WARN(1, "%s: should never be called on an OMAP1-only kernel\n",
991 __func__);
992 return;
993}
994#endif
995
969#ifdef CONFIG_ARCH_OMAP3 996#ifdef CONFIG_ARCH_OMAP3
970#define max_thres(m) (mcbsp->pdata->buffer_size) 997#define max_thres(m) (mcbsp->pdata->buffer_size)
971#define valid_threshold(m, val) ((val) <= max_thres(m)) 998#define valid_threshold(m, val) ((val) <= max_thres(m))