Skip to contentSkip to conversation

ARM: EXYNOS: Add clocks for EXYNOS I2S and PCM I/F

PATCH RESEND Superseded Sangsu Park 3 participants 5 messages Feb 6, 2013 – Feb 8, 2013

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 ARM: EXYNOS: Add clocks for EXYNOS I2S and PCM I/F

Audio Subsystem has own clocks for I2S0 and PCM0 in all EXYNOS series. This patch add clocks for I2S0 and PCM0 I/F.

---
 arch/arm/mach-exynos/Makefile      |    1 +
 arch/arm/mach-exynos/clock-audss.c |   64 ++++++++++++++++++++++++++++++++++++
 2 files changed, 65 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-exynos/clock-audss.c
arch/arm/mach-exynos/Makefile +1 -0
index 7e53a3a..5b6c7c0 100644
@@ -13,6 +13,7 @@ obj-				:=
 # Core
 
 obj-$(CONFIG_ARCH_EXYNOS)	+= common.o
+obj-$(CONFIG_ARCH_EXYNOS)	+= clock-audss.o
 obj-$(CONFIG_ARCH_EXYNOS4)	+= clock-exynos4.o
 obj-$(CONFIG_CPU_EXYNOS4210)	+= clock-exynos4210.o
 obj-$(CONFIG_SOC_EXYNOS4212)	+= clock-exynos4212.o
(quoted diff) +0 -0

b/arch/arm/mach-exynos/clock-audss.c
new file mode 100644
index 0000000..8260185

arch/arm/mach-exynos/clock-audss.c new file +43 -0

43 lines not on this page · raw message

EXYNOS_AUDSS_CLKGATE_I2SBUS
+ | EXYNOS_AUDSS_CLKGATE_GPIO,
+ }, {
+ .name = "pcm",
+ .devname = "samsung-pcm.0",
+ .enable = exynos_clk_audss_ctrl,
+ .ctrlbit = EXYNOS_AUDSS_CLKGATE_PCMSPECIAL |
EXYNOS_AUDSS_CLKGATE_PCMBUS
+ | EXYNOS_AUDSS_CLKGATE_GPIO,
+ },
+};
+
+void __init exynos_register_audss_clocks(void)
+{
+ clk_audss_base = ioremap(EXYNOS_PA_AUDSS, SZ_4K);
+ if (clk_audss_base == NULL) {
+ pr_err("unable to ioremap for gpio_base1\n");
+ return;
+ }
+
+ s3c_register_clocks(exynos_init_audss_clocks,
ARRAY_SIZE(exynos_init_audss_clocks));
+ s3c_disable_clocks(exynos_init_audss_clocks,
ARRAY_SIZE(exynos_init_audss_clocks));
+}

Signature · 1 line
1.7.4.1
#1 lore raw

PATCH RESEND 1/1 ARM: EXYNOS: Add clocks for EXYNOS I2S and PCM I/F

Quoted 10 lines · Sangsu Park

Audio Subsystem has own clocks for I2S0 and PCM0 in all EXYNOS series. This patch add clocks for I2S0 and PCM0 I/F.

---
 arch/arm/mach-exynos/Makefile      |    1 +
 arch/arm/mach-exynos/clock-audss.c |   64 ++++++++++++++++++++++++++++++++++++
 2 files changed, 65 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-exynos/clock-audss.c

[snip]

Quoted 7 lines
arch/arm/mach-exynos/clock-audss.c new file +0 -0
new file mode 100644
index 0000000..8260185
@@ -0,0 +1,64 @@

[snip]

arch/arm/mach-exynos/clock-audss.c line 33

Quoted 6 lines
arch/arm/mach-exynos/clock-audss.c new file +6 -0
+static void __iomem *clk_audss_base = 0;
+
+static int exynos_clk_audss_ctrl(struct clk *clk, int enable)
+{
+       if (!clk_audss_base)
+               return ENOMEM;

Return value should be negative (-ENOMEM).

Signature · 2 lines
With warm regards,
Sachin
#2 lore raw

PATCH RESEND 1/1 ARM: EXYNOS: Add clocks for EXYNOS I2S and PCM I/F

Quoted 21 lines · Sachin Kamat
Quoted 7 lines · Sangsu Park

Audio Subsystem has own clocks for I2S0 and PCM0 in all EXYNOS series. This patch add clocks for I2S0 and PCM0 I/F.

---
 arch/arm/mach-exynos/Makefile      |    1 +
 arch/arm/mach-exynos/clock-audss.c |   64

++++++++++++++++++++++++++++++++++++

Quoted 3 lines
 2 files changed, 65 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-exynos/clock-audss.c

[snip]

Quoted 7 lines
arch/arm/mach-exynos/clock-audss.c new file +0 -0
new file mode 100644
index 0000000..8260185
@@ -0,0 +1,64 @@

[snip]

Quoted 8 lines

arch/arm/mach-exynos/clock-audss.c line 33

Quoted 6 lines
arch/arm/mach-exynos/clock-audss.c new file +6 -0
+static void __iomem *clk_audss_base = 0;
+
+static int exynos_clk_audss_ctrl(struct clk *clk, int enable)
+{
+       if (!clk_audss_base)
+               return ENOMEM;

Return value should be negative (-ENOMEM).

Thanks for your comment.
I'll fix it.

Quoted 6 lines

--
With warm regards,
Sachin

#3 lore raw

PATCH RESEND 1/1 ARM: EXYNOS: Add clocks for EXYNOS I2S and PCM I/F

In reply to Sangsu Park
Quoted 80 lines · Sangsu Park

Audio Subsystem has own clocks for I2S0 and PCM0 in all EXYNOS series. This patch add clocks for I2S0 and PCM0 I/F.

---
 arch/arm/mach-exynos/Makefile      |    1 +
 arch/arm/mach-exynos/clock-audss.c |   64 ++++++++++++++++++++++++++++++++++++
 2 files changed, 65 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-exynos/clock-audss.c
arch/arm/mach-exynos/Makefile +1 -0
index 7e53a3a..5b6c7c0 100644
@@ -13,6 +13,7 @@ obj-                          :=
 # Core
 
 obj-$(CONFIG_ARCH_EXYNOS)      += common.o
+obj-$(CONFIG_ARCH_EXYNOS)      += clock-audss.o
 obj-$(CONFIG_ARCH_EXYNOS4)     += clock-exynos4.o
 obj-$(CONFIG_CPU_EXYNOS4210)   += clock-exynos4210.o
 obj-$(CONFIG_SOC_EXYNOS4212)   += clock-exynos4212.o
arch/arm/mach-exynos/clock-audss.c new file +43 -0
new file mode 100644
index 0000000..8260185
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com
+ *
+ * Clock support for EXYNOS Audio Subsystem
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/err.h>
+#include <linux/io.h>
+
+#include <plat/clock.h>
+#include <plat/s5p-clock.h>
+
+#define EXYNOS_PA_AUDSS        (0x03810000)
+
+/* IP Clock Gate 0 Registers */
+#define EXYNOS_AUDSS_CLKGATE_I2SBUS    (1<<2)
+#define EXYNOS_AUDSS_CLKGATE_I2SSPECIAL        (1<<3)
+#define EXYNOS_AUDSS_CLKGATE_PCMBUS    (1<<4)
+#define EXYNOS_AUDSS_CLKGATE_PCMSPECIAL        (1<<5)
+#define EXYNOS_AUDSS_CLKGATE_GPIO      (1<<6)
+
+static void __iomem *clk_audss_base = 0;
+
+static int exynos_clk_audss_ctrl(struct clk *clk, int enable)
+{
+       if (!clk_audss_base)
+               return ENOMEM;
+
+       return s5p_gatectrl(clk_audss_base, clk, enable);
+}
+
+static struct clk exynos_init_audss_clocks[] = {
+       {
+               .name           = "iis",
+               .devname        = "samsung-i2s.0",
+               .enable         = exynos_clk_audss_ctrl,
+               .ctrlbit        = EXYNOS_AUDSS_CLKGATE_I2SSPECIAL |

EXYNOS_AUDSS_CLKGATE_I2SBUS

arch/arm/mach-exynos/clock-audss.c new file +6 -0
+                               | EXYNOS_AUDSS_CLKGATE_GPIO,
+       }, {
+               .name           = "pcm",
+               .devname        = "samsung-pcm.0",
+               .enable         = exynos_clk_audss_ctrl,
+               .ctrlbit        = EXYNOS_AUDSS_CLKGATE_PCMSPECIAL |

EXYNOS_AUDSS_CLKGATE_PCMBUS

arch/arm/mach-exynos/clock-audss.c

Quoted 8 lines
arch/arm/mach-exynos/clock-audss.c new file +8 -0
+                               | EXYNOS_AUDSS_CLKGATE_GPIO,
+       },
+};
+
+void __init exynos_register_audss_clocks(void)
+{
+       clk_audss_base = ioremap(EXYNOS_PA_AUDSS, SZ_4K);
+       if (clk_audss_base == NULL) {

Please run checkpatch. There should be space after if.

Quoted 1 line

+ pr_err("unable to ioremap for gpio_base1\n");

Please fix the err message.

Quoted 12 lines
arch/arm/mach-exynos/clock-audss.c new file +4 -0
+               return;
+       }
+
+       s3c_register_clocks(exynos_init_audss_clocks,

ARRAY_SIZE(exynos_init_audss_clocks));
+ s3c_disable_clocks(exynos_init_audss_clocks,
ARRAY_SIZE(exynos_init_audss_clocks));
+}
--
1.7.4.1

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Thanks
Padma

#4 lore raw

PATCH RESEND 1/1 ARM: EXYNOS: Add clocks for EXYNOS I2S and PCM I/F

Quoted 1 line · Padma Venkat

On Wed, Feb 6, 2013 at 10:51 AM, Sangsu Park <[email protected]>

Quoted 6 lines · wrote:

Review

Quoted 4 lines
(quoted diff) +4 -0
+void __init exynos_register_audss_clocks(void)
+{
+       clk_audss_base = ioremap(EXYNOS_PA_AUDSS, SZ_4K);
+       if (clk_audss_base == NULL) {

Please run checkpatch. There should be space after if.

I mistakenly forgot checking patch with checkpatch. I can find some errors and warnings about this patch. I'll fix them. Thank you for your comment.

Quoted 4 lines
Quoted 2 lines

+ pr_err("unable to ioremap for gpio_base1\n");

Please fix the err message.

I'll change it. :)

Thanks.
Sangsu Park