Skip to contentSkip to conversation

I2C: Rename struct s3c2410_platform_i2c to s3c_platform_i2c

PATCH In review Daniel Silverstone 2 participants 3 messages Feb 12, 2009 1 message not in the archive

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

PATCH 1/1 I2C: Rename struct s3c2410_platform_i2c to s3c_platform_i2c

The I2C driver currently known as i2c-s3c2410 is now used by several different s3cXXXX SoCs. As such, this patch renames the platform data to be SoC agnostic.

---
 arch/arm/mach-s3c2410/mach-bast.c    |    2 +-
 arch/arm/mach-s3c2410/mach-n30.c     |    2 +-
 arch/arm/mach-s3c2412/mach-jive.c    |    2 +-
 arch/arm/plat-s3c/dev-i2c0.c         |    8 ++++----
 arch/arm/plat-s3c/dev-i2c1.c         |    8 ++++----
 arch/arm/plat-s3c/include/plat/iic.h |    8 ++++----
 drivers/i2c/busses/i2c-s3c2410.c     |    6 +++---
 7 files changed, 18 insertions(+), 18 deletions(-)
arch/arm/mach-s3c2410/mach-bast.c +1 -1
Index: b/arch/arm/mach-s3c2410/mach-bast.c
===================================================================
@@ -406,7 +406,7 @@ static struct platform_device bast_sio =
  * standard 100KHz i2c bus frequency
 */
 
-static struct s3c2410_platform_i2c __initdata bast_i2c_info = {
+static struct s3c_platform_i2c __initdata bast_i2c_info = {
 	.flags		= 0,
 	.slave_addr	= 0x10,
 	.frequency	= 100*1000,
arch/arm/mach-s3c2410/mach-n30.c +1 -1
Index: b/arch/arm/mach-s3c2410/mach-n30.c
===================================================================
@@ -337,7 +337,7 @@ static struct platform_device *n35_devic
 	&n35_button_device,
 };
 
-static struct s3c2410_platform_i2c n30_i2ccfg = {
+static struct s3c_platform_i2c n30_i2ccfg = {
 	.flags		= 0,
 	.slave_addr	= 0x10,
 	.frequency	= 10*1000,
arch/arm/mach-s3c2412/mach-jive.c +1 -1
Index: b/arch/arm/mach-s3c2412/mach-jive.c
===================================================================
@@ -452,7 +452,7 @@ static struct spi_board_info __initdata 
 
 /* I2C bus and device configuration. */
 
-static struct s3c2410_platform_i2c jive_i2c_cfg __initdata = {
+static struct s3c_platform_i2c jive_i2c_cfg __initdata = {
 	.frequency	= 80 * 1000,
 	.flags		= S3C_IICFLG_FILTER,
 	.sda_delay	= 2,
arch/arm/plat-s3c/dev-i2c0.c +4 -4
Index: b/arch/arm/plat-s3c/dev-i2c0.c
===================================================================
@@ -47,21 +47,21 @@ struct platform_device s3c_device_i2c0 =
 	.resource	  = s3c_i2c_resource,
 };
 
-static struct s3c2410_platform_i2c default_i2c_data0 __initdata = {
+static struct s3c_platform_i2c default_i2c_data0 __initdata = {
 	.flags		= 0,
 	.slave_addr	= 0x10,
 	.frequency	= 100*1000,
 	.sda_delay	= 100,
 };
 
-void __init s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *pd)
+void __init s3c_i2c0_set_platdata(struct s3c_platform_i2c *pd)
 {
-	struct s3c2410_platform_i2c *npd;
+	struct s3c_platform_i2c *npd;
 
 	if (!pd)
 		pd = &default_i2c_data0;
 
-	npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL);
+	npd = kmemdup(pd, sizeof(struct s3c_platform_i2c), GFP_KERNEL);
 	if (!npd)
 		printk(KERN_ERR "%s: no memory for platform data\n", __func__);
 	else if (!npd->cfg_gpio)
arch/arm/plat-s3c/dev-i2c1.c +4 -4
Index: b/arch/arm/plat-s3c/dev-i2c1.c
===================================================================
@@ -43,7 +43,7 @@ struct platform_device s3c_device_i2c1 =
 	.resource	  = s3c_i2c_resource,
 };
 
-static struct s3c2410_platform_i2c default_i2c_data1 __initdata = {
+static struct s3c_platform_i2c default_i2c_data1 __initdata = {
 	.flags		= 0,
 	.bus_num	= 1,
 	.slave_addr	= 0x10,
@@ -51,14 +51,14 @@ static struct s3c2410_platform_i2c defau
 	.sda_delay	= 100,
 };
 
-void __init s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *pd)
+void __init s3c_i2c1_set_platdata(struct s3c_platform_i2c *pd)
 {
-	struct s3c2410_platform_i2c *npd;
+	struct s3c_platform_i2c *npd;
 
 	if (!pd)
 		pd = &default_i2c_data1;
 
-	npd = kmemdup(pd, sizeof(struct s3c2410_platform_i2c), GFP_KERNEL);
+	npd = kmemdup(pd, sizeof(struct s3c_platform_i2c), GFP_KERNEL);
 	if (!npd)
 		printk(KERN_ERR "%s: no memory for platform data\n", __func__);
 	else if (!npd->cfg_gpio)
arch/arm/plat-s3c/include/plat/iic.h +4 -4
Index: b/arch/arm/plat-s3c/include/plat/iic.h
===================================================================
@@ -16,7 +16,7 @@
 #define S3C_IICFLG_FILTER	(1<<0)	/* enable s3c2440 filter */
 
 /**
- *	struct s3c2410_platform_i2c - Platform data for s3c I2C.
+ *	struct s3c_platform_i2c - Platform data for s3c I2C.
  *	@bus_num: The bus number to use (if possible).
  *	@flags: Any flags for the I2C bus (E.g. S3C_IICFLK_FILTER).
  *	@slave_addr: The I2C address for the slave device (if enabled).
@@ -27,7 +27,7 @@
  *	@sda_delay: The delay (in ns) applied to SDA edges.
  *	@cfg_gpio: A callback to configure the pins for I2C operation.
  */
-struct s3c2410_platform_i2c {
+struct s3c_platform_i2c {
 	int		bus_num;
 	unsigned int	flags;
 	unsigned int	slave_addr;
@@ -52,8 +52,8 @@ struct s3c2410_platform_i2c {
  * NULL to ensure that the device is given the default platform data
  * as the driver will no longer carry defaults.
  */
-extern void s3c_i2c0_set_platdata(struct s3c2410_platform_i2c *i2c);
-extern void s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *i2c);
+extern void s3c_i2c0_set_platdata(struct s3c_platform_i2c *i2c);
+extern void s3c_i2c1_set_platdata(struct s3c_platform_i2c *i2c);
 
 /* defined by architecture to configure gpio */
 extern void s3c_i2c0_cfg_gpio(struct platform_device *dev);
drivers/i2c/busses/i2c-s3c2410.c +3 -3
Index: b/drivers/i2c/busses/i2c-s3c2410.c
===================================================================
@@ -599,7 +599,7 @@ static int s3c24xx_i2c_calcdivisor(unsig
 
 static int s3c24xx_i2c_clockrate(struct s3c24xx_i2c *i2c, unsigned int *got)
 {
-	struct s3c2410_platform_i2c *pdata = i2c->dev->platform_data;
+	struct s3c_platform_i2c *pdata = i2c->dev->platform_data;
 	unsigned long clkin = clk_get_rate(i2c->clk);
 	unsigned int divs, div1;
 	unsigned long target_frequency;
@@ -721,7 +721,7 @@ static inline void s3c24xx_i2c_deregiste
 static int s3c24xx_i2c_init(struct s3c24xx_i2c *i2c)
 {
 	unsigned long iicon = S3C2410_IICCON_IRQEN | S3C2410_IICCON_ACKEN;
-	struct s3c2410_platform_i2c *pdata;
+	struct s3c_platform_i2c *pdata;
 	unsigned int freq;
 
 	/* get the plafrom data */
@@ -770,7 +770,7 @@ static int s3c24xx_i2c_init(struct s3c24
 static int s3c24xx_i2c_probe(struct platform_device *pdev)
 {
 	struct s3c24xx_i2c *i2c;
-	struct s3c2410_platform_i2c *pdata;
+	struct s3c_platform_i2c *pdata;
 	struct resource *res;
 	int ret;
 
Signature · 2 lines
Daniel Silverstone                              http://www.simtec.co.uk/
PGP mail accepted and encouraged.            Key Id: 2BC8 4016 2068 7895
#1 lore raw
Quoted 7 lines · Daniel Silverstone

The I2C driver currently known as i2c-s3c2410 is now used by several different s3cXXXX SoCs. As such, this patch renames the platform data to be SoC agnostic.

Quoted 9 lines
---
 arch/arm/mach-s3c2410/mach-bast.c    |    2 +-
 arch/arm/mach-s3c2410/mach-n30.c     |    2 +-
 arch/arm/mach-s3c2412/mach-jive.c    |    2 +-
 arch/arm/plat-s3c/dev-i2c0.c         |    8 ++++----
 arch/arm/plat-s3c/dev-i2c1.c         |    8 ++++----
 arch/arm/plat-s3c/include/plat/iic.h |    8 ++++----
 drivers/i2c/busses/i2c-s3c2410.c     |    6 +++---
 7 files changed, 18 insertions(+), 18 deletions(-)

This is Ben's call, not mine, but I tend to discourage that kind of changes. For one thing, they cost more than then bring. And for another, they may need to be reverted if incompatible hardware appears in the future.

Personally, I read "s3c2410" in these structure names as "S3C 2410 and compatible", so it looks perfectly right to me, I don't see this as something which needs to be changed.

Signature · 1 line
Jean Delvare

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 7 lines · Jean Delvare
Quoted 3 lines

The I2C driver currently known as i2c-s3c2410 is now used by several different s3cXXXX SoCs. As such, this patch renames the platform data to be SoC agnostic.

This is Ben's call, not mine, but I tend to discourage that kind of changes. For one thing, they cost more than then bring. And for another, they may need to be reverted if incompatible hardware appears in the future.

The same I2C controller is found throughout Samsung's s3c24xx and 64xx range. I doubt they'll introduce wildly incompatible peripherals in the same range.

Quoted 3 lines

Personally, I read "s3c2410" in these structure names as "S3C 2410 and compatible", so it looks perfectly right to me, I don't see this as something which needs to be changed.

Whereas I see it as "s3c2410" or at most liberal, "s3c241x". Given there's a family of 10 or more chips which all use this i2c controller, only 4 of which could plausibly be thought of as a 2410 (2410, 2412, 2413, 2416) it seems disingenuously named as-is. The confusion which could ensue (and indeed *does* ensue with some of our customers) seems worth trying to avoid.

D.

Signature · 2 lines
Daniel Silverstone                              http://www.simtec.co.uk/
PGP mail accepted and encouraged.            Key Id: 2BC8 4016 2068 7895