All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 12/22] exynos: Add support for exynos5420 i2s pinmux
Date: Mon, 10 Dec 2018 10:37:41 -0700	[thread overview]
Message-ID: <20181210173751.177266-13-sjg@chromium.org> (raw)
In-Reply-To: <20181210173751.177266-1-sjg@chromium.org>

Allow setting the i2s pinmux correctly on exyno5420 so that i2c can be
used on that SoC. Also rename EXYNOS_AUDSS to something consistent with
other naming.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None

 arch/arm/mach-exynos/clock.c              | 21 +++++++++++++++++++--
 arch/arm/mach-exynos/include/mach/clock.h |  3 +++
 arch/arm/mach-exynos/pinmux.c             | 17 +++++++++++++++++
 3 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-exynos/clock.c b/arch/arm/mach-exynos/clock.c
index 2425a728669..73aa4cdad32 100644
--- a/arch/arm/mach-exynos/clock.c
+++ b/arch/arm/mach-exynos/clock.c
@@ -1317,6 +1317,19 @@ int exynos5_set_epll_clk(unsigned long rate)
 	return 0;
 }
 
+static int exynos5420_set_i2s_clk_source(void)
+{
+	struct exynos5420_clock *clk =
+		(struct exynos5420_clock *)samsung_get_base_clock();
+
+	setbits_le32(&clk->src_top6, EXYNOS5420_CLK_SRC_MOUT_EPLL);
+	clrsetbits_le32(&clk->src_mau, EXYNOS5420_AUDIO0_SEL_MASK,
+			(EXYNOS5420_CLK_SRC_SCLK_EPLL));
+	setbits_le32(EXYNOS5_AUDIOSS_BASE, 1 << 0);
+
+	return 0;
+}
+
 int exynos5_set_i2s_clk_source(unsigned int i2s_id)
 {
 	struct exynos5_clock *clk =
@@ -1758,8 +1771,12 @@ int set_i2s_clk_prescaler(unsigned int src_frq, unsigned int dst_frq,
 
 int set_i2s_clk_source(unsigned int i2s_id)
 {
-	if (cpu_is_exynos5())
-		return exynos5_set_i2s_clk_source(i2s_id);
+	if (cpu_is_exynos5()) {
+		if (proid_is_exynos542x())
+			return exynos5420_set_i2s_clk_source();
+		else
+			return exynos5_set_i2s_clk_source(i2s_id);
+	}
 
 	return 0;
 }
diff --git a/arch/arm/mach-exynos/include/mach/clock.h b/arch/arm/mach-exynos/include/mach/clock.h
index edf62bdf853..e4c706adeac 100644
--- a/arch/arm/mach-exynos/include/mach/clock.h
+++ b/arch/arm/mach-exynos/include/mach/clock.h
@@ -1370,10 +1370,13 @@ struct set_epll_con_val {
 #define AUDIO_1_RATIO_MASK		0x0f
 
 #define AUDIO0_SEL_MASK			0xf
+#define EXYNOS5420_AUDIO0_SEL_MASK	(0x3 << 28)
 #define AUDIO1_SEL_MASK			0xf
 
 #define CLK_SRC_SCLK_EPLL		0x7
+#define EXYNOS5420_CLK_SRC_SCLK_EPLL	(0x6 << 28)
 #define CLK_SRC_MOUT_EPLL		(1<<12)
+#define EXYNOS5420_CLK_SRC_MOUT_EPLL	BIT(20)
 #define AUDIO_CLKMUX_ASS		(1<<0)
 
 /* CON0 bit-fields */
diff --git a/arch/arm/mach-exynos/pinmux.c b/arch/arm/mach-exynos/pinmux.c
index 5072f4f5691..b24f1bb8f4f 100644
--- a/arch/arm/mach-exynos/pinmux.c
+++ b/arch/arm/mach-exynos/pinmux.c
@@ -378,6 +378,20 @@ static void exynos5_i2s_config(int peripheral)
 	}
 }
 
+static void exynos5420_i2s_config(int peripheral)
+{
+	int i;
+
+	switch (peripheral) {
+	case PERIPH_ID_I2S0:
+		for (i = 0; i < 5; i++)
+			gpio_cfg_pin(EXYNOS5420_GPIO_Z0 + i,
+				     S5P_GPIO_FUNC(0x02));
+		break;
+	}
+}
+
+
 void exynos5_spi_config(int peripheral)
 {
 	int cfg = 0, pin = 0, i;
@@ -550,6 +564,9 @@ static int exynos5420_pinmux_config(int peripheral, int flags)
 	case PERIPH_ID_I2C10:
 		exynos5420_i2c_config(peripheral);
 		break;
+	case PERIPH_ID_I2S0:
+		exynos5420_i2s_config(peripheral);
+		break;
 	case PERIPH_ID_PWM0:
 		gpio_cfg_pin(EXYNOS5420_GPIO_B20, S5P_GPIO_FUNC(2));
 		break;
-- 
2.20.0.rc2.403.gdbc3b29805-goog

  parent reply	other threads:[~2018-12-10 17:37 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-10 17:37 [U-Boot] [PATCH v2 00/22] dm: sound: Convert to driver model Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 01/22] dm: sound: exynos: Correct codec bus addresses Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 02/22] dm: sound: Create an option to use driver model for sound Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 03/22] dm: sound: Rename samsung_i2s_priv to i2s_uc_priv Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 04/22] dm: sound: Create a uclass for audio codecs Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 05/22] dm: sound: Create a uclass for i2s Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 06/22] dm: sandbox: Update sound to use two buffers Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 07/22] dm: sound: Create a uclass for sound Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 08/22] dm: core: Add a function to read into a unsigned int Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 09/22] dm: sound: Start i2c IDs from 0 Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 10/22] dm: sound: Add conversion to driver model Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 11/22] exynos: Add proid_is_exynos542x() for common 542x Simon Glass
2018-12-10 17:37 ` Simon Glass [this message]
2018-12-10 17:37 ` [U-Boot] [PATCH v2 13/22] dm: sound: Move common code out of maxim98095 Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 14/22] dm: sound: exynos: Add support for max98090 Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 15/22] dm: exynos: sound: Convert to use driver model Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 16/22] dm: sandbox: " Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 17/22] dm: exynos: Drop CONFIG_DM_I2C_COMPAT Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 18/22] dm: sound: Complete migration to driver model Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 19/22] dm: sound: Fix license headers Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 20/22] dm: sound: max98095: Tidy up error codes Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 21/22] dm: sandbox: Allow selection of sample rate and channels Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 22/22] dm: sound: Use the correct number of channels for sound Simon Glass
2018-12-14 15:35 ` sjg at google.com
2018-12-14 15:35 ` [U-Boot] [PATCH v2 21/22] dm: sandbox: Allow selection of sample rate and channels sjg at google.com
2018-12-14 15:35 ` [U-Boot] [PATCH v2 20/22] dm: sound: max98095: Tidy up error codes sjg at google.com
2018-12-14 15:35 ` [U-Boot] [PATCH v2 19/22] dm: sound: Fix license headers sjg at google.com
2018-12-14 15:35 ` [U-Boot] [PATCH v2 18/22] dm: sound: Complete migration to driver model sjg at google.com
2018-12-14 15:35 ` [U-Boot] [PATCH v2 17/22] dm: exynos: Drop CONFIG_DM_I2C_COMPAT sjg at google.com
2018-12-14 15:35 ` [U-Boot] [PATCH v2 16/22] dm: sandbox: sound: Convert to use driver model sjg at google.com
2018-12-14 15:35 ` [U-Boot] [PATCH v2 15/22] dm: exynos: " sjg at google.com
2018-12-14 15:35 ` [U-Boot] [PATCH v2 14/22] dm: sound: exynos: Add support for max98090 sjg at google.com
2018-12-14 15:35 ` [U-Boot] [PATCH v2 13/22] dm: sound: Move common code out of maxim98095 sjg at google.com
2018-12-14 15:35 ` [U-Boot] [PATCH v2 12/22] exynos: Add support for exynos5420 i2s pinmux sjg at google.com
2018-12-14 15:35 ` [U-Boot] [PATCH v2 11/22] exynos: Add proid_is_exynos542x() for common 542x sjg at google.com
2018-12-14 15:35 ` [U-Boot] [PATCH v2 10/22] dm: sound: Add conversion to driver model sjg at google.com
2018-12-14 15:35 ` [U-Boot] [PATCH v2 09/22] dm: sound: Start i2c IDs from 0 sjg at google.com
2018-12-14 15:35 ` [U-Boot] [PATCH v2 08/22] dm: core: Add a function to read into a unsigned int sjg at google.com
2018-12-14 15:38 ` [U-Boot] [PATCH v2 07/22] dm: sound: Create a uclass for sound sjg at google.com
2018-12-14 15:38 ` [U-Boot] [PATCH v2 06/22] dm: sandbox: Update sound to use two buffers sjg at google.com
2018-12-14 15:38 ` [U-Boot] [PATCH v2 05/22] dm: sound: Create a uclass for i2s sjg at google.com
2018-12-14 15:38 ` [U-Boot] [PATCH v2 04/22] dm: sound: Create a uclass for audio codecs sjg at google.com
2018-12-14 15:38 ` [U-Boot] [PATCH v2 03/22] dm: sound: Rename samsung_i2s_priv to i2s_uc_priv sjg at google.com
2018-12-14 15:38 ` [U-Boot] [PATCH v2 02/22] dm: sound: Create an option to use driver model for sound sjg at google.com
2018-12-14 15:38 ` [U-Boot] [PATCH v2 01/22] dm: sound: exynos: Correct codec bus addresses sjg at google.com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181210173751.177266-13-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.