Skip to contentSkip to conversation

i2c: Add SDA and SCL pin numbers to i2c platform data

PATCH In review Philby John 4 participants 5 messages Jan 12, 2010 – Feb 5, 2010 3 messages not in the archive

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

PATCH v3 1/2 i2c: Add SDA and SCL pin numbers to i2c platform data

Quoted 1 line

From cb3347e45449ff16a332aa164eae24ef6a2432e6 Mon Sep 17 00:00:00 2001

From: Philby John <pjohn-k0rHJ+Hhz/[email protected]>
Date: Mon, 11 Jan 2010 15:53:31 +0530
Subject: [PATCH 1/2] Add SDA and SCL pin numbers to i2c platform data

Patch adds SDA and SCL pin numbers to the i2c platform data structure for Davinci DM355 and DM6446. This at present is used for i2c bus recovery.
TODO: Add SDA and SCL pin number information to include all Davinci platforms such as dm355-leopard, dm365, dm646x, da8xx etc.

---
 arch/arm/mach-davinci/board-dm355-evm.c  |    2 ++
 arch/arm/mach-davinci/board-dm644x-evm.c |    2 ++
 arch/arm/mach-davinci/include/mach/i2c.h |    2 ++
 3 files changed, 6 insertions(+), 0 deletions(-)
arch/arm/mach-davinci/board-dm355-evm.c +2 -0
index 077ecf4..aa48e3f 100644
@@ -111,6 +111,8 @@ static struct platform_device davinci_nand_device = {
 static struct davinci_i2c_platform_data i2c_pdata = {
 	.bus_freq	= 400	/* kHz */,
 	.bus_delay	= 0	/* usec */,
+	.sda_pin        = 15,
+	.scl_pin        = 14,
 };
 
 static struct snd_platform_data dm355_evm_snd_data;
arch/arm/mach-davinci/board-dm644x-evm.c +2 -0
index e9612cf..976e11b 100644
@@ -629,6 +629,8 @@ static struct i2c_board_info __initdata i2c_info[] =  {
 static struct davinci_i2c_platform_data i2c_pdata = {
 	.bus_freq	= 20 /* kHz */,
 	.bus_delay	= 100 /* usec */,
+	.sda_pin        = 44,
+	.scl_pin        = 43,
 };
 
 static void __init evm_init_i2c(void)
arch/arm/mach-davinci/include/mach/i2c.h +2 -0
index c248e9b..39fdcea 100644
@@ -16,6 +16,8 @@
 struct davinci_i2c_platform_data {
 	unsigned int	bus_freq;	/* standard bus frequency (kHz) */
 	unsigned int	bus_delay;	/* post-transaction delay (usec) */
+	unsigned int    sda_pin;        /* GPIO pin ID to use for SDA */
+	unsigned int    scl_pin;        /* GPIO pin ID to use for SCL */
 };
 
 /* for board setup code */
Signature · 1 line
1.6.3.3.MVISTA

A message that is not in the archive (sent off-list or not yet received): 1263295031.3437.16.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected]

#2 lore raw

Kevin,

Quoted 10 lines · Philby John
Quoted 1 line

From cb3347e45449ff16a332aa164eae24ef6a2432e6 Mon Sep 17 00:00:00 2001

From: Philby John <pjohn-k0rHJ+Hhz/[email protected]>
Date: Mon, 11 Jan 2010 15:53:31 +0530
Subject: [PATCH 1/2] Add SDA and SCL pin numbers to i2c platform data

Patch adds SDA and SCL pin numbers to the i2c platform data structure for Davinci DM355 and DM6446. This at present is used for i2c bus recovery.
TODO: Add SDA and SCL pin number information to include all Davinci platforms such as dm355-leopard, dm365, dm646x, da8xx etc.

Will this be included in your next pull? My concern was [PATCH v3 2/2] would fail as it depends on data structures in this patch least it be pulled into the i2c git repo by Jean, though chances of that happening are highly unlikely. Would like to follow up with Jean once you include this into your tree.

Thanks,
Philby

A message that is not in the archive (sent off-list or not yet received): 1263974661.3546.103.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected]

#4 lore raw
Quoted 15 lines · Philby John

Kevin,

Quoted 10 lines · Philby John
Quoted 1 line

From cb3347e45449ff16a332aa164eae24ef6a2432e6 Mon Sep 17 00:00:00 2001

From: Philby John <pjohn-k0rHJ+Hhz/[email protected]>
Date: Mon, 11 Jan 2010 15:53:31 +0530
Subject: [PATCH 1/2] Add SDA and SCL pin numbers to i2c platform data

Patch adds SDA and SCL pin numbers to the i2c platform data structure for Davinci DM355 and DM6446. This at present is used for i2c bus recovery.
TODO: Add SDA and SCL pin number information to include all Davinci platforms such as dm355-leopard, dm365, dm646x, da8xx etc.

Quoted 5 lines

Will this be included in your next pull? My concern was [PATCH v3 2/2] would fail as it depends on data structures in this patch least it be pulled into the i2c git repo by Jean, though chances of that happening are highly unlikely. Would like to follow up with Jean once you include this into your tree.

Hello,

This looks good, I will queue in davinci-next for 2.6.34.

Kevin

#5 lore raw
In reply to a message not in the archive

Hi Philby,

Quoted 49 lines · Philby John
Quoted 1 line

From cb3347e45449ff16a332aa164eae24ef6a2432e6 Mon Sep 17 00:00:00 2001

From: Philby John <pjohn-k0rHJ+Hhz/[email protected]>
Date: Mon, 11 Jan 2010 15:53:31 +0530
Subject: [PATCH 1/2] Add SDA and SCL pin numbers to i2c platform data

Patch adds SDA and SCL pin numbers to the i2c platform data structure for Davinci DM355 and DM6446. This at present is used for i2c bus recovery.
TODO: Add SDA and SCL pin number information to include all Davinci platforms such as dm355-leopard, dm365, dm646x, da8xx etc.

---
 arch/arm/mach-davinci/board-dm355-evm.c  |    2 ++
 arch/arm/mach-davinci/board-dm644x-evm.c |    2 ++
 arch/arm/mach-davinci/include/mach/i2c.h |    2 ++
 3 files changed, 6 insertions(+), 0 deletions(-)
arch/arm/mach-davinci/board-dm355-evm.c +2 -0
index 077ecf4..aa48e3f 100644
@@ -111,6 +111,8 @@ static struct platform_device davinci_nand_device = {
 static struct davinci_i2c_platform_data i2c_pdata = {
      .bus_freq       = 400   /* kHz */,
      .bus_delay      = 0     /* usec */,
+     .sda_pin        = 15,
+     .scl_pin        = 14,
 };
 
 static struct snd_platform_data dm355_evm_snd_data;
arch/arm/mach-davinci/board-dm644x-evm.c +2 -0
index e9612cf..976e11b 100644
@@ -629,6 +629,8 @@ static struct i2c_board_info __initdata i2c_info[] =  {
 static struct davinci_i2c_platform_data i2c_pdata = {
      .bus_freq       = 20 /* kHz */,
      .bus_delay      = 100 /* usec */,
+     .sda_pin        = 44,
+     .scl_pin        = 43,
 };
 
 static void __init evm_init_i2c(void)
arch/arm/mach-davinci/include/mach/i2c.h +0 -0
index c248e9b..39fdcea 100644

arch/arm/mach-davinci/include/mach/i2c.h line 19

Quoted 4 lines
arch/arm/mach-davinci/include/mach/i2c.h +1 -0
@@ -16,6 +16,8 @@
 struct davinci_i2c_platform_data {
      unsigned int    bus_freq;       /* standard bus frequency (kHz) */
      unsigned int    bus_delay;      /* post-transaction delay (usec) */
+     unsigned int    sda_pin;        /* GPIO pin ID to use for SDA */

It doesn't look like you need the SDA pin to be a GPIO in patch 2/2 - can you drop it from platform data in that case?

Thanks,
Sekhar

Quoted 14 lines
arch/arm/mach-davinci/include/mach/i2c.h +1 -1
+     unsigned int    scl_pin;        /* GPIO pin ID to use for SCL */
 };
 
 /* for board setup code */
--

1.6.3.3.MVISTA

_______________________________________________
Davinci-linux-open-source mailing list Davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

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

#7 lore raw

Hello Sekhar,

Quoted 46 lines · Sekhar

Hi Philby,

Quoted 43 lines · Philby John
Quoted 1 line

From cb3347e45449ff16a332aa164eae24ef6a2432e6 Mon Sep 17 00:00:00 2001

From: Philby John <pjohn-k0rHJ+Hhz/[email protected]>
Date: Mon, 11 Jan 2010 15:53:31 +0530
Subject: [PATCH 1/2] Add SDA and SCL pin numbers to i2c platform data

Patch adds SDA and SCL pin numbers to the i2c platform data structure for Davinci DM355 and DM6446. This at present is used for i2c bus recovery.
TODO: Add SDA and SCL pin number information to include all Davinci platforms such as dm355-leopard, dm365, dm646x, da8xx etc.

---
 arch/arm/mach-davinci/board-dm355-evm.c  |    2 ++ arch/arm/mach-davinci/board-dm644x-evm.c |    2 ++ arch/arm/mach-davinci/include/mach/i2c.h |    2 ++

 3 files changed, 6 insertions(+), 0 deletions(-)
arch/arm/mach-davinci/board-dm355-evm.c +2 -0
index 077ecf4..aa48e3f 100644
@@ -111,6 +111,8 @@ static struct platform_device davinci_nand_device = {
  static struct davinci_i2c_platform_data i2c_pdata = {
       .bus_freq       = 400   /* kHz */,
       .bus_delay      = 0     /* usec */,
+     .sda_pin        = 15,
+     .scl_pin        = 14,
  };
 
  static struct snd_platform_data dm355_evm_snd_data;
arch/arm/mach-davinci/board-dm644x-evm.c +2 -0
index e9612cf..976e11b 100644
@@ -629,6 +629,8 @@ static struct i2c_board_info __initdata i2c_info[] =  {
  static struct davinci_i2c_platform_data i2c_pdata = {
       .bus_freq       = 20 /* kHz */,
       .bus_delay      = 100 /* usec */,
+     .sda_pin        = 44,
+     .scl_pin        = 43,
  };
 
Quoted 14 lines
Quoted 10 lines
arch/arm/mach-davinci/board-dm644x-evm.c +0 -0
  static void __init evm_init_i2c(void)
arch/arm/mach-davinci/include/mach/i2c.h +0 -0
index c248e9b..39fdcea 100644
@@ -16,6 +16,8 @@
  struct davinci_i2c_platform_data {

      unsigned int    bus_freq;       /* standard bus frequency (kHz) */ unsigned int    bus_delay;      /* post-transaction delay (usec) */
+     unsigned int    sda_pin;        /* GPIO pin ID to use for SDA */

It doesn't look like you need the SDA pin to be a GPIO in patch 2/2 - can you drop it from platform data in that case?

Yes, SDA pin can be dropped. I merely added it for the sake of completeness.

Regards,
Philby