public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Dirk Behme <dirk.behme@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Add I2C multibus support for OMAP2/3 boards
Date: Mon, 02 Nov 2009 20:32:54 +0100	[thread overview]
Message-ID: <4AEF33E6.2030104@googlemail.com> (raw)
In-Reply-To: <4AEE8A1A.8000607@denx.de>

Hi Heiko,

Heiko Schocher wrote:
> Dirk Behme wrote:
>> I would remove the following three functions as they are not needed at
>> the moment (i.e. without command line interface).
> 
> Hmm... really? If someone uses multibus support,
> this functions are needed, or?

Well, most probably yes. But I was not really looking for multibus 
support ;)

The functionality needed for Zippy I'm currently working on is just to 
be able to do

i2c_get_bus_num(1); /* Switch to bus 1 */
... do some stuff on bus 1 ...
i2c_get_bus_num(0); /* Switch back to default bus 0 */

And for this having only i2c_get_bus_num() is sufficient. And the only 
tested ;)

>>> +unsigned int i2c_get_bus_num(void)
>>> +{
>>> +    if (i2c == (i2c_t *)I2C_BASE1)
>>> +        return 0;
>>> +    else
>>> +    if (i2c == (i2c_t *)I2C_BASE2)
>>> +        return 1;
>>> +#if defined(CONFIG_OMAP34XX)
>>> +    else
>>> +    if (i2c == (i2c_t *)I2C_BASE3)
>>> +        return 2;
>>> +#endif
>>> +    else
>>> +        return 0xFFFFFFFF;
>>> +}
>>> +
>>> +/*
>>> + * To be Implemented
>>> + */
>>> +int i2c_set_bus_speed(unsigned int speed)
>>> +{
>>> +    return 0;
>>> +}
>>> +
>>> +unsigned int i2c_get_bus_speed(void)
>>> +{
>>> +    return 0;
>>> +}
>>> +
...
>> While all above are only style questions, what's about the main
>> functionality topic:
>>
>> Do we have to call i2c_init() for bus 1 and 2 if switching to it? If
>> yes, who does it? For bus 0 it's already in the code. I'd like that the
>> user doesn't have to care about it. Therefore, I added
> 
> I solved this in the multibus_v2 branch, see:
> 
> http://git.denx.de/?p=u-boot/u-boot-i2c.git;a=shortlog;h=refs/heads/multibus_v2

Looks like we have to merge that with what is in this patch somehow. 
What are your plans with that branch? Is it intended to go into 
mainline, soon?

It seems to me that multibus_v2 and this patch are somehow orthogonal 
(but yes, they will need some merging).
Regarding omap24xx_i2c.c, multibus_v2 seems to deal mainly with the 
API stuff

http://git.denx.de/?p=u-boot/u-boot-i2c.git;a=blobdiff;f=drivers/i2c/omap24xx_i2c.c;h=993b995d34a298d07fbd11bce23f2d0cfdebb40f;hp=1a4c8c9ad2701b550fc1ad0ab2a9fde741902080;hb=899dbf9fbd089a9e8133026be3817e0116f44390;hpb=24d3d6307e1e5d5cddddee399a15e70ef9da8818

while the main part of this patch is to replace all hard coded 
registers by the ability to switch to an other bus.

I will send an updated patch with fixing at least the review comments, 
soon.

Best regards

Dirk

  reply	other threads:[~2009-11-02 19:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-01  1:52 [U-Boot] Better I2C support for OMAP Tom Rix
2009-11-01  1:52 ` [U-Boot] [PATCH] Add I2C multibus support for OMAP2/3 boards Tom Rix
2009-11-01  8:24   ` Dirk Behme
2009-11-01 12:43     ` Tom
2009-11-01 17:09       ` Tom
2009-11-02  7:28     ` Heiko Schocher
2009-11-02 19:32       ` Dirk Behme [this message]
2009-11-05  6:25         ` Heiko Schocher
2009-11-05  6:35           ` Dirk Behme
2009-11-05  6:50             ` Heiko Schocher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AEF33E6.2030104@googlemail.com \
    --to=dirk.behme@googlemail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox