public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* twl4030 - converting to new I2C style
@ 2007-06-11 11:54 Trilok Soni
  2007-06-29  4:17 ` Syed Mohammed, Khasim
  2007-06-29 17:26 ` David Brownell
  0 siblings, 2 replies; 4+ messages in thread
From: Trilok Soni @ 2007-06-11 11:54 UTC (permalink / raw)
  To: David Brownell, Linux OMAP

David,

I would like to convert twl4030_core.c (driver for TWL4030 chip
available on OMAP2430/3430 TI EVM) [1] to new I2C style bindings. But
it doesn't look straightforward to me compared to menelaus, because

* this chip can decode upto four slave addresses (0x48, 0x49, 0x4A,
0x4B), which we can consider as four different module chips inside one
twl4030.

Now as per new I2C style, we bind one i2c_driver with one client,
matching it (i2c_match) based on it's name in I2C_BOARD_INFO to the
driver name in order to call probe on that.

Now mapping the same concept here we have four clients which should
have different name which registering with i2c_regsiter_board_info,
like this ?

+static struct i2c_board_info __initdata sdp2430_i2c_board_info[] = {
+       {
+               I2C_BOARD_INFO("twl4030:0", 0x48),
+       },
+       {
+               I2C_BOARD_INFO("twl4030:1", 0x49),
+       },
+       {
+               I2C_BOARD_INFO("twl4030:2", 0x4A),
+       },
+       {
+               I2C_BOARD_INFO("twl4030:3", 0x4B),
+       },
+};
+

OR should we keep the same name as in i2c_driver.driver.name for all
four clients above?

[1]
http://source.mvista.com/git/gitweb.cgi?p=linux-omap-2.6.git;a=blob;f=drivers/i2c/chips/twl4030_core.c;h=6123ce893ee731d5fcb0ed3467066e79f3c29571;hb=HEAD
-- 
--Trilok Soni

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: twl4030 - converting to new I2C style
  2007-06-11 11:54 twl4030 - converting to new I2C style Trilok Soni
@ 2007-06-29  4:17 ` Syed Mohammed, Khasim
  2007-07-02  5:16   ` Trilok Soni
  2007-06-29 17:26 ` David Brownell
  1 sibling, 1 reply; 4+ messages in thread
From: Syed Mohammed, Khasim @ 2007-06-29  4:17 UTC (permalink / raw)
  To: Trilok Soni, David Brownell, Linux OMAP

Hi David / Trilok,

>-----Original Message-----
>From: linux-omap-open-source-bounces@linux.omap.com [mailto:linux-omap-
>open-source-bounces@linux.omap.com] On Behalf Of Trilok Soni
>Sent: Monday, June 11, 2007 6:55 AM
>To: David Brownell; Linux OMAP
>Subject: twl4030 - converting to new I2C style
>
<snip>

Is there any update on this? I would like to repost 3430 patch set along with TWL4030 driver (as 3430 SDP uses TWL4030). I can correct the driver as required by new model.

Thanks.

Regards,
Khasim

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: twl4030 - converting to new I2C style
  2007-06-11 11:54 twl4030 - converting to new I2C style Trilok Soni
  2007-06-29  4:17 ` Syed Mohammed, Khasim
@ 2007-06-29 17:26 ` David Brownell
  1 sibling, 0 replies; 4+ messages in thread
From: David Brownell @ 2007-06-29 17:26 UTC (permalink / raw)
  To: Trilok Soni; +Cc: Linux OMAP

On Monday 11 June 2007, Trilok Soni wrote:
> David,
> 
> I would like to convert twl4030_core.c (driver for TWL4030 chip
> available on OMAP2430/3430 TI EVM) [1] to new I2C style bindings. But
> it doesn't look straightforward to me compared to menelaus, because
> 
> * this chip can decode upto four slave addresses (0x48, 0x49, 0x4A,
> 0x4B), which we can consider as four different module chips inside one
> twl4030.

I'm assuming it makes no sense to have four different
drivers here ... right?

FWIW a similar issue comes up with 24c00 EEPROMs, which
take eight addresses for no good reason, and some larger
EEPROMS (which use 2, or 4, or 8 addresses to grow more
address space, which seem like decent reasons overall).


> Now as per new I2C style, we bind one i2c_driver with one client,
> matching it (i2c_match) based on it's name in I2C_BOARD_INFO to the
> driver name in order to call probe on that.
> 
> Now mapping the same concept here we have four clients which should
> have different name which registering with i2c_regsiter_board_info,
> like this ?
> 
> +static struct i2c_board_info __initdata sdp2430_i2c_board_info[] = {
> +       {
> +               I2C_BOARD_INFO("twl4030:0", 0x48),
> +       },
> +       {
> +               I2C_BOARD_INFO("twl4030:1", 0x49),
> +       },
> +       {
> +               I2C_BOARD_INFO("twl4030:2", 0x4A),
> +       },
> +       {
> +               I2C_BOARD_INFO("twl4030:3", 0x4B),
> +       },
> +};
> +
> 
> OR should we keep the same name as in i2c_driver.driver.name for all
> four clients above?

I'd use the same name, unless four different drivers really
makes sense.  Your probe() would likely need to look at the
address it's given and then do some magic to hook up to the
other devices sharing that address ... the USB approach
doesn't quite work here, since when you're probed several
of those interfaces may not yet exist.

What I question is whether all four addresses should be listed
in the boardinfo table.  That's one of several defensible
stances; probably not the easiest one to work with though.
I'd suggest asking (on the i2c list) whether anyone has a
better proposal for how to handle such chips.

- Dave



> [1]
> http://source.mvista.com/git/gitweb.cgi?p=linux-omap-2.6.git;a=blob;f=drivers/i2c/chips/twl4030_core.c;h=6123ce893ee731d5fcb0ed3467066e79f3c29571;hb=HEAD
> -- 
> --Trilok Soni
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: twl4030 - converting to new I2C style
  2007-06-29  4:17 ` Syed Mohammed, Khasim
@ 2007-07-02  5:16   ` Trilok Soni
  0 siblings, 0 replies; 4+ messages in thread
From: Trilok Soni @ 2007-07-02  5:16 UTC (permalink / raw)
  To: Syed Mohammed, Khasim; +Cc: Linux OMAP

Syed,

On 6/29/07, Syed Mohammed, Khasim <x0khasim@ti.com> wrote:
> Hi David / Trilok,
>
> >-----Original Message-----
> >From: linux-omap-open-source-bounces@linux.omap.com [mailto:linux-omap-
> >open-source-bounces@linux.omap.com] On Behalf Of Trilok Soni
> >Sent: Monday, June 11, 2007 6:55 AM
> >To: David Brownell; Linux OMAP
> >Subject: twl4030 - converting to new I2C style
> >
> <snip>
>
> Is there any update on this? I would like to repost 3430 patch set along with TWL4030 driver (as 3430 SDP uses TWL4030). I can correct the driver as required by new model.
>

Until, we ask i2c list for this particular chip scenario, you better
continue adding 34xx support required for twl4030 for omap-git as per
old-style. Thanx.

-- 
--Trilok Soni

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-07-02  5:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-11 11:54 twl4030 - converting to new I2C style Trilok Soni
2007-06-29  4:17 ` Syed Mohammed, Khasim
2007-07-02  5:16   ` Trilok Soni
2007-06-29 17:26 ` David Brownell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox