aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2012-08-16 09:41:04 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-08-22 15:17:05 -0400
commit8fef6263ea68f6160637f370a5864d0a455c620d (patch)
tree20b29e74932c3f7d8430fc663d44cb3a16f3d2ef
parentfca04aea36a82bc451ddc33dee6f9a48bb0f8a2a (diff)
ARM/ASoC: omap-mcbsp: Remove CLKR/FSR mux configuration code
Remove the feature to configure the CLKR/FSR mux on McBSP port with 6pin configuration. When moving to devicetree these callback can no longer be used in a clean way anymore. If a board require to change the 6pin port to work in 4pin setup it needs to set up the mux in the board file. For OMAP2/3: u32 devconf0; /* McBSP1 CLKR/FSR signal to be connected to CLKX/FSX pin */ devconf0 = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0); devconf0 |= OMAP2_MCBSP1_CLKR_MASK | OMAP2_MCBSP1_FSR_MASK; omap_ctrl_writel(devconf0, OMAP2_CONTROL_DEVCONF0); For OMAP4: u32 mcbsp_pad; /* McBSP4 CLKR/FSR signal to be connected to CLKX/FSX pin */ mcbsp_pad = omap4_ctrl_pad_readl(OMAP2_CONTROL_DEVCONF0); mcbsp_pad |= ((1 << 31) | (1 << 30)); omap4_ctrl_pad_writel(mcbsp_pad, OMAP2_CONTROL_DEVCONF0); In case when the kernel is booted with DT blob the pinctrl-single will be provided as soon as it is enabled on the platform. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--arch/arm/mach-omap2/mcbsp.c77
-rw-r--r--arch/arm/plat-omap/include/plat/mcbsp.h1
-rw-r--r--sound/soc/omap/mcbsp.h3
-rw-r--r--sound/soc/omap/omap-mcbsp.c32
-rw-r--r--sound/soc/omap/omap-mcbsp.h4
5 files changed, 3 insertions, 114 deletions
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c
index 6e046e1111b1..660e00b3ef82 100644
--- a/arch/arm/mach-omap2/mcbsp.c
+++ b/arch/arm/mach-omap2/mcbsp.c
@@ -25,8 +25,6 @@
25#include <plat/omap_device.h> 25#include <plat/omap_device.h>
26#include <linux/pm_runtime.h> 26#include <linux/pm_runtime.h>
27 27
28#include "control.h"
29
30/* 28/*
31 * FIXME: Find a mechanism to enable/disable runtime the McBSP ICLK autoidle. 29 * FIXME: Find a mechanism to enable/disable runtime the McBSP ICLK autoidle.
32 * Sidetone needs non-gated ICLK and sidetone autoidle is broken. 30 * Sidetone needs non-gated ICLK and sidetone autoidle is broken.
@@ -34,73 +32,6 @@
34#include "cm2xxx_3xxx.h" 32#include "cm2xxx_3xxx.h"
35#include "cm-regbits-34xx.h" 33#include "cm-regbits-34xx.h"
36 34
37/* McBSP1 internal signal muxing function for OMAP2/3 */
38static int omap2_mcbsp1_mux_rx_clk(struct device *dev, const char *signal,
39 const char *src)
40{
41 u32 v;
42
43 v = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0);
44
45 if (!strcmp(signal, "clkr")) {
46 if (!strcmp(src, "clkr"))
47 v &= ~OMAP2_MCBSP1_CLKR_MASK;
48 else if (!strcmp(src, "clkx"))
49 v |= OMAP2_MCBSP1_CLKR_MASK;
50 else
51 return -EINVAL;
52 } else if (!strcmp(signal, "fsr")) {
53 if (!strcmp(src, "fsr"))
54 v &= ~OMAP2_MCBSP1_FSR_MASK;
55 else if (!strcmp(src, "fsx"))
56 v |= OMAP2_MCBSP1_FSR_MASK;
57 else
58 return -EINVAL;
59 } else {
60 return -EINVAL;
61 }
62
63 omap_ctrl_writel(v, OMAP2_CONTROL_DEVCONF0);
64
65 return 0;
66}
67
68/* McBSP4 internal signal muxing function for OMAP4 */
69#define OMAP4_CONTROL_MCBSPLP_ALBCTRLRX_FSX (1 << 31)
70#define OMAP4_CONTROL_MCBSPLP_ALBCTRLRX_CLKX (1 << 30)
71static int omap4_mcbsp4_mux_rx_clk(struct device *dev, const char *signal,
72 const char *src)
73{
74 u32 v;
75
76 /*
77 * In CONTROL_MCBSPLP register only bit 30 (CLKR mux), and bit 31 (FSR
78 * mux) is used */
79 v = omap4_ctrl_pad_readl(OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_MCBSPLP);
80
81 if (!strcmp(signal, "clkr")) {
82 if (!strcmp(src, "clkr"))
83 v &= ~OMAP4_CONTROL_MCBSPLP_ALBCTRLRX_CLKX;
84 else if (!strcmp(src, "clkx"))
85 v |= OMAP4_CONTROL_MCBSPLP_ALBCTRLRX_CLKX;
86 else
87 return -EINVAL;
88 } else if (!strcmp(signal, "fsr")) {
89 if (!strcmp(src, "fsr"))
90 v &= ~OMAP4_CONTROL_MCBSPLP_ALBCTRLRX_FSX;
91 else if (!strcmp(src, "fsx"))
92 v |= OMAP4_CONTROL_MCBSPLP_ALBCTRLRX_FSX;
93 else
94 return -EINVAL;
95 } else {
96 return -EINVAL;
97 }
98
99 omap4_ctrl_pad_writel(v, OMAP4_CTRL_MODULE_PAD_CORE_CONTROL_MCBSPLP);
100
101 return 0;
102}
103
104static int omap3_enable_st_clock(unsigned int id, bool enable) 35static int omap3_enable_st_clock(unsigned int id, bool enable)
105{ 36{
106 unsigned int w; 37 unsigned int w;
@@ -143,14 +74,6 @@ static int __init omap_init_mcbsp(struct omap_hwmod *oh, void *unused)
143 pdata->has_ccr = true; 74 pdata->has_ccr = true;
144 } 75 }
145 76
146 /* On OMAP2/3 the McBSP1 port has 6 pin configuration */
147 if (id == 1 && oh->class->rev < MCBSP_CONFIG_TYPE4)
148 pdata->mux_signal = omap2_mcbsp1_mux_rx_clk;
149
150 /* On OMAP4 the McBSP4 port has 6 pin configuration */
151 if (id == 4 && oh->class->rev == MCBSP_CONFIG_TYPE4)
152 pdata->mux_signal = omap4_mcbsp4_mux_rx_clk;
153
154 if (oh->class->rev == MCBSP_CONFIG_TYPE2) { 77 if (oh->class->rev == MCBSP_CONFIG_TYPE2) {
155 /* The FIFO has 128 locations */ 78 /* The FIFO has 128 locations */
156 pdata->buffer_size = 0x80; 79 pdata->buffer_size = 0x80;
diff --git a/arch/arm/plat-omap/include/plat/mcbsp.h b/arch/arm/plat-omap/include/plat/mcbsp.h
index 0a7d5ca471e0..c78d90b28b19 100644
--- a/arch/arm/plat-omap/include/plat/mcbsp.h
+++ b/arch/arm/plat-omap/include/plat/mcbsp.h
@@ -47,7 +47,6 @@ struct omap_mcbsp_platform_data {
47 bool has_wakeup; /* Wakeup capability */ 47 bool has_wakeup; /* Wakeup capability */
48 bool has_ccr; /* Transceiver has configuration control registers */ 48 bool has_ccr; /* Transceiver has configuration control registers */
49 int (*enable_st_clock)(unsigned int, bool); 49 int (*enable_st_clock)(unsigned int, bool);
50 int (*mux_signal)(struct device *dev, const char *signal, const char *src);
51}; 50};
52 51
53/** 52/**
diff --git a/sound/soc/omap/mcbsp.h b/sound/soc/omap/mcbsp.h
index 262a6152111f..49a67259ce5a 100644
--- a/sound/soc/omap/mcbsp.h
+++ b/sound/soc/omap/mcbsp.h
@@ -334,9 +334,6 @@ void omap_mcbsp_stop(struct omap_mcbsp *mcbsp, int tx, int rx);
334/* McBSP functional clock source changing function */ 334/* McBSP functional clock source changing function */
335int omap2_mcbsp_set_clks_src(struct omap_mcbsp *mcbsp, u8 fck_src_id); 335int omap2_mcbsp_set_clks_src(struct omap_mcbsp *mcbsp, u8 fck_src_id);
336 336
337/* McBSP signal muxing API */
338int omap_mcbsp_6pin_src_mux(struct omap_mcbsp *mcbsp, u8 mux);
339
340/* Sidetone specific API */ 337/* Sidetone specific API */
341int omap_st_set_chgain(struct omap_mcbsp *mcbsp, int channel, s16 chgain); 338int omap_st_set_chgain(struct omap_mcbsp *mcbsp, int channel, s16 chgain);
342int omap_st_get_chgain(struct omap_mcbsp *mcbsp, int channel, s16 *chgain); 339int omap_st_get_chgain(struct omap_mcbsp *mcbsp, int channel, s16 *chgain);
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c
index 1046083e90a0..506159493a9d 100644
--- a/sound/soc/omap/omap-mcbsp.c
+++ b/sound/soc/omap/omap-mcbsp.c
@@ -516,21 +516,9 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
516 return -EBUSY; 516 return -EBUSY;
517 } 517 }
518 518
519 if (clk_id == OMAP_MCBSP_SYSCLK_CLK || 519 mcbsp->in_freq = freq;
520 clk_id == OMAP_MCBSP_SYSCLK_CLKS_FCLK || 520 regs->srgr2 &= ~CLKSM;
521 clk_id == OMAP_MCBSP_SYSCLK_CLKS_EXT || 521 regs->pcr0 &= ~SCLKME;
522 clk_id == OMAP_MCBSP_SYSCLK_CLKX_EXT ||
523 clk_id == OMAP_MCBSP_SYSCLK_CLKR_EXT) {
524 mcbsp->in_freq = freq;
525 regs->srgr2 &= ~CLKSM;
526 regs->pcr0 &= ~SCLKME;
527 } else if (cpu_class_is_omap1()) {
528 /*
529 * McBSP CLKR/FSR signal muxing functions are only available on
530 * OMAP2 or newer versions
531 */
532 return -EINVAL;
533 }
534 522
535 switch (clk_id) { 523 switch (clk_id) {
536 case OMAP_MCBSP_SYSCLK_CLK: 524 case OMAP_MCBSP_SYSCLK_CLK:
@@ -558,20 +546,6 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
558 case OMAP_MCBSP_SYSCLK_CLKR_EXT: 546 case OMAP_MCBSP_SYSCLK_CLKR_EXT:
559 regs->pcr0 |= SCLKME; 547 regs->pcr0 |= SCLKME;
560 break; 548 break;
561
562
563 case OMAP_MCBSP_CLKR_SRC_CLKR:
564 err = omap_mcbsp_6pin_src_mux(mcbsp, CLKR_SRC_CLKR);
565 break;
566 case OMAP_MCBSP_CLKR_SRC_CLKX:
567 err = omap_mcbsp_6pin_src_mux(mcbsp, CLKR_SRC_CLKX);
568 break;
569 case OMAP_MCBSP_FSR_SRC_FSR:
570 err = omap_mcbsp_6pin_src_mux(mcbsp, FSR_SRC_FSR);
571 break;
572 case OMAP_MCBSP_FSR_SRC_FSX:
573 err = omap_mcbsp_6pin_src_mux(mcbsp, FSR_SRC_FSX);
574 break;
575 default: 549 default:
576 err = -ENODEV; 550 err = -ENODEV;
577 } 551 }
diff --git a/sound/soc/omap/omap-mcbsp.h b/sound/soc/omap/omap-mcbsp.h
index f877b16f19c9..baebcee30e30 100644
--- a/sound/soc/omap/omap-mcbsp.h
+++ b/sound/soc/omap/omap-mcbsp.h
@@ -32,10 +32,6 @@ enum omap_mcbsp_clksrg_clk {
32 OMAP_MCBSP_SYSCLK_CLK, /* Internal ICLK */ 32 OMAP_MCBSP_SYSCLK_CLK, /* Internal ICLK */
33 OMAP_MCBSP_SYSCLK_CLKX_EXT, /* External CLKX pin */ 33 OMAP_MCBSP_SYSCLK_CLKX_EXT, /* External CLKX pin */
34 OMAP_MCBSP_SYSCLK_CLKR_EXT, /* External CLKR pin */ 34 OMAP_MCBSP_SYSCLK_CLKR_EXT, /* External CLKR pin */
35 OMAP_MCBSP_CLKR_SRC_CLKR, /* CLKR from CLKR pin */
36 OMAP_MCBSP_CLKR_SRC_CLKX, /* CLKR from CLKX pin */
37 OMAP_MCBSP_FSR_SRC_FSR, /* FSR from FSR pin */
38 OMAP_MCBSP_FSR_SRC_FSX, /* FSR from FSX pin */
39}; 35};
40 36
41/* McBSP dividers */ 37/* McBSP dividers */