Skip to content

Bring in new I2C framework

Tom Rini u-boot 1 version New

Get series with b4
b4 am 20121031052001.GJ15024@bill-the-cat

Versions newest first

  1. v1 Latest0 of 3 patches 0 repliesNew

Patches in v1 No applies recorded yet

None of the 3 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [U-Boot] [PATCH 0/3] Bring in new I2C framework
Quoted 48 lines · Simon Glass

Hi,

Quoted 39 lines · Stephen Warren
Quoted 3 lines · Heiko Schocher

Hello Stephen,

On 29.10.2012 16:34, Stephen Warren wrote:

...

Quoted 34 lines
Quoted 4 lines

If there are e.g. 4 I2C controllers in an SoC, the driver needs to know which one is in use. Passing that information directly to the driver functions is much simple than requiring the SoC I2C driver to go grovel in some I2C core global variables to find out the same information.

Ah, do you mean we should change the i2c adapter struct from:

struct i2c_adapter {
       void            (*init)(int speed, int slaveaddr);
       int             (*probe)(uint8_t chip);
       int             (*read)(uint8_t chip, uint addr, int alen,
                               uint8_t *buffer, int len);
       int             (*write)(uint8_t chip, uint addr, int alen,
                               uint8_t *buffer, int len);
       uint            (*set_bus_speed)(uint speed);

[...]

to

struct i2c_adapter {
void (*init)(struct i2c_adapter *adap, int speed, int
slaveaddr);
int (*probe)(struct i2c_adapter *adap, uint8_t chip);
int (*read)(struct i2c_adapter *adap, uint8_t chip,
uint addr, int alen,
uint8_t *buffer, int len);
int (*write)(struct i2c_adapter *adap, uint8_t chip,
uint addr, int alen,
uint8_t *buffer, int len);
uint (*set_bus_speed)(struct i2c_adapter *adap, uint
speed);
[...]
?

Quoted 5 lines
Quoted 1 line

We can do this. Simon suggested this too ...

Yes, exactly. (the functions will need some way to get information out of the struct i2c_adapter; I assume there's some kind of driver_private field in there too).

Quoted 8 lines

Yes.

I will post a few patches to move Tegra over to the new framework as it is, so that people can see the impact. Given that every driver has to change, it would be my preference to set the i2c API once. But I suppose within a short while everything will move to the device model, so perhaps the job of this series is just to move things in the right direction?

Funny enough I don't see a UDM-i2c.txt file, so I guess the community gets to think about that one :)

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20121030/48d42ea8/attachment.pgp>