Skip to contentSkip to conversation

ARM: Add clkdev support for Samsung's platforms

RFC PATCH Superseded Thomas Abraham 2 participants 16 messages May 19, 2011 – May 26, 2011

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover ARM: Add clkdev support for Samsung's platforms

Thomas Abraham (7):
ARM: SAMSUNG: Add clkdev infrastructure
ARM: S3C24XX: Add clkdev support
ARM: S3C64XX: Add clkdev support
ARM: S5P64X0: Add clkdev support
ARM: S5PC100: Add clkdev support
ARM: S5PV210: Add clkdev support
ARM: Exynos4: Add clkdev support

 arch/arm/Kconfig                            |    6 ++
 arch/arm/mach-exynos4/clock.c               |   63 +++++++++++++++++++-
 arch/arm/mach-exynos4/include/mach/clkdev.h |    7 ++
 arch/arm/mach-exynos4/time.c                |    2 +
 arch/arm/mach-s3c2412/clock.c               |    3 +
 arch/arm/mach-s3c2416/clock.c               |    5 ++
 arch/arm/mach-s3c2443/clock.c               |    4 +
 arch/arm/mach-s3c64xx/clock.c               |   25 ++++++++
 arch/arm/mach-s3c64xx/include/mach/clkdev.h |    7 ++
 arch/arm/mach-s5p64x0/clock-s5p6440.c       |   20 +++++++
 arch/arm/mach-s5p64x0/clock-s5p6450.c       |   19 ++++++
 arch/arm/mach-s5p64x0/include/mach/clkdev.h |    7 ++
 arch/arm/mach-s5pc100/clock.c               |   42 +++++++++++++-
 arch/arm/mach-s5pc100/include/mach/clkdev.h |    7 ++
 arch/arm/mach-s5pv210/clock.c               |   42 +++++++++++++-
 arch/arm/mach-s5pv210/include/mach/clkdev.h |    7 ++
 arch/arm/plat-s3c24xx/include/mach/clkdev.h |    7 ++
 arch/arm/plat-s3c24xx/s3c2410-clock.c       |    3 +
 arch/arm/plat-s3c24xx/s3c2443-clock.c       |    4 +
 arch/arm/plat-s5p/s5p-time.c                |    9 +++
 arch/arm/plat-samsung/clock.c               |   83 ++-------------------------
 arch/arm/plat-samsung/include/plat/clock.h  |    3 +
 arch/arm/plat-samsung/pwm-clock.c           |   10 +++
 arch/arm/plat-samsung/time.c                |    2 +
 24 files changed, 303 insertions(+), 84 deletions(-)
 create mode 100644 arch/arm/mach-exynos4/include/mach/clkdev.h
 create mode 100644 arch/arm/mach-s3c64xx/include/mach/clkdev.h
 create mode 100644 arch/arm/mach-s5p64x0/include/mach/clkdev.h
 create mode 100644 arch/arm/mach-s5pc100/include/mach/clkdev.h
 create mode 100644 arch/arm/mach-s5pv210/include/mach/clkdev.h
 create mode 100644 arch/arm/plat-s3c24xx/include/mach/clkdev.h
#1 lore raw

PATCH 1/7 ARM: SAMSUNG: Add clkdev infrastructure

The struct clk definition for Samsung platforms is extended to include a instance of struct clk_lookup and a device name. When clocks are registered using s3c24xx_register_clock function, the dev_id, con_id and clk members are initialized with information from the struct clk instance and struct clk_lookup member is registered.

---
 arch/arm/plat-samsung/clock.c              |   83 ++--------------------------
 arch/arm/plat-samsung/include/plat/clock.h |    3 +
 2 files changed, 8 insertions(+), 78 deletions(-)
arch/arm/plat-samsung/clock.c +5 -78
index 7728928..6956fed 100644
@@ -71,74 +71,6 @@ static int clk_null_enable(struct clk *clk, int enable)
 	return 0;
 }
 
-static int dev_is_s3c_uart(struct device *dev)
-{
-	struct platform_device **pdev = s3c24xx_uart_devs;
-	int i;
-	for (i = 0; i < ARRAY_SIZE(s3c24xx_uart_devs); i++, pdev++)
-		if (*pdev && dev == &(*pdev)->dev)
-			return 1;
-	return 0;
-}
-
-/*
- * Serial drivers call get_clock() very early, before platform bus
- * has been set up, this requires a special check to let them get
- * a proper clock
- */
-
-static int dev_is_platform_device(struct device *dev)
-{
-	return dev->bus == &platform_bus_type ||
-	       (dev->bus == NULL && dev_is_s3c_uart(dev));
-}
-
-/* Clock API calls */
-
-struct clk *clk_get(struct device *dev, const char *id)
-{
-	struct clk *p;
-	struct clk *clk = ERR_PTR(-ENOENT);
-	int idno;
-
-	if (dev == NULL || !dev_is_platform_device(dev))
-		idno = -1;
-	else
-		idno = to_platform_device(dev)->id;
-
-	spin_lock(&clocks_lock);
-
-	list_for_each_entry(p, &clocks, list) {
-		if (p->id == idno &&
-		    strcmp(id, p->name) == 0 &&
-		    try_module_get(p->owner)) {
-			clk = p;
-			break;
-		}
-	}
-
-	/* check for the case where a device was supplied, but the
-	 * clock that was being searched for is not device specific */
-
-	if (IS_ERR(clk)) {
-		list_for_each_entry(p, &clocks, list) {
-			if (p->id == -1 && strcmp(id, p->name) == 0 &&
-			    try_module_get(p->owner)) {
-				clk = p;
-				break;
-			}
-		}
-	}
-
-	spin_unlock(&clocks_lock);
-	return clk;
-}
-
-void clk_put(struct clk *clk)
-{
-	module_put(clk->owner);
-}
-
 int clk_enable(struct clk *clk)
 {
 	if (IS_ERR(clk) || clk == NULL)
@@ -241,8 +173,6 @@ int clk_set_parent(struct clk *clk, struct clk *parent)
 	return ret;
 }
 
-EXPORT_SYMBOL(clk_get);
-EXPORT_SYMBOL(clk_put);
 EXPORT_SYMBOL(clk_enable);
 EXPORT_SYMBOL(clk_disable);
 EXPORT_SYMBOL(clk_get_rate);
@@ -346,14 +276,11 @@ int s3c24xx_register_clock(struct clk *clk)
 	if (clk->enable == NULL)
 		clk->enable = clk_null_enable;
 
-	/* add to the list of available clocks */
-
-	/* Quick check to see if this clock has already been registered. */
-	BUG_ON(clk->list.prev != clk->list.next);
-
-	spin_lock(&clocks_lock);
-	list_add(&clk->list, &clocks);
-	spin_unlock(&clocks_lock);
+	/* fill up the clk_lookup structure and register it*/
+	clk->lookup.dev_id = clk->devname;
+	clk->lookup.con_id = clk->name;
+	clk->lookup.clk = clk;
+	clkdev_add(&clk->lookup);
 
 	return 0;
 }
arch/arm/plat-samsung/include/plat/clock.h +3 -0
index 983c578..87d5b38 100644
@@ -10,6 +10,7 @@
 */
 
 #include <linux/spinlock.h>
+#include <linux/clkdev.h>
 
 struct clk;
 
@@ -40,6 +41,7 @@ struct clk {
 	struct module        *owner;
 	struct clk           *parent;
 	const char           *name;
+	const char		*devname;
 	int		      id;
 	int		      usage;
 	unsigned long         rate;
@@ -47,6 +49,7 @@ struct clk {
 
 	struct clk_ops		*ops;
 	int		    (*enable)(struct clk *, int enable);
+	struct clk_lookup	lookup;
 #if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
 	struct dentry		*dent;	/* For visible tree hierarchy */
 #endif
Signature · 1 line
1.6.6.rc2
#2 lore raw

PATCH 2/7 ARM: S3C24XX: Add clkdev support

In reply to Thomas Abraham

Add clkdev support for Samsung's s3c24xx platforms.

---
 arch/arm/Kconfig                            |    1 +
 arch/arm/mach-s3c2412/clock.c               |    3 +++
 arch/arm/mach-s3c2416/clock.c               |    5 +++++
 arch/arm/mach-s3c2443/clock.c               |    4 ++++
 arch/arm/plat-s3c24xx/include/mach/clkdev.h |    7 +++++++
 arch/arm/plat-s3c24xx/s3c2410-clock.c       |    3 +++
 arch/arm/plat-s3c24xx/s3c2443-clock.c       |    4 ++++
 arch/arm/plat-samsung/pwm-clock.c           |   10 ++++++++++
 arch/arm/plat-samsung/time.c                |    2 ++
 9 files changed, 39 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/plat-s3c24xx/include/mach/clkdev.h
arch/arm/Kconfig +1 -0
index 377a7a5..225f63a 100644
@@ -686,6 +686,7 @@ config ARCH_S3C2410
 	select GENERIC_GPIO
 	select ARCH_HAS_CPUFREQ
 	select HAVE_CLK
+	select CLKDEV_LOOKUP
 	select ARCH_USES_GETTIMEOFFSET
 	select HAVE_S3C2410_I2C if I2C
 	help
arch/arm/mach-s3c2412/clock.c +3 -0
index 0c0505b..aff4ee9 100644
@@ -557,18 +557,21 @@ static struct clk init_clocks[] = {
 		.ctrlbit	= S3C2412_CLKCON_PWMT,
 	}, {
 		.name		= "uart",
+		.devname	= "s3c2412-uart.0",
 		.id		= 0,
 		.parent		= &clk_p,
 		.enable		= s3c2412_clkcon_enable,
 		.ctrlbit	= S3C2412_CLKCON_UART0,
 	}, {
 		.name		= "uart",
+		.devname	= "s3c2412-uart.1",
 		.id		= 1,
 		.parent		= &clk_p,
 		.enable		= s3c2412_clkcon_enable,
 		.ctrlbit	= S3C2412_CLKCON_UART1,
 	}, {
 		.name		= "uart",
+		.devname	= "s3c2412-uart.2",
 		.id		= 2,
 		.parent		= &clk_p,
 		.enable		= s3c2412_clkcon_enable,
arch/arm/mach-s3c2416/clock.c +5 -0
index 3b02d85..60b98a9 100644
@@ -42,6 +42,7 @@ static struct clksrc_clk hsmmc_div[] = {
 	[0] = {
 		.clk = {
 			.name	= "hsmmc-div",
+			.devname	= "s3c-sdhci.0",
 			.id	= 0,
 			.parent	= &clk_esysclk.clk,
 		},
@@ -50,6 +51,7 @@ static struct clksrc_clk hsmmc_div[] = {
 	[1] = {
 		.clk = {
 			.name	= "hsmmc-div",
+			.devname	= "s3c-sdhci.1",
 			.id	= 1,
 			.parent	= &clk_esysclk.clk,
 		},
@@ -62,6 +64,7 @@ static struct clksrc_clk hsmmc_mux[] = {
 		.clk	= {
 			.id	= 0,
 			.name	= "hsmmc-if",
+			.devname	= "s3c-sdhci.0",
 			.ctrlbit = (1 << 6),
 			.enable = s3c2443_clkcon_enable_s,
 		},
@@ -78,6 +81,7 @@ static struct clksrc_clk hsmmc_mux[] = {
 		.clk	= {
 			.id	= 1,
 			.name	= "hsmmc-if",
+			.devname	= "s3c-sdhci.1",
 			.ctrlbit = (1 << 12),
 			.enable = s3c2443_clkcon_enable_s,
 		},
@@ -94,6 +98,7 @@ static struct clksrc_clk hsmmc_mux[] = {
 
 static struct clk hsmmc0_clk = {
 	.name		= "hsmmc",
+	.devname	= "s3c-sdhci.0",
 	.id		= 0,
 	.parent		= &clk_h,
 	.enable		= s3c2443_clkcon_enable_h,
arch/arm/mach-s3c2443/clock.c +4 -0
index f4ec6d5..3486955 100644
@@ -196,6 +196,7 @@ static struct clksrc_clk clk_hsspi = {
 static struct clksrc_clk clk_hsmmc_div = {
 	.clk	= {
 		.name		= "hsmmc-div",
+		.devname	= "s3c-sdhci.1",
 		.id		= 1,
 		.parent		= &clk_esysclk.clk,
 	},
@@ -231,6 +232,7 @@ static int s3c2443_enable_hsmmc(struct clk *clk, int enable)
 
 static struct clk clk_hsmmc = {
 	.name		= "hsmmc-if",
+	.devname	= "s3c-sdhci.1",
 	.id		= 1,
 	.parent		= &clk_hsmmc_div.clk,
 	.enable		= s3c2443_enable_hsmmc,
@@ -300,12 +302,14 @@ static struct clk init_clocks_off[] = {
 		.ctrlbit	= S3C2443_PCLKCON_IIS,
 	}, {
 		.name		= "spi",
+		.devname	= "s3c2410-spi.0",
 		.id		= 0,
 		.parent		= &clk_p,
 		.enable		= s3c2443_clkcon_enable_p,
 		.ctrlbit	= S3C2443_PCLKCON_SPI0,
 	}, {
 		.name		= "spi",
+		.devname	= "s3c2410-spi.1",
 		.id		= 1,
 		.parent		= &clk_p,
 		.enable		= s3c2443_clkcon_enable_p,
arch/arm/plat-s3c24xx/include/mach/clkdev.h new file +7 -0
new file mode 100644
index 0000000..1247f5e
@@ -0,0 +1,7 @@
+#ifndef __MACH_EXYNOS4_CLKDEV_H__
+#define __MACH_EXYNOS4_CLKDEV_H__
+
+#define __clk_get(clk) ({ 1; })
+#define __clk_put(clk) do { } while (0)
+
+#endif
arch/arm/plat-s3c24xx/s3c2410-clock.c +3 -0
index 9ecc5d9..b84dea0 100644
@@ -160,18 +160,21 @@ static struct clk init_clocks[] = {
 		.ctrlbit	= S3C2410_CLKCON_PWMT,
 	}, {
 		.name		= "uart",
+		.devname	= "s3c2410-uart.0",
 		.id		= 0,
 		.parent		= &clk_p,
 		.enable		= s3c2410_clkcon_enable,
 		.ctrlbit	= S3C2410_CLKCON_UART0,
 	}, {
 		.name		= "uart",
+		.devname	= "s3c2410-uart.1",
 		.id		= 1,
 		.parent		= &clk_p,
 		.enable		= s3c2410_clkcon_enable,
 		.ctrlbit	= S3C2410_CLKCON_UART1,
 	}, {
 		.name		= "uart",
+		.devname	= "s3c2410-uart.2",
 		.id		= 2,
 		.parent		= &clk_p,
 		.enable		= s3c2410_clkcon_enable,
arch/arm/plat-s3c24xx/s3c2443-clock.c +4 -0
index 82f2d4a..818781e 100644
@@ -320,24 +320,28 @@ static struct clk init_clocks[] = {
 		.ctrlbit	= S3C2443_HCLKCON_SSMC,
 	}, {
 		.name		= "uart",
+		.devname	= "s3c2440-uart.0",
 		.id		= 0,
 		.parent		= &clk_p,
 		.enable		= s3c2443_clkcon_enable_p,
 		.ctrlbit	= S3C2443_PCLKCON_UART0,
 	}, {
 		.name		= "uart",
+		.devname	= "s3c2440-uart.1",
 		.id		= 1,
 		.parent		= &clk_p,
 		.enable		= s3c2443_clkcon_enable_p,
 		.ctrlbit	= S3C2443_PCLKCON_UART1,
 	}, {
 		.name		= "uart",
+		.devname	= "s3c2440-uart.2",
 		.id		= 2,
 		.parent		= &clk_p,
 		.enable		= s3c2443_clkcon_enable_p,
 		.ctrlbit	= S3C2443_PCLKCON_UART2,
 	}, {
 		.name		= "uart",
+		.devname	= "s3c2440-uart.3",
 		.id		= 3,
 		.parent		= &clk_p,
 		.enable		= s3c2443_clkcon_enable_p,
arch/arm/plat-samsung/pwm-clock.c +10 -0
index 46c9381..f1bba88 100644
@@ -268,6 +268,7 @@ static struct pwm_tdiv_clk clk_timer_tdiv[] = {
 	[0]	= {
 		.clk	= {
 			.name	= "pwm-tdiv",
+			.devname	= "s3c24xx-pwm.0",
 			.ops	= &clk_tdiv_ops,
 			.parent	= &clk_timer_scaler[0],
 		},
@@ -275,6 +276,7 @@ static struct pwm_tdiv_clk clk_timer_tdiv[] = {
 	[1]	= {
 		.clk	= {
 			.name	= "pwm-tdiv",
+			.devname	= "s3c24xx-pwm.1",
 			.ops	= &clk_tdiv_ops,
 			.parent	= &clk_timer_scaler[0],
 		}
@@ -282,6 +284,7 @@ static struct pwm_tdiv_clk clk_timer_tdiv[] = {
 	[2]	= {
 		.clk	= {
 			.name	= "pwm-tdiv",
+			.devname	= "s3c24xx-pwm.2",
 			.ops	= &clk_tdiv_ops,
 			.parent	= &clk_timer_scaler[1],
 		},
@@ -289,6 +292,7 @@ static struct pwm_tdiv_clk clk_timer_tdiv[] = {
 	[3]	= {
 		.clk	= {
 			.name	= "pwm-tdiv",
+			.devname	= "s3c24xx-pwm.3",
 			.ops	= &clk_tdiv_ops,
 			.parent	= &clk_timer_scaler[1],
 		},
@@ -296,6 +300,7 @@ static struct pwm_tdiv_clk clk_timer_tdiv[] = {
 	[4]	= {
 		.clk	= {
 			.name	= "pwm-tdiv",
+			.devname	= "s3c24xx-pwm.4",
 			.ops	= &clk_tdiv_ops,
 			.parent	= &clk_timer_scaler[1],
 		},
@@ -361,26 +366,31 @@ static struct clk_ops clk_tin_ops = {
 static struct clk clk_tin[] = {
 	[0]	= {
 		.name	= "pwm-tin",
+		.devname	= "s3c24xx-pwm.0",
 		.id	= 0,
 		.ops	= &clk_tin_ops,
 	},
 	[1]	= {
 		.name	= "pwm-tin",
+		.devname	= "s3c24xx-pwm.1",
 		.id	= 1,
 		.ops	= &clk_tin_ops,
 	},
 	[2]	= {
 		.name	= "pwm-tin",
+		.devname	= "s3c24xx-pwm.2",
 		.id	= 2,
 		.ops	= &clk_tin_ops,
 	},
 	[3]	= {
 		.name	= "pwm-tin",
+		.devname	= "s3c24xx-pwm.3",
 		.id	= 3,
 		.ops	= &clk_tin_ops,
 	},
 	[4]	= {
 		.name	= "pwm-tin",
+		.devname	= "s3c24xx-pwm.4",
 		.id	= 4,
 		.ops	= &clk_tin_ops,
 	},
arch/arm/plat-samsung/time.c +2 -0
index 2231d80..e3bb806 100644
@@ -259,6 +259,8 @@ static void __init s3c2410_timer_resources(void)
 	clk_enable(timerclk);
 
 	if (!use_tclk1_12()) {
+		tmpdev.id = 4;
+		tmpdev.dev.init_name = "s3c24xx-pwm.4";
 		tin = clk_get(&tmpdev.dev, "pwm-tin");
 		if (IS_ERR(tin))
 			panic("failed to get pwm-tin clock for system timer");
Signature · 1 line
1.6.6.rc2
#3 lore raw

PATCH 3/7 ARM: S3C64XX: Add clkdev support

In reply to Thomas Abraham

Add clkdev support for Samsung's s3c64xx platforms.

---
 arch/arm/Kconfig                            |    1 +
 arch/arm/mach-s3c64xx/clock.c               |   25 +++++++++++++++++++++++++
 arch/arm/mach-s3c64xx/include/mach/clkdev.h |    7 +++++++
 3 files changed, 33 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s3c64xx/include/mach/clkdev.h
arch/arm/Kconfig +1 -0
index 225f63a..e0a62fe 100644
@@ -704,6 +704,7 @@ config ARCH_S3C64XX
 	select CPU_V6
 	select ARM_VIC
 	select HAVE_CLK
+	select CLKDEV_LOOKUP
 	select NO_IOPORT
 	select ARCH_USES_GETTIMEOFFSET
 	select ARCH_HAS_CPUFREQ
arch/arm/mach-s3c64xx/clock.c +25 -0
index fdfc4d5..3b6fb54 100644
@@ -152,18 +152,21 @@ static struct clk init_clocks_off[] = {
 		.ctrlbit	= S3C_CLKCON_PCLK_IIC,
 	}, {
 		.name		= "i2c",
+		.devname	= "s3c2440-i2c.1",
 		.id		= 1,
 		.parent		= &clk_p,
 		.enable		= s3c64xx_pclk_ctrl,
 		.ctrlbit	= S3C6410_CLKCON_PCLK_I2C1,
 	}, {
 		.name		= "iis",
+		.devname	= "samsung-i2s.0",
 		.id		= 0,
 		.parent		= &clk_p,
 		.enable		= s3c64xx_pclk_ctrl,
 		.ctrlbit	= S3C_CLKCON_PCLK_IIS0,
 	}, {
 		.name		= "iis",
+		.devname	= "samsung-i2s.1",
 		.id		= 1,
 		.parent		= &clk_p,
 		.enable		= s3c64xx_pclk_ctrl,
@@ -184,42 +187,49 @@ static struct clk init_clocks_off[] = {
 		.ctrlbit	= S3C_CLKCON_PCLK_KEYPAD,
 	}, {
 		.name		= "spi",
+		.devname	= "s3c64xx-spi.0",
 		.id		= 0,
 		.parent		= &clk_p,
 		.enable		= s3c64xx_pclk_ctrl,
 		.ctrlbit	= S3C_CLKCON_PCLK_SPI0,
 	}, {
 		.name		= "spi",
+		.devname	= "s3c64xx-spi.1",
 		.id		= 1,
 		.parent		= &clk_p,
 		.enable		= s3c64xx_pclk_ctrl,
 		.ctrlbit	= S3C_CLKCON_PCLK_SPI1,
 	}, {
 		.name		= "spi_48m",
+		.devname	= "s3c64xx-spi.0",
 		.id		= 0,
 		.parent		= &clk_48m,
 		.enable		= s3c64xx_sclk_ctrl,
 		.ctrlbit	= S3C_CLKCON_SCLK_SPI0_48,
 	}, {
 		.name		= "spi_48m",
+		.devname	= "s3c64xx-spi.1",
 		.id		= 1,
 		.parent		= &clk_48m,
 		.enable		= s3c64xx_sclk_ctrl,
 		.ctrlbit	= S3C_CLKCON_SCLK_SPI1_48,
 	}, {
 		.name		= "48m",
+		.devname	= "s3c-sdhci.0",
 		.id		= 0,
 		.parent		= &clk_48m,
 		.enable		= s3c64xx_sclk_ctrl,
 		.ctrlbit	= S3C_CLKCON_SCLK_MMC0_48,
 	}, {
 		.name		= "48m",
+		.devname	= "s3c-sdhci.1",
 		.id		= 1,
 		.parent		= &clk_48m,
 		.enable		= s3c64xx_sclk_ctrl,
 		.ctrlbit	= S3C_CLKCON_SCLK_MMC1_48,
 	}, {
 		.name		= "48m",
+		.devname	= "s3c-sdhci.2",
 		.id		= 2,
 		.parent		= &clk_48m,
 		.enable		= s3c64xx_sclk_ctrl,
@@ -260,18 +270,21 @@ static struct clk init_clocks[] = {
 		.ctrlbit	= S3C_CLKCON_HCLK_UHOST,
 	}, {
 		.name		= "hsmmc",
+		.devname	= "s3c-sdhci.0",
 		.id		= 0,
 		.parent		= &clk_h,
 		.enable		= s3c64xx_hclk_ctrl,
 		.ctrlbit	= S3C_CLKCON_HCLK_HSMMC0,
 	}, {
 		.name		= "hsmmc",
+		.devname	= "s3c-sdhci.1",
 		.id		= 1,
 		.parent		= &clk_h,
 		.enable		= s3c64xx_hclk_ctrl,
 		.ctrlbit	= S3C_CLKCON_HCLK_HSMMC1,
 	}, {
 		.name		= "hsmmc",
+		.devname	= "s3c-sdhci.2",
 		.id		= 2,
 		.parent		= &clk_h,
 		.enable		= s3c64xx_hclk_ctrl,
@@ -290,24 +303,28 @@ static struct clk init_clocks[] = {
 		.ctrlbit	= S3C_CLKCON_PCLK_PWM,
 	}, {
 		.name		= "uart",
+		.devname	= "s3c6400-uart.0",
 		.id		= 0,
 		.parent		= &clk_p,
 		.enable		= s3c64xx_pclk_ctrl,
 		.ctrlbit	= S3C_CLKCON_PCLK_UART0,
 	}, {
 		.name		= "uart",
+		.devname	= "s3c6400-uart.1",
 		.id		= 1,
 		.parent		= &clk_p,
 		.enable		= s3c64xx_pclk_ctrl,
 		.ctrlbit	= S3C_CLKCON_PCLK_UART1,
 	}, {
 		.name		= "uart",
+		.devname	= "s3c6400-uart.2",
 		.id		= 2,
 		.parent		= &clk_p,
 		.enable		= s3c64xx_pclk_ctrl,
 		.ctrlbit	= S3C_CLKCON_PCLK_UART2,
 	}, {
 		.name		= "uart",
+		.devname	= "s3c6400-uart.3",
 		.id		= 3,
 		.parent		= &clk_p,
 		.enable		= s3c64xx_pclk_ctrl,
@@ -610,6 +627,7 @@ static struct clksrc_clk clksrcs[] = {
 	{
 		.clk	= {
 			.name		= "mmc_bus",
+			.devname	= "s3c-sdhci.0",
 			.id		= 0,
 			.ctrlbit        = S3C_CLKCON_SCLK_MMC0,
 			.enable		= s3c64xx_sclk_ctrl,
@@ -620,6 +638,7 @@ static struct clksrc_clk clksrcs[] = {
 	}, {
 		.clk	= {
 			.name		= "mmc_bus",
+			.devname	= "s3c-sdhci.1",
 			.id		= 1,
 			.ctrlbit        = S3C_CLKCON_SCLK_MMC1,
 			.enable		= s3c64xx_sclk_ctrl,
@@ -630,6 +649,7 @@ static struct clksrc_clk clksrcs[] = {
 	}, {
 		.clk	= {
 			.name		= "mmc_bus",
+			.devname	= "s3c-sdhci.2",
 			.id		= 2,
 			.ctrlbit        = S3C_CLKCON_SCLK_MMC2,
 			.enable		= s3c64xx_sclk_ctrl,
@@ -661,6 +681,7 @@ static struct clksrc_clk clksrcs[] = {
 /* Where does UCLK0 come from? */
 		.clk	= {
 			.name		= "spi-bus",
+			.devname	= "s3c64xx-spi.0",
 			.id		= 0,
 			.ctrlbit        = S3C_CLKCON_SCLK_SPI0,
 			.enable		= s3c64xx_sclk_ctrl,
@@ -671,6 +692,7 @@ static struct clksrc_clk clksrcs[] = {
 	}, {
 		.clk	= {
 			.name		= "spi-bus",
+			.devname	= "s3c64xx-spi.1",
 			.id		= 1,
 			.ctrlbit        = S3C_CLKCON_SCLK_SPI1,
 			.enable		= s3c64xx_sclk_ctrl,
@@ -681,6 +703,7 @@ static struct clksrc_clk clksrcs[] = {
 	}, {
 		.clk	= {
 			.name		= "audio-bus",
+			.devname	= "samsung-i2s.0",
 			.id		= 0,
 			.ctrlbit        = S3C_CLKCON_SCLK_AUDIO0,
 			.enable		= s3c64xx_sclk_ctrl,
@@ -691,6 +714,7 @@ static struct clksrc_clk clksrcs[] = {
 	}, {
 		.clk	= {
 			.name		= "audio-bus",
+			.devname	= "samsung-i2s.1",
 			.id		= 1,
 			.ctrlbit        = S3C_CLKCON_SCLK_AUDIO1,
 			.enable		= s3c64xx_sclk_ctrl,
@@ -701,6 +725,7 @@ static struct clksrc_clk clksrcs[] = {
 	}, {
 		.clk	= {
 			.name		= "audio-bus",
+			.devname	= "samsung-i2s.2",
 			.id		= 2,
 			.ctrlbit        = S3C6410_CLKCON_SCLK_AUDIO2,
 			.enable		= s3c64xx_sclk_ctrl,
arch/arm/mach-s3c64xx/include/mach/clkdev.h new file +7 -0
new file mode 100644
index 0000000..1247f5e
@@ -0,0 +1,7 @@
+#ifndef __MACH_EXYNOS4_CLKDEV_H__
+#define __MACH_EXYNOS4_CLKDEV_H__
+
+#define __clk_get(clk) ({ 1; })
+#define __clk_put(clk) do { } while (0)
+
+#endif
Signature · 1 line
1.6.6.rc2
#4 lore raw

PATCH 4/7 ARM: S5P64X0: Add clkdev support

In reply to Thomas Abraham

Add clkdev support for Samsung's s5p64x0 platforms.

---
 arch/arm/Kconfig                            |    1 +
 arch/arm/mach-s5p64x0/clock-s5p6440.c       |   20 ++++++++++++++++++++
 arch/arm/mach-s5p64x0/clock-s5p6450.c       |   19 +++++++++++++++++++
 arch/arm/mach-s5p64x0/include/mach/clkdev.h |    7 +++++++
 arch/arm/plat-s5p/s5p-time.c                |    9 +++++++++
 5 files changed, 56 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-s5p64x0/include/mach/clkdev.h
arch/arm/Kconfig +1 -0
index e0a62fe..33ad464 100644
@@ -729,6 +729,7 @@ config ARCH_S5P64X0
 	select CPU_V6
 	select GENERIC_GPIO
 	select HAVE_CLK
+	select CLKDEV_LOOKUP
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
 	select GENERIC_CLOCKEVENTS
 	select HAVE_SCHED_CLOCK
arch/arm/mach-s5p64x0/clock-s5p6440.c +20 -0
index 9f12c2e..8e77738 100644
@@ -160,18 +160,21 @@ static struct clk init_clocks_off[] = {
 		.ctrlbit	= (1 << 12),
 	}, {
 		.name		= "hsmmc",
+		.devname	= "sdhci-s3c.0",
 		.id		= 0,
 		.parent		= &clk_hclk_low.clk,
 		.enable		= s5p64x0_hclk0_ctrl,
 		.ctrlbit	= (1 << 17),
 	}, {
 		.name		= "hsmmc",
+		.devname	= "sdhci-s3c.1",
 		.id		= 1,
 		.parent		= &clk_hclk_low.clk,
 		.enable		= s5p64x0_hclk0_ctrl,
 		.ctrlbit	= (1 << 18),
 	}, {
 		.name		= "hsmmc",
+		.devname	= "sdhci-s3c.2",
 		.id		= 2,
 		.parent		= &clk_hclk_low.clk,
 		.enable		= s5p64x0_hclk0_ctrl,
@@ -244,12 +247,14 @@ static struct clk init_clocks_off[] = {
 		.ctrlbit	= (1 << 17),
 	}, {
 		.name		= "spi",
+		.devname	= "s3c64xx-spi.0",
 		.id		= 0,
 		.parent		= &clk_pclk_low.clk,
 		.enable		= s5p64x0_pclk_ctrl,
 		.ctrlbit	= (1 << 21),
 	}, {
 		.name		= "spi",
+		.devname	= "s3c64xx-spi.1",
 		.id		= 1,
 		.parent		= &clk_pclk_low.clk,
 		.enable		= s5p64x0_pclk_ctrl,
@@ -262,6 +267,7 @@ static struct clk init_clocks_off[] = {
 		.ctrlbit	= (1 << 25),
 	}, {
 		.name		= "iis",
+		.devname	= "samsung-i2s.0",
 		.id		= 0,
 		.parent		= &clk_pclk_low.clk,
 		.enable		= s5p64x0_pclk_ctrl,
@@ -292,30 +298,35 @@ static struct clk init_clocks_off[] = {
 		.ctrlbit	= (1 << 31),
 	}, {
 		.name		= "sclk_spi_48",
+		.devname	= "s3c64xx-spi.0",
 		.id		= 0,
 		.parent		= &clk_48m,
 		.enable		= s5p64x0_sclk_ctrl,
 		.ctrlbit	= (1 << 22),
 	}, {
 		.name		= "sclk_spi_48",
+		.devname	= "s3c64xx-spi.1",
 		.id		= 1,
 		.parent		= &clk_48m,
 		.enable		= s5p64x0_sclk_ctrl,
 		.ctrlbit	= (1 << 23),
 	}, {
 		.name		= "mmc_48m",
+		.devname	= "sdhci-s3c.0",
 		.id		= 0,
 		.parent		= &clk_48m,
 		.enable		= s5p64x0_sclk_ctrl,
 		.ctrlbit	= (1 << 27),
 	}, {
 		.name		= "mmc_48m",
+		.devname	= "sdhci-s3c.1",
 		.id		= 1,
 		.parent		= &clk_48m,
 		.enable		= s5p64x0_sclk_ctrl,
 		.ctrlbit	= (1 << 28),
 	}, {
 		.name		= "mmc_48m",
+		.devname	= "sdhci-s3c.2",
 		.id		= 2,
 		.parent		= &clk_48m,
 		.enable		= s5p64x0_sclk_ctrl,
@@ -341,24 +352,28 @@ static struct clk init_clocks[] = {
 		.ctrlbit	= (1 << 21),
 	}, {
 		.name		= "uart",
+		.devname	= "s3c6400-uart.0",
 		.id		= 0,
 		.parent		= &clk_pclk_low.clk,
 		.enable		= s5p64x0_pclk_ctrl,
 		.ctrlbit	= (1 << 1),
 	}, {
 		.name		= "uart",
+		.devname	= "s3c6400-uart.1",
 		.id		= 1,
 		.parent		= &clk_pclk_low.clk,
 		.enable		= s5p64x0_pclk_ctrl,
 		.ctrlbit	= (1 << 2),
 	}, {
 		.name		= "uart",
+		.devname	= "s3c6400-uart.2",
 		.id		= 2,
 		.parent		= &clk_pclk_low.clk,
 		.enable		= s5p64x0_pclk_ctrl,
 		.ctrlbit	= (1 << 3),
 	}, {
 		.name		= "uart",
+		.devname	= "s3c6400-uart.3",
 		.id		= 3,
 		.parent		= &clk_pclk_low.clk,
 		.enable		= s5p64x0_pclk_ctrl,
@@ -420,6 +435,7 @@ static struct clksrc_clk clksrcs[] = {
 	{
 		.clk	= {
 			.name		= "sclk_mmc",
+			.devname	= "sdhci-s3c.0",
 			.id		= 0,
 			.ctrlbit	= (1 << 24),
 			.enable		= s5p64x0_sclk_ctrl,
@@ -430,6 +446,7 @@ static struct clksrc_clk clksrcs[] = {
 	}, {
 		.clk	= {
 			.name		= "sclk_mmc",
+			.devname	= "sdhci-s3c.1",
 			.id		= 1,
 			.ctrlbit	= (1 << 25),
 			.enable		= s5p64x0_sclk_ctrl,
@@ -440,6 +457,7 @@ static struct clksrc_clk clksrcs[] = {
 	}, {
 		.clk	= {
 			.name		= "sclk_mmc",
+			.devname	= "sdhci-s3c.2",
 			.id		= 2,
 			.ctrlbit	= (1 << 26),
 			.enable		= s5p64x0_sclk_ctrl,
@@ -460,6 +478,7 @@ static struct clksrc_clk clksrcs[] = {
 	}, {
 		.clk	= {
 			.name		= "sclk_spi",
+			.devname	= "s3c64xx-spi.0",
 			.id		= 0,
 			.ctrlbit	= (1 << 20),
 			.enable		= s5p64x0_sclk_ctrl,
@@ -470,6 +489,7 @@ static struct clksrc_clk clksrcs[] = {
 	}, {
 		.clk	= {
 			.name		= "sclk_spi",
+			.devname	= "s3c64xx-spi.1",
 			.id		= 1,
 			.ctrlbit	= (1 << 21),
 			.enable		= s5p64x0_sclk_ctrl,
arch/arm/mach-s5p64x0/clock-s5p6450.c +19 -0
index 4eec457..bd8adb7 100644
@@ -196,18 +196,21 @@ static struct clk init_clocks_off[] = {
 		.ctrlbit	= (1 << 12),
 	}, {
 		.name		= "hsmmc",
+		.devname	= "sdhci-s3c.0",
 		.id		= 0,
 		.parent		= &clk_hclk_low.clk,
 		.enable		= s5p64x0_hclk0_ctrl,
 		.ctrlbit	= (1 << 17),
 	}, {
 		.name		= "hsmmc",
+		.devname	= "sdhci-s3c.1",
 		.id		= 1,
 		.parent		= &clk_hclk_low.clk,
 		.enable		= s5p64x0_hclk0_ctrl,
 		.ctrlbit	= (1 << 18),
 	}, {
 		.name		= "hsmmc",
+		.devname	= "sdhci-s3c.2",
 		.id		= 2,
 		.parent		= &clk_hclk_low.clk,
 		.enable		= s5p64x0_hclk0_ctrl,
@@ -244,42 +247,49 @@ static struct clk init_clocks_off[] = {
 		.ctrlbit	= (1 << 12),
 	}, {
 		.name		= "i2c",
+		.devname	= "s3c2440-i2c.0",
 		.id		= 0,
 		.parent		= &clk_pclk_low.clk,
 		.enable		= s5p64x0_pclk_ctrl,
 		.ctrlbit	= (1 << 17),
 	}, {
 		.name		= "spi",
+		.devname	= "s3c64xx-spi.0",
 		.id		= 0,
 		.parent		= &clk_pclk_low.clk,
 		.enable		= s5p64x0_pclk_ctrl,
 		.ctrlbit	= (1 << 21),
 	}, {
 		.name		= "spi",
+		.devname	= "s3c64xx-spi.1",
 		.id		= 1,
 		.parent		= &clk_pclk_low.clk,
 		.enable		= s5p64x0_pclk_ctrl,
 		.ctrlbit	= (1 << 22),
 	}, {
 		.name		= "iis",
+		.devname	= "samsung-i2s.0",
 		.id		= 0,
 		.parent		= &clk_pclk_low.clk,
 		.enable		= s5p64x0_pclk_ctrl,
 		.ctrlbit	= (1 << 26),
 	}, {
 		.name		= "iis",
+		.devname	= "samsung-i2s.1",
 		.id		= 1,
 		.parent		= &clk_pclk_low.clk,
 		.enable		= s5p64x0_pclk_ctrl,
 		.ctrlbit	= (1 << 15),
 	}, {
 		.name		= "iis",
+		.devname	= "samsung-i2s.2",
 		.id		= 2,
 		.parent		= &clk_pclk_low.clk,
 		.enable		= s5p64x0_pclk_ctrl,
 		.ctrlbit	= (1 << 16),
 	}, {
 		.name		= "i2c",
+		.devname	= "s3c2440-i2c.1",
 		.id		= 1,
 		.parent		= &clk_pclk_low.clk,
 		.enable		= s5p64x0_pclk_ctrl,
@@ -311,24 +321,28 @@ static struct clk init_clocks[] = {
 		.ctrlbit	= (1 << 21),
 	}, {
 		.name		= "uart",
+		.devname	= "s3c6400-uart.0",
 		.id		= 0,
 		.parent		= &clk_pclk_low.clk,
 		.enable		= s5p64x0_pclk_ctrl,
 		.ctrlbit	= (1 << 1),
 	}, {
 		.name		= "uart",
+		.devname	= "s3c6400-uart.1",
 		.id		= 1,
 		.parent		= &clk_pclk_low.clk,
 		.enable		= s5p64x0_pclk_ctrl,
 		.ctrlbit	= (1 << 2),
 	}, {
 		.name		= "uart",
+		.devname	= "s3c6400-uart.2",
 		.id		= 2,
 		.parent		= &clk_pclk_low.clk,
 		.enable		= s5p64x0_pclk_ctrl,
 		.ctrlbit	= (1 << 3),
 	}, {
 		.name		= "uart",
+		.devname	= "s3c6400-uart.3",
 		.id		= 3,
 		.parent		= &clk_pclk_low.clk,
 		.enable		= s5p64x0_pclk_ctrl,
@@ -435,6 +449,7 @@ static struct clksrc_clk clksrcs[] = {
 	{
 		.clk	= {
 			.name		= "sclk_mmc",
+			.devname	= "sdhci-s3c.0",
 			.id		= 0,
 			.ctrlbit	= (1 << 24),
 			.enable		= s5p64x0_sclk_ctrl,
@@ -445,6 +460,7 @@ static struct clksrc_clk clksrcs[] = {
 	}, {
 		.clk	= {
 			.name		= "sclk_mmc",
+			.devname	= "sdhci-s3c.1",
 			.id		= 1,
 			.ctrlbit	= (1 << 25),
 			.enable		= s5p64x0_sclk_ctrl,
@@ -455,6 +471,7 @@ static struct clksrc_clk clksrcs[] = {
 	}, {
 		.clk	= {
 			.name		= "sclk_mmc",
+			.devname	= "sdhci-s3c.2",
 			.id		= 2,
 			.ctrlbit	= (1 << 26),
 			.enable		= s5p64x0_sclk_ctrl,
@@ -475,6 +492,7 @@ static struct clksrc_clk clksrcs[] = {
 	}, {
 		.clk	= {
 			.name		= "sclk_spi",
+			.devname	= "s3c64xx-spi.0",
 			.id		= 0,
 			.ctrlbit	= (1 << 20),
 			.enable		= s5p64x0_sclk_ctrl,
@@ -485,6 +503,7 @@ static struct clksrc_clk clksrcs[] = {
 	}, {
 		.clk	= {
 			.name		= "sclk_spi",
+			.devname	= "s3c64xx-spi.1",
 			.id		= 1,
 			.ctrlbit	= (1 << 21),
 			.enable		= s5p64x0_sclk_ctrl,
arch/arm/mach-s5p64x0/include/mach/clkdev.h new file +7 -0
new file mode 100644
index 0000000..1247f5e
@@ -0,0 +1,7 @@
+#ifndef __MACH_EXYNOS4_CLKDEV_H__
+#define __MACH_EXYNOS4_CLKDEV_H__
+
+#define __clk_get(clk) ({ 1; })
+#define __clk_put(clk) do { } while (0)
+
+#endif
arch/arm/plat-s5p/s5p-time.c +9 -0
index 8090403..d9efd29 100644
@@ -408,6 +408,7 @@ static void __init s5p_timer_resources(void)
 
 	unsigned long event_id = timer_source.event_id;
 	unsigned long source_id = timer_source.source_id;
+	char devname[15];
 
 	timerclk = clk_get(NULL, "timers");
 	if (IS_ERR(timerclk))
@@ -415,6 +416,10 @@ static void __init s5p_timer_resources(void)
 
 	clk_enable(timerclk);
 
+	sprintf(devname, "s3c24xx-pwm.%lu", event_id);
+	s3c_device_timer[event_id].id = event_id;
+	s3c_device_timer[event_id].dev.init_name = devname;
+
 	tin_event = clk_get(&s3c_device_timer[event_id].dev, "pwm-tin");
 	if (IS_ERR(tin_event))
 		panic("failed to get pwm-tin clock for event timer");
@@ -425,6 +430,10 @@ static void __init s5p_timer_resources(void)
 
 	clk_enable(tin_event);
 
+	sprintf(devname, "s3c24xx-pwm.%lu", source_id);
+	s3c_device_timer[source_id].id = source_id;
+	s3c_device_timer[source_id].dev.init_name = devname;
+
 	tin_source = clk_get(&s3c_device_timer[source_id].dev, "pwm-tin");
 	if (IS_ERR(tin_source))
 		panic("failed to get pwm-tin clock for source timer");
Signature · 1 line
1.6.6.rc2
#5 lore raw

Re: [PATCH 4/7] ARM: S5P64X0: Add clkdev support

Quoted 11 lines · Thomas Abraham

Add clkdev support for Samsung's s5p64x0 platforms.

---
  arch/arm/Kconfig                            |    1 +
  arch/arm/mach-s5p64x0/clock-s5p6440.c       |   20 ++++++++++++++++++++
  arch/arm/mach-s5p64x0/clock-s5p6450.c       |   19 +++++++++++++++++++
  arch/arm/mach-s5p64x0/include/mach/clkdev.h |    7 +++++++
  arch/arm/plat-s5p/s5p-time.c                |    9 +++++++++
  5 files changed, 56 insertions(+), 0 deletions(-)

create mode 100644 arch/arm/mach-s5p64x0/include/mach/clkdev.h

(snip)

I wonder why following is included in this, "S5P64X0: Add clkdev support".

Quoted 24 lines
arch/arm/plat-s5p/s5p-time.c +5 -0
index 8090403..d9efd29 100644
@@ -408,6 +408,7 @@ static void __init s5p_timer_resources(void)
 
  	unsigned long event_id = timer_source.event_id;
  	unsigned long source_id = timer_source.source_id;
+	char devname[15];
 
  	timerclk = clk_get(NULL, "timers");
  	if (IS_ERR(timerclk))
@@ -415,6 +416,10 @@ static void __init s5p_timer_resources(void)
 
  	clk_enable(timerclk);
 
+	sprintf(devname, "s3c24xx-pwm.%lu", event_id);
+	s3c_device_timer[event_id].id = event_id;
+	s3c_device_timer[event_id].dev.init_name = devname;
+
  	tin_event = clk_get(&s3c_device_timer[event_id].dev, "pwm-tin");
  	if (IS_ERR(tin_event))
  		panic("failed to get pwm-tin clock for event timer");

arch/arm/plat-s5p/s5p-time.c static void __init s5p_timer_resources(void) · line 439

Quoted 10 lines
arch/arm/plat-s5p/s5p-time.c +4 -0
@@ -425,6 +430,10 @@ static void __init s5p_timer_resources(void)
 
  	clk_enable(tin_event);
 
+	sprintf(devname, "s3c24xx-pwm.%lu", source_id);
+	s3c_device_timer[source_id].id = source_id;
+	s3c_device_timer[source_id].dev.init_name = devname;
+
  	tin_source = clk_get(&s3c_device_timer[source_id].dev, "pwm-tin");
  	if (IS_ERR(tin_source))
  		panic("failed to get pwm-tin clock for source timer");

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#6 lore raw

Re: [PATCH 4/7] ARM: S5P64X0: Add clkdev support

Hi Mr. Kukjin Kim,

Quoted 14 lines · Kukjin Kim
Quoted 4 lines · Thomas Abraham

Add clkdev support for Samsung's s5p64x0 platforms.

Quoted 8 lines

---
 arch/arm/Kconfig                            |    1 + arch/arm/mach-s5p64x0/clock-s5p6440.c       |   20 ++++++++++++++++++++ arch/arm/mach-s5p64x0/clock-s5p6450.c       |   19 +++++++++++++++++++ arch/arm/mach-s5p64x0/include/mach/clkdev.h |    7 +++++++ arch/arm/plat-s5p/s5p-time.c                |    9 +++++++++

 5 files changed, 56 insertions(+), 0 deletions(-)

 create mode 100644 arch/arm/mach-s5p64x0/include/mach/clkdev.h

Quoted 3 lines

(snip)

I wonder why following is included in this, "S5P64X0: Add clkdev support".

For clock lookups (using clk_get) based on clkdev, the platform devices should be registered before calling the clk_get function. In this case, the clk_get is called when platform devices (s3c_device_timer[]) is not registered. So these platform devices can be assigned a init_name which is then used by clk_dev to lookup the clocks. So, that is the reason for modifying the clock lookup in s5p-time.c file.

Thanks,
Thomas.

Quoted 50 lines
Quoted 25 lines
arch/arm/plat-s5p/s5p-time.c +5 -0
index 8090403..d9efd29 100644
@@ -408,6 +408,7 @@ static void __init s5p_timer_resources(void)
 
        unsigned long event_id = timer_source.event_id;
        unsigned long source_id = timer_source.source_id;
+       char devname[15];
 
        timerclk = clk_get(NULL, "timers");
        if (IS_ERR(timerclk))
@@ -415,6 +416,10 @@ static void __init s5p_timer_resources(void)
 
        clk_enable(timerclk);
 
+       sprintf(devname, "s3c24xx-pwm.%lu", event_id);
+       s3c_device_timer[event_id].id = event_id;
+       s3c_device_timer[event_id].dev.init_name = devname;
+
        tin_event = clk_get(&s3c_device_timer[event_id].dev, "pwm-tin");
        if (IS_ERR(tin_event))
                panic("failed to get pwm-tin clock for event timer");

arch/arm/plat-s5p/s5p-time.c static void __init s5p_timer_resources(void) · line 439

Quoted 10 lines
arch/arm/plat-s5p/s5p-time.c +4 -0
@@ -425,6 +430,10 @@ static void __init s5p_timer_resources(void)
 
        clk_enable(tin_event);
 
+       sprintf(devname, "s3c24xx-pwm.%lu", source_id);
+       s3c_device_timer[source_id].id = source_id;
+       s3c_device_timer[source_id].dev.init_name = devname;
+
        tin_source = clk_get(&s3c_device_timer[source_id].dev, "pwm-tin");
        if (IS_ERR(tin_source))
                panic("failed to get pwm-tin clock for source timer");

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

#7 lore raw

PATCH 5/7 ARM: S5PC100: Add clkdev support

In reply to Thomas Abraham

Add clkdev support for Samsung's s5pc100 platforms.

---
 arch/arm/Kconfig                            |    1 +
 arch/arm/mach-s5pc100/clock.c               |   42 ++++++++++++++++++++++++++-
 arch/arm/mach-s5pc100/include/mach/clkdev.h |    7 ++++
 3 files changed, 49 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-s5pc100/include/mach/clkdev.h
arch/arm/Kconfig +1 -0
index 33ad464..b329ee4 100644
@@ -753,6 +753,7 @@ config ARCH_S5PC100
 	bool "Samsung S5PC100"
 	select GENERIC_GPIO
 	select HAVE_CLK
+	select CLKDEV_LOOKUP
 	select CPU_V7
 	select ARM_L1_CACHE_SHIFT_6
 	select ARCH_USES_GETTIMEOFFSET
arch/arm/mach-s5pc100/clock.c +41 -1

288 lines not on this page · raw message

arch/arm/mach-s5pc100/include/mach/clkdev.h new file +7 -0
new file mode 100644
index 0000000..1247f5e
@@ -0,0 +1,7 @@
+#ifndef __MACH_EXYNOS4_CLKDEV_H__
+#define __MACH_EXYNOS4_CLKDEV_H__
+
+#define __clk_get(clk) ({ 1; })
+#define __clk_put(clk) do { } while (0)
+
+#endif
Signature · 1 line
1.6.6.rc2
#8 lore raw

Re: [PATCH 5/7] ARM: S5PC100: Add clkdev support

Quoted 10 lines · Thomas Abraham

Add clkdev support for Samsung's s5pc100 platforms.

---
  arch/arm/Kconfig                            |    1 +
  arch/arm/mach-s5pc100/clock.c               |   42 ++++++++++++++++++++++++++-
  arch/arm/mach-s5pc100/include/mach/clkdev.h |    7 ++++
  3 files changed, 49 insertions(+), 1 deletions(-)

create mode 100644 arch/arm/mach-s5pc100/include/mach/clkdev.h

(snip)

arch/arm/mach-s5pc100/clock.c static struct clk init_clocks_off[] = { · line 560

Quoted 6 lines
arch/arm/mach-s5pc100/clock.c +1 -1
@@ -549,7 +557,7 @@ static struct clk init_clocks_off[] = {
  		.ctrlbit	= (1 <<  7),
  	}, {
  		.name		= "g3d",
-		.id		= 0,
+		.id		= -1,

should be split

(snip)

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#9 lore raw

PATCH 6/7 ARM: S5PV210: Add clkdev support

In reply to Thomas Abraham

Add clkdev support for Samsung's s5pv210 platform.

---
 arch/arm/Kconfig                            |    1 +
 arch/arm/mach-s5pv210/clock.c               |   42 ++++++++++++++++++++++++++-
 arch/arm/mach-s5pv210/include/mach/clkdev.h |    7 ++++
 3 files changed, 49 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/mach-s5pv210/include/mach/clkdev.h
arch/arm/Kconfig +1 -0
index b329ee4..8d010f2 100644
@@ -769,6 +769,7 @@ config ARCH_S5PV210
 	select ARCH_SPARSEMEM_ENABLE
 	select GENERIC_GPIO
 	select HAVE_CLK
+	select CLKDEV_LOOKUP
 	select ARM_L1_CACHE_SHIFT_6
 	select ARCH_HAS_CPUFREQ
 	select GENERIC_CLOCKEVENTS
arch/arm/mach-s5pv210/clock.c +41 -1

287 lines not on this page · raw message

arch/arm/mach-s5pv210/include/mach/clkdev.h new file +7 -0
new file mode 100644
index 0000000..1247f5e
@@ -0,0 +1,7 @@
+#ifndef __MACH_EXYNOS4_CLKDEV_H__
+#define __MACH_EXYNOS4_CLKDEV_H__
+
+#define __clk_get(clk) ({ 1; })
+#define __clk_put(clk) do { } while (0)
+
+#endif
Signature · 1 line
1.6.6.rc2
#10 lore raw

Re: [PATCH 6/7] ARM: S5PV210: Add clkdev support

Quoted 10 lines · Thomas Abraham

Add clkdev support for Samsung's s5pv210 platform.

---
  arch/arm/Kconfig                            |    1 +
  arch/arm/mach-s5pv210/clock.c               |   42 ++++++++++++++++++++++++++-
  arch/arm/mach-s5pv210/include/mach/clkdev.h |    7 ++++
  3 files changed, 49 insertions(+), 1 deletions(-)

create mode 100644 arch/arm/mach-s5pv210/include/mach/clkdev.h

(snip)

arch/arm/mach-s5pv210/clock.c static struct clk init_clocks_off[] = { · line 374

Quoted 6 lines
arch/arm/mach-s5pv210/clock.c +1 -1
@@ -366,30 +371,34 @@ static struct clk init_clocks_off[] = {
  		.ctrlbit	= (1<<0),
  	}, {
  		.name		= "cfcon",
-		.id		= 0,
+		.id		= -1,

Should be split.

Signature · 7 lines
Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
#11 lore raw

PATCH 7/7 ARM: Exynos4: Add clkdev support

In reply to Thomas Abraham

Add clkdev support for Samsung's Exynos4 platform.

---
 arch/arm/Kconfig                            |    1 +
 arch/arm/mach-exynos4/clock.c               |   63 +++++++++++++++++++++++++--
 arch/arm/mach-exynos4/include/mach/clkdev.h |    7 +++
 arch/arm/mach-exynos4/time.c                |    2 +
 4 files changed, 69 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/mach-exynos4/include/mach/clkdev.h
arch/arm/Kconfig +1 -0
index 8d010f2..452e1c1 100644
@@ -786,6 +786,7 @@ config ARCH_EXYNOS4
 	select ARCH_SPARSEMEM_ENABLE
 	select GENERIC_GPIO
 	select HAVE_CLK
+	select CLKDEV_LOOKUP
 	select ARCH_HAS_CPUFREQ
 	select GENERIC_CLOCKEVENTS
 	select HAVE_S3C_RTC if RTC_CLASS
arch/arm/mach-exynos4/clock.c +59 -4

386 lines not on this page · raw message

arch/arm/mach-exynos4/include/mach/clkdev.h new file +7 -0
new file mode 100644
index 0000000..1247f5e
@@ -0,0 +1,7 @@
+#ifndef __MACH_EXYNOS4_CLKDEV_H__
+#define __MACH_EXYNOS4_CLKDEV_H__
+
+#define __clk_get(clk) ({ 1; })
+#define __clk_put(clk) do { } while (0)
+
+#endif
arch/arm/mach-exynos4/time.c +2 -0
index 86b9fa0..cb63f97 100644
@@ -262,6 +262,7 @@ static void __init exynos4_timer_resources(void)
 	clk_enable(timerclk);
 
 	tmpdev.id = 2;
+	tmpdev.dev.init_name = "s3c24xx-pwm.2";
 	tin2 = clk_get(&tmpdev.dev, "pwm-tin");
 	if (IS_ERR(tin2))
 		panic("failed to get pwm-tin2 clock for system timer");
@@ -272,6 +273,7 @@ static void __init exynos4_timer_resources(void)
 	clk_enable(tin2);
 
 	tmpdev.id = 4;
+	tmpdev.dev.init_name = "s3c24xx-pwm.4";
 	tin4 = clk_get(&tmpdev.dev, "pwm-tin");
 	if (IS_ERR(tin4))
 		panic("failed to get pwm-tin4 clock for system timer");
Signature · 1 line
1.6.6.rc2
#12 lore raw

Re: [PATCH 7/7] ARM: Exynos4: Add clkdev support

Quoted 11 lines · Thomas Abraham

Add clkdev support for Samsung's Exynos4 platform.

---
  arch/arm/Kconfig                            |    1 +
  arch/arm/mach-exynos4/clock.c               |   63 +++++++++++++++++++++++++--
  arch/arm/mach-exynos4/include/mach/clkdev.h |    7 +++
  arch/arm/mach-exynos4/time.c                |    2 +
  4 files changed, 69 insertions(+), 4 deletions(-)

create mode 100644 arch/arm/mach-exynos4/include/mach/clkdev.h

(snip)

arch/arm/mach-exynos4/clock.c static struct clk init_clocks_off[] = { · line 489

Quoted 4 lines
arch/arm/mach-exynos4/clock.c +2 -2
-		.name		= "hsmmc",
-		.id		= 4,
+		.name		= "dwmmc",
+		.id		= -1,

This change should be split :)

(snip)

arch/arm/mach-exynos4/clock.c static struct clksrc_clk clksrcs[] = { · line 1131

Quoted 8 lines
arch/arm/mach-exynos4/clock.c +2 -2
@@ -1072,8 +1127,8 @@ static struct clksrc_clk clksrcs[] = {
  		.reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 24, .size = 8 },
  	}, {
  		.clk		= {
-			.name		= "sclk_mmc",
-			.id		= 4,
+			.name		= "sclk_dwmmc",
+			.id		= -1,

Same as above.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#13 lore raw

Re: [PATCH 7/7] ARM: Exynos4: Add clkdev support

Hi Mr. Kukjin Kim,

Quoted 15 lines · Kukjin Kim
Quoted 4 lines · Thomas Abraham

Add clkdev support for Samsung's Exynos4 platform.

Quoted 9 lines

---
 arch/arm/Kconfig                            |    1 + arch/arm/mach-exynos4/clock.c               |   63
+++++++++++++++++++++++++--
 arch/arm/mach-exynos4/include/mach/clkdev.h |    7 +++ arch/arm/mach-exynos4/time.c                |    2 +

 4 files changed, 69 insertions(+), 4 deletions(-)

 create mode 100644 arch/arm/mach-exynos4/include/mach/clkdev.h

Quoted 8 lines

(snip)

Quoted 4 lines

-               .name           = "hsmmc",
-               .id             = 4,
+               .name           = "dwmmc",
+               .id             = -1,

This change should be split :)

Ok. I will move these changes to another patch.

Thanks,
Thomas.

Quoted 28 lines

(snip)

Quoted 9 lines
(quoted diff) +0 -0
@@ -1072,8 +1127,8 @@ static struct clksrc_clk clksrcs[] = {

               .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 24, .size = 8 },
       }, {
               .clk            = {
-                       .name           = "sclk_mmc",
-                       .id             = 4,
+                       .name           = "sclk_dwmmc",
+                       .id             = -1,

Same as above.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

#14 lore raw
In reply to Thomas Abraham
Quoted 34 lines · Thomas Abraham

Thomas Abraham (7):
ARM: SAMSUNG: Add clkdev infrastructure
ARM: S3C24XX: Add clkdev support
ARM: S3C64XX: Add clkdev support
ARM: S5P64X0: Add clkdev support
ARM: S5PC100: Add clkdev support
ARM: S5PV210: Add clkdev support
ARM: Exynos4: Add clkdev support

  arch/arm/Kconfig                            |    6 ++
  arch/arm/mach-exynos4/clock.c               |   63 +++++++++++++++++++-
  arch/arm/mach-exynos4/include/mach/clkdev.h |    7 ++
  arch/arm/mach-exynos4/time.c                |    2 +
  arch/arm/mach-s3c2412/clock.c               |    3 +
  arch/arm/mach-s3c2416/clock.c               |    5 ++
  arch/arm/mach-s3c2443/clock.c               |    4 +
  arch/arm/mach-s3c64xx/clock.c               |   25 ++++++++
  arch/arm/mach-s3c64xx/include/mach/clkdev.h |    7 ++
  arch/arm/mach-s5p64x0/clock-s5p6440.c       |   20 +++++++
  arch/arm/mach-s5p64x0/clock-s5p6450.c       |   19 ++++++
  arch/arm/mach-s5p64x0/include/mach/clkdev.h |    7 ++
  arch/arm/mach-s5pc100/clock.c               |   42 +++++++++++++-
  arch/arm/mach-s5pc100/include/mach/clkdev.h |    7 ++
  arch/arm/mach-s5pv210/clock.c               |   42 +++++++++++++-
  arch/arm/mach-s5pv210/include/mach/clkdev.h |    7 ++
  arch/arm/plat-s3c24xx/include/mach/clkdev.h |    7 ++
  arch/arm/plat-s3c24xx/s3c2410-clock.c       |    3 +
  arch/arm/plat-s3c24xx/s3c2443-clock.c       |    4 +
  arch/arm/plat-s5p/s5p-time.c                |    9 +++
  arch/arm/plat-samsung/clock.c               |   83 ++-------------------------
  arch/arm/plat-samsung/include/plat/clock.h  |    3 +
  arch/arm/plat-samsung/pwm-clock.c           |   10 +++
  arch/arm/plat-samsung/time.c                |    2 +
  24 files changed, 303 insertions(+), 84 deletions(-)
Quoted 7 lines

create mode 100644 arch/arm/mach-exynos4/include/mach/clkdev.h create mode 100644 arch/arm/mach-s3c64xx/include/mach/clkdev.h create mode 100644 arch/arm/mach-s5p64x0/include/mach/clkdev.h create mode 100644 arch/arm/mach-s5pc100/include/mach/clkdev.h create mode 100644 arch/arm/mach-s5pv210/include/mach/clkdev.h create mode 100644 arch/arm/plat-s3c24xx/include/mach/clkdev.h

Hi Thomas,

Thanks for this patches :)

There are some comments in each patches and I need to check again about the devname like following.

s5p-fimc vs. s5pv210-fimc
sdhci-s3c vs. s3c-sdhci
and so on...

Since I'm out of office now, don't have all regarding materials. I will back this soon.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#15 lore raw

Hi Mr. Kukjin Kim,

Quoted 51 lines · Kukjin Kim
Quoted 35 lines · Thomas Abraham

Thomas Abraham (7):
  ARM: SAMSUNG: Add clkdev infrastructure
  ARM: S3C24XX: Add clkdev support
  ARM: S3C64XX: Add clkdev support
  ARM: S5P64X0: Add clkdev support
  ARM: S5PC100: Add clkdev support
  ARM: S5PV210: Add clkdev support
  ARM: Exynos4: Add clkdev support

 arch/arm/Kconfig                            |    6 ++ arch/arm/mach-exynos4/clock.c               |   63 +++++++++++++++++++- arch/arm/mach-exynos4/include/mach/clkdev.h |    7 ++ arch/arm/mach-exynos4/time.c                |    2 +

 arch/arm/mach-s3c2412/clock.c               |    3 +
 arch/arm/mach-s3c2416/clock.c               |    5 ++
 arch/arm/mach-s3c2443/clock.c               |    4 +
 arch/arm/mach-s3c64xx/clock.c               |   25 ++++++++

 arch/arm/mach-s3c64xx/include/mach/clkdev.h |    7 ++ arch/arm/mach-s5p64x0/clock-s5p6440.c       |   20 +++++++ arch/arm/mach-s5p64x0/clock-s5p6450.c       |   19 ++++++ arch/arm/mach-s5p64x0/include/mach/clkdev.h |    7 ++ arch/arm/mach-s5pc100/clock.c               |   42 +++++++++++++- arch/arm/mach-s5pc100/include/mach/clkdev.h |    7 ++ arch/arm/mach-s5pv210/clock.c               |   42 +++++++++++++- arch/arm/mach-s5pv210/include/mach/clkdev.h |    7 ++ arch/arm/plat-s3c24xx/include/mach/clkdev.h |    7 ++ arch/arm/plat-s3c24xx/s3c2410-clock.c       |    3 + arch/arm/plat-s3c24xx/s3c2443-clock.c       |    4 + arch/arm/plat-s5p/s5p-time.c                |    9 +++ arch/arm/plat-samsung/clock.c               |   83
++-------------------------
 arch/arm/plat-samsung/include/plat/clock.h  |    3 + arch/arm/plat-samsung/pwm-clock.c           |   10 +++ arch/arm/plat-samsung/time.c                |    2 +

Quoted 8 lines
 24 files changed, 303 insertions(+), 84 deletions(-)

 create mode 100644 arch/arm/mach-exynos4/include/mach/clkdev.h create mode 100644 arch/arm/mach-s3c64xx/include/mach/clkdev.h create mode 100644 arch/arm/mach-s5p64x0/include/mach/clkdev.h create mode 100644 arch/arm/mach-s5pc100/include/mach/clkdev.h create mode 100644 arch/arm/mach-s5pv210/include/mach/clkdev.h create mode 100644 arch/arm/plat-s3c24xx/include/mach/clkdev.h

Hi Thomas,

Thanks for this patches :)

There are some comments in each patches and I need to check again about the devname like following.

Quoted 6 lines

s5p-fimc vs. s5pv210-fimc
sdhci-s3c vs. s3c-sdhci
and so on...

Since I'm out of office now, don't have all regarding materials. I will back this soon.

Thanks for reviewing the patches. I will rework the patches as per your comments and submit again.

Thanks,
Thomas.

Quoted 14 lines

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html