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 15/22] dm: exynos: sound: Convert to use driver model
Date: Mon, 10 Dec 2018 10:37:44 -0700	[thread overview]
Message-ID: <20181210173751.177266-16-sjg@chromium.org> (raw)
In-Reply-To: <20181210173751.177266-1-sjg@chromium.org>

Update snow's device tree and config to use driver model for sound. Also
update the others as best we can.

Spring does not appear to have audio support in the kernel. The smdk5250
and smdk5420 boards use a wolfson codec which I cannot test with. So the
only boards that is tested and known to work are snow, pit and pi.

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

Changes in v2:
- Correct conversion for pit and pi, updating commit message

 arch/arm/dts/exynos5250-smdk5250.dts  | 20 ++++++++++++++++++--
 arch/arm/dts/exynos5250-snow.dts      | 21 ++++++++++++++++-----
 arch/arm/dts/exynos5250-spring.dts    | 24 ++++++++++++++++++++----
 arch/arm/dts/exynos5250.dtsi          | 15 ++++++++++-----
 arch/arm/dts/exynos5420-peach-pit.dts | 20 ++++++++++++++++++--
 arch/arm/dts/exynos5420-smdk5420.dts  | 20 ++++++++++++++++++--
 arch/arm/dts/exynos54xx.dtsi          | 14 ++++++++++++++
 arch/arm/dts/exynos5800-peach-pi.dts  | 20 ++++++++++++++++++--
 configs/arndale_defconfig             |  1 +
 configs/peach-pi_defconfig            |  3 +++
 configs/peach-pit_defconfig           |  3 +++
 configs/smdk5250_defconfig            |  1 +
 configs/snow_defconfig                |  1 +
 configs/spring_defconfig              |  1 +
 drivers/sound/samsung_sound.c         |  3 +++
 15 files changed, 145 insertions(+), 22 deletions(-)

diff --git a/arch/arm/dts/exynos5250-smdk5250.dts b/arch/arm/dts/exynos5250-smdk5250.dts
index bf60b82d449..e542a790761 100644
--- a/arch/arm/dts/exynos5250-smdk5250.dts
+++ b/arch/arm/dts/exynos5250-smdk5250.dts
@@ -60,10 +60,26 @@
 	};
 
 	i2c at 12C70000 {
-		soundcodec at 1a {
+		wm8994: soundcodec at 1a {
 			reg = <0x1a>;
 			u-boot,i2c-offset-len = <2>;
-			compatible = "wolfson,wm8994-codec";
+			compatible = "wolfson,wm8994";
+			#sound-dai-cells = <1>;
+		};
+	};
+
+	sound {
+		compatible = "google,smdk5250-audio-wm8994";
+
+		samsung,model = "SMDK5250-I2S-WM8994";
+		samsung,audio-codec = <&wm8994>;
+
+		cpu {
+			sound-dai = <&i2s0 0>;
+		};
+
+		codec {
+			sound-dai = <&wm8994 0>;
 		};
 	};
 
diff --git a/arch/arm/dts/exynos5250-snow.dts b/arch/arm/dts/exynos5250-snow.dts
index cb5067b9669..7587dc0ff24 100644
--- a/arch/arm/dts/exynos5250-snow.dts
+++ b/arch/arm/dts/exynos5250-snow.dts
@@ -40,7 +40,6 @@
 		mmc3 = "/mmc at 12230000";
 		serial0 = "/serial at 12C30000";
 		console = "/serial at 12C30000";
-		i2s = "/sound at 3830000";
 	};
 
         memory {
@@ -214,9 +213,10 @@
 			};
 		};
 
-		soundcodec at 11 {
+		max98095: codec at 11 {
+			compatible = "maxim,max98095";
 			reg = <0x11>;
-			compatible = "maxim,max98095-codec";
+			#sound-dai-cells = <1>;
 		};
 	};
 
@@ -273,9 +273,20 @@
 		};
 	};
 
-	sound at 3830000 {
-		samsung,codec-type = "max98095";
+	sound {
+		compatible = "google,snow-audio-max98095";
+
+		samsung,model = "Snow-I2S-MAX98095";
+		samsung,audio-codec = <&max98095>;
 		codec-enable-gpio = <&gpx1 7 GPIO_ACTIVE_HIGH>;
+
+		cpu {
+			sound-dai = <&i2s0 0>;
+		};
+
+		codec {
+			sound-dai = <&max98095 0>;
+		};
 	};
 
 	sound at 12d60000 {
diff --git a/arch/arm/dts/exynos5250-spring.dts b/arch/arm/dts/exynos5250-spring.dts
index 7633d36874f..191e12af6a1 100644
--- a/arch/arm/dts/exynos5250-spring.dts
+++ b/arch/arm/dts/exynos5250-spring.dts
@@ -34,7 +34,6 @@
 		mmc0 = "/mmc at 12200000";
 		serial0 = "/serial at 12C30000";
 		console = "/serial at 12C30000";
-		i2s = "/sound at 3830000";
 	};
 
 	memory {
@@ -639,10 +638,27 @@
 		};
 	};
 
-	soundcodec at 20 {
-		reg = <0x20>;
-		compatible = "maxim,max98088-codec";
+	max98095: soundcodec at 10 {
+		reg = <0x10>;
+		compatible = "maxim,max98095";
+		#sound-dai-cells = <1>;
 	};
+
+	sound {
+		compatible = "google,spring-audio-max98095";
+
+		samsung,model = "Spring-I2S-MAX98095";
+		samsung,audio-codec = <&max98095>;
+
+		cpu {
+			sound-dai = <&i2s0 0>;
+		};
+
+		codec {
+			sound-dai = <&max98095 0>;
+		};
+	};
+
 };
 
 #include "cros-ec-keyboard.dtsi"
diff --git a/arch/arm/dts/exynos5250.dtsi b/arch/arm/dts/exynos5250.dtsi
index 502c687802e..66c5b6dca95 100644
--- a/arch/arm/dts/exynos5250.dtsi
+++ b/arch/arm/dts/exynos5250.dtsi
@@ -78,9 +78,12 @@
 		#size-cells = <0>;
 	};
 
-	sound at 3830000 {
-		compatible = "samsung,exynos-sound";
-		reg = <0x3830000 0x50>;
+	i2s0: i2s at 3830000 {
+		compatible = "samsung,s5pv210-i2s";
+		reg = <0x03830000 0x100>;
+		samsung,idma-addr = <0x03000000>;
+		#clock-cells = <1>;
+		#sound-dai-cells = <1>;
 		samsung,i2s-epll-clock-frequency = <192000000>;
 		samsung,i2s-sampling-rate = <48000>;
 		samsung,i2s-bits-per-sample = <16>;
@@ -90,9 +93,11 @@
 		samsung,i2s-id = <0>;
 	};
 
-	sound at 12d60000 {
-		compatible = "samsung,exynos-sound";
+	i2s1: i2s at 12d60000 {
+		compatible = "samsung,s5pv210-i2s";
 		reg = <0x12d60000 0x20>;
+		#clock-cells = <1>;
+		#sound-dai-cells = <1>;
 		samsung,i2s-epll-clock-frequency = <192000000>;
 		samsung,i2s-sampling-rate = <48000>;
 		samsung,i2s-bits-per-sample = <16>;
diff --git a/arch/arm/dts/exynos5420-peach-pit.dts b/arch/arm/dts/exynos5420-peach-pit.dts
index bd0a9c116d4..4a96a18110a 100644
--- a/arch/arm/dts/exynos5420-peach-pit.dts
+++ b/arch/arm/dts/exynos5420-peach-pit.dts
@@ -67,11 +67,27 @@
 		};
 	};
 
+	sound {
+		compatible = "google,peach-audio-max98090";
+
+		samsung,model = "PEACH-I2S-MAX98090";
+		samsung,audio-codec = <&max98090>;
+
+		cpu {
+			sound-dai = <&i2s0 0>;
+		};
+
+		codec {
+			sound-dai = <&max98090 0>;
+		};
+	};
+
 	i2c at 12CD0000 { /* i2c7 */
 		clock-frequency = <100000>;
-		soundcodec at 10 {
+		max98090: soundcodec at 10 {
 			reg = <0x10>;
-			compatible = "maxim,max98090-codec";
+			compatible = "maxim,max98090";
+			#sound-dai-cells = <1>;
 		};
 
 		edp-lvds-bridge at 48 {
diff --git a/arch/arm/dts/exynos5420-smdk5420.dts b/arch/arm/dts/exynos5420-smdk5420.dts
index daaa4666964..7a5da674fbe 100644
--- a/arch/arm/dts/exynos5420-smdk5420.dts
+++ b/arch/arm/dts/exynos5420-smdk5420.dts
@@ -82,10 +82,26 @@
 	};
 
 	i2c at 12C70000 {
-		soundcodec at 1a {
+		wm8994: soundcodec at 1a {
 			reg = <0x1a>;
 			u-boot,i2c-offset-len = <2>;
-			compatible = "wolfson,wm8994-codec";
+			compatible = "wolfson,wm8994";
+			#sound-dai-cells = <1>;
+		};
+	};
+
+	sound {
+		compatible = "samsung,smdk5420-audio-wm8994";
+
+		samsung,model = "Snow-I2S-MAX98095";
+		samsung,audio-codec = <&wm8994>;
+
+		cpu {
+			sound-dai = <&i2s0 0>;
+		};
+
+		codec {
+			sound-dai = <&wm8994 0>;
 		};
 	};
 
diff --git a/arch/arm/dts/exynos54xx.dtsi b/arch/arm/dts/exynos54xx.dtsi
index 09bef56e6c2..221da8b4850 100644
--- a/arch/arm/dts/exynos54xx.dtsi
+++ b/arch/arm/dts/exynos54xx.dtsi
@@ -104,6 +104,20 @@
 		interrupts = <0 203 0>;
 	};
 
+	i2s0: i2s at 3830000 {
+		compatible = "samsung,s5pv210-i2s";
+		reg = <0x03830000 0x100>;
+		#sound-dai-cells = <1>;
+		samsung,idma-addr = <0x03000000>;
+		samsung,i2s-epll-clock-frequency = <192000000>;
+		samsung,i2s-sampling-rate = <48000>;
+		samsung,i2s-bits-per-sample = <16>;
+		samsung,i2s-channels = <2>;
+		samsung,i2s-lr-clk-framesize = <256>;
+		samsung,i2s-bit-clk-framesize = <32>;
+		samsung,i2s-id = <0>;
+	};
+
 	mmc at 12200000 {
 		samsung,bus-width = <8>;
 		samsung,timing = <1 3 3>;
diff --git a/arch/arm/dts/exynos5800-peach-pi.dts b/arch/arm/dts/exynos5800-peach-pi.dts
index 239781b34bb..63c0b186e42 100644
--- a/arch/arm/dts/exynos5800-peach-pi.dts
+++ b/arch/arm/dts/exynos5800-peach-pi.dts
@@ -79,11 +79,27 @@
 		};
 	};
 
+	sound {
+		compatible = "google,peach-audio-max98090";
+
+		samsung,model = "PEACH-I2S-MAX98090";
+		samsung,audio-codec = <&max98090>;
+
+		cpu {
+			sound-dai = <&i2s0 0>;
+		};
+
+		codec {
+			sound-dai = <&max98090 0>;
+		};
+	};
+
 	i2c at 12CD0000 { /* i2c7 */
 		clock-frequency = <100000>;
-		soundcodec at 10 {
+		max98090: soundcodec at 10 {
 			reg = <0x10>;
-			compatible = "maxim,max98090-codec";
+			compatible = "maxim,max98090";
+			#sound-dai-cells = <1>;
 		};
 	};
 
diff --git a/configs/arndale_defconfig b/configs/arndale_defconfig
index 2b6af4b2215..22881c3a2c6 100644
--- a/configs/arndale_defconfig
+++ b/configs/arndale_defconfig
@@ -31,6 +31,7 @@ CONFIG_MMC_SDHCI_S5P=y
 CONFIG_SMC911X=y
 CONFIG_SMC911X_BASE=0x5000000
 CONFIG_SOUND=y
+CONFIG_DM_SOUND=y
 CONFIG_I2S=y
 CONFIG_I2S_SAMSUNG=y
 CONFIG_SOUND_MAX98095=y
diff --git a/configs/peach-pi_defconfig b/configs/peach-pi_defconfig
index 338eae20b41..5ced3423160 100644
--- a/configs/peach-pi_defconfig
+++ b/configs/peach-pi_defconfig
@@ -21,6 +21,7 @@ CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
+CONFIG_CMD_SOUND=y
 CONFIG_CMD_PMIC=y
 CONFIG_CMD_REGULATOR=y
 CONFIG_CMD_TPM=y
@@ -50,8 +51,10 @@ CONFIG_REGULATOR_TPS65090=y
 CONFIG_DM_PWM=y
 CONFIG_PWM_EXYNOS=y
 CONFIG_SOUND=y
+CONFIG_DM_SOUND=y
 CONFIG_I2S=y
 CONFIG_I2S_SAMSUNG=y
+CONFIG_SOUND_MAX98090=y
 CONFIG_SOUND_MAX98095=y
 CONFIG_SOUND_WM8994=y
 CONFIG_EXYNOS_SPI=y
diff --git a/configs/peach-pit_defconfig b/configs/peach-pit_defconfig
index 933c823ea86..b1fe3f73abb 100644
--- a/configs/peach-pit_defconfig
+++ b/configs/peach-pit_defconfig
@@ -20,6 +20,7 @@ CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_TIME=y
+CONFIG_CMD_SOUND=y
 CONFIG_CMD_PMIC=y
 CONFIG_CMD_REGULATOR=y
 CONFIG_CMD_TPM=y
@@ -49,8 +50,10 @@ CONFIG_REGULATOR_TPS65090=y
 CONFIG_DM_PWM=y
 CONFIG_PWM_EXYNOS=y
 CONFIG_SOUND=y
+CONFIG_DM_SOUND=y
 CONFIG_I2S=y
 CONFIG_I2S_SAMSUNG=y
+CONFIG_SOUND_MAX98090=y
 CONFIG_SOUND_MAX98095=y
 CONFIG_SOUND_WM8994=y
 CONFIG_EXYNOS_SPI=y
diff --git a/configs/smdk5250_defconfig b/configs/smdk5250_defconfig
index 161454b33fd..90ee0ffbc9d 100644
--- a/configs/smdk5250_defconfig
+++ b/configs/smdk5250_defconfig
@@ -44,6 +44,7 @@ CONFIG_DM_PMIC_MAX77686=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_MAX77686=y
 CONFIG_SOUND=y
+CONFIG_DM_SOUND=y
 CONFIG_I2S=y
 CONFIG_I2S_SAMSUNG=y
 CONFIG_SOUND_MAX98095=y
diff --git a/configs/snow_defconfig b/configs/snow_defconfig
index 21080091a7d..4d1c53d4291 100644
--- a/configs/snow_defconfig
+++ b/configs/snow_defconfig
@@ -61,6 +61,7 @@ CONFIG_DM_PWM=y
 CONFIG_PWM_EXYNOS=y
 CONFIG_DEBUG_UART_S5P=y
 CONFIG_SOUND=y
+CONFIG_DM_SOUND=y
 CONFIG_I2S=y
 CONFIG_I2S_SAMSUNG=y
 CONFIG_SOUND_MAX98095=y
diff --git a/configs/spring_defconfig b/configs/spring_defconfig
index ca1799895e8..8f9436c74af 100644
--- a/configs/spring_defconfig
+++ b/configs/spring_defconfig
@@ -61,6 +61,7 @@ CONFIG_DM_PWM=y
 CONFIG_PWM_EXYNOS=y
 CONFIG_DEBUG_UART_S5P=y
 CONFIG_SOUND=y
+CONFIG_DM_SOUND=y
 CONFIG_I2S=y
 CONFIG_I2S_SAMSUNG=y
 CONFIG_SOUND_MAX98095=y
diff --git a/drivers/sound/samsung_sound.c b/drivers/sound/samsung_sound.c
index 23b467c1de0..1d711c87322 100644
--- a/drivers/sound/samsung_sound.c
+++ b/drivers/sound/samsung_sound.c
@@ -89,6 +89,9 @@ static const struct sound_ops samsung_sound_ops = {
 
 static const struct udevice_id samsung_sound_ids[] = {
 	{ .compatible = "google,snow-audio-max98095" },
+	{ .compatible = "google,spring-audio-max98095" },
+	{ .compatible = "samsung,smdk5420-audio-wm8994" },
+	{ .compatible = "google,peach-audio-max98090" },
 	{ }
 };
 
-- 
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 ` [U-Boot] [PATCH v2 12/22] exynos: Add support for exynos5420 i2s pinmux Simon Glass
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 ` Simon Glass [this message]
2018-12-10 17:37 ` [U-Boot] [PATCH v2 16/22] dm: sandbox: sound: Convert to use driver model 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-16-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.