Skip to contentSkip to conversation

PATCH: Add command support for second I2C controller

U-Boot-Users Ben Warren 2 participants 3 messages May 15, 2006 – May 18, 2006

lore
Share & tools
lore

Ben Warren

author
#0 lore raw

Hello,

Attached is a patch to common/cmd_i2c.c that allows access to two I2C controllers on a board. Note that this doesn't actually change any hardware control - it just enhances the command set and passes more information to whatever version of i2c_read(), i2c_write() etc. that you're using. I've implemented driver changes on MPC8349 hardware, but they're not quite ready for review yet. New definitions:
CONFIG_I2C_2_CTRLS - board has two I2C controllers CFG_I2C2_NOPROBES {} - list of devices on bus 2 to ignore when probing

CHANGELOG:
If CONFIG_I2C_2_CTRLS is defined, the 'chip' parameter of all I2C
commands will accept an optional controller argument.
e.g. 'imd 50.1 0' displays data at offset 0 of controller 1 device 50
'imd 50.2 0' displays data at offset 0 of controller 2 device 50 'iprobe 2' probes for devices on the second bus

regards,
Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CMD_I2C.patch
Type: text/x-patch
Size: 12679 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20060515/5eb0fa18/attachment.bin

#1 lore raw
Quoted 10 lines · In message <[email protected]> you wrote:

Attached is a patch to common/cmd_i2c.c that allows access to two I2C controllers on a board. Note that this doesn't actually change any hardware control - it just enhances the command set and passes more information to whatever version of i2c_read(), i2c_write() etc. that you're using. I've implemented driver changes on MPC8349 hardware, but they're not quite ready for review yet. New definitions:
CONFIG_I2C_2_CTRLS - board has two I2C controllers CFG_I2C2_NOPROBES {} - list of devices on bus 2 to ignore when probing

Quoted 6 lines

CHANGELOG:
If CONFIG_I2C_2_CTRLS is defined, the 'chip' parameter of all I2C
commands will accept an optional controller argument.
e.g. 'imd 50.1 0' displays data at offset 0 of controller 1 device 50
'imd 50.2 0' displays data at offset 0 of controller 2 device 50 'iprobe 2' probes for devices on the second bus

I reject this patch.

As discussed before, I don't like the command format. Second, what happens if there comes a board with 3 I2C busses? Then we touch the code gain... No, thanks.

Also note that your patch has trailing white space, so it violates the coding standard.

Best regards,

Wolfgang Denk

Signature · 3 lines
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A rolling stone gathers momentum.
author
#2 lore raw

Thanks Wolfgang.

I have no idea how you got this again - strange things are afoot with the sourceforge mailing list. Anyway, I'll be on the lookout for traling white space in future submissions.

regards,
Ben

Quoted 24 lines · Wolfgang Denk
Quoted 10 lines · In message <[email protected]> you wrote:

Attached is a patch to common/cmd_i2c.c that allows access to two I2C controllers on a board. Note that this doesn't actually change any hardware control - it just enhances the command set and passes more information to whatever version of i2c_read(), i2c_write() etc. that you're using. I've implemented driver changes on MPC8349 hardware, but they're not quite ready for review yet. New definitions:
CONFIG_I2C_2_CTRLS - board has two I2C controllers CFG_I2C2_NOPROBES {} - list of devices on bus 2 to ignore when probing

Quoted 6 lines

CHANGELOG:
If CONFIG_I2C_2_CTRLS is defined, the 'chip' parameter of all I2C
commands will accept an optional controller argument.
e.g. 'imd 50.1 0' displays data at offset 0 of controller 1 device 50
'imd 50.2 0' displays data at offset 0 of controller 2 device 50 'iprobe 2' probes for devices on the second bus

I reject this patch.

As discussed before, I don't like the command format. Second, what happens if there comes a board with 3 I2C busses? Then we touch the code gain... No, thanks.

Quoted 7 lines

Also note that your patch has trailing white space, so it violates the coding standard.

Best regards,

Wolfgang Denk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.denx.de/pipermail/u-boot/attachments/20060518/f9e499e6/attachment.htm