Skip to contentSkip to conversation

ARM: SAMSUNG: Add support for sdhci clock lookup using generic names

PATCH Superseded Rajeshwari Shinde 4 participants 11 messages Oct 12, 2011 – Oct 13, 2011

Subsystems (6)

v3 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v3 cover ARM: SAMSUNG: Add support for sdhci clock lookup using generic names

This patchset adds support for sdhci controller clock lookup using generic names. With this patchset, there will be no need to pass clock names in sdhci platform data.

This patchset depends on the patchset:
Add a common macro for creating struct clk_lookup entries.
mmc: sdhci-s3c: add default controller configuration.

V2 Changes:
- Added HCLK instance for HSMMC instance 1 as suggested by Heiko.
- Rebased on UART clkdev patches. So these patches should be applied after UART clkdev patches are applied.

V3 Changes:
- Removed double registration of hsmmc1 hclk from s3c2416 as suggested by Heiko

Rajeshwari Shinde (3):
SDHCI: S3C: Use generic clock names for sdhci bus clock options
ARM: SAMSUNG: Remove SDHCI bus clocks from platform data
ARM: SAMSUNG: Add lookup of sdhci-s3c clocks using generic names

 arch/arm/mach-exynos4/Makefile             |    1 -
 arch/arm/mach-exynos4/clock.c              |   88 +++++++++------
 arch/arm/mach-exynos4/setup-sdhci.c        |   22 ----
 arch/arm/mach-s3c2416/Makefile             |    1 -
 arch/arm/mach-s3c2416/clock.c              |   68 ++++++-----
 arch/arm/mach-s3c2416/setup-sdhci.c        |   24 ----
 arch/arm/mach-s3c64xx/Makefile             |    1 -
 arch/arm/mach-s3c64xx/clock.c              |  126 +++++++++++++--------
 arch/arm/mach-s3c64xx/setup-sdhci.c        |   24 ----
 arch/arm/mach-s5pc100/Makefile             |    1 -
 arch/arm/mach-s5pc100/clock.c              |  130 +++++++++++++---------
 arch/arm/mach-s5pc100/setup-sdhci.c        |   23 ----
 arch/arm/mach-s5pv210/Makefile             |    1 -
 arch/arm/mach-s5pv210/clock.c              |  167 +++++++++++++++++-----------
 arch/arm/mach-s5pv210/setup-sdhci.c        |   22 ----
 arch/arm/plat-s3c24xx/s3c2443-clock.c      |   15 ++-
 arch/arm/plat-samsung/include/plat/sdhci.h |   31 -----
 drivers/mmc/host/sdhci-s3c.c               |    6 +-
 18 files changed, 361 insertions(+), 390 deletions(-)
 delete mode 100644 arch/arm/mach-exynos4/setup-sdhci.c
 delete mode 100644 arch/arm/mach-s3c2416/setup-sdhci.c
 delete mode 100644 arch/arm/mach-s3c64xx/setup-sdhci.c
 delete mode 100644 arch/arm/mach-s5pc100/setup-sdhci.c
 delete mode 100644 arch/arm/mach-s5pv210/setup-sdhci.c
Signature · 1 line
1.7.4.4
#1 lore raw

PATCH v3 1/3 SDHCI: S3C: Use generic clock names for sdhci bus clock options

This patch modifies the driver to stop depending on the clock names being passed from the platform and switch over to bus clock lookup using generic clock names.

---
 drivers/mmc/host/sdhci-s3c.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
drivers/mmc/host/sdhci-s3c.c +2 -4
index 82709b6..a5fde87 100644
@@ -435,14 +435,12 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
 
 	for (clks = 0, ptr = 0; ptr < MAX_BUS_CLK; ptr++) {
 		struct clk *clk;
-		char *name = pdata->clocks[ptr];
+		char name[14];
 
-		if (name == NULL)
-			continue;
+		sprintf(name, "mmc_busclk.%d", ptr);
 
 		clk = clk_get(dev, name);
 		if (IS_ERR(clk)) {
-			dev_err(dev, "failed to get clock %s\n", name);
 			continue;
 		}
 
Signature · 1 line
1.7.4.4
#2 lore raw

PATCH v3 2/3 ARM: SAMSUNG: Remove SDHCI bus clocks from platform data

In reply to Rajeshwari Shinde

The bus clocks previously sent through platform data to SDHCI controller are removed.

---
 arch/arm/mach-exynos4/Makefile             |    1 -
 arch/arm/mach-exynos4/setup-sdhci.c        |   22 -------------------
 arch/arm/mach-s3c2416/Makefile             |    1 -
 arch/arm/mach-s3c2416/setup-sdhci.c        |   24 ---------------------
 arch/arm/mach-s3c64xx/Makefile             |    1 -
 arch/arm/mach-s3c64xx/setup-sdhci.c        |   24 ---------------------
 arch/arm/mach-s5pc100/Makefile             |    1 -
 arch/arm/mach-s5pc100/setup-sdhci.c        |   23 --------------------
 arch/arm/mach-s5pv210/Makefile             |    1 -
 arch/arm/mach-s5pv210/setup-sdhci.c        |   22 -------------------
 arch/arm/plat-samsung/include/plat/sdhci.h |   31 ----------------------------
 11 files changed, 0 insertions(+), 151 deletions(-)
 delete mode 100644 arch/arm/mach-exynos4/setup-sdhci.c
 delete mode 100644 arch/arm/mach-s3c2416/setup-sdhci.c
 delete mode 100644 arch/arm/mach-s3c64xx/setup-sdhci.c
 delete mode 100644 arch/arm/mach-s5pc100/setup-sdhci.c
 delete mode 100644 arch/arm/mach-s5pv210/setup-sdhci.c
arch/arm/mach-exynos4/Makefile +0 -1
index 2bb18f4..c47aae3 100644
@@ -55,7 +55,6 @@ obj-$(CONFIG_EXYNOS4_SETUP_I2C5)	+= setup-i2c5.o
 obj-$(CONFIG_EXYNOS4_SETUP_I2C6)	+= setup-i2c6.o
 obj-$(CONFIG_EXYNOS4_SETUP_I2C7)	+= setup-i2c7.o
 obj-$(CONFIG_EXYNOS4_SETUP_KEYPAD)	+= setup-keypad.o
-obj-$(CONFIG_EXYNOS4_SETUP_SDHCI)	+= setup-sdhci.o
 obj-$(CONFIG_EXYNOS4_SETUP_SDHCI_GPIO)	+= setup-sdhci-gpio.o
 
 obj-$(CONFIG_EXYNOS4_SETUP_USB_PHY)	+= setup-usb-phy.o
arch/arm/mach-exynos4/setup-sdhci.c deleted +0 -22
deleted file mode 100644
index 92937b4..0000000
@@ -1,22 +0,0 @@
-/* linux/arch/arm/mach-exynos4/setup-sdhci.c
- *
- * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
- *		http://www.samsung.com
- *
- * EXYNOS4 - Helper functions for settign up SDHCI device(s) (HSMMC)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-#include <linux/types.h>
-
-/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
-
-char *exynos4_hsmmc_clksrcs[4] = {
-	[0] = NULL,
-	[1] = NULL,
-	[2] = "sclk_mmc",	/* mmc_bus */
-	[3] = NULL,
-};
arch/arm/mach-s3c2416/Makefile +0 -1
index 7b805b2..ca0cd22 100644
@@ -15,7 +15,6 @@ obj-$(CONFIG_S3C2416_PM)	+= pm.o
 #obj-$(CONFIG_S3C2416_DMA)	+= dma.o
 
 # Device setup
-obj-$(CONFIG_S3C2416_SETUP_SDHCI) += setup-sdhci.o
 obj-$(CONFIG_S3C2416_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
 
 # Machine support
arch/arm/mach-s3c2416/setup-sdhci.c deleted +0 -24
deleted file mode 100644
index cee5395..0000000
@@ -1,24 +0,0 @@
-/* linux/arch/arm/mach-s3c2416/setup-sdhci.c
- *
- * Copyright 2010 Promwad Innovation Company
- *	Yauhen Kharuzhy <[email protected]>
- *
- * S3C2416 - Helper functions for settign up SDHCI device(s) (HSMMC)
- *
- * Based on mach-s3c64xx/setup-sdhci.c
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-#include <linux/types.h>
-
-/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
-
-char *s3c2416_hsmmc_clksrcs[4] = {
-	[0] = "hsmmc",
-	[1] = "hsmmc",
-	[2] = "hsmmc-if",
-	/* [3] = "48m", - note not successfully used yet */
-};
arch/arm/mach-s3c64xx/Makefile +0 -1
index 902ab9a..94de24b 100644
@@ -32,7 +32,6 @@ obj-$(CONFIG_S3C64XX_SETUP_I2C0) += setup-i2c0.o
 obj-$(CONFIG_S3C64XX_SETUP_I2C1) += setup-i2c1.o
 obj-$(CONFIG_S3C64XX_SETUP_IDE) += setup-ide.o
 obj-$(CONFIG_S3C64XX_SETUP_KEYPAD) += setup-keypad.o
-obj-$(CONFIG_S3C64XX_SETUP_SDHCI) += setup-sdhci.o
 obj-$(CONFIG_S3C64XX_SETUP_FB_24BPP) += setup-fb-24bpp.o
 obj-$(CONFIG_S3C64XX_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
 
arch/arm/mach-s3c64xx/setup-sdhci.c deleted +0 -24
deleted file mode 100644
index c75a71b..0000000
@@ -1,24 +0,0 @@
-/* linux/arch/arm/mach-s3c64xx/setup-sdhci.c
- *
- * Copyright 2008 Simtec Electronics
- * Copyright 2008 Simtec Electronics
- *	Ben Dooks <[email protected]>
- *	http://armlinux.simtec.co.uk/
- *
- * S3C6400/S3C6410 - Helper functions for settign up SDHCI device(s) (HSMMC)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-#include <linux/types.h>
-
-/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
-
-char *s3c64xx_hsmmc_clksrcs[4] = {
-	[0] = "hsmmc",
-	[1] = "hsmmc",
-	[2] = "mmc_bus",
-	/* [3] = "48m", - note not successfully used yet */
-};
arch/arm/mach-s5pc100/Makefile +0 -1
index a5e6e60..2320e54 100644
@@ -21,7 +21,6 @@ obj-$(CONFIG_S5PC100_SETUP_FB_24BPP)	+= setup-fb-24bpp.o
 obj-$(CONFIG_S5PC100_SETUP_I2C1)	+= setup-i2c1.o
 obj-$(CONFIG_S5PC100_SETUP_IDE)		+= setup-ide.o
 obj-$(CONFIG_S5PC100_SETUP_KEYPAD)	+= setup-keypad.o
-obj-$(CONFIG_S5PC100_SETUP_SDHCI)	+= setup-sdhci.o
 obj-$(CONFIG_S5PC100_SETUP_SDHCI_GPIO)	+= setup-sdhci-gpio.o
 
 # device support
arch/arm/mach-s5pc100/setup-sdhci.c deleted +0 -23
deleted file mode 100644
index 6418c6e..0000000
@@ -1,23 +0,0 @@
-/* linux/arch/arm/mach-s5pc100/setup-sdhci.c
- *
- * Copyright 2008 Samsung Electronics
- *
- * S5PC100 - Helper functions for settign up SDHCI device(s) (HSMMC)
- *
- * Based on mach-s3c6410/setup-sdhci.c
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-#include <linux/types.h>
-
-/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
-
-char *s5pc100_hsmmc_clksrcs[4] = {
-	[0] = "hsmmc",		/* HCLK */
-	/* [1] = "hsmmc",	- duplicate HCLK entry */
-	[2] = "sclk_mmc",	/* mmc_bus */
-	/* [3] = "48m",		- note not successfully used yet */
-};
arch/arm/mach-s5pv210/Makefile +0 -1
index 009fbe5..53c346a 100644
@@ -35,5 +35,4 @@ obj-$(CONFIG_S5PV210_SETUP_I2C1) 	+= setup-i2c1.o
 obj-$(CONFIG_S5PV210_SETUP_I2C2) 	+= setup-i2c2.o
 obj-$(CONFIG_S5PV210_SETUP_IDE)		+= setup-ide.o
 obj-$(CONFIG_S5PV210_SETUP_KEYPAD)	+= setup-keypad.o
-obj-$(CONFIG_S5PV210_SETUP_SDHCI)       += setup-sdhci.o
 obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO)	+= setup-sdhci-gpio.o
arch/arm/mach-s5pv210/setup-sdhci.c deleted +0 -22
deleted file mode 100644
index 6b8ccc4..0000000
@@ -1,22 +0,0 @@
-/* linux/arch/arm/mach-s5pv210/setup-sdhci.c
- *
- * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
- *		http://www.samsung.com/
- *
- * S5PV210 - Helper functions for settign up SDHCI device(s) (HSMMC)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-#include <linux/types.h>
-
-/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */
-
-char *s5pv210_hsmmc_clksrcs[4] = {
-	[0] = "hsmmc",		/* HCLK */
-	/* [1] = "hsmmc",	- duplicate HCLK entry */
-	[2] = "sclk_mmc",	/* mmc_bus */
-	/* [3] = NULL,		- reserved */
-};
arch/arm/plat-samsung/include/plat/sdhci.h +0 -31
index e7b3c75..dcff7dd 100644
@@ -66,8 +66,6 @@ struct s3c_sdhci_platdata {
 	enum cd_types	cd_type;
 	enum clk_types	clk_type;
 
-	char		**clocks;	/* set of clock sources */
-
 	int		ext_cd_gpio;
 	bool		ext_cd_gpio_invert;
 	int	(*ext_cd_init)(void (*notify_func)(struct platform_device *,
@@ -129,12 +127,9 @@ extern void exynos4_setup_sdhci3_cfg_gpio(struct platform_device *, int w);
 /* S3C2416 SDHCI setup */
 
 #ifdef CONFIG_S3C2416_SETUP_SDHCI
-extern char *s3c2416_hsmmc_clksrcs[4];
-
 static inline void s3c2416_default_sdhci0(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC
-	s3c_hsmmc0_def_platdata.clocks = s3c2416_hsmmc_clksrcs;
 	s3c_hsmmc0_def_platdata.cfg_gpio = s3c2416_setup_sdhci0_cfg_gpio;
 #endif /* CONFIG_S3C_DEV_HSMMC */
 }
@@ -142,7 +137,6 @@ static inline void s3c2416_default_sdhci0(void)
 static inline void s3c2416_default_sdhci1(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC1
-	s3c_hsmmc1_def_platdata.clocks = s3c2416_hsmmc_clksrcs;
 	s3c_hsmmc1_def_platdata.cfg_gpio = s3c2416_setup_sdhci1_cfg_gpio;
 #endif /* CONFIG_S3C_DEV_HSMMC1 */
 }
@@ -155,12 +149,9 @@ static inline void s3c2416_default_sdhci1(void) { }
 /* S3C64XX SDHCI setup */
 
 #ifdef CONFIG_S3C64XX_SETUP_SDHCI
-extern char *s3c64xx_hsmmc_clksrcs[4];
-
 static inline void s3c6400_default_sdhci0(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC
-	s3c_hsmmc0_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
 	s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio;
 #endif
 }
@@ -168,7 +159,6 @@ static inline void s3c6400_default_sdhci0(void)
 static inline void s3c6400_default_sdhci1(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC1
-	s3c_hsmmc1_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
 	s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio;
 #endif
 }
@@ -176,7 +166,6 @@ static inline void s3c6400_default_sdhci1(void)
 static inline void s3c6400_default_sdhci2(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC2
-	s3c_hsmmc2_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
 	s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
 #endif
 }
@@ -184,7 +173,6 @@ static inline void s3c6400_default_sdhci2(void)
 static inline void s3c6410_default_sdhci0(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC
-	s3c_hsmmc0_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
 	s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio;
 #endif
 }
@@ -192,7 +180,6 @@ static inline void s3c6410_default_sdhci0(void)
 static inline void s3c6410_default_sdhci1(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC1
-	s3c_hsmmc1_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
 	s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio;
 #endif
 }
@@ -200,7 +187,6 @@ static inline void s3c6410_default_sdhci1(void)
 static inline void s3c6410_default_sdhci2(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC2
-	s3c_hsmmc2_def_platdata.clocks = s3c64xx_hsmmc_clksrcs;
 	s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
 #endif
 }
@@ -218,12 +204,9 @@ static inline void s3c6400_default_sdhci2(void) { }
 /* S5PC100 SDHCI setup */
 
 #ifdef CONFIG_S5PC100_SETUP_SDHCI
-extern char *s5pc100_hsmmc_clksrcs[4];
-
 static inline void s5pc100_default_sdhci0(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC
-	s3c_hsmmc0_def_platdata.clocks = s5pc100_hsmmc_clksrcs;
 	s3c_hsmmc0_def_platdata.cfg_gpio = s5pc100_setup_sdhci0_cfg_gpio;
 #endif
 }
@@ -231,7 +214,6 @@ static inline void s5pc100_default_sdhci0(void)
 static inline void s5pc100_default_sdhci1(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC1
-	s3c_hsmmc1_def_platdata.clocks = s5pc100_hsmmc_clksrcs;
 	s3c_hsmmc1_def_platdata.cfg_gpio = s5pc100_setup_sdhci1_cfg_gpio;
 #endif
 }
@@ -239,7 +221,6 @@ static inline void s5pc100_default_sdhci1(void)
 static inline void s5pc100_default_sdhci2(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC2
-	s3c_hsmmc2_def_platdata.clocks = s5pc100_hsmmc_clksrcs;
 	s3c_hsmmc2_def_platdata.cfg_gpio = s5pc100_setup_sdhci2_cfg_gpio;
 #endif
 }
@@ -254,12 +235,9 @@ static inline void s5pc100_default_sdhci2(void) { }
 /* S5PV210 SDHCI setup */
 
 #ifdef CONFIG_S5PV210_SETUP_SDHCI
-extern char *s5pv210_hsmmc_clksrcs[4];
-
 static inline void s5pv210_default_sdhci0(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC
-	s3c_hsmmc0_def_platdata.clocks = s5pv210_hsmmc_clksrcs;
 	s3c_hsmmc0_def_platdata.cfg_gpio = s5pv210_setup_sdhci0_cfg_gpio;
 #endif
 }
@@ -267,7 +245,6 @@ static inline void s5pv210_default_sdhci0(void)
 static inline void s5pv210_default_sdhci1(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC1
-	s3c_hsmmc1_def_platdata.clocks = s5pv210_hsmmc_clksrcs;
 	s3c_hsmmc1_def_platdata.cfg_gpio = s5pv210_setup_sdhci1_cfg_gpio;
 #endif
 }
@@ -275,7 +252,6 @@ static inline void s5pv210_default_sdhci1(void)
 static inline void s5pv210_default_sdhci2(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC2
-	s3c_hsmmc2_def_platdata.clocks = s5pv210_hsmmc_clksrcs;
 	s3c_hsmmc2_def_platdata.cfg_gpio = s5pv210_setup_sdhci2_cfg_gpio;
 #endif
 }
@@ -283,7 +259,6 @@ static inline void s5pv210_default_sdhci2(void)
 static inline void s5pv210_default_sdhci3(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC3
-	s3c_hsmmc3_def_platdata.clocks = s5pv210_hsmmc_clksrcs;
 	s3c_hsmmc3_def_platdata.cfg_gpio = s5pv210_setup_sdhci3_cfg_gpio;
 #endif
 }
@@ -298,12 +273,9 @@ static inline void s5pv210_default_sdhci3(void) { }
 
 /* EXYNOS4 SDHCI setup */
 #ifdef CONFIG_EXYNOS4_SETUP_SDHCI
-extern char *exynos4_hsmmc_clksrcs[4];
-
 static inline void exynos4_default_sdhci0(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC
-	s3c_hsmmc0_def_platdata.clocks = exynos4_hsmmc_clksrcs;
 	s3c_hsmmc0_def_platdata.cfg_gpio = exynos4_setup_sdhci0_cfg_gpio;
 #endif
 }
@@ -311,7 +283,6 @@ static inline void exynos4_default_sdhci0(void)
 static inline void exynos4_default_sdhci1(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC1
-	s3c_hsmmc1_def_platdata.clocks = exynos4_hsmmc_clksrcs;
 	s3c_hsmmc1_def_platdata.cfg_gpio = exynos4_setup_sdhci1_cfg_gpio;
 #endif
 }
@@ -319,7 +290,6 @@ static inline void exynos4_default_sdhci1(void)
 static inline void exynos4_default_sdhci2(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC2
-	s3c_hsmmc2_def_platdata.clocks = exynos4_hsmmc_clksrcs;
 	s3c_hsmmc2_def_platdata.cfg_gpio = exynos4_setup_sdhci2_cfg_gpio;
 #endif
 }
@@ -327,7 +297,6 @@ static inline void exynos4_default_sdhci2(void)
 static inline void exynos4_default_sdhci3(void)
 {
 #ifdef CONFIG_S3C_DEV_HSMMC3
-	s3c_hsmmc3_def_platdata.clocks = exynos4_hsmmc_clksrcs;
 	s3c_hsmmc3_def_platdata.cfg_gpio = exynos4_setup_sdhci3_cfg_gpio;
 #endif
 }
Signature · 1 line
1.7.4.4
#3 lore raw

PATCH v4 3/3 ARM: SAMSUNG: Add lookup of sdhci-s3c clocks using generic names

In reply to Rajeshwari Shinde

Add support for lookup of sdhci-s3c controller clocks using generic names for s3c2416, s3c64xx, s5pc100, s5pv210 and exynos4 SoC's.

---
 arch/arm/mach-exynos4/clock.c         |   88 ++++++++++-------
 arch/arm/mach-s3c2416/clock.c         |   68 +++++++------
 arch/arm/mach-s3c64xx/clock.c         |  126 +++++++++++++++----------
 arch/arm/mach-s5pc100/clock.c         |  130 ++++++++++++++++----------
 arch/arm/mach-s5pv210/clock.c         |  167 ++++++++++++++++++++-------------
 arch/arm/plat-s3c24xx/s3c2443-clock.c |   15 ++-
 6 files changed, 359 insertions(+), 235 deletions(-)
arch/arm/mach-exynos4/clock.c +52 -36
index 9f50e33..c6383b9 100644
@@ -1157,42 +1157,6 @@ static struct clksrc_clk clksrcs[] = {
 		.reg_div = { .reg = S5P_CLKDIV_MFC, .shift = 0, .size = 4 },
 	}, {
 		.clk		= {
-			.name		= "sclk_mmc",
-			.devname	= "s3c-sdhci.0",
-			.parent		= &clk_dout_mmc0.clk,
-			.enable		= exynos4_clksrc_mask_fsys_ctrl,
-			.ctrlbit	= (1 << 0),
-		},
-		.reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 8, .size = 8 },
-	}, {
-		.clk		= {
-			.name		= "sclk_mmc",
-			.devname	= "s3c-sdhci.1",
-			.parent         = &clk_dout_mmc1.clk,
-			.enable		= exynos4_clksrc_mask_fsys_ctrl,
-			.ctrlbit	= (1 << 4),
-		},
-		.reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 24, .size = 8 },
-	}, {
-		.clk		= {
-			.name		= "sclk_mmc",
-			.devname	= "s3c-sdhci.2",
-			.parent         = &clk_dout_mmc2.clk,
-			.enable		= exynos4_clksrc_mask_fsys_ctrl,
-			.ctrlbit	= (1 << 8),
-		},
-		.reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 8, .size = 8 },
-	}, {
-		.clk		= {
-			.name		= "sclk_mmc",
-			.devname	= "s3c-sdhci.3",
-			.parent         = &clk_dout_mmc3.clk,
-			.enable		= exynos4_clksrc_mask_fsys_ctrl,
-			.ctrlbit	= (1 << 12),
-		},
-		.reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 24, .size = 8 },
-	}, {
-		.clk		= {
 			.name		= "sclk_dwmmc",
 			.parent         = &clk_dout_mmc4.clk,
 			.enable		= exynos4_clksrc_mask_fsys_ctrl,
@@ -1250,6 +1214,50 @@ static struct clksrc_clk clk_sclk_uart3 = {
 	.reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 12, .size = 4 },
 };
 
+static struct clksrc_clk clk_sclk_mmc0 = {
+	.clk		= {
+		.name		= "sclk_mmc",
+		.devname	= "s3c-sdhci.0",
+		.parent		= &clk_dout_mmc0.clk,
+		.enable		= exynos4_clksrc_mask_fsys_ctrl,
+		.ctrlbit	= (1 << 0),
+	},
+	.reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 8, .size = 8 },
+};
+
+static struct clksrc_clk clk_sclk_mmc1 = {
+	.clk		= {
+		.name		= "sclk_mmc",
+		.devname	= "s3c-sdhci.1",
+		.parent         = &clk_dout_mmc1.clk,
+		.enable		= exynos4_clksrc_mask_fsys_ctrl,
+		.ctrlbit	= (1 << 4),
+	},
+	.reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 24, .size = 8 },
+};
+
+static struct clksrc_clk clk_sclk_mmc2 = {
+	.clk		= {
+		.name		= "sclk_mmc",
+		.devname	= "s3c-sdhci.2",
+		.parent         = &clk_dout_mmc2.clk,
+		.enable		= exynos4_clksrc_mask_fsys_ctrl,
+		.ctrlbit	= (1 << 8),
+	},
+	.reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 8, .size = 8 },
+};
+
+static struct clksrc_clk clk_sclk_mmc3 = {
+	.clk		= {
+		.name		= "sclk_mmc",
+		.devname	= "s3c-sdhci.3",
+		.parent         = &clk_dout_mmc3.clk,
+		.enable		= exynos4_clksrc_mask_fsys_ctrl,
+		.ctrlbit	= (1 << 12),
+	},
+	.reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 24, .size = 8 },
+};
+
 /* Clock initialization code */
 static struct clksrc_clk *sysclks[] = {
 	&clk_mout_apll,
@@ -1289,6 +1297,10 @@ static struct clksrc_clk *clksrc_cdev[] = {
 	&clk_sclk_uart1,
 	&clk_sclk_uart2,
 	&clk_sclk_uart3,
+	&clk_sclk_mmc0,
+	&clk_sclk_mmc1,
+	&clk_sclk_mmc2,
+	&clk_sclk_mmc3,
 };
 
 static struct clk_lookup exynos4_clk_lookup[] = {
@@ -1296,6 +1308,10 @@ static struct clk_lookup exynos4_clk_lookup[] = {
 	CLKDEV_INIT("exynos4210-uart.1", "clk_uart_baud0", &clk_sclk_uart1.clk),
 	CLKDEV_INIT("exynos4210-uart.2", "clk_uart_baud0", &clk_sclk_uart2.clk),
 	CLKDEV_INIT("exynos4210-uart.3", "clk_uart_baud0", &clk_sclk_uart3.clk),
+	CLKDEV_INIT("exynos4-sdhci.0", "mmc_busclk.2", &clk_sclk_mmc0.clk),
+	CLKDEV_INIT("exynos4-sdhci.1", "mmc_busclk.2", &clk_sclk_mmc1.clk),
+	CLKDEV_INIT("exynos4-sdhci.2", "mmc_busclk.2", &clk_sclk_mmc2.clk),
+	CLKDEV_INIT("exynos4-sdhci.3", "mmc_busclk.2", &clk_sclk_mmc3.clk),
 };
 
 static int xtal_rate;
arch/arm/mach-s3c2416/clock.c +37 -31

90 lines not on this page · raw message

arch/arm/mach-s3c64xx/clock.c +78 -48

167 lines not on this page · raw message

arch/arm/mach-s5pc100/clock.c +79 -51

174 lines not on this page · raw message

arch/arm/mach-s5pv210/clock.c +103 -64

208 lines not on this page · raw message

arch/arm/plat-s3c24xx/s3c2443-clock.c +10 -5
index 4a24e15..2a2a255 100644
@@ -309,11 +309,6 @@ static struct clk init_clocks[] = {
 		.enable		= s3c2443_clkcon_enable_h,
 		.ctrlbit	= S3C2443_HCLKCON_DMA5,
 	}, {
-		.name		= "hsmmc",
-		.parent		= &clk_h,
-		.enable		= s3c2443_clkcon_enable_h,
-		.ctrlbit	= S3C2443_HCLKCON_HSMMC,
-	}, {
 		.name		= "gpio",
 		.parent		= &clk_p,
 		.enable		= s3c2443_clkcon_enable_p,
@@ -395,6 +390,14 @@ static struct clk init_clocks[] = {
 	}
 };
 
+static struct clk hsmmc1_clk = {
+	.name		= "hsmmc",
+	.devname	= "s3c-sdhci.1",
+	.parent		= &clk_h,
+	.enable		= s3c2443_clkcon_enable_h,
+	.ctrlbit	= S3C2443_HCLKCON_HSMMC,
+};
+
 static inline unsigned long s3c2443_get_hdiv(unsigned long clkcon0)
 {
 	clkcon0 &= S3C2443_CLKDIV0_HCLKDIV_MASK;
@@ -460,6 +463,7 @@ static struct clk *clks[] __initdata = {
 	&clk_ext,
 	&clk_epll,
 	&clk_usb_bus,
+	&hsmmc1_clk,
 };
 
 static struct clksrc_clk *clksrcs[] __initdata = {
@@ -475,6 +479,7 @@ static struct clk_lookup s3c2443_clk_lookup[] = {
 	CLKDEV_INIT(NULL, "clk_uart_baud1", &s3c24xx_uclk),
 	CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_p),
 	CLKDEV_INIT(NULL, "clk_uart_baud3", &clk_esys_uart.clk),
+	CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.0", &hsmmc1_clk),
 };
 
 void __init s3c2443_common_init_clocks(int xtal, pll_fn get_mpll,
Signature · 1 line
1.7.4.4
#4 lore raw

PATCH v4 3/3 ARM: SAMSUNG: Add lookup of sdhci-s3c clocks using generic names

Hi Rajeshwari,

Quoted 61 lines · Rajeshwari Shinde

Add support for lookup of sdhci-s3c controller clocks using generic names for s3c2416, s3c64xx, s5pc100, s5pv210 and exynos4 SoC's.

---
 arch/arm/mach-exynos4/clock.c         |   88 ++++++++++-------
 arch/arm/mach-s3c2416/clock.c         |   68 +++++++------
 arch/arm/mach-s3c64xx/clock.c         |  126 +++++++++++++++----------
 arch/arm/mach-s5pc100/clock.c         |  130 ++++++++++++++++----------
 arch/arm/mach-s5pv210/clock.c         |  167 ++++++++++++++++++++-------------
 arch/arm/plat-s3c24xx/s3c2443-clock.c |   15 ++-
 6 files changed, 359 insertions(+), 235 deletions(-)
arch/arm/mach-exynos4/clock.c +0 -36
index 9f50e33..c6383b9 100644
@@ -1157,42 +1157,6 @@ static struct clksrc_clk clksrcs[] = {
 		.reg_div = { .reg = S5P_CLKDIV_MFC, .shift = 0, .size = 4 },
 	}, {
 		.clk		= {
-			.name		= "sclk_mmc",
-			.devname	= "s3c-sdhci.0",
-			.parent		= &clk_dout_mmc0.clk,
-			.enable		= exynos4_clksrc_mask_fsys_ctrl,
-			.ctrlbit	= (1 << 0),
-		},
-		.reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 8, .size = 8 },
-	}, {
-		.clk		= {
-			.name		= "sclk_mmc",
-			.devname	= "s3c-sdhci.1",
-			.parent         = &clk_dout_mmc1.clk,
-			.enable		= exynos4_clksrc_mask_fsys_ctrl,
-			.ctrlbit	= (1 << 4),
-		},
-		.reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 24, .size = 8 },
-	}, {
-		.clk		= {
-			.name		= "sclk_mmc",
-			.devname	= "s3c-sdhci.2",
-			.parent         = &clk_dout_mmc2.clk,
-			.enable		= exynos4_clksrc_mask_fsys_ctrl,
-			.ctrlbit	= (1 << 8),
-		},
-		.reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 8, .size = 8 },
-	}, {
-		.clk		= {
-			.name		= "sclk_mmc",
-			.devname	= "s3c-sdhci.3",
-			.parent         = &clk_dout_mmc3.clk,
-			.enable		= exynos4_clksrc_mask_fsys_ctrl,
-			.ctrlbit	= (1 << 12),
-		},
-		.reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 24, .size = 8 },
-	}, {
-		.clk		= {
 			.name		= "sclk_dwmmc",
 			.parent         = &clk_dout_mmc4.clk,
 			.enable		= exynos4_clksrc_mask_fsys_ctrl,

arch/arm/mach-exynos4/clock.c static struct clksrc_clk clk_sclk_uart3 = { · line 1220

Quoted 7 lines
arch/arm/mach-exynos4/clock.c +4 -0
@@ -1250,6 +1214,50 @@ static struct clksrc_clk clk_sclk_uart3 = {
 	.reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 12, .size = 4 },
 };
 
+static struct clksrc_clk clk_sclk_mmc0 = {
+	.clk		= {
+		.name		= "sclk_mmc",
+		.devname	= "s3c-sdhci.0",

Would it make sense to drop this 'devname' field here and others until sclk_mmc3 ....

Quoted 47 lines
arch/arm/mach-exynos4/clock.c +40 -0
+		.parent		= &clk_dout_mmc0.clk,
+		.enable		= exynos4_clksrc_mask_fsys_ctrl,
+		.ctrlbit	= (1 << 0),
+	},
+	.reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 8, .size = 8 },
+};
+
+static struct clksrc_clk clk_sclk_mmc1 = {
+	.clk		= {
+		.name		= "sclk_mmc",
+		.devname	= "s3c-sdhci.1",
 
+		.parent         = &clk_dout_mmc1.clk,
+		.enable		= exynos4_clksrc_mask_fsys_ctrl,
+		.ctrlbit	= (1 << 4),
+	},
+	.reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 24, .size = 8 },
+};
+
+static struct clksrc_clk clk_sclk_mmc2 = {
+	.clk		= {
+		.name		= "sclk_mmc",
+		.devname	= "s3c-sdhci.2",
 
+		.parent         = &clk_dout_mmc2.clk,
+		.enable		= exynos4_clksrc_mask_fsys_ctrl,
+		.ctrlbit	= (1 << 8),
+	},
+	.reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 8, .size = 8 },
+};
+
+static struct clksrc_clk clk_sclk_mmc3 = {
+	.clk		= {
+		.name		= "sclk_mmc",
+		.devname	= "s3c-sdhci.3",
 
+		.parent         = &clk_dout_mmc3.clk,
+		.enable		= exynos4_clksrc_mask_fsys_ctrl,
+		.ctrlbit	= (1 << 12),
+	},
+	.reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 24, .size = 8 },
+};
+

/* Clock initialization code */
static struct clksrc_clk *sysclks[] = {

arch/arm/mach-exynos4/clock.c +0 -0
 	&clk_mout_apll,

arch/arm/mach-exynos4/clock.c static struct clksrc_clk *clksrc_cdev[] = { · line 1303

Quoted 7 lines
arch/arm/mach-exynos4/clock.c +4 -0
@@ -1289,6 +1297,10 @@ static struct clksrc_clk *clksrc_cdev[] = {
 	&clk_sclk_uart1,
 	&clk_sclk_uart2,
 	&clk_sclk_uart3,
+	&clk_sclk_mmc0,
+	&clk_sclk_mmc1,
+	&clk_sclk_mmc2,
+	&clk_sclk_mmc3,

..then drop the above 4 lines...

arch/arm/mach-exynos4/clock.c static struct clk_lookup exynos4_clk_lookup[] = { · line 1314

Quoted 11 lines
arch/arm/mach-exynos4/clock.c +4 -0
 };
 
 static struct clk_lookup exynos4_clk_lookup[] = {
@@ -1296,6 +1308,10 @@ static struct clk_lookup exynos4_clk_lookup[] = {
 	CLKDEV_INIT("exynos4210-uart.1", "clk_uart_baud0", &clk_sclk_uart1.clk),
 	CLKDEV_INIT("exynos4210-uart.2", "clk_uart_baud0", &clk_sclk_uart2.clk),
 	CLKDEV_INIT("exynos4210-uart.3", "clk_uart_baud0", &clk_sclk_uart3.clk),
+	CLKDEV_INIT("exynos4-sdhci.0", "mmc_busclk.2", &clk_sclk_mmc0.clk),
+	CLKDEV_INIT("exynos4-sdhci.1", "mmc_busclk.2", &clk_sclk_mmc1.clk),
+	CLKDEV_INIT("exynos4-sdhci.2", "mmc_busclk.2", &clk_sclk_mmc2.clk),
+	CLKDEV_INIT("exynos4-sdhci.3", "mmc_busclk.2", &clk_sclk_mmc3.clk),

..and add something like:

+ CLKDEV_INIT("s3c-sdhci.0", "sclk_mmc", &clk_sclk_mmc0.clk),
+ CLKDEV_INIT("s3c-sdhci.1", "sclk_mmc", &clk_sclk_mmc1.clk),
+ CLKDEV_INIT("s3c-sdhci.2", "sclk_mmc", &clk_sclk_mmc2.clk),
+ CLKDEV_INIT("s3c-sdhci.3", "sclk_mmc", &clk_sclk_mmc3.clk),

?

Also I'm wondering why we're using different device names for clk_sclk_mmc0..3 clocks, i.e. exynos4-sdhci.? and s3c-sdhci.? ?

Does it all work on exynos ? I would expect the device name to be same across all the clock definitions, otherwise clk_get(dev, ..) will fail.

arch/arm/mach-exynos4/clock.c static struct clk_lookup exynos4_clk_lookup[] = { · line 1316

Quoted 2 lines
arch/arm/mach-exynos4/clock.c +0 -0
 };
 

Regards

Signature · 2 lines
Sylwester Nawrocki
Samsung Poland R&D Center
#5 lore raw

PATCH v4 3/3 ARM: SAMSUNG: Add lookup of sdhci-s3c clocks using generic names

Hi Sylwester,

Quoted 67 lines · Sylwester Nawrocki

Hi Rajeshwari,

Quoted 64 lines · Rajeshwari Shinde

Add support for lookup of sdhci-s3c controller clocks using generic names for s3c2416, s3c64xx, s5pc100, s5pv210 and exynos4 SoC's.

---

?arch/arm/mach-exynos4/clock.c ? ? ? ? | ? 88 ++++++++++-------
?arch/arm/mach-s3c2416/clock.c ? ? ? ? | ? 68 +++++++------
?arch/arm/mach-s3c64xx/clock.c ? ? ? ? | ?126 +++++++++++++++----------
?arch/arm/mach-s5pc100/clock.c ? ? ? ? | ?130 ++++++++++++++++----------
?arch/arm/mach-s5pv210/clock.c ? ? ? ? | ?167 ++++++++++++++++++++-------------
?arch/arm/plat-s3c24xx/s3c2443-clock.c | ? 15 ++-

?6 files changed, 359 insertions(+), 235 deletions(-)

arch/arm/mach-exynos4/clock.c +0 -36
index 9f50e33..c6383b9 100644
@@ -1157,42 +1157,6 @@ static struct clksrc_clk clksrcs[] = {
 ? ? ? ? ? ? ? .reg_div = { .reg = S5P_CLKDIV_MFC, .shift = 0, .size = 4 },
 ? ? ? }, {
 ? ? ? ? ? ? ? .clk ? ? ? ? ? ?= {
- ? ? ? ? ? ? ? ? ? ? .name ? ? ? ? ? = "sclk_mmc",
- ? ? ? ? ? ? ? ? ? ? .devname ? ? ? ?= "s3c-sdhci.0",
- ? ? ? ? ? ? ? ? ? ? .parent ? ? ? ? = &clk_dout_mmc0.clk,
- ? ? ? ? ? ? ? ? ? ? .enable ? ? ? ? = exynos4_clksrc_mask_fsys_ctrl,
- ? ? ? ? ? ? ? ? ? ? .ctrlbit ? ? ? ?= (1 << 0),
- ? ? ? ? ? ? },
- ? ? ? ? ? ? .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 8, .size = 8 },
- ? ? }, {
- ? ? ? ? ? ? .clk ? ? ? ? ? ?= {
- ? ? ? ? ? ? ? ? ? ? .name ? ? ? ? ? = "sclk_mmc",
- ? ? ? ? ? ? ? ? ? ? .devname ? ? ? ?= "s3c-sdhci.1",
- ? ? ? ? ? ? ? ? ? ? .parent ? ? ? ? = &clk_dout_mmc1.clk,
- ? ? ? ? ? ? ? ? ? ? .enable ? ? ? ? = exynos4_clksrc_mask_fsys_ctrl,
- ? ? ? ? ? ? ? ? ? ? .ctrlbit ? ? ? ?= (1 << 4),
- ? ? ? ? ? ? },
- ? ? ? ? ? ? .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 24, .size = 8 },
- ? ? }, {
- ? ? ? ? ? ? .clk ? ? ? ? ? ?= {
- ? ? ? ? ? ? ? ? ? ? .name ? ? ? ? ? = "sclk_mmc",
- ? ? ? ? ? ? ? ? ? ? .devname ? ? ? ?= "s3c-sdhci.2",
- ? ? ? ? ? ? ? ? ? ? .parent ? ? ? ? = &clk_dout_mmc2.clk,
- ? ? ? ? ? ? ? ? ? ? .enable ? ? ? ? = exynos4_clksrc_mask_fsys_ctrl,
- ? ? ? ? ? ? ? ? ? ? .ctrlbit ? ? ? ?= (1 << 8),
- ? ? ? ? ? ? },
- ? ? ? ? ? ? .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 8, .size = 8 },
- ? ? }, {
- ? ? ? ? ? ? .clk ? ? ? ? ? ?= {
- ? ? ? ? ? ? ? ? ? ? .name ? ? ? ? ? = "sclk_mmc",
- ? ? ? ? ? ? ? ? ? ? .devname ? ? ? ?= "s3c-sdhci.3",
- ? ? ? ? ? ? ? ? ? ? .parent ? ? ? ? = &clk_dout_mmc3.clk,
- ? ? ? ? ? ? ? ? ? ? .enable ? ? ? ? = exynos4_clksrc_mask_fsys_ctrl,
- ? ? ? ? ? ? ? ? ? ? .ctrlbit ? ? ? ?= (1 << 12),
- ? ? ? ? ? ? },
- ? ? ? ? ? ? .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 24, .size = 8 },
- ? ? }, {
- ? ? ? ? ? ? .clk ? ? ? ? ? ?= {
 ? ? ? ? ? ? ? ? ? ? ? .name ? ? ? ? ? = "sclk_dwmmc",
 ? ? ? ? ? ? ? ? ? ? ? .parent ? ? ? ? = &clk_dout_mmc4.clk,
 ? ? ? ? ? ? ? ? ? ? ? .enable ? ? ? ? = exynos4_clksrc_mask_fsys_ctrl,
@@ -1250,6 +1214,50 @@ static struct clksrc_clk clk_sclk_uart3 = {
 ? ? ? .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 12, .size = 4 },
 ?};
 
Quoted 7 lines

arch/arm/mach-exynos4/clock.c static struct clksrc_clk clk_sclk_uart3 = { · line 1220

Quoted 4 lines
arch/arm/mach-exynos4/clock.c +4 -0
+static struct clksrc_clk clk_sclk_mmc0 = {
+ ? ? .clk ? ? ? ? ? ?= {
+ ? ? ? ? ? ? .name ? ? ? ? ? = "sclk_mmc",
+ ? ? ? ? ? ? .devname ? ? ? ?= "s3c-sdhci.0",

Would it make sense to drop this 'devname' field here and others until sclk_mmc3 ....

*** The devname here distinguishes these clocks. So it should be okay to have a devname for these clocks.

Quoted 49 lines
Quoted 49 lines
arch/arm/mach-exynos4/clock.c +40 -0
+ ? ? ? ? ? ? .parent ? ? ? ? = &clk_dout_mmc0.clk,
+ ? ? ? ? ? ? .enable ? ? ? ? = exynos4_clksrc_mask_fsys_ctrl,
+ ? ? ? ? ? ? .ctrlbit ? ? ? ?= (1 << 0),
+ ? ? },
+ ? ? .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 8, .size = 8 },
+};
+
+static struct clksrc_clk clk_sclk_mmc1 = {
+ ? ? .clk ? ? ? ? ? ?= {
+ ? ? ? ? ? ? .name ? ? ? ? ? = "sclk_mmc",
+ ? ? ? ? ? ? .devname ? ? ? ?= "s3c-sdhci.1",
 
+ ? ? ? ? ? ? .parent ? ? ? ? = &clk_dout_mmc1.clk,
+ ? ? ? ? ? ? .enable ? ? ? ? = exynos4_clksrc_mask_fsys_ctrl,
+ ? ? ? ? ? ? .ctrlbit ? ? ? ?= (1 << 4),
+ ? ? },
+ ? ? .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 24, .size = 8 },
+};
+
+static struct clksrc_clk clk_sclk_mmc2 = {
+ ? ? .clk ? ? ? ? ? ?= {
+ ? ? ? ? ? ? .name ? ? ? ? ? = "sclk_mmc",
+ ? ? ? ? ? ? .devname ? ? ? ?= "s3c-sdhci.2",
 
+ ? ? ? ? ? ? .parent ? ? ? ? = &clk_dout_mmc2.clk,
+ ? ? ? ? ? ? .enable ? ? ? ? = exynos4_clksrc_mask_fsys_ctrl,
+ ? ? ? ? ? ? .ctrlbit ? ? ? ?= (1 << 8),
+ ? ? },
+ ? ? .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 8, .size = 8 },
+};
+
+static struct clksrc_clk clk_sclk_mmc3 = {
+ ? ? .clk ? ? ? ? ? ?= {
+ ? ? ? ? ? ? .name ? ? ? ? ? = "sclk_mmc",
+ ? ? ? ? ? ? .devname ? ? ? ?= "s3c-sdhci.3",
 
+ ? ? ? ? ? ? .parent ? ? ? ? = &clk_dout_mmc3.clk,
+ ? ? ? ? ? ? .enable ? ? ? ? = exynos4_clksrc_mask_fsys_ctrl,
+ ? ? ? ? ? ? .ctrlbit ? ? ? ?= (1 << 12),
+ ? ? },
+ ? ? .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 24, .size = 8 },
+};
+

?/* Clock initialization code */
?static struct clksrc_clk *sysclks[] = {
? ? ? &clk_mout_apll,

arch/arm/mach-exynos4/clock.c +0 -0
@@ -1289,6 +1297,10 @@ static struct clksrc_clk *clksrc_cdev[] = {
 ? ? ? &clk_sclk_uart1,
Quoted 8 lines

arch/arm/mach-exynos4/clock.c static struct clksrc_clk *clksrc_cdev[] = { · line 1303

Quoted 6 lines
arch/arm/mach-exynos4/clock.c +4 -0
 ? ? ? &clk_sclk_uart2,
 ? ? ? &clk_sclk_uart3,
+ ? ? &clk_sclk_mmc0,
+ ? ? &clk_sclk_mmc1,
+ ? ? &clk_sclk_mmc2,
+ ? ? &clk_sclk_mmc3,

..then drop the above 4 lines...

**** The registration for these clocks are important. The s3c_register_clksrc() function sets the .ops of this clock and also its parent. So the registration cannot be dropped.

Quoted 15 lines

arch/arm/mach-exynos4/clock.c static struct clk_lookup exynos4_clk_lookup[] = { · line 1314

Quoted 12 lines
arch/arm/mach-exynos4/clock.c +4 -0
 ?};
 
 ?static struct clk_lookup exynos4_clk_lookup[] = {
@@ -1296,6 +1308,10 @@ static struct clk_lookup exynos4_clk_lookup[] = {
 ? ? ? CLKDEV_INIT("exynos4210-uart.1", "clk_uart_baud0", &clk_sclk_uart1.clk),
 ? ? ? CLKDEV_INIT("exynos4210-uart.2", "clk_uart_baud0", &clk_sclk_uart2.clk),
 ? ? ? CLKDEV_INIT("exynos4210-uart.3", "clk_uart_baud0", &clk_sclk_uart3.clk),
+ ? ? CLKDEV_INIT("exynos4-sdhci.0", "mmc_busclk.2", &clk_sclk_mmc0.clk),
+ ? ? CLKDEV_INIT("exynos4-sdhci.1", "mmc_busclk.2", &clk_sclk_mmc1.clk),
+ ? ? CLKDEV_INIT("exynos4-sdhci.2", "mmc_busclk.2", &clk_sclk_mmc2.clk),
+ ? ? CLKDEV_INIT("exynos4-sdhci.3", "mmc_busclk.2", &clk_sclk_mmc3.clk),

..and add something like:

Quoted 6 lines

?+ ? ? ?CLKDEV_INIT("s3c-sdhci.0", "sclk_mmc", &clk_sclk_mmc0.clk), ?+ ? ? ?CLKDEV_INIT("s3c-sdhci.1", "sclk_mmc", &clk_sclk_mmc1.clk), ?+ ? ? ?CLKDEV_INIT("s3c-sdhci.2", "sclk_mmc", &clk_sclk_mmc2.clk), ?+ ? ? ?CLKDEV_INIT("s3c-sdhci.3", "sclk_mmc", &clk_sclk_mmc3.clk),

?

**** The driver uses a common name for the possible bus clock sources, that is ?mmc_busclk?. This keeps the clock lookup code in the driver simple. Also, there could be SoC?s which do no use sclk_mmc as the bus clock name as per the user manual

Quoted 6 lines

Also I'm wondering why we're using different device names for clk_sclk_mmc0..3 clocks, i.e. exynos4-sdhci.? and s3c-sdhci.? ?

Does it all work on exynos ? I would expect the device name to be same across all the clock definitions, otherwise clk_get(dev, ..) will fail.

**** There was a patch submitted to rename the device name of sdhci for Exynos to exynos4-sdhci. I will remove this change from this patch and let that patch handle this change.

Quoted 4 lines

arch/arm/mach-exynos4/clock.c static struct clk_lookup exynos4_clk_lookup[] = { · line 1316

Quoted 3 lines
arch/arm/mach-exynos4/clock.c +0 -0
 ?};
 
Quoted 9 lines

Regards
--
Sylwester Nawrocki
Samsung Poland R&D Center
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo at vger.kernel.org
More majordomo info at ?http://vger.kernel.org/majordomo-info.html

Regards,
Rajeshwari Shinde.

#6 lore raw

PATCH v4 3/3 ARM: SAMSUNG: Add lookup of sdhci-s3c clocks using generic names

Quoted 24 lines · Rajeshwari Birje
Quoted 22 lines · Sylwester Nawrocki

Hi Rajeshwari,

Quoted 19 lines · Rajeshwari Shinde

Add support for lookup of sdhci-s3c controller clocks using generic names for s3c2416, s3c64xx, s5pc100, s5pv210 and exynos4 SoC's.

---
 arch/arm/mach-exynos4/clock.c         |   88 ++++++++++-------
 arch/arm/mach-s3c2416/clock.c         |   68 +++++++------
 arch/arm/mach-s3c64xx/clock.c         |  126 +++++++++++++++----------
 arch/arm/mach-s5pc100/clock.c         |  130 ++++++++++++++++----------
 arch/arm/mach-s5pv210/clock.c         |  167 ++++++++++++++++++++-------------
 arch/arm/plat-s3c24xx/s3c2443-clock.c |   15 ++-
 6 files changed, 359 insertions(+), 235 deletions(-)
arch/arm/mach-exynos4/clock.c +0 -0
index 9f50e33..c6383b9 100644
@@ -1157,42 +1157,6 @@ static struct clksrc_clk clksrcs[] = {
              .reg_div = { .reg = S5P_CLKDIV_MFC, .shift = 0, .size = 4 },

...

Quoted 10 lines
Quoted 7 lines

arch/arm/mach-exynos4/clock.c static struct clksrc_clk clk_sclk_uart3 = { · line 1220

Quoted 4 lines
arch/arm/mach-exynos4/clock.c +4 -0
+static struct clksrc_clk clk_sclk_mmc0 = {
+     .clk            = {
+             .name           = "sclk_mmc",
+             .devname        = "s3c-sdhci.0",

Would it make sense to drop this 'devname' field here and others until sclk_mmc3 ....

*** The devname here distinguishes these clocks. So it should be okay to have a devname for these clocks.

I'm not sure what's Mr Kukjin's opinion on that, but I personally would really like to see all the devname fields disappear from samsung clk data structures. Possibly if all involved people would keep that in mind we could achieve this over time.

Quoted 59 lines
Quoted 50 lines
Quoted 50 lines
arch/arm/mach-exynos4/clock.c +40 -0
+             .parent         = &clk_dout_mmc0.clk,
+             .enable         = exynos4_clksrc_mask_fsys_ctrl,
+             .ctrlbit        = (1 << 0),
+     },
+     .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 8, .size = 8 },
+};
+
+static struct clksrc_clk clk_sclk_mmc1 = {
+     .clk            = {
+             .name           = "sclk_mmc",
+             .devname        = "s3c-sdhci.1",
 
+             .parent         = &clk_dout_mmc1.clk,
+             .enable         = exynos4_clksrc_mask_fsys_ctrl,
+             .ctrlbit        = (1 << 4),
+     },
+     .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 24, .size = 8 },
+};
+
+static struct clksrc_clk clk_sclk_mmc2 = {
+     .clk            = {
+             .name           = "sclk_mmc",
+             .devname        = "s3c-sdhci.2",
 
+             .parent         = &clk_dout_mmc2.clk,
+             .enable         = exynos4_clksrc_mask_fsys_ctrl,
+             .ctrlbit        = (1 << 8),
+     },
+     .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 8, .size = 8 },
+};
+
+static struct clksrc_clk clk_sclk_mmc3 = {
+     .clk            = {
+             .name           = "sclk_mmc",
+             .devname        = "s3c-sdhci.3",
 
+             .parent         = &clk_dout_mmc3.clk,
+             .enable         = exynos4_clksrc_mask_fsys_ctrl,
+             .ctrlbit        = (1 << 12),
+     },
+     .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 24, .size = 8 },
+};
+
 /* Clock initialization code */
 static struct clksrc_clk *sysclks[] = {
      &clk_mout_apll,
@@ -1289,6 +1297,10 @@ static struct clksrc_clk *clksrc_cdev[] = {
      &clk_sclk_uart1,
Quoted 8 lines

arch/arm/mach-exynos4/clock.c static struct clksrc_clk *clksrc_cdev[] = { · line 1303

Quoted 6 lines
arch/arm/mach-exynos4/clock.c +4 -0
      &clk_sclk_uart2,
      &clk_sclk_uart3,
+     &clk_sclk_mmc0,
+     &clk_sclk_mmc1,
+     &clk_sclk_mmc2,
+     &clk_sclk_mmc3,

..then drop the above 4 lines...

Quoted 3 lines

**** The registration for these clocks are important. The s3c_register_clksrc() function sets the .ops of this clock and also its parent. So the registration cannot be dropped.

OK.

Quoted 21 lines
Quoted 21 lines

arch/arm/mach-exynos4/clock.c static struct clk_lookup exynos4_clk_lookup[] = { · line 1314

Quoted 13 lines
arch/arm/mach-exynos4/clock.c +4 -0
 };
 
 static struct clk_lookup exynos4_clk_lookup[] = {
@@ -1296,6 +1308,10 @@ static struct clk_lookup exynos4_clk_lookup[] = {
      CLKDEV_INIT("exynos4210-uart.1", "clk_uart_baud0", &clk_sclk_uart1.clk),
      CLKDEV_INIT("exynos4210-uart.2", "clk_uart_baud0", &clk_sclk_uart2.clk),
      CLKDEV_INIT("exynos4210-uart.3", "clk_uart_baud0", &clk_sclk_uart3.clk),
+     CLKDEV_INIT("exynos4-sdhci.0", "mmc_busclk.2", &clk_sclk_mmc0.clk),
+     CLKDEV_INIT("exynos4-sdhci.1", "mmc_busclk.2", &clk_sclk_mmc1.clk),
+     CLKDEV_INIT("exynos4-sdhci.2", "mmc_busclk.2", &clk_sclk_mmc2.clk),
+     CLKDEV_INIT("exynos4-sdhci.3", "mmc_busclk.2", &clk_sclk_mmc3.clk),

..and add something like:

 +      CLKDEV_INIT("s3c-sdhci.0", "sclk_mmc", &clk_sclk_mmc0.clk),
 +      CLKDEV_INIT("s3c-sdhci.1", "sclk_mmc", &clk_sclk_mmc1.clk),
 +      CLKDEV_INIT("s3c-sdhci.2", "sclk_mmc", &clk_sclk_mmc2.clk),
 +      CLKDEV_INIT("s3c-sdhci.3", "sclk_mmc", &clk_sclk_mmc3.clk),
Quoted 6 lines
Quoted 1 line

?

**** The driver uses a common name for the possible bus clock sources, that is ?mmc_busclk?. This keeps the clock lookup code in the driver simple. Also, there could be SoC?s which do no use sclk_mmc as the bus clock name as per the user manual

OK, I was aware of that. I didn't mean removing the "mmc_busclk.2" entries, just adding another 4, which are created anyway by s3c_register_clksrc() function. But for now I think the patch is OK.

Quoted 6 lines
Quoted 6 lines

Also I'm wondering why we're using different device names for clk_sclk_mmc0..3 clocks, i.e. exynos4-sdhci.? and s3c-sdhci.? ?

Quoted 6 lines
Quoted 2 lines

Does it all work on exynos ? I would expect the device name to be same across all the clock definitions, otherwise clk_get(dev, ..) will fail.

**** There was a patch submitted to rename the device name of sdhci for Exynos to exynos4-sdhci. I will remove this change from this patch and let that patch handle this change.

I wouldn't do that. IMHO it's better to keep this patch as is, to make the final diff size lower.
Perhaps it's even worth to consider doing the clock rename altogether in this patch. But it's of course up to you.

Regards,

Signature · 2 lines
Sylwester Nawrocki
Samsung Poland R&D Center
#7 lore raw

PATCH v4 3/3 ARM: SAMSUNG: Add lookup of sdhci-s3c clocks using generic names

Hi Sylwester,

Quoted 34 lines · Sylwester Nawrocki
Quoted 24 lines · Rajeshwari Birje
Quoted 22 lines · Sylwester Nawrocki

Hi Rajeshwari,

Quoted 19 lines · Rajeshwari Shinde

Add support for lookup of sdhci-s3c controller clocks using generic names for s3c2416, s3c64xx, s5pc100, s5pv210 and exynos4 SoC's.

---

?arch/arm/mach-exynos4/clock.c ? ? ? ? | ? 88 ++++++++++-------
?arch/arm/mach-s3c2416/clock.c ? ? ? ? | ? 68 +++++++------
?arch/arm/mach-s3c64xx/clock.c ? ? ? ? | ?126 +++++++++++++++----------
?arch/arm/mach-s5pc100/clock.c ? ? ? ? | ?130 ++++++++++++++++----------
?arch/arm/mach-s5pv210/clock.c ? ? ? ? | ?167 ++++++++++++++++++++-------------
?arch/arm/plat-s3c24xx/s3c2443-clock.c | ? 15 ++-

?6 files changed, 359 insertions(+), 235 deletions(-)

arch/arm/mach-exynos4/clock.c +0 -0
index 9f50e33..c6383b9 100644
@@ -1157,42 +1157,6 @@ static struct clksrc_clk clksrcs[] = {
 ? ? ? ? ? ? ? .reg_div = { .reg = S5P_CLKDIV_MFC, .shift = 0, .size = 4 },

...

Quoted 8 lines
Quoted 7 lines
Quoted 4 lines

+static struct clksrc_clk clk_sclk_mmc0 = {
+ ? ? .clk ? ? ? ? ? ?= {
+ ? ? ? ? ? ? .name ? ? ? ? ? = "sclk_mmc",
+ ? ? ? ? ? ? .devname ? ? ? ?= "s3c-sdhci.0",

Would it make sense to drop this 'devname' field here and others until sclk_mmc3 ....

Quoted 7 lines
Quoted 2 lines

*** The devname here distinguishes these clocks. So it should be okay to have a devname for these clocks.

I'm not sure what's Mr Kukjin's opinion on that, but I personally would really like to see all the devname fields disappear from samsung clk data structures. Possibly if all involved people would keep that in mind we could achieve this over time.

**** Devname field is still required for clocks like hsmmc for driver to work fine. Hence it would be tough to remove the devname completely.

Quoted 107 lines
Quoted 60 lines
Quoted 51 lines
Quoted 51 lines

+ ? ? ? ? ? ? .parent ? ? ? ? = &clk_dout_mmc0.clk,
+ ? ? ? ? ? ? .enable ? ? ? ? = exynos4_clksrc_mask_fsys_ctrl,
+ ? ? ? ? ? ? .ctrlbit ? ? ? ?= (1 << 0),
+ ? ? },
+ ? ? .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 8, .size = 8 },

arch/arm/mach-exynos4/clock.c +35 -0
+};
+
+static struct clksrc_clk clk_sclk_mmc1 = {
+ ? ? .clk ? ? ? ? ? ?= {
+ ? ? ? ? ? ? .name ? ? ? ? ? = "sclk_mmc",
+ ? ? ? ? ? ? .devname ? ? ? ?= "s3c-sdhci.1",
 
+ ? ? ? ? ? ? .parent ? ? ? ? = &clk_dout_mmc1.clk,
+ ? ? ? ? ? ? .enable ? ? ? ? = exynos4_clksrc_mask_fsys_ctrl,
+ ? ? ? ? ? ? .ctrlbit ? ? ? ?= (1 << 4),
+ ? ? },
+ ? ? .reg_div = { .reg = S5P_CLKDIV_FSYS1, .shift = 24, .size = 8 },
+};
+
+static struct clksrc_clk clk_sclk_mmc2 = {
+ ? ? .clk ? ? ? ? ? ?= {
+ ? ? ? ? ? ? .name ? ? ? ? ? = "sclk_mmc",
+ ? ? ? ? ? ? .devname ? ? ? ?= "s3c-sdhci.2",
 
+ ? ? ? ? ? ? .parent ? ? ? ? = &clk_dout_mmc2.clk,
+ ? ? ? ? ? ? .enable ? ? ? ? = exynos4_clksrc_mask_fsys_ctrl,
+ ? ? ? ? ? ? .ctrlbit ? ? ? ?= (1 << 8),
+ ? ? },
+ ? ? .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 8, .size = 8 },
+};
+
+static struct clksrc_clk clk_sclk_mmc3 = {
+ ? ? .clk ? ? ? ? ? ?= {
+ ? ? ? ? ? ? .name ? ? ? ? ? = "sclk_mmc",
+ ? ? ? ? ? ? .devname ? ? ? ?= "s3c-sdhci.3",
 
+ ? ? ? ? ? ? .parent ? ? ? ? = &clk_dout_mmc3.clk,
+ ? ? ? ? ? ? .enable ? ? ? ? = exynos4_clksrc_mask_fsys_ctrl,
+ ? ? ? ? ? ? .ctrlbit ? ? ? ?= (1 << 12),
+ ? ? },
+ ? ? .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 24, .size = 8 },
+};
+

?/* Clock initialization code */
?static struct clksrc_clk *sysclks[] = {
? ? ? &clk_mout_apll,

arch/arm/mach-exynos4/clock.c +0 -0
@@ -1289,6 +1297,10 @@ static struct clksrc_clk *clksrc_cdev[] = {
 ? ? ? &clk_sclk_uart1,
Quoted 8 lines

arch/arm/mach-exynos4/clock.c static struct clksrc_clk *clksrc_cdev[] = { · line 1303

Quoted 6 lines
arch/arm/mach-exynos4/clock.c +4 -0
 ? ? ? &clk_sclk_uart2,
 ? ? ? &clk_sclk_uart3,
+ ? ? &clk_sclk_mmc0,
+ ? ? &clk_sclk_mmc1,
+ ? ? &clk_sclk_mmc2,
+ ? ? &clk_sclk_mmc3,

..then drop the above 4 lines...

Quoted 3 lines

**** The registration for these clocks are important. The s3c_register_clksrc() function sets the .ops of this clock and also its parent. So the registration cannot be dropped.

OK.

Quoted 21 lines
Quoted 21 lines

arch/arm/mach-exynos4/clock.c static struct clk_lookup exynos4_clk_lookup[] = { · line 1314

Quoted 13 lines
arch/arm/mach-exynos4/clock.c +4 -0
 ?};
 
 ?static struct clk_lookup exynos4_clk_lookup[] = {
@@ -1296,6 +1308,10 @@ static struct clk_lookup exynos4_clk_lookup[] = {
 ? ? ? CLKDEV_INIT("exynos4210-uart.1", "clk_uart_baud0", &clk_sclk_uart1.clk),
 ? ? ? CLKDEV_INIT("exynos4210-uart.2", "clk_uart_baud0", &clk_sclk_uart2.clk),
 ? ? ? CLKDEV_INIT("exynos4210-uart.3", "clk_uart_baud0", &clk_sclk_uart3.clk),
+ ? ? CLKDEV_INIT("exynos4-sdhci.0", "mmc_busclk.2", &clk_sclk_mmc0.clk),
+ ? ? CLKDEV_INIT("exynos4-sdhci.1", "mmc_busclk.2", &clk_sclk_mmc1.clk),
+ ? ? CLKDEV_INIT("exynos4-sdhci.2", "mmc_busclk.2", &clk_sclk_mmc2.clk),
+ ? ? CLKDEV_INIT("exynos4-sdhci.3", "mmc_busclk.2", &clk_sclk_mmc3.clk),

..and add something like:

?+ ? ? ?CLKDEV_INIT("s3c-sdhci.0", "sclk_mmc", &clk_sclk_mmc0.clk), ?+ ? ? ?CLKDEV_INIT("s3c-sdhci.1", "sclk_mmc", &clk_sclk_mmc1.clk), ?+ ? ? ?CLKDEV_INIT("s3c-sdhci.2", "sclk_mmc", &clk_sclk_mmc2.clk), ?+ ? ? ?CLKDEV_INIT("s3c-sdhci.3", "sclk_mmc", &clk_sclk_mmc3.clk),

Quoted 6 lines
Quoted 1 line

?

**** The driver uses a common name for the possible bus clock sources, that is ?mmc_busclk?. This keeps the clock lookup code in the driver simple. Also, there could be SoC?s which do no use sclk_mmc as the bus clock name as per the user manual

OK, I was aware of that. I didn't mean removing the "mmc_busclk.2" entries, just adding another 4, which are created anyway by s3c_register_clksrc() function. But for now I think the patch is OK.

Quoted 9 lines
Quoted 8 lines

Also I'm wondering why we're using different device names for clk_sclk_mmc0..3 clocks, i.e. exynos4-sdhci.? and s3c-sdhci.? ?

Does it all work on exynos ? I would expect the device name to be same across all the clock definitions, otherwise clk_get(dev, ..) will fail.

Quoted 6 lines
Quoted 3 lines

**** There was a patch submitted to rename the device name of sdhci for Exynos to exynos4-sdhci. I will remove this change from this patch and let that patch handle this change.

I wouldn't do that. IMHO it's better to keep this patch as is, to make the final diff size lower.

**** Will modify the exynos4-sdhci. to s3c-sdhci. and send the updated patch for review.

Quoted 9 lines

Perhaps it's even worth to consider doing the clock rename altogether in this patch. But it's of course up to you.

Regards,
--
Sylwester Nawrocki
Samsung Poland R&D Center

Regards,
Rajeshwari Shinde.

#8 lore raw

PATCH v4 3/3 ARM: SAMSUNG: Add lookup of sdhci-s3c clocks using generic names

Quoted 45 lines · Rajeshwari Birje
Quoted 34 lines · Sylwester Nawrocki
Quoted 24 lines · Rajeshwari Birje
Quoted 22 lines · Sylwester Nawrocki

Hi Rajeshwari,

Quoted 19 lines · Rajeshwari Shinde

Add support for lookup of sdhci-s3c controller clocks using generic names for s3c2416, s3c64xx, s5pc100, s5pv210 and exynos4 SoC's.

---
 arch/arm/mach-exynos4/clock.c         |   88 ++++++++++-------
 arch/arm/mach-s3c2416/clock.c         |   68 +++++++------
 arch/arm/mach-s3c64xx/clock.c         |  126 +++++++++++++++----------
 arch/arm/mach-s5pc100/clock.c         |  130 ++++++++++++++++----------
 arch/arm/mach-s5pv210/clock.c         |  167 ++++++++++++++++++++-------------
 arch/arm/plat-s3c24xx/s3c2443-clock.c |   15 ++-
 6 files changed, 359 insertions(+), 235 deletions(-)
arch/arm/mach-exynos4/clock.c +0 -0
index 9f50e33..c6383b9 100644
@@ -1157,42 +1157,6 @@ static struct clksrc_clk clksrcs[] = {
              .reg_div = { .reg = S5P_CLKDIV_MFC, .shift = 0, .size = 4 },

...

Quoted 8 lines
Quoted 7 lines

arch/arm/mach-exynos4/clock.c static struct clksrc_clk clk_sclk_uart3 = { · line 1220

Quoted 4 lines
arch/arm/mach-exynos4/clock.c +4 -0
+static struct clksrc_clk clk_sclk_mmc0 = {
+     .clk            = {
+             .name           = "sclk_mmc",
+             .devname        = "s3c-sdhci.0",

Would it make sense to drop this 'devname' field here and others until sclk_mmc3 ....

Quoted 7 lines
Quoted 2 lines

*** The devname here distinguishes these clocks. So it should be okay to have a devname for these clocks.

I'm not sure what's Mr Kukjin's opinion on that, but I personally would really like to see all the devname fields disappear from samsung clk data structures. Possibly if all involved people would keep that in mind we could achieve this over time.

Quoted 3 lines

**** Devname field is still required for clocks like hsmmc for driver to work fine. Hence it would be tough to remove the devname completely.

Yes, it allowed to add clkdev support with minimal changes required.

But let's see what happens when the works on common struct clk for all architectures are more or less completed and we convert Samsung platforms to use it;)

Regards,

Signature · 2 lines
Sylwester Nawrocki
Samsung Poland R&D Center
#9 lore raw

PATCH v4 3/3 ARM: SAMSUNG: Add lookup of sdhci-s3c clocks using generic names

Quoted 5 lines · Sylwester Nawrocki

Yes, it allowed to add clkdev support with minimal changes required.

But let's see what happens when the works on common struct clk for all architectures are more or less completed and we convert Samsung platforms to use it;)

The common struct clk shouldn't have much to do with the clkdev part of it - clkdev just provides a method to associate a struct clk with the drivers request. The common struct clk doesn't change that.

#10 lore raw

PATCH v4 3/3 ARM: SAMSUNG: Add lookup of sdhci-s3c clocks using generic names

Quoted 10 lines · Russell King - ARM Linux
Quoted 5 lines · Sylwester Nawrocki

Yes, it allowed to add clkdev support with minimal changes required.

But let's see what happens when the works on common struct clk for all architectures are more or less completed and we convert Samsung platforms to use it;)

The common struct clk shouldn't have much to do with the clkdev part of it - clkdev just provides a method to associate a struct clk with the drivers request. The common struct clk doesn't change that.

Indeed. I was just wondering where we end up with the arch struct clk attribute which is specific to clkdev processes.
It could just go into the hardware-specific data, although it doesn't sound like a perfectly right approach.