Skip to contentSkip to conversation

Add clkdev support for Samsung platforms

RFC PATCH In review Thomas Abraham 3 participants 14 messages May 27, 2011 – May 28, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover Add clkdev support for Samsung platforms

This patch series adds clkdev support for all Samsung platforms. clkdev support is a prerequisite for adding device tree and common clock features on Samsung platforms.

Changes since v1:

1. Removed the clock id field from clock instances.
2. Fixed incorrect naming of guards in mach/clkdev.h files.

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               |  178 +++++++++------------------
 arch/arm/mach-exynos4/include/mach/clkdev.h |    7 +
 arch/arm/mach-exynos4/time.c                |    2 +
 arch/arm/mach-s3c2412/clock.c               |   36 +-----
 arch/arm/mach-s3c2416/clock.c               |   10 +-
 arch/arm/mach-s3c2440/clock.c               |    3 -
 arch/arm/mach-s3c2443/clock.c               |   16 +--
 arch/arm/mach-s3c64xx/clock.c               |   86 ++++---------
 arch/arm/mach-s3c64xx/include/mach/clkdev.h |    7 +
 arch/arm/mach-s5p64x0/clock-s5p6440.c       |   74 +++--------
 arch/arm/mach-s5p64x0/clock-s5p6450.c       |   68 +++--------
 arch/arm/mach-s5p64x0/include/mach/clkdev.h |    7 +
 arch/arm/mach-s5pc100/clock.c               |  163 ++++++------------------
 arch/arm/mach-s5pc100/include/mach/clkdev.h |    7 +
 arch/arm/mach-s5pv210/clock.c               |  130 ++++++--------------
 arch/arm/mach-s5pv210/include/mach/clkdev.h |    7 +
 arch/arm/plat-s3c24xx/clock-dclk.c          |    4 -
 arch/arm/plat-s3c24xx/include/mach/clkdev.h |    7 +
 arch/arm/plat-s3c24xx/s3c2410-clock.c       |   21 +---
 arch/arm/plat-s3c24xx/s3c2443-clock.c       |   39 +-----
 arch/arm/plat-s5p/s5p-time.c                |    9 ++
 arch/arm/plat-samsung/clock.c               |   98 +--------------
 arch/arm/plat-samsung/include/plat/clock.h  |    3 +
 arch/arm/plat-samsung/pwm-clock.c           |   10 ++
 arch/arm/plat-samsung/time.c                |    2 +
 26 files changed, 300 insertions(+), 700 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 v2 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              |   98 ++--------------------------
 arch/arm/plat-samsung/include/plat/clock.h |    3 +
 2 files changed, 9 insertions(+), 92 deletions(-)
arch/arm/plat-samsung/clock.c +6 -92
index 7728928..86633e8 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);
@@ -265,7 +195,6 @@ struct clk_ops clk_ops_def_setrate = {
 
 struct clk clk_xtal = {
 	.name		= "xtal",
-	.id		= -1,
 	.rate		= 0,
 	.parent		= NULL,
 	.ctrlbit	= 0,
@@ -273,30 +202,25 @@ struct clk clk_xtal = {
 
 struct clk clk_ext = {
 	.name		= "ext",
-	.id		= -1,
 };
 
 struct clk clk_epll = {
 	.name		= "epll",
-	.id		= -1,
 };
 
 struct clk clk_mpll = {
 	.name		= "mpll",
-	.id		= -1,
 	.ops		= &clk_ops_def_setrate,
 };
 
 struct clk clk_upll = {
 	.name		= "upll",
-	.id		= -1,
 	.parent		= NULL,
 	.ctrlbit	= 0,
 };
 
 struct clk clk_f = {
 	.name		= "fclk",
-	.id		= -1,
 	.rate		= 0,
 	.parent		= &clk_mpll,
 	.ctrlbit	= 0,
@@ -304,7 +228,6 @@ struct clk clk_f = {
 
 struct clk clk_h = {
 	.name		= "hclk",
-	.id		= -1,
 	.rate		= 0,
 	.parent		= NULL,
 	.ctrlbit	= 0,
@@ -313,7 +236,6 @@ struct clk clk_h = {
 
 struct clk clk_p = {
 	.name		= "pclk",
-	.id		= -1,
 	.rate		= 0,
 	.parent		= NULL,
 	.ctrlbit	= 0,
@@ -322,7 +244,6 @@ struct clk clk_p = {
 
 struct clk clk_usb_bus = {
 	.name		= "usb-bus",
-	.id		= -1,
 	.rate		= 0,
 	.parent		= &clk_upll,
 };
@@ -330,7 +251,6 @@ struct clk clk_usb_bus = {
 
 struct clk s3c24xx_uclk = {
 	.name		= "uclk",
-	.id		= -1,
 };
 
 /* initialise the clock system */
@@ -346,14 +266,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;
 }
@@ -463,10 +380,7 @@ static int clk_debugfs_register_one(struct clk *c)
 	char s[255];
 	char *p = s;
 
-	p += sprintf(p, "%s", c->name);
-
-	if (c->id >= 0)
-		sprintf(p, ":%d", c->id);
+	p += sprintf(p, "%s", c->dev_name);
 
 	d = debugfs_create_dir(s, pa ? pa->dent : clk_debugfs_root);
 	if (!d)
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 v2 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               |   36 ++----------------------
 arch/arm/mach-s3c2416/clock.c               |   10 +++---
 arch/arm/mach-s3c2440/clock.c               |    3 --
 arch/arm/mach-s3c2443/clock.c               |   16 +++--------
 arch/arm/plat-s3c24xx/clock-dclk.c          |    4 ---
 arch/arm/plat-s3c24xx/include/mach/clkdev.h |    7 +++++
 arch/arm/plat-s3c24xx/s3c2410-clock.c       |   21 ++------------
 arch/arm/plat-s3c24xx/s3c2443-clock.c       |   39 +++------------------------
 arch/arm/plat-samsung/pwm-clock.c           |   10 +++++++
 arch/arm/plat-samsung/time.c                |    2 +
 11 files changed, 39 insertions(+), 110 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 -33
index 0c0505b..140711d 100644
@@ -95,12 +95,10 @@ static int s3c2412_upll_enable(struct clk *clk, int enable)
 
 static struct clk clk_erefclk = {
 	.name		= "erefclk",
-	.id		= -1,
 };
 
 static struct clk clk_urefclk = {
 	.name		= "urefclk",
-	.id		= -1,
 };
 
 static int s3c2412_setparent_usysclk(struct clk *clk, struct clk *parent)
@@ -122,7 +120,6 @@ static int s3c2412_setparent_usysclk(struct clk *clk, struct clk *parent)
 
 static struct clk clk_usysclk = {
 	.name		= "usysclk",
-	.id		= -1,
 	.parent		= &clk_xtal,
 	.ops		= &(struct clk_ops) {
 		.set_parent	= s3c2412_setparent_usysclk,
@@ -132,13 +129,11 @@ static struct clk clk_usysclk = {
 static struct clk clk_mrefclk = {
 	.name		= "mrefclk",
 	.parent		= &clk_xtal,
-	.id		= -1,
 };
 
 static struct clk clk_mdivclk = {
 	.name		= "mdivclk",
 	.parent		= &clk_xtal,
-	.id		= -1,
 };
 
 static int s3c2412_setparent_usbsrc(struct clk *clk, struct clk *parent)
@@ -200,7 +195,6 @@ static int s3c2412_setrate_usbsrc(struct clk *clk, unsigned long rate)
 
 static struct clk clk_usbsrc = {
 	.name		= "usbsrc",
-	.id		= -1,
 	.ops		= &(struct clk_ops) {
 		.get_rate	= s3c2412_getrate_usbsrc,
 		.set_rate	= s3c2412_setrate_usbsrc,
@@ -228,7 +222,6 @@ static int s3c2412_setparent_msysclk(struct clk *clk, struct clk *parent)
 
 static struct clk clk_msysclk = {
 	.name		= "msysclk",
-	.id		= -1,
 	.ops		= &(struct clk_ops) {
 		.set_parent	= s3c2412_setparent_msysclk,
 	},
@@ -268,7 +261,6 @@ static int s3c2412_setparent_armclk(struct clk *clk, struct clk *parent)
 
 static struct clk clk_armclk = {
 	.name		= "armclk",
-	.id		= -1,
 	.parent		= &clk_msysclk,
 	.ops		= &(struct clk_ops) {
 		.set_parent	= s3c2412_setparent_armclk,
@@ -344,7 +336,6 @@ static int s3c2412_setrate_uart(struct clk *clk, unsigned long rate)
 
 static struct clk clk_uart = {
 	.name		= "uartclk",
-	.id		= -1,
 	.ops		= &(struct clk_ops) {
 		.get_rate	= s3c2412_getrate_uart,
 		.set_rate	= s3c2412_setrate_uart,
@@ -397,7 +388,6 @@ static int s3c2412_setrate_i2s(struct clk *clk, unsigned long rate)
 
 static struct clk clk_i2s = {
 	.name		= "i2sclk",
-	.id		= -1,
 	.ops		= &(struct clk_ops) {
 		.get_rate	= s3c2412_getrate_i2s,
 		.set_rate	= s3c2412_setrate_i2s,
@@ -449,7 +439,6 @@ static int s3c2412_setrate_cam(struct clk *clk, unsigned long rate)
 
 static struct clk clk_cam = {
 	.name		= "camif-upll",	/* same as 2440 name */
-	.id		= -1,
 	.ops		= &(struct clk_ops) {
 		.get_rate	= s3c2412_getrate_cam,
 		.set_rate	= s3c2412_setrate_cam,
@@ -463,37 +452,31 @@ static struct clk clk_cam = {
 static struct clk init_clocks_disable[] = {
 	{
 		.name		= "nand",
-		.id		= -1,
 		.parent		= &clk_h,
 		.enable		= s3c2412_clkcon_enable,
 		.ctrlbit	= S3C2412_CLKCON_NAND,
 	}, {
 		.name		= "sdi",
-		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s3c2412_clkcon_enable,
 		.ctrlbit	= S3C2412_CLKCON_SDI,
 	}, {
 		.name		= "adc",
-		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s3c2412_clkcon_enable,
 		.ctrlbit	= S3C2412_CLKCON_ADC,
 	}, {
 		.name		= "i2c",
-		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s3c2412_clkcon_enable,
 		.ctrlbit	= S3C2412_CLKCON_IIC,
 	}, {
 		.name		= "iis",
-		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s3c2412_clkcon_enable,
 		.ctrlbit	= S3C2412_CLKCON_IIS,
 	}, {
 		.name		= "spi",
-		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s3c2412_clkcon_enable,
 		.ctrlbit	= S3C2412_CLKCON_SPI,
@@ -503,96 +486,83 @@ static struct clk init_clocks_disable[] = {
 static struct clk init_clocks[] = {
 	{
 		.name		= "dma",
-		.id		= 0,
 		.parent		= &clk_h,
 		.enable		= s3c2412_clkcon_enable,
 		.ctrlbit	= S3C2412_CLKCON_DMA0,
 	}, {
 		.name		= "dma",
-		.id		= 1,
 		.parent		= &clk_h,
 		.enable		= s3c2412_clkcon_enable,
 		.ctrlbit	= S3C2412_CLKCON_DMA1,
 	}, {
 		.name		= "dma",
-		.id		= 2,
 		.parent		= &clk_h,
 		.enable		= s3c2412_clkcon_enable,
 		.ctrlbit	= S3C2412_CLKCON_DMA2,
 	}, {
 		.name		= "dma",
-		.id		= 3,
 		.parent		= &clk_h,
 		.enable		= s3c2412_clkcon_enable,
 		.ctrlbit	= S3C2412_CLKCON_DMA3,
 	}, {
 		.name		= "lcd",
-		.id		= -1,
 		.parent		= &clk_h,
 		.enable		= s3c2412_clkcon_enable,
 		.ctrlbit	= S3C2412_CLKCON_LCDC,
 	}, {
 		.name		= "gpio",
-		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s3c2412_clkcon_enable,
 		.ctrlbit	= S3C2412_CLKCON_GPIO,
 	}, {
 		.name		= "usb-host",
-		.id		= -1,
 		.parent		= &clk_h,
 		.enable		= s3c2412_clkcon_enable,
 		.ctrlbit	= S3C2412_CLKCON_USBH,
 	}, {
 		.name		= "usb-device",
-		.id		= -1,
 		.parent		= &clk_h,
 		.enable		= s3c2412_clkcon_enable,
 		.ctrlbit	= S3C2412_CLKCON_USBD,
 	}, {
 		.name		= "timers",
-		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s3c2412_clkcon_enable,
 		.ctrlbit	= S3C2412_CLKCON_PWMT,
 	}, {
 		.name		= "uart",
-		.id		= 0,
+		.devname	= "s3c2412-uart.0",
 		.parent		= &clk_p,
 		.enable		= s3c2412_clkcon_enable,
 		.ctrlbit	= S3C2412_CLKCON_UART0,
 	}, {
 		.name		= "uart",
-		.id		= 1,
+		.devname	= "s3c2412-uart.1",
 		.parent		= &clk_p,
 		.enable		= s3c2412_clkcon_enable,
 		.ctrlbit	= S3C2412_CLKCON_UART1,
 	}, {
 		.name		= "uart",
-		.id		= 2,
+		.devname	= "s3c2412-uart.2",
 		.parent		= &clk_p,
 		.enable		= s3c2412_clkcon_enable,
 		.ctrlbit	= S3C2412_CLKCON_UART2,
 	}, {
 		.name		= "rtc",
-		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s3c2412_clkcon_enable,
 		.ctrlbit	= S3C2412_CLKCON_RTC,
 	}, {
 		.name		= "watchdog",
-		.id		= -1,
 		.parent		= &clk_p,
 		.ctrlbit	= 0,
 	}, {
 		.name		= "usb-bus-gadget",
-		.id		= -1,
 		.parent		= &clk_usb_bus,
 		.enable		= s3c2412_clkcon_enable,
 		.ctrlbit	= S3C2412_CLKCON_USB_DEV48,
 	}, {
 		.name		= "usb-bus-host",
-		.id		= -1,
 		.parent		= &clk_usb_bus,
 		.enable		= s3c2412_clkcon_enable,
 		.ctrlbit	= S3C2412_CLKCON_USB_HOST48,
arch/arm/mach-s3c2416/clock.c +5 -5
index 3b02d85..21a5e81 100644
@@ -42,7 +42,7 @@ static struct clksrc_clk hsmmc_div[] = {
 	[0] = {
 		.clk = {
 			.name	= "hsmmc-div",
-			.id	= 0,
+			.devname	= "s3c-sdhci.0",
 			.parent	= &clk_esysclk.clk,
 		},
 		.reg_div = { .reg = S3C2416_CLKDIV2, .size = 2, .shift = 6 },
@@ -50,7 +50,7 @@ static struct clksrc_clk hsmmc_div[] = {
 	[1] = {
 		.clk = {
 			.name	= "hsmmc-div",
-			.id	= 1,
+			.devname	= "s3c-sdhci.1",
 			.parent	= &clk_esysclk.clk,
 		},
 		.reg_div = { .reg = S3C2443_CLKDIV1, .size = 2, .shift = 6 },
@@ -60,8 +60,8 @@ static struct clksrc_clk hsmmc_div[] = {
 static struct clksrc_clk hsmmc_mux[] = {
 	[0] = {
 		.clk	= {
-			.id	= 0,
 			.name	= "hsmmc-if",
+			.devname	= "s3c-sdhci.0",
 			.ctrlbit = (1 << 6),
 			.enable = s3c2443_clkcon_enable_s,
 		},
@@ -76,8 +76,8 @@ static struct clksrc_clk hsmmc_mux[] = {
 	},
 	[1] = {
 		.clk	= {
-			.id	= 1,
 			.name	= "hsmmc-if",
+			.devname	= "s3c-sdhci.1",
 			.ctrlbit = (1 << 12),
 			.enable = s3c2443_clkcon_enable_s,
 		},
@@ -94,7 +94,7 @@ static struct clksrc_clk hsmmc_mux[] = {
 
 static struct clk hsmmc0_clk = {
 	.name		= "hsmmc",
-	.id		= 0,
+	.devname	= "s3c-sdhci.0",
 	.parent		= &clk_h,
 	.enable		= s3c2443_clkcon_enable_h,
 	.ctrlbit	= S3C2416_HCLKCON_HSMMC0,
arch/arm/mach-s3c2440/clock.c +0 -3
index 3dc2426..554e0d3 100644
@@ -90,14 +90,12 @@ static int s3c2440_camif_upll_setrate(struct clk *clk, unsigned long rate)
 
 static struct clk s3c2440_clk_cam = {
 	.name		= "camif",
-	.id		= -1,
 	.enable		= s3c2410_clkcon_enable,
 	.ctrlbit	= S3C2440_CLKCON_CAMERA,
 };
 
 static struct clk s3c2440_clk_cam_upll = {
 	.name		= "camif-upll",
-	.id		= -1,
 	.ops		= &(struct clk_ops) {
 		.set_rate	= s3c2440_camif_upll_setrate,
 		.round_rate	= s3c2440_camif_upll_round,
@@ -106,7 +104,6 @@ static struct clk s3c2440_clk_cam_upll = {
 
 static struct clk s3c2440_clk_ac97 = {
 	.name		= "ac97",
-	.id		= -1,
 	.enable		= s3c2410_clkcon_enable,
 	.ctrlbit	= S3C2440_CLKCON_CAMERA,
 };
arch/arm/mach-s3c2443/clock.c +4 -12
index f4ec6d5..a1a7176 100644
@@ -59,7 +59,6 @@
 
 static struct clk clk_i2s_ext = {
 	.name		= "i2s-ext",
-	.id		= -1,
 };
 
 /* armdiv
@@ -139,7 +138,6 @@ static int s3c2443_armclk_setrate(struct clk *clk, unsigned long rate)
 
 static struct clk clk_armdiv = {
 	.name		= "armdiv",
-	.id		= -1,
 	.parent		= &clk_msysclk.clk,
 	.ops		= &(struct clk_ops) {
 		.round_rate = s3c2443_armclk_roundrate,
@@ -160,7 +158,6 @@ static struct clk *clk_arm_sources[] = {
 static struct clksrc_clk clk_arm = {
 	.clk	= {
 		.name		= "armclk",
-		.id		= -1,
 	},
 	.sources = &(struct clksrc_sources) {
 		.sources = clk_arm_sources,
@@ -177,7 +174,6 @@ static struct clksrc_clk clk_arm = {
 static struct clksrc_clk clk_hsspi = {
 	.clk	= {
 		.name		= "hsspi",
-		.id		= -1,
 		.parent		= &clk_esysclk.clk,
 		.ctrlbit	= S3C2443_SCLKCON_HSSPICLK,
 		.enable		= s3c2443_clkcon_enable_s,
@@ -196,7 +192,7 @@ static struct clksrc_clk clk_hsspi = {
 static struct clksrc_clk clk_hsmmc_div = {
 	.clk	= {
 		.name		= "hsmmc-div",
-		.id		= 1,
+		.devname	= "s3c-sdhci.1",
 		.parent		= &clk_esysclk.clk,
 	},
 	.reg_div = { .reg = S3C2443_CLKDIV1, .size = 2, .shift = 6 },
@@ -231,7 +227,7 @@ static int s3c2443_enable_hsmmc(struct clk *clk, int enable)
 
 static struct clk clk_hsmmc = {
 	.name		= "hsmmc-if",
-	.id		= 1,
+	.devname	= "s3c-sdhci.1",
 	.parent		= &clk_hsmmc_div.clk,
 	.enable		= s3c2443_enable_hsmmc,
 	.ops		= &(struct clk_ops) {
@@ -248,7 +244,6 @@ static struct clk clk_hsmmc = {
 static struct clksrc_clk clk_i2s_eplldiv = {
 	.clk	= {
 		.name		= "i2s-eplldiv",
-		.id		= -1,
 		.parent		= &clk_esysclk.clk,
 	},
 	.reg_div = { .reg = S3C2443_CLKDIV1, .size = 4, .shift = 12, },
@@ -271,7 +266,6 @@ struct clk *clk_i2s_srclist[] = {
 static struct clksrc_clk clk_i2s = {
 	.clk	= {
 		.name		= "i2s-if",
-		.id		= -1,
 		.ctrlbit	= S3C2443_SCLKCON_I2SCLK,
 		.enable		= s3c2443_clkcon_enable_s,
 
@@ -288,25 +282,23 @@ static struct clksrc_clk clk_i2s = {
 static struct clk init_clocks_off[] = {
 	{
 		.name		= "sdi",
-		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s3c2443_clkcon_enable_p,
 		.ctrlbit	= S3C2443_PCLKCON_SDI,
 	}, {
 		.name		= "iis",
-		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s3c2443_clkcon_enable_p,
 		.ctrlbit	= S3C2443_PCLKCON_IIS,
 	}, {
 		.name		= "spi",
-		.id		= 0,
+		.devname	= "s3c2410-spi.0",
 		.parent		= &clk_p,
 		.enable		= s3c2443_clkcon_enable_p,
 		.ctrlbit	= S3C2443_PCLKCON_SPI0,
 	}, {
 		.name		= "spi",
-		.id		= 1,
+		.devname	= "s3c2410-spi.1",
 		.parent		= &clk_p,
 		.enable		= s3c2443_clkcon_enable_p,
 		.ctrlbit	= S3C2443_PCLKCON_SPI1,
arch/arm/plat-s3c24xx/clock-dclk.c +0 -4
index cf97caa..f95d326 100644
@@ -169,7 +169,6 @@ static struct clk_ops dclk_ops = {
 
 struct clk s3c24xx_dclk0 = {
 	.name		= "dclk0",
-	.id		= -1,
 	.ctrlbit	= S3C2410_DCLKCON_DCLK0EN,
 	.enable	        = s3c24xx_dclk_enable,
 	.ops		= &dclk_ops,
@@ -177,7 +176,6 @@ struct clk s3c24xx_dclk0 = {
 
 struct clk s3c24xx_dclk1 = {
 	.name		= "dclk1",
-	.id		= -1,
 	.ctrlbit	= S3C2410_DCLKCON_DCLK1EN,
 	.enable		= s3c24xx_dclk_enable,
 	.ops		= &dclk_ops,
@@ -189,12 +187,10 @@ static struct clk_ops clkout_ops = {
 
 struct clk s3c24xx_clkout0 = {
 	.name		= "clkout0",
-	.id		= -1,
 	.ops		= &clkout_ops,
 };
 
 struct clk s3c24xx_clkout1 = {
 	.name		= "clkout1",
-	.id		= -1,
 	.ops		= &clkout_ops,
 };
arch/arm/plat-s3c24xx/include/mach/clkdev.h new file +7 -0
new file mode 100644
index 0000000..089757c
@@ -0,0 +1,7 @@
+#ifndef __MACH_S3C24XX_CLKDEV_H__
+#define __MACH_S3C24XX_CLKDEV_H__
+
+#define __clk_get(clk) ({ 1; })
+#define __clk_put(clk) do { } while (0)
+
+#endif
arch/arm/plat-s3c24xx/s3c2410-clock.c +3 -18
index 9ecc5d9..def76aa 100644
@@ -90,37 +90,31 @@ static int s3c2410_upll_enable(struct clk *clk, int enable)
 static struct clk init_clocks_off[] = {
 	{
 		.name		= "nand",
-		.id		= -1,
 		.parent		= &clk_h,
 		.enable		= s3c2410_clkcon_enable,
 		.ctrlbit	= S3C2410_CLKCON_NAND,
 	}, {
 		.name		= "sdi",
-		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s3c2410_clkcon_enable,
 		.ctrlbit	= S3C2410_CLKCON_SDI,
 	}, {
 		.name		= "adc",
-		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s3c2410_clkcon_enable,
 		.ctrlbit	= S3C2410_CLKCON_ADC,
 	}, {
 		.name		= "i2c",
-		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s3c2410_clkcon_enable,
 		.ctrlbit	= S3C2410_CLKCON_IIC,
 	}, {
 		.name		= "iis",
-		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s3c2410_clkcon_enable,
 		.ctrlbit	= S3C2410_CLKCON_IIS,
 	}, {
 		.name		= "spi",
-		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s3c2410_clkcon_enable,
 		.ctrlbit	= S3C2410_CLKCON_SPI,
@@ -130,70 +124,61 @@ static struct clk init_clocks_off[] = {
 static struct clk init_clocks[] = {
 	{
 		.name		= "lcd",
-		.id		= -1,
 		.parent		= &clk_h,
 		.enable		= s3c2410_clkcon_enable,
 		.ctrlbit	= S3C2410_CLKCON_LCDC,
 	}, {
 		.name		= "gpio",
-		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s3c2410_clkcon_enable,
 		.ctrlbit	= S3C2410_CLKCON_GPIO,
 	}, {
 		.name		= "usb-host",
-		.id		= -1,
 		.parent		= &clk_h,
 		.enable		= s3c2410_clkcon_enable,
 		.ctrlbit	= S3C2410_CLKCON_USBH,
 	}, {
 		.name		= "usb-device",
-		.id		= -1,
 		.parent		= &clk_h,
 		.enable		= s3c2410_clkcon_enable,
 		.ctrlbit	= S3C2410_CLKCON_USBD,
 	}, {
 		.name		= "timers",
-		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s3c2410_clkcon_enable,
 		.ctrlbit	= S3C2410_CLKCON_PWMT,
 	}, {
 		.name		= "uart",
-		.id		= 0,
+		.devname	= "s3c2410-uart.0",
 		.parent		= &clk_p,
 		.enable		= s3c2410_clkcon_enable,
 		.ctrlbit	= S3C2410_CLKCON_UART0,
 	}, {
 		.name		= "uart",
-		.id		= 1,
+		.devname	= "s3c2410-uart.1",
 		.parent		= &clk_p,
 		.enable		= s3c2410_clkcon_enable,
 		.ctrlbit	= S3C2410_CLKCON_UART1,
 	}, {
 		.name		= "uart",
-		.id		= 2,
+		.devname	= "s3c2410-uart.2",
 		.parent		= &clk_p,
 		.enable		= s3c2410_clkcon_enable,
 		.ctrlbit	= S3C2410_CLKCON_UART2,
 	}, {
 		.name		= "rtc",
-		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s3c2410_clkcon_enable,
 		.ctrlbit	= S3C2410_CLKCON_RTC,
 	}, {
 		.name		= "watchdog",
-		.id		= -1,
 		.parent		= &clk_p,
 		.ctrlbit	= 0,
 	}, {
 		.name		= "usb-bus-host",
-		.id		= -1,
 		.parent		= &clk_usb_bus,
 	}, {
 		.name		= "usb-bus-gadget",
-		.id		= -1,
 		.parent		= &clk_usb_bus,
 	},
 };
arch/arm/plat-s3c24xx/s3c2443-clock.c +4 -35
index 82f2d4a..59552c0 100644
@@ -56,7 +56,6 @@ int s3c2443_clkcon_enable_s(struct clk *clk, int enable)
 struct clk clk_mpllref = {
 	.name		= "mpllref",
 	.parent		= &clk_xtal,
-	.id		= -1,
 };
 
 static struct clk *clk_epllref_sources[] = {
@@ -69,7 +68,6 @@ static struct clk *clk_epllref_sources[] = {
 struct clksrc_clk clk_epllref = {
 	.clk	= {
 		.name		= "epllref",
-		.id		= -1,
 	},
 	.sources = &(struct clksrc_sources) {
 		.sources = clk_epllref_sources,
@@ -92,7 +90,6 @@ struct clksrc_clk clk_esysclk = {
 	.clk	= {
 		.name		= "esysclk",
 		.parent		= &clk_epll,
-		.id		= -1,
 	},
 	.sources = &(struct clksrc_sources) {
 		.sources = clk_sysclk_sources,
@@ -115,7 +112,6 @@ static unsigned long s3c2443_getrate_mdivclk(struct clk *clk)
 static struct clk clk_mdivclk = {
 	.name		= "mdivclk",
 	.parent		= &clk_mpllref,
-	.id		= -1,
 	.ops		= &(struct clk_ops) {
 		.get_rate	= s3c2443_getrate_mdivclk,
 	},
@@ -132,7 +128,6 @@ struct clksrc_clk clk_msysclk = {
 	.clk	= {
 		.name		= "msysclk",
 		.parent		= &clk_xtal,
-		.id		= -1,
 	},
 	.sources = &(struct clksrc_sources) {
 		.sources = clk_msysclk_sources,
@@ -159,7 +154,6 @@ static unsigned long s3c2443_prediv_getrate(struct clk *clk)
 
 static struct clk clk_prediv = {
 	.name		= "prediv",
-	.id		= -1,
 	.parent		= &clk_msysclk.clk,
 	.ops		= &(struct clk_ops) {
 		.get_rate	= s3c2443_prediv_getrate,
@@ -174,7 +168,6 @@ static struct clk clk_prediv = {
 static struct clksrc_clk clk_usb_bus_host = {
 	.clk	= {
 		.name		= "usb-bus-host-parent",
-		.id		= -1,
 		.parent		= &clk_esysclk.clk,
 		.ctrlbit	= S3C2443_SCLKCON_USBHOST,
 		.enable		= s3c2443_clkcon_enable_s,
@@ -189,7 +182,6 @@ static struct clksrc_clk clksrc_clks[] = {
 		/* ART baud-rate clock sourced from esysclk via a divisor */
 		.clk	= {
 			.name		= "uartclk",
-			.id		= -1,
 			.parent		= &clk_esysclk.clk,
 		},
 		.reg_div = { .reg = S3C2443_CLKDIV1, .size = 4, .shift = 8 },
@@ -197,7 +189,6 @@ static struct clksrc_clk clksrc_clks[] = {
 		/* camera interface bus-clock, divided down from esysclk */
 		.clk	= {
 			.name		= "camif-upll",	/* same as 2440 name */
-			.id		= -1,
 			.parent		= &clk_esysclk.clk,
 			.ctrlbit	= S3C2443_SCLKCON_CAMCLK,
 			.enable		= s3c2443_clkcon_enable_s,
@@ -206,7 +197,6 @@ static struct clksrc_clk clksrc_clks[] = {
 	}, {
 		.clk	= {
 			.name		= "display-if",
-			.id		= -1,
 			.parent		= &clk_esysclk.clk,
 			.ctrlbit	= S3C2443_SCLKCON_DISPCLK,
 			.enable		= s3c2443_clkcon_enable_s,
@@ -219,13 +209,11 @@ static struct clksrc_clk clksrc_clks[] = {
 static struct clk init_clocks_off[] = {
 	{
 		.name		= "adc",
-		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s3c2443_clkcon_enable_p,
 		.ctrlbit	= S3C2443_PCLKCON_ADC,
 	}, {
 		.name		= "i2c",
-		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s3c2443_clkcon_enable_p,
 		.ctrlbit	= S3C2443_PCLKCON_IIC,
@@ -235,136 +223,117 @@ static struct clk init_clocks_off[] = {
 static struct clk init_clocks[] = {
 	{
 		.name		= "dma",
-		.id		= 0,
 		.parent		= &clk_h,
 		.enable		= s3c2443_clkcon_enable_h,
 		.ctrlbit	= S3C2443_HCLKCON_DMA0,
 	}, {
 		.name		= "dma",
-		.id		= 1,
 		.parent		= &clk_h,
 		.enable		= s3c2443_clkcon_enable_h,
 		.ctrlbit	= S3C2443_HCLKCON_DMA1,
 	}, {
 		.name		= "dma",
-		.id		= 2,
 		.parent		= &clk_h,
 		.enable		= s3c2443_clkcon_enable_h,
 		.ctrlbit	= S3C2443_HCLKCON_DMA2,
 	}, {
 		.name		= "dma",
-		.id		= 3,
 		.parent		= &clk_h,
 		.enable		= s3c2443_clkcon_enable_h,
 		.ctrlbit	= S3C2443_HCLKCON_DMA3,
 	}, {
 		.name		= "dma",
-		.id		= 4,
 		.parent		= &clk_h,
 		.enable		= s3c2443_clkcon_enable_h,
 		.ctrlbit	= S3C2443_HCLKCON_DMA4,
 	}, {
 		.name		= "dma",
-		.id		= 5,
 		.parent		= &clk_h,
 		.enable		= s3c2443_clkcon_enable_h,
 		.ctrlbit	= S3C2443_HCLKCON_DMA5,
 	}, {
 		.name		= "hsmmc",
-		.id		= 1,
 		.parent		= &clk_h,
 		.enable		= s3c2443_clkcon_enable_h,
 		.ctrlbit	= S3C2443_HCLKCON_HSMMC,
 	}, {
 		.name		= "gpio",
-		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s3c2443_clkcon_enable_p,
 		.ctrlbit	= S3C2443_PCLKCON_GPIO,
 	}, {
 		.name		= "usb-host",
-		.id		= -1,
 		.parent		= &clk_h,
 		.enable		= s3c2443_clkcon_enable_h,
 		.ctrlbit	= S3C2443_HCLKCON_USBH,
 	}, {
 		.name		= "usb-device",
-		.id		= -1,
 		.parent		= &clk_h,
 		.enable		= s3c2443_clkcon_enable_h,
 		.ctrlbit	= S3C2443_HCLKCON_USBD,
 	}, {
 		.name		= "lcd",
-		.id		= -1,
 		.parent		= &clk_h,
 		.enable		= s3c2443_clkcon_enable_h,
 		.ctrlbit	= S3C2443_HCLKCON_LCDC,
 
 	}, {
 		.name		= "timers",
-		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s3c2443_clkcon_enable_p,
 		.ctrlbit	= S3C2443_PCLKCON_PWMT,
 	}, {
 		.name		= "cfc",
-		.id		= -1,
 		.parent		= &clk_h,
 		.enable		= s3c2443_clkcon_enable_h,
 		.ctrlbit	= S3C2443_HCLKCON_CFC,
 	}, {
 		.name		= "ssmc",
-		.id		= -1,
 		.parent		= &clk_h,
 		.enable		= s3c2443_clkcon_enable_h,
 		.ctrlbit	= S3C2443_HCLKCON_SSMC,
 	}, {
 		.name		= "uart",
-		.id		= 0,
+		.devname	= "s3c2440-uart.0",
 		.parent		= &clk_p,
 		.enable		= s3c2443_clkcon_enable_p,
 		.ctrlbit	= S3C2443_PCLKCON_UART0,
 	}, {
 		.name		= "uart",
-		.id		= 1,
+		.devname	= "s3c2440-uart.1",
 		.parent		= &clk_p,
 		.enable		= s3c2443_clkcon_enable_p,
 		.ctrlbit	= S3C2443_PCLKCON_UART1,
 	}, {
 		.name		= "uart",
-		.id		= 2,
+		.devname	= "s3c2440-uart.2",
 		.parent		= &clk_p,
 		.enable		= s3c2443_clkcon_enable_p,
 		.ctrlbit	= S3C2443_PCLKCON_UART2,
 	}, {
 		.name		= "uart",
-		.id		= 3,
+		.devname	= "s3c2440-uart.3",
 		.parent		= &clk_p,
 		.enable		= s3c2443_clkcon_enable_p,
 		.ctrlbit	= S3C2443_PCLKCON_UART3,
 	}, {
 		.name		= "rtc",
-		.id		= -1,
 		.parent		= &clk_p,
 		.enable		= s3c2443_clkcon_enable_p,
 		.ctrlbit	= S3C2443_PCLKCON_RTC,
 	}, {
 		.name		= "watchdog",
-		.id		= -1,
 		.parent		= &clk_p,
 		.ctrlbit	= S3C2443_PCLKCON_WDT,
 	}, {
 		.name		= "ac97",
-		.id		= -1,
 		.parent		= &clk_p,
 		.ctrlbit	= S3C2443_PCLKCON_AC97,
 	}, {
 		.name		= "nand",
-		.id		= -1,
 		.parent		= &clk_h,
 	}, {
 		.name		= "usb-bus-host",
-		.id		= -1,
 		.parent		= &clk_usb_bus_host.clk,
 	}
 };
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 v2 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               |   86 ++++++++-------------------
 arch/arm/mach-s3c64xx/include/mach/clkdev.h |    7 ++
 3 files changed, 33 insertions(+), 61 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 -61

406 lines not on this page · raw message

arch/arm/mach-s3c64xx/include/mach/clkdev.h new file +7 -0
new file mode 100644
index 0000000..15dbe1f
@@ -0,0 +1,7 @@
+#ifndef __MACH_S3C64XX_CLKDEV_H__
+#define __MACH_S3C64XX_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 v2 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       |   74 +++++++-------------------
 arch/arm/mach-s5p64x0/clock-s5p6450.c       |   68 +++++++------------------
 arch/arm/mach-s5p64x0/include/mach/clkdev.h |    7 +++
 arch/arm/plat-s5p/s5p-time.c                |    9 +++
 5 files changed, 56 insertions(+), 103 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 -54

360 lines not on this page · raw message

arch/arm/mach-s5p64x0/clock-s5p6450.c +19 -49

338 lines not on this page · raw message

arch/arm/mach-s5p64x0/include/mach/clkdev.h new file +7 -0
new file mode 100644
index 0000000..17bc68e
@@ -0,0 +1,7 @@
+#ifndef __MACH_S5P64X0_CLKDEV_H__
+#define __MACH_S5P64X0_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

PATCH v2 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               |  163 +++++++--------------------
 arch/arm/mach-s5pc100/include/mach/clkdev.h |    7 +
 3 files changed, 48 insertions(+), 123 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 +40 -123

813 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..b8ff60b
@@ -0,0 +1,7 @@
+#ifndef __MACH_S5PC100_CLKDEV_H__
+#define __MACH_S5PC100_CLKDEV_H__
+
+#define __clk_get(clk) ({ 1; })
+#define __clk_put(clk) do { } while (0)
+
+#endif
Signature · 1 line
1.6.6.rc2
#6 lore raw

PATCH v2 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               |  130 ++++++++------------------
 arch/arm/mach-s5pv210/include/mach/clkdev.h |    7 ++
 3 files changed, 48 insertions(+), 90 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 +40 -90

626 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..4c281c9
@@ -0,0 +1,7 @@
+#ifndef __MACH_S5PV210_CLKDEV_H__
+#define __MACH_S5PV210_CLKDEV_H__
+
+#define __clk_get(clk) ({ 1; })
+#define __clk_put(clk) do { } while (0)
+
+#endif
Signature · 1 line
1.6.6.rc2
#7 lore raw

PATCH v2 7/7 ARM: Exynos4: Add clkdev support

In reply to Thomas Abraham

Add clkdev support for Samsung's Exynos4 platform and fixes the incorrect clock name for the dw_mmc controller.

---
 arch/arm/Kconfig                            |    1 +
 arch/arm/mach-exynos4/clock.c               |  178 +++++++++------------------
 arch/arm/mach-exynos4/include/mach/clkdev.h |    7 +
 arch/arm/mach-exynos4/time.c                |    2 +
 4 files changed, 67 insertions(+), 121 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 +57 -121

788 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
#8 lore raw

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

Quoted 880 lines · Thomas Abraham

Add clkdev support for Samsung's Exynos4 platform and fixes the incorrect clock name for the dw_mmc controller.

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

 4 files changed, 67 insertions(+), 121 deletions(-)

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

arch/arm/Kconfig +0 -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 +57 -121
index 871f9d5..4fecbe9 100644
@@ -27,24 +27,20 @@
 
  static struct clk clk_sclk_hdmi27m = {
        .name           = "sclk_hdmi27m",
-       .id             = -1,
        .rate           = 27000000,
  };
 
  static struct clk clk_sclk_hdmiphy = {
        .name           = "sclk_hdmiphy",
-       .id             = -1,
  };
 
  static struct clk clk_sclk_usbphy0 = {
        .name           = "sclk_usbphy0",
-       .id             = -1,
        .rate           = 27000000,
  };
 
  static struct clk clk_sclk_usbphy1 = {
        .name           = "sclk_usbphy1",
-       .id             = -1,
  };
 
  static int exynos4_clksrc_mask_top_ctrl(struct clk *clk, int enable)
@@ -132,7 +128,6 @@ static int exynos4_clk_ip_perir_ctrl(struct clk *clk, int enable)
  static struct clksrc_clk clk_mout_apll = {
        .clk    = {
                .name           = "mout_apll",
-               .id             = -1,
        },
        .sources        = &clk_src_apll,
        .reg_src        = { .reg = S5P_CLKSRC_CPU, .shift = 0, .size = 1 },
@@ -141,7 +136,6 @@ static struct clksrc_clk clk_mout_apll = {
  static struct clksrc_clk clk_sclk_apll = {
        .clk    = {
                .name           = "sclk_apll",
-               .id             = -1,
                .parent         = &clk_mout_apll.clk,
        },
        .reg_div        = { .reg = S5P_CLKDIV_CPU, .shift = 24, .size = 3 },
@@ -150,7 +144,6 @@ static struct clksrc_clk clk_sclk_apll = {
  static struct clksrc_clk clk_mout_epll = {
        .clk    = {
                .name           = "mout_epll",
-               .id             = -1,
        },
        .sources        = &clk_src_epll,
        .reg_src        = { .reg = S5P_CLKSRC_TOP0, .shift = 4, .size = 1 },
@@ -159,7 +152,6 @@ static struct clksrc_clk clk_mout_epll = {
  static struct clksrc_clk clk_mout_mpll = {
        .clk = {
                .name           = "mout_mpll",
-               .id             = -1,
        },
        .sources        = &clk_src_mpll,
        .reg_src        = { .reg = S5P_CLKSRC_CPU, .shift = 8, .size = 1 },
@@ -178,7 +170,6 @@ static struct clksrc_sources clkset_moutcore = {
  static struct clksrc_clk clk_moutcore = {
        .clk    = {
                .name           = "moutcore",
-               .id             = -1,
        },
        .sources        = &clkset_moutcore,
        .reg_src        = { .reg = S5P_CLKSRC_CPU, .shift = 16, .size = 1 },
@@ -187,7 +178,6 @@ static struct clksrc_clk clk_moutcore = {
  static struct clksrc_clk clk_coreclk = {
        .clk    = {
                .name           = "core_clk",
-               .id             = -1,
                .parent         = &clk_moutcore.clk,
        },
        .reg_div        = { .reg = S5P_CLKDIV_CPU, .shift = 0, .size = 3 },
@@ -196,7 +186,6 @@ static struct clksrc_clk clk_coreclk = {
  static struct clksrc_clk clk_armclk = {
        .clk    = {
                .name           = "armclk",
-               .id             = -1,
                .parent         = &clk_coreclk.clk,
        },
  };
@@ -204,7 +193,6 @@ static struct clksrc_clk clk_armclk = {
  static struct clksrc_clk clk_aclk_corem0 = {
        .clk    = {
                .name           = "aclk_corem0",
-               .id             = -1,
                .parent         = &clk_coreclk.clk,
        },
        .reg_div        = { .reg = S5P_CLKDIV_CPU, .shift = 4, .size = 3 },
@@ -213,7 +201,6 @@ static struct clksrc_clk clk_aclk_corem0 = {
  static struct clksrc_clk clk_aclk_cores = {
        .clk    = {
                .name           = "aclk_cores",
-               .id             = -1,
                .parent         = &clk_coreclk.clk,
        },
        .reg_div        = { .reg = S5P_CLKDIV_CPU, .shift = 4, .size = 3 },
@@ -222,7 +209,6 @@ static struct clksrc_clk clk_aclk_cores = {
  static struct clksrc_clk clk_aclk_corem1 = {
        .clk    = {
                .name           = "aclk_corem1",
-               .id             = -1,
                .parent         = &clk_coreclk.clk,
        },
        .reg_div        = { .reg = S5P_CLKDIV_CPU, .shift = 8, .size = 3 },
@@ -231,7 +217,6 @@ static struct clksrc_clk clk_aclk_corem1 = {
  static struct clksrc_clk clk_periphclk = {
        .clk    = {
                .name           = "periphclk",
-               .id             = -1,
                .parent         = &clk_coreclk.clk,
        },
        .reg_div        = { .reg = S5P_CLKDIV_CPU, .shift = 12, .size = 3 },
@@ -252,7 +237,6 @@ static struct clksrc_sources clkset_mout_corebus = {
  static struct clksrc_clk clk_mout_corebus = {
        .clk    = {
                .name           = "mout_corebus",
-               .id             = -1,
        },
        .sources        = &clkset_mout_corebus,
        .reg_src        = { .reg = S5P_CLKSRC_DMC, .shift = 4, .size = 1 },
@@ -261,7 +245,6 @@ static struct clksrc_clk clk_mout_corebus = {
  static struct clksrc_clk clk_sclk_dmc = {
        .clk    = {
                .name           = "sclk_dmc",
-               .id             = -1,
                .parent         = &clk_mout_corebus.clk,
        },
        .reg_div        = { .reg = S5P_CLKDIV_DMC0, .shift = 12, .size = 3 },
@@ -270,7 +253,6 @@ static struct clksrc_clk clk_sclk_dmc = {
  static struct clksrc_clk clk_aclk_cored = {
        .clk    = {
                .name           = "aclk_cored",
-               .id             = -1,
                .parent         = &clk_sclk_dmc.clk,
        },
        .reg_div        = { .reg = S5P_CLKDIV_DMC0, .shift = 16, .size = 3 },
@@ -279,7 +261,6 @@ static struct clksrc_clk clk_aclk_cored = {
  static struct clksrc_clk clk_aclk_corep = {
        .clk    = {
                .name           = "aclk_corep",
-               .id             = -1,
                .parent         = &clk_aclk_cored.clk,
        },
        .reg_div        = { .reg = S5P_CLKDIV_DMC0, .shift = 20, .size = 3 },
@@ -288,7 +269,6 @@ static struct clksrc_clk clk_aclk_corep = {
  static struct clksrc_clk clk_aclk_acp = {
        .clk    = {
                .name           = "aclk_acp",
-               .id             = -1,
                .parent         = &clk_mout_corebus.clk,
        },
        .reg_div        = { .reg = S5P_CLKDIV_DMC0, .shift = 0, .size = 3 },
@@ -297,7 +277,6 @@ static struct clksrc_clk clk_aclk_acp = {
  static struct clksrc_clk clk_pclk_acp = {
        .clk    = {
                .name           = "pclk_acp",
-               .id             = -1,
                .parent         = &clk_aclk_acp.clk,
        },
        .reg_div        = { .reg = S5P_CLKDIV_DMC0, .shift = 4, .size = 3 },
@@ -318,7 +297,6 @@ static struct clksrc_sources clkset_aclk = {
  static struct clksrc_clk clk_aclk_200 = {
        .clk    = {
                .name           = "aclk_200",
-               .id             = -1,
        },
        .sources        = &clkset_aclk,
        .reg_src        = { .reg = S5P_CLKSRC_TOP0, .shift = 12, .size = 1 },
@@ -328,7 +306,6 @@ static struct clksrc_clk clk_aclk_200 = {
  static struct clksrc_clk clk_aclk_100 = {
        .clk    = {
                .name           = "aclk_100",
-               .id             = -1,
        },
        .sources        = &clkset_aclk,
        .reg_src        = { .reg = S5P_CLKSRC_TOP0, .shift = 16, .size = 1 },
@@ -338,7 +315,6 @@ static struct clksrc_clk clk_aclk_100 = {
  static struct clksrc_clk clk_aclk_160 = {
        .clk    = {
                .name           = "aclk_160",
-               .id             = -1,
        },
        .sources        = &clkset_aclk,
        .reg_src        = { .reg = S5P_CLKSRC_TOP0, .shift = 20, .size = 1 },
@@ -348,7 +324,6 @@ static struct clksrc_clk clk_aclk_160 = {
  static struct clksrc_clk clk_aclk_133 = {
        .clk    = {
                .name           = "aclk_133",
-               .id             = -1,
        },
        .sources        = &clkset_aclk,
        .reg_src        = { .reg = S5P_CLKSRC_TOP0, .shift = 24, .size = 1 },
@@ -368,7 +343,6 @@ static struct clksrc_sources clkset_vpllsrc = {
  static struct clksrc_clk clk_vpllsrc = {
        .clk    = {
                .name           = "vpll_src",
-               .id             = -1,
                .enable         = exynos4_clksrc_mask_top_ctrl,
                .ctrlbit        = (1 << 0),
        },
@@ -389,7 +363,6 @@ static struct clksrc_sources clkset_sclk_vpll = {
  static struct clksrc_clk clk_sclk_vpll = {
        .clk    = {
                .name           = "sclk_vpll",
-               .id             = -1,
        },
        .sources        = &clkset_sclk_vpll,
        .reg_src        = { .reg = S5P_CLKSRC_TOP0, .shift = 8, .size = 1 },
@@ -398,289 +371,263 @@ static struct clksrc_clk clk_sclk_vpll = {
  static struct clk init_clocks_off[] = {
        {
                .name           = "timers",
-               .id             = -1,
                .parent         = &clk_aclk_100.clk,
                .enable         = exynos4_clk_ip_peril_ctrl,
                .ctrlbit        = (1<<24),
        }, {
                .name           = "csis",
-               .id             = 0,
+               .devname        = "s5p-mipi-csis.0",
                .enable         = exynos4_clk_ip_cam_ctrl,
                .ctrlbit        = (1 << 4),
        }, {
                .name           = "csis",
-               .id             = 1,
+               .devname        = "s5p-mipi-csis.1",
                .enable         = exynos4_clk_ip_cam_ctrl,
                .ctrlbit        = (1 << 5),
        }, {
                .name           = "fimc",
-               .id             = 0,
+               .devname        = "exynos4-fimc.0",
                .enable         = exynos4_clk_ip_cam_ctrl,
                .ctrlbit        = (1 << 0),
        }, {
                .name           = "fimc",
-               .id             = 1,
+               .devname        = "exynos4-fimc.1",
                .enable         = exynos4_clk_ip_cam_ctrl,
                .ctrlbit        = (1 << 1),
        }, {
                .name           = "fimc",
-               .id             = 2,
+               .devname        = "exynos4-fimc.2",
                .enable         = exynos4_clk_ip_cam_ctrl,
                .ctrlbit        = (1 << 2),
        }, {
                .name           = "fimc",
-               .id             = 3,
+               .devname        = "exynos4-fimc.3",
                .enable         = exynos4_clk_ip_cam_ctrl,
                .ctrlbit        = (1 << 3),
        }, {
                .name           = "fimd",
-               .id             = 0,
+               .devname        = "s5pv310-fb.0",
                .enable         = exynos4_clk_ip_lcd0_ctrl,
                .ctrlbit        = (1 << 0),
        }, {
                .name           = "fimd",
-               .id             = 1,
+               .devname        = "s5pv310-fb.1",
                .enable         = exynos4_clk_ip_lcd1_ctrl,
                .ctrlbit        = (1 << 0),
        }, {
                .name           = "sataphy",
-               .id             = -1,
                .parent         = &clk_aclk_133.clk,
                .enable         = exynos4_clk_ip_fsys_ctrl,
                .ctrlbit        = (1 << 3),
        }, {
                .name           = "hsmmc",
-               .id             = 0,
+               .devname        = "s3c-sdhci.0",
                .parent         = &clk_aclk_133.clk,
                .enable         = exynos4_clk_ip_fsys_ctrl,
                .ctrlbit        = (1 << 5),
        }, {
                .name           = "hsmmc",
-               .id             = 1,
+               .devname        = "s3c-sdhci.1",
                .parent         = &clk_aclk_133.clk,
                .enable         = exynos4_clk_ip_fsys_ctrl,
                .ctrlbit        = (1 << 6),
        }, {
                .name           = "hsmmc",
-               .id             = 2,
+               .devname        = "s3c-sdhci.2",
                .parent         = &clk_aclk_133.clk,
                .enable         = exynos4_clk_ip_fsys_ctrl,
                .ctrlbit        = (1 << 7),
        }, {
                .name           = "hsmmc",
-               .id             = 3,
+               .devname        = "s3c-sdhci.3",
                .parent         = &clk_aclk_133.clk,
                .enable         = exynos4_clk_ip_fsys_ctrl,
                .ctrlbit        = (1 << 8),
        }, {
-               .name           = "hsmmc",
-               .id             = 4,
+               .name           = "dwmmc",
                .parent         = &clk_aclk_133.clk,
                .enable         = exynos4_clk_ip_fsys_ctrl,
                .ctrlbit        = (1 << 9),
        }, {
                .name           = "sata",
-               .id             = -1,
                .parent         = &clk_aclk_133.clk,
                .enable         = exynos4_clk_ip_fsys_ctrl,
                .ctrlbit        = (1 << 10),
        }, {
                .name           = "pdma",
-               .id             = 0,
+               .devname        = "s3c-pl330.0",
                .enable         = exynos4_clk_ip_fsys_ctrl,
                .ctrlbit        = (1 << 0),
        }, {
                .name           = "pdma",
-               .id             = 1,
+               .devname        = "s3c-pl330.1",
                .enable         = exynos4_clk_ip_fsys_ctrl,
                .ctrlbit        = (1 << 1),
        }, {
                .name           = "adc",
-               .id             = -1,
                .enable         = exynos4_clk_ip_peril_ctrl,
                .ctrlbit        = (1 << 15),
        }, {
                .name           = "keypad",
-               .id             = -1,
                .enable         = exynos4_clk_ip_perir_ctrl,
                .ctrlbit        = (1 << 16),
        }, {
                .name           = "rtc",
-               .id             = -1,
                .enable         = exynos4_clk_ip_perir_ctrl,
                .ctrlbit        = (1 << 15),
        }, {
                .name           = "watchdog",
-               .id             = -1,
                .parent         = &clk_aclk_100.clk,
                .enable         = exynos4_clk_ip_perir_ctrl,
                .ctrlbit        = (1 << 14),
        }, {
                .name           = "usbhost",
-               .id             = -1,
                .enable         = exynos4_clk_ip_fsys_ctrl ,
                .ctrlbit        = (1 << 12),
        }, {
                .name           = "otg",
-               .id             = -1,
                .enable         = exynos4_clk_ip_fsys_ctrl,
                .ctrlbit        = (1 << 13),
        }, {
                .name           = "spi",
-               .id             = 0,
+               .devname        = "s3c64xx-spi.0",
                .enable         = exynos4_clk_ip_peril_ctrl,
                .ctrlbit        = (1 << 16),
        }, {
                .name           = "spi",
-               .id             = 1,
+               .devname        = "s3c64xx-spi.1",
                .enable         = exynos4_clk_ip_peril_ctrl,
                .ctrlbit        = (1 << 17),
        }, {
                .name           = "spi",
-               .id             = 2,
+               .devname        = "s3c64xx-spi.2",
                .enable         = exynos4_clk_ip_peril_ctrl,
                .ctrlbit        = (1 << 18),
        }, {
                .name           = "iis",
-               .id             = 0,
+               .devname        = "samsung-i2s.0",
                .enable         = exynos4_clk_ip_peril_ctrl,
                .ctrlbit        = (1 << 19),
        }, {
                .name           = "iis",
-               .id             = 1,
+               .devname        = "samsung-i2s.1",
                .enable         = exynos4_clk_ip_peril_ctrl,
                .ctrlbit        = (1 << 20),
        }, {
                .name           = "iis",
-               .id             = 2,
+               .devname        = "samsung-i2s.2",
                .enable         = exynos4_clk_ip_peril_ctrl,
                .ctrlbit        = (1 << 21),
        }, {
                .name           = "ac97",
-               .id             = -1,
                .enable         = exynos4_clk_ip_peril_ctrl,
                .ctrlbit        = (1 << 27),
        }, {
                .name           = "fimg2d",
-               .id             = -1,
                .enable         = exynos4_clk_ip_image_ctrl,
                .ctrlbit        = (1 << 0),
        }, {
                .name           = "i2c",
-               .id             = 0,
+               .devname        = "s3c2440-i2c.0",
                .parent         = &clk_aclk_100.clk,
                .enable         = exynos4_clk_ip_peril_ctrl,
                .ctrlbit        = (1 << 6),
        }, {
                .name           = "i2c",
-               .id             = 1,
+               .devname        = "s3c2440-i2c.1",
                .parent         = &clk_aclk_100.clk,
                .enable         = exynos4_clk_ip_peril_ctrl,
                .ctrlbit        = (1 << 7),
        }, {
                .name           = "i2c",
-               .id             = 2,
+               .devname        = "s3c2440-i2c.2",
                .parent         = &clk_aclk_100.clk,
                .enable         = exynos4_clk_ip_peril_ctrl,
                .ctrlbit        = (1 << 8),
        }, {
                .name           = "i2c",
-               .id             = 3,
+               .devname        = "s3c2440-i2c.3",
                .parent         = &clk_aclk_100.clk,
                .enable         = exynos4_clk_ip_peril_ctrl,
                .ctrlbit        = (1 << 9),
        }, {
                .name           = "i2c",
-               .id             = 4,
+               .devname        = "s3c2440-i2c.4",
                .parent         = &clk_aclk_100.clk,
                .enable         = exynos4_clk_ip_peril_ctrl,
                .ctrlbit        = (1 << 10),
        }, {
                .name           = "i2c",
-               .id             = 5,
+               .devname        = "s3c2440-i2c.5",
                .parent         = &clk_aclk_100.clk,
                .enable         = exynos4_clk_ip_peril_ctrl,
                .ctrlbit        = (1 << 11),
        }, {
                .name           = "i2c",
-               .id             = 6,
+               .devname        = "s3c2440-i2c.6",
                .parent         = &clk_aclk_100.clk,
                .enable         = exynos4_clk_ip_peril_ctrl,
                .ctrlbit        = (1 << 12),
        }, {
                .name           = "i2c",
-               .id             = 7,
+               .devname        = "s3c2440-i2c.7",
                .parent         = &clk_aclk_100.clk,
                .enable         = exynos4_clk_ip_peril_ctrl,
                .ctrlbit        = (1 << 13),
        }, {
                .name           = "SYSMMU_MDMA",
-               .id             = -1,
                .enable         = exynos4_clk_ip_image_ctrl,
                .ctrlbit        = (1 << 5),
        }, {
                .name           = "SYSMMU_FIMC0",
-               .id             = -1,
                .enable         = exynos4_clk_ip_cam_ctrl,
                .ctrlbit        = (1 << 7),
        }, {
                .name           = "SYSMMU_FIMC1",
-               .id             = -1,
                .enable         = exynos4_clk_ip_cam_ctrl,
                .ctrlbit        = (1 << 8),
        }, {
                .name           = "SYSMMU_FIMC2",
-               .id             = -1,
                .enable         = exynos4_clk_ip_cam_ctrl,
                .ctrlbit        = (1 << 9),
        }, {
                .name           = "SYSMMU_FIMC3",
-               .id             = -1,
                .enable         = exynos4_clk_ip_cam_ctrl,
                .ctrlbit        = (1 << 10),
        }, {
                .name           = "SYSMMU_JPEG",
-               .id             = -1,
                .enable         = exynos4_clk_ip_cam_ctrl,
                .ctrlbit        = (1 << 11),
        }, {
                .name           = "SYSMMU_FIMD0",
-               .id             = -1,
                .enable         = exynos4_clk_ip_lcd0_ctrl,
                .ctrlbit        = (1 << 4),
        }, {
                .name           = "SYSMMU_FIMD1",
-               .id             = -1,
                .enable         = exynos4_clk_ip_lcd1_ctrl,
                .ctrlbit        = (1 << 4),
        }, {
                .name           = "SYSMMU_PCIe",
-               .id             = -1,
                .enable         = exynos4_clk_ip_fsys_ctrl,
                .ctrlbit        = (1 << 18),
        }, {
                .name           = "SYSMMU_G2D",
-               .id             = -1,
                .enable         = exynos4_clk_ip_image_ctrl,
                .ctrlbit        = (1 << 3),
        }, {
                .name           = "SYSMMU_ROTATOR",
-               .id             = -1,
                .enable         = exynos4_clk_ip_image_ctrl,
                .ctrlbit        = (1 << 4),
        }, {
                .name           = "SYSMMU_TV",
-               .id             = -1,
                .enable         = exynos4_clk_ip_tv_ctrl,
                .ctrlbit        = (1 << 4),
        }, {
                .name           = "SYSMMU_MFC_L",
-               .id             = -1,
                .enable         = exynos4_clk_ip_mfc_ctrl,
                .ctrlbit        = (1 << 1),
        }, {
                .name           = "SYSMMU_MFC_R",
-               .id             = -1,
                .enable         = exynos4_clk_ip_mfc_ctrl,
                .ctrlbit        = (1 << 2),
        }
@@ -689,32 +636,32 @@ static struct clk init_clocks_off[] = {
  static struct clk init_clocks[] = {
        {
                .name           = "uart",
-               .id             = 0,
+               .devname        = "s5pv210-uart.0",
                .enable         = exynos4_clk_ip_peril_ctrl,
                .ctrlbit        = (1 << 0),
        }, {
                .name           = "uart",
-               .id             = 1,
+               .devname        = "s5pv210-uart.1",
                .enable         = exynos4_clk_ip_peril_ctrl,
                .ctrlbit        = (1 << 1),
        }, {
                .name           = "uart",
-               .id             = 2,
+               .devname        = "s5pv210-uart.2",
                .enable         = exynos4_clk_ip_peril_ctrl,
                .ctrlbit        = (1 << 2),
        }, {
                .name           = "uart",
-               .id             = 3,
+               .devname        = "s5pv210-uart.3",
                .enable         = exynos4_clk_ip_peril_ctrl,
                .ctrlbit        = (1 << 3),
        }, {
                .name           = "uart",
-               .id             = 4,
+               .devname        = "s5pv210-uart.4",
                .enable         = exynos4_clk_ip_peril_ctrl,
                .ctrlbit        = (1 << 4),
        }, {
                .name           = "uart",
-               .id             = 5,
+               .devname        = "s5pv210-uart.5",
                .enable         = exynos4_clk_ip_peril_ctrl,
                .ctrlbit        = (1 << 5),
        }
@@ -750,7 +697,6 @@ static struct clksrc_sources clkset_mout_g2d0 = {
  static struct clksrc_clk clk_mout_g2d0 = {
        .clk    = {
                .name           = "mout_g2d0",
-               .id             = -1,
        },
        .sources        = &clkset_mout_g2d0,
        .reg_src        = { .reg = S5P_CLKSRC_IMAGE, .shift = 0, .size = 1 },
@@ -769,7 +715,6 @@ static struct clksrc_sources clkset_mout_g2d1 = {
  static struct clksrc_clk clk_mout_g2d1 = {
        .clk    = {
                .name           = "mout_g2d1",
-               .id             = -1,
        },
        .sources        = &clkset_mout_g2d1,
        .reg_src        = { .reg = S5P_CLKSRC_IMAGE, .shift = 4, .size = 1 },
@@ -788,7 +733,6 @@ static struct clksrc_sources clkset_mout_g2d = {
  static struct clksrc_clk clk_dout_mmc0 = {
        .clk            = {
                .name           = "dout_mmc0",
-               .id             = -1,
        },
        .sources = &clkset_group,
        .reg_src = { .reg = S5P_CLKSRC_FSYS, .shift = 0, .size = 4 },
@@ -798,7 +742,6 @@ static struct clksrc_clk clk_dout_mmc0 = {
  static struct clksrc_clk clk_dout_mmc1 = {
        .clk            = {
                .name           = "dout_mmc1",
-               .id             = -1,
        },
        .sources = &clkset_group,
        .reg_src = { .reg = S5P_CLKSRC_FSYS, .shift = 4, .size = 4 },
@@ -808,7 +751,6 @@ static struct clksrc_clk clk_dout_mmc1 = {
  static struct clksrc_clk clk_dout_mmc2 = {
        .clk            = {
                .name           = "dout_mmc2",
-               .id             = -1,
        },
        .sources = &clkset_group,
        .reg_src = { .reg = S5P_CLKSRC_FSYS, .shift = 8, .size = 4 },
@@ -818,7 +760,6 @@ static struct clksrc_clk clk_dout_mmc2 = {
  static struct clksrc_clk clk_dout_mmc3 = {
        .clk            = {
                .name           = "dout_mmc3",
-               .id             = -1,
        },
        .sources = &clkset_group,
        .reg_src = { .reg = S5P_CLKSRC_FSYS, .shift = 12, .size = 4 },
@@ -828,7 +769,6 @@ static struct clksrc_clk clk_dout_mmc3 = {
  static struct clksrc_clk clk_dout_mmc4 = {
        .clk            = {
                .name           = "dout_mmc4",
-               .id             = -1,
        },
        .sources = &clkset_group,
        .reg_src = { .reg = S5P_CLKSRC_FSYS, .shift = 16, .size = 4 },
@@ -839,7 +779,7 @@ static struct clksrc_clk clksrcs[] = {
        {
                .clk    = {
                        .name           = "uclk1",
-                       .id             = 0,
+                       .devname        = "s5pv210-uart.0",
                        .enable         = exynos4_clksrc_mask_peril0_ctrl,
                        .ctrlbit        = (1 << 0),
                },
@@ -849,7 +789,7 @@ static struct clksrc_clk clksrcs[] = {
        }, {
                .clk            = {
                        .name           = "uclk1",
-                       .id             = 1,
+                       .devname        = "s5pv210-uart.1",
                        .enable         = exynos4_clksrc_mask_peril0_ctrl,
                        .ctrlbit        = (1 << 4),
                },
@@ -859,7 +799,7 @@ static struct clksrc_clk clksrcs[] = {
        }, {
                .clk            = {
                        .name           = "uclk1",
-                       .id             = 2,
+                       .devname        = "s5pv210-uart.2",
                        .enable         = exynos4_clksrc_mask_peril0_ctrl,
                        .ctrlbit        = (1 << 8),
                },
@@ -869,7 +809,7 @@ static struct clksrc_clk clksrcs[] = {
        }, {
                .clk            = {
                        .name           = "uclk1",
-                       .id             = 3,
+                       .devname        = "s5pv210-uart.3",
                        .enable         = exynos4_clksrc_mask_peril0_ctrl,
                        .ctrlbit        = (1 << 12),
                },
@@ -879,7 +819,6 @@ static struct clksrc_clk clksrcs[] = {
        }, {
                .clk            = {
                        .name           = "sclk_pwm",
-                       .id             = -1,
                        .enable         = exynos4_clksrc_mask_peril0_ctrl,
                        .ctrlbit        = (1 << 24),
                },
@@ -889,7 +828,7 @@ static struct clksrc_clk clksrcs[] = {
        }, {
                .clk            = {
                        .name           = "sclk_csis",
-                       .id             = 0,
+                       .devname        = "s5p-mipi-csis.0",
                        .enable         = exynos4_clksrc_mask_cam_ctrl,
                        .ctrlbit        = (1 << 24),
                },
@@ -899,7 +838,7 @@ static struct clksrc_clk clksrcs[] = {
        }, {
                .clk            = {
                        .name           = "sclk_csis",
-                       .id             = 1,
+                       .devname        = "s5p-mipi-csis.1",
                        .enable         = exynos4_clksrc_mask_cam_ctrl,
                        .ctrlbit        = (1 << 28),
                },
@@ -909,7 +848,7 @@ static struct clksrc_clk clksrcs[] = {
        }, {
                .clk            = {
                        .name           = "sclk_cam",
-                       .id             = 0,
+                       .devname        = "exynos4-fimc.0",
                        .enable         = exynos4_clksrc_mask_cam_ctrl,
                        .ctrlbit        = (1 << 16),
                },
@@ -919,7 +858,7 @@ static struct clksrc_clk clksrcs[] = {
        }, {
                .clk            = {
                        .name           = "sclk_cam",
-                       .id             = 1,
+                       .devname        = "exynos4-fimc.1",
                        .enable         = exynos4_clksrc_mask_cam_ctrl,
                        .ctrlbit        = (1 << 20),
                },
@@ -929,7 +868,7 @@ static struct clksrc_clk clksrcs[] = {
        }, {
                .clk            = {
                        .name           = "sclk_fimc",
-                       .id             = 0,
+                       .devname        = "exynos4-fimc.0",
                        .enable         = exynos4_clksrc_mask_cam_ctrl,
                        .ctrlbit        = (1 << 0),
                },
@@ -939,7 +878,7 @@ static struct clksrc_clk clksrcs[] = {
        }, {
                .clk            = {
                        .name           = "sclk_fimc",
-                       .id             = 1,
+                       .devname        = "exynos4-fimc.1",
                        .enable         = exynos4_clksrc_mask_cam_ctrl,
                        .ctrlbit        = (1 << 4),
                },
@@ -949,7 +888,7 @@ static struct clksrc_clk clksrcs[] = {
        }, {
                .clk            = {
                        .name           = "sclk_fimc",
-                       .id             = 2,
+                       .devname        = "exynos4-fimc.2",
                        .enable         = exynos4_clksrc_mask_cam_ctrl,
                        .ctrlbit        = (1 << 8),
                },
@@ -959,7 +898,7 @@ static struct clksrc_clk clksrcs[] = {
        }, {
                .clk            = {
                        .name           = "sclk_fimc",
-                       .id             = 3,
+                       .devname        = "exynos4-fimc.3",
                        .enable         = exynos4_clksrc_mask_cam_ctrl,
                        .ctrlbit        = (1 << 12),
                },
@@ -969,7 +908,7 @@ static struct clksrc_clk clksrcs[] = {
        }, {
                .clk            = {
                        .name           = "sclk_fimd",
-                       .id             = 0,
+                       .devname        = "s5pv310-fb.0",
                        .enable         = exynos4_clksrc_mask_lcd0_ctrl,
                        .ctrlbit        = (1 << 0),
                },
@@ -979,7 +918,7 @@ static struct clksrc_clk clksrcs[] = {
        }, {
                .clk            = {
                        .name           = "sclk_fimd",
-                       .id             = 1,
+                       .devname        = "s5pv310-fb.1",
                        .enable         = exynos4_clksrc_mask_lcd1_ctrl,
                        .ctrlbit        = (1 << 0),
                },
@@ -989,7 +928,6 @@ static struct clksrc_clk clksrcs[] = {
        }, {
                .clk            = {
                        .name           = "sclk_sata",
-                       .id             = -1,
                        .enable         = exynos4_clksrc_mask_fsys_ctrl,
                        .ctrlbit        = (1 << 24),
                },
@@ -999,7 +937,7 @@ static struct clksrc_clk clksrcs[] = {
        }, {
                .clk            = {
                        .name           = "sclk_spi",
-                       .id             = 0,
+                       .devname        = "s3c64xx-spi.0",
                        .enable         = exynos4_clksrc_mask_peril1_ctrl,
                        .ctrlbit        = (1 << 16),
                },
@@ -1009,7 +947,7 @@ static struct clksrc_clk clksrcs[] = {
        }, {
                .clk            = {
                        .name           = "sclk_spi",
-                       .id             = 1,
+                       .devname        = "s3c64xx-spi.1",
                        .enable         = exynos4_clksrc_mask_peril1_ctrl,
                        .ctrlbit        = (1 << 20),
                },
@@ -1019,7 +957,7 @@ static struct clksrc_clk clksrcs[] = {
        }, {
                .clk            = {
                        .name           = "sclk_spi",
-                       .id             = 2,
+                       .devname        = "s3c64xx-spi.2",
                        .enable         = exynos4_clksrc_mask_peril1_ctrl,
                        .ctrlbit        = (1 << 24),
                },
@@ -1029,7 +967,6 @@ static struct clksrc_clk clksrcs[] = {
        }, {
                .clk            = {
                        .name           = "sclk_fimg2d",
-                       .id             = -1,
                },
                .sources = &clkset_mout_g2d,
                .reg_src = { .reg = S5P_CLKSRC_IMAGE, .shift = 8, .size = 1 },
@@ -1037,7 +974,7 @@ static struct clksrc_clk clksrcs[] = {
        }, {
                .clk            = {
                        .name           = "sclk_mmc",
-                       .id             = 0,
+                       .devname        = "s3c-sdhci.0",
                        .parent         = &clk_dout_mmc0.clk,
                        .enable         = exynos4_clksrc_mask_fsys_ctrl,
                        .ctrlbit        = (1 << 0),
@@ -1046,7 +983,7 @@ static struct clksrc_clk clksrcs[] = {
        }, {
                .clk            = {
                        .name           = "sclk_mmc",
-                       .id             = 1,
+                       .devname        = "s3c-sdhci.1",
                        .parent         = &clk_dout_mmc1.clk,
                        .enable         = exynos4_clksrc_mask_fsys_ctrl,
                        .ctrlbit        = (1 << 4),
@@ -1055,7 +992,7 @@ static struct clksrc_clk clksrcs[] = {
        }, {
                .clk            = {
                        .name           = "sclk_mmc",
-                       .id             = 2,
+                       .devname        = "s3c-sdhci.2",
                        .parent         = &clk_dout_mmc2.clk,
                        .enable         = exynos4_clksrc_mask_fsys_ctrl,
                        .ctrlbit        = (1 << 8),
@@ -1064,7 +1001,7 @@ static struct clksrc_clk clksrcs[] = {
        }, {
                .clk            = {
                        .name           = "sclk_mmc",
-                       .id             = 3,
+                       .devname        = "s3c-sdhci.3",
                        .parent         = &clk_dout_mmc3.clk,
                        .enable         = exynos4_clksrc_mask_fsys_ctrl,
                        .ctrlbit        = (1 << 12),
@@ -1072,8 +1009,7 @@ static struct clksrc_clk clksrcs[] = {
                .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 24, .size = 8 },
        }, {
                .clk            = {
-                       .name           = "sclk_mmc",
-                       .id             = 4,
+                       .name           = "sclk_dwmmc",
                        .parent         = &clk_dout_mmc4.clk,
                        .enable         = exynos4_clksrc_mask_fsys_ctrl,
                        .ctrlbit        = (1 << 16),
arch/arm/mach-exynos4/include/mach/clkdev.h new file +0 -0
new file mode 100644
index 0000000..1247f5e

arch/arm/mach-exynos4/include/mach/clkdev.h line 7

Quoted 7 lines
arch/arm/mach-exynos4/include/mach/clkdev.h new file +7 -0
@@ -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

Looks good to me.

One nitpick
How about to just create the one clkdev.h at plat-samsung with proper ifdef endif config.
I think don't need to create clkdev.h for each SoCs.

Thank you,
Kyungmin Park

Quoted 28 lines
arch/arm/mach-exynos4/time.c +2 -1
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");
--

1.6.6.rc2

--
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

#9 lore raw

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

Quoted 12 lines · Kyungmin Park
Quoted 11 lines · Thomas Abraham

Add clkdev support for Samsung's Exynos4 platform and fixes the incorrect clock name for the dw_mmc controller.

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

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

(snip)

Quoted 16 lines

arch/arm/mach-exynos4/include/mach/clkdev.h line 7

Quoted 13 lines
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

Looks good to me.

Quoted 4 lines

One nitpick
How about to just create the one clkdev.h at plat-samsung with proper ifdef endif config.
I think don't need to create clkdev.h for each SoCs.

No, basically the "mach/clkdev.h" should be added, please see arch/arm/include/asm/clkdev.h.

Thanks.

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

#10 lore raw

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

Quoted 39 lines · Kukjin Kim
Quoted 16 lines · Kyungmin Park
Quoted 13 lines · Thomas Abraham

Add clkdev support for Samsung's Exynos4 platform and fixes the incorrect clock name for the dw_mmc controller.

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

 4 files changed, 67 insertions(+), 121 deletions(-)

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

(snip)

Quoted 17 lines
Quoted 7 lines
arch/arm/mach-exynos4/include/mach/clkdev.h new file +0 -0
new file mode 100644
index 0000000..1247f5e

arch/arm/mach-exynos4/include/mach/clkdev.h line 7

Quoted 7 lines
arch/arm/mach-exynos4/include/mach/clkdev.h new file +7 -0
@@ -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

Looks good to me.

Quoted 7 lines
Quoted 4 lines

One nitpick
How about to just create the one clkdev.h at plat-samsung with proper ifdef endif config.
I think don't need to create clkdev.h for each SoCs.

No, basically the "mach/clkdev.h" should be added, please see arch/arm/include/asm/clkdev.h.

Okay it's required,
but also see the others.
http://git.infradead.org/linux-2.6.git/blob/HEAD:/arch/arm/mach-omap2/include/mach/clkdev.h

1 /*
2 * arch/arm/mach-omap2/include/mach/clkdev.h
3 */
4
5 #include <plat/clkdev.h>

Thank you,
Kyungmin Park

#11 lore raw

PATCH v2 7/7 ARM: Exynos4: Add clkdev support

Quoted 52 lines · Kyungmin Park
Quoted 39 lines · Kukjin Kim
Quoted 16 lines · Kyungmin Park
Quoted 13 lines · On Sat, May 28, 2011 at 12:26 AM, Thomas Abraham<[email protected]> ?wrote:

Add clkdev support for Samsung's Exynos4 platform and fixes the incorrect clock name for the dw_mmc controller.

---
?arch/arm/Kconfig ? ? ? ? ? ? ? ? ? ? ? ? ? ?| ? ?1 + ?arch/arm/mach-exynos4/clock.c ? ? ? ? ? ? ? | ?178
+++++++++------------------
?arch/arm/mach-exynos4/include/mach/clkdev.h | ? ?7 + ?arch/arm/mach-exynos4/time.c ? ? ? ? ? ? ? ?| ? ?2 + ?4 files changed, 67 insertions(+), 121 deletions(-) ?create mode 100644 arch/arm/mach-exynos4/include/mach/clkdev.h

(snip)

Quoted 17 lines
Quoted 7 lines
arch/arm/mach-exynos4/include/mach/clkdev.h new file +0 -0
new file mode 100644
index 0000000..1247f5e

arch/arm/mach-exynos4/include/mach/clkdev.h line 7

Quoted 7 lines
arch/arm/mach-exynos4/include/mach/clkdev.h new file +7 -0
@@ -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

Looks good to me.

Quoted 7 lines
Quoted 4 lines

One nitpick
How about to just create the one clkdev.h at plat-samsung with proper ifdef endif config.
I think don't need to create clkdev.h for each SoCs.

No, basically the "mach/clkdev.h" should be added, please see arch/arm/include/asm/clkdev.h.

Okay it's required,
but also see the others.
http://git.infradead.org/linux-2.6.git/blob/HEAD:/arch/arm/mach-omap2/include/mach/clkdev.h

Quoted 5 lines

? 1 /*
? 2 ?* arch/arm/mach-omap2/include/mach/clkdev.h
? 3 ?*/
? 4
? 5 #include <plat/clkdev.h>

and
http://git.infradead.org/linux-2.6.git/blob/HEAD:/arch/arm/plat-omap/include/plat/clkdev.h

   1 #ifndef __MACH_CLKDEV_H
   2 #define __MACH_CLKDEV_H
   3
   4 static inline int __clk_get(struct clk *clk)
   5 {
   6         return 1;
   7 }
   8
   9 static inline void __clk_put(struct clk *clk)
  10 {
  11 }
  12
  13 #endif

To Arnd,

in case of ARM, it has almost same form. then how about to move the arm generic one?

Quoted 4 lines

Thank you,
Kyungmin Park

#12 lore raw

PATCH v2 7/7 ARM: Exynos4: Add clkdev support

Quoted 76 lines · Kyungmin Park
Quoted 52 lines · Kyungmin Park
Quoted 39 lines · Kukjin Kim
Quoted 16 lines · Kyungmin Park
Quoted 13 lines · On Sat, May 28, 2011 at 12:26 AM, Thomas Abraham<[email protected]> ?wrote:

Add clkdev support for Samsung's Exynos4 platform and fixes the incorrect clock name for the dw_mmc controller.

---
?arch/arm/Kconfig ? ? ? ? ? ? ? ? ? ? ? ? ? ?| ? ?1 + ?arch/arm/mach-exynos4/clock.c ? ? ? ? ? ? ? | ?178
+++++++++------------------
?arch/arm/mach-exynos4/include/mach/clkdev.h | ? ?7 + ?arch/arm/mach-exynos4/time.c ? ? ? ? ? ? ? ?| ? ?2 + ?4 files changed, 67 insertions(+), 121 deletions(-) ?create mode 100644 arch/arm/mach-exynos4/include/mach/clkdev.h

(snip)

Quoted 17 lines
Quoted 7 lines
arch/arm/mach-exynos4/include/mach/clkdev.h new file +0 -0
new file mode 100644
index 0000000..1247f5e

arch/arm/mach-exynos4/include/mach/clkdev.h line 7

Quoted 7 lines
arch/arm/mach-exynos4/include/mach/clkdev.h new file +7 -0
@@ -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

Looks good to me.

Quoted 7 lines
Quoted 4 lines

One nitpick
How about to just create the one clkdev.h at plat-samsung with proper ifdef endif config.
I think don't need to create clkdev.h for each SoCs.

No, basically the "mach/clkdev.h" should be added, please see arch/arm/include/asm/clkdev.h.

Okay it's required,
but also see the others.
http://git.infradead.org/linux-2.6.git/blob/HEAD:/arch/arm/mach-omap2/include/mach/clkdev.h

Quoted 5 lines

? 1 /*
? 2 ?* arch/arm/mach-omap2/include/mach/clkdev.h
? 3 ?*/
? 4
? 5 #include <plat/clkdev.h>

and
http://git.infradead.org/linux-2.6.git/blob/HEAD:/arch/arm/plat-omap/include/plat/clkdev.h

? 1 #ifndef __MACH_CLKDEV_H
? 2 #define __MACH_CLKDEV_H
? 3
? 4 static inline int __clk_get(struct clk *clk)
? 5 {
? 6 ? ? ? ? return 1;
? 7 }
? 8
? 9 static inline void __clk_put(struct clk *clk)
?10 {
?11 }
?12
?13 #endif

Quoted 5 lines

To Arnd,

in case of ARM, it has almost same form. then how about to move the arm generic one?

Quoted 1 line

We also need to consider the case in which a platform requires a custom implementation of __clk_get and __clk_put. In that case, will a single clkdev.h suffice?

Thanks,
Thomas.

Quoted 8 lines
Quoted 3 lines

Thank you,
Kyungmin Park

--
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

#13 lore raw
In reply to Thomas Abraham
Quoted 3 lines · Thomas Abraham

This patch series adds clkdev support for all Samsung platforms. clkdev support is a prerequisite for adding device tree and common clock features on Samsung platforms.

This patch series is based on the latest git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git master

and has been tested on the following boards.

SMDK2416, SMDK2440, SMDK2450, SMDK6410, SMDK6440, SMDK6450, SMDKC100, SMDKV210 and SMDKV310.

Quoted 54 lines

Changes since v1:

1. Removed the clock id field from clock instances.
2. Fixed incorrect naming of guards in mach/clkdev.h files.

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               |  178 +++++++++------------------ arch/arm/mach-exynos4/include/mach/clkdev.h |    7 + arch/arm/mach-exynos4/time.c                |    2 +

 arch/arm/mach-s3c2412/clock.c               |   36 +-----
 arch/arm/mach-s3c2416/clock.c               |   10 +-
 arch/arm/mach-s3c2440/clock.c               |    3 -
 arch/arm/mach-s3c2443/clock.c               |   16 +--
 arch/arm/mach-s3c64xx/clock.c               |   86 ++++---------

 arch/arm/mach-s3c64xx/include/mach/clkdev.h |    7 + arch/arm/mach-s5p64x0/clock-s5p6440.c       |   74 +++-------- arch/arm/mach-s5p64x0/clock-s5p6450.c       |   68 +++-------- arch/arm/mach-s5p64x0/include/mach/clkdev.h |    7 + arch/arm/mach-s5pc100/clock.c               |  163 ++++++------------------ arch/arm/mach-s5pc100/include/mach/clkdev.h |    7 + arch/arm/mach-s5pv210/clock.c               |  130 ++++++-------------- arch/arm/mach-s5pv210/include/mach/clkdev.h |    7 + arch/arm/plat-s3c24xx/clock-dclk.c          |    4 - arch/arm/plat-s3c24xx/include/mach/clkdev.h |    7 + arch/arm/plat-s3c24xx/s3c2410-clock.c       |   21 +--- arch/arm/plat-s3c24xx/s3c2443-clock.c       |   39 +----- arch/arm/plat-s5p/s5p-time.c                |    9 ++ arch/arm/plat-samsung/clock.c               |   98 +-------------- arch/arm/plat-samsung/include/plat/clock.h  |    3 + arch/arm/plat-samsung/pwm-clock.c           |   10 ++ arch/arm/plat-samsung/time.c                |    2 +

 26 files changed, 300 insertions(+), 700 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

--
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