* [PATCH] I2C: Rename struct s3c2410_platform_i2c to s3c_platform_i2c
@ 2009-02-12 13:49 Daniel Silverstone
2009-02-12 14:05 ` Jean Delvare
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Silverstone @ 2009-02-12 13:49 UTC (permalink / raw)
To: linux-i2c-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-xIg/pKzrS19vn6HldHNs0ANdhmdF6hFW
Cc: ben-linux-elnMNo+KYs3YtjvyW6yDsg
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.
Signed-Off-By: Simtec Linux Team <linux-Y5A6D6n0/KfQXOPxS62xeg@public.gmane.org>
Signed-Off-By: Daniel Silverstone <dsilvers-Y5A6D6n0/KfQXOPxS62xeg@public.gmane.org>
---
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(-)
Index: b/arch/arm/mach-s3c2410/mach-bast.c
===================================================================
--- a/arch/arm/mach-s3c2410/mach-bast.c 2009-02-12 10:24:29.394616021 +0000
+++ b/arch/arm/mach-s3c2410/mach-bast.c 2009-02-12 10:25:34.834613727 +0000
@@ -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,
Index: b/arch/arm/mach-s3c2410/mach-n30.c
===================================================================
--- a/arch/arm/mach-s3c2410/mach-n30.c 2009-02-12 10:24:29.410614435 +0000
+++ b/arch/arm/mach-s3c2410/mach-n30.c 2009-02-12 10:25:34.834613727 +0000
@@ -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,
Index: b/arch/arm/mach-s3c2412/mach-jive.c
===================================================================
--- a/arch/arm/mach-s3c2412/mach-jive.c 2009-02-12 10:24:29.430615021 +0000
+++ b/arch/arm/mach-s3c2412/mach-jive.c 2009-02-12 10:25:34.879282354 +0000
@@ -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,
Index: b/arch/arm/plat-s3c/dev-i2c0.c
===================================================================
--- a/arch/arm/plat-s3c/dev-i2c0.c 2009-02-12 10:24:29.450615087 +0000
+++ b/arch/arm/plat-s3c/dev-i2c0.c 2009-02-12 10:25:34.896066163 +0000
@@ -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)
Index: b/arch/arm/plat-s3c/dev-i2c1.c
===================================================================
--- a/arch/arm/plat-s3c/dev-i2c1.c 2009-02-12 10:24:29.466616700 +0000
+++ b/arch/arm/plat-s3c/dev-i2c1.c 2009-02-12 10:25:34.914112380 +0000
@@ -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)
Index: b/arch/arm/plat-s3c/include/plat/iic.h
===================================================================
--- a/arch/arm/plat-s3c/include/plat/iic.h 2009-02-12 10:24:29.502615860 +0000
+++ b/arch/arm/plat-s3c/include/plat/iic.h 2009-02-12 10:25:34.938112460 +0000
@@ -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);
Index: b/drivers/i2c/busses/i2c-s3c2410.c
===================================================================
--- a/drivers/i2c/busses/i2c-s3c2410.c 2009-02-12 10:24:29.530615073 +0000
+++ b/drivers/i2c/busses/i2c-s3c2410.c 2009-02-12 10:25:34.954113072 +0000
@@ -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;
--
Daniel Silverstone http://www.simtec.co.uk/
PGP mail accepted and encouraged. Key Id: 2BC8 4016 2068 7895
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] I2C: Rename struct s3c2410_platform_i2c to s3c_platform_i2c
2009-02-12 13:49 [PATCH] I2C: Rename struct s3c2410_platform_i2c to s3c_platform_i2c Daniel Silverstone
@ 2009-02-12 14:05 ` Jean Delvare
[not found] ` <20090212150527.2d8031ad-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Jean Delvare @ 2009-02-12 14:05 UTC (permalink / raw)
To: dsilvers-Y5A6D6n0/KfQXOPxS62xeg
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-xIg/pKzrS19vn6HldHNs0ANdhmdF6hFW,
ben-linux-elnMNo+KYs3YtjvyW6yDsg
On Thu, 12 Feb 2009 13:49:30 +0000, Daniel Silverstone wrote:
> 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.
>
> Signed-Off-By: Simtec Linux Team <linux-Y5A6D6n0/KfQXOPxS62xeg@public.gmane.org>
> Signed-Off-By: Daniel Silverstone <dsilvers-Y5A6D6n0/KfQXOPxS62xeg@public.gmane.org>
>
> ---
> 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.
--
Jean Delvare
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] I2C: Rename struct s3c2410_platform_i2c to s3c_platform_i2c
[not found] ` <20090212150527.2d8031ad-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
@ 2009-02-12 14:24 ` Daniel Silverstone
0 siblings, 0 replies; 3+ messages in thread
From: Daniel Silverstone @ 2009-02-12 14:24 UTC (permalink / raw)
To: Jean Delvare
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-xIg/pKzrS19vn6HldHNs0ANdhmdF6hFW,
ben-linux-elnMNo+KYs3YtjvyW6yDsg
On Thu, 2009-02-12 at 15:05 +0100, Jean Delvare wrote:
> > 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.
> 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.
--
Daniel Silverstone http://www.simtec.co.uk/
PGP mail accepted and encouraged. Key Id: 2BC8 4016 2068 7895
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-02-12 14:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-12 13:49 [PATCH] I2C: Rename struct s3c2410_platform_i2c to s3c_platform_i2c Daniel Silverstone
2009-02-12 14:05 ` Jean Delvare
[not found] ` <20090212150527.2d8031ad-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-02-12 14:24 ` Daniel Silverstone
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox