OTOH, if that is true, we shouldn't select SOFTWARE_I2C from a driver
because it disables platform_i2c_tansfer() and who knows when it is
needed?

CONFIG(SOFTWARE_I2C) only says that the software I2C code is compiled in, it doesn't mean you can't still use hardware I2C controllers. The way it's designed right now it will still always use hardware by default unless you explicitly enable software I2C (by setting the software_i2c[bus] pointer to something non-NULL).

I see, now. Missed that a software I2C bus must be registered to override
a hardware one. It's just the way it's used here that confuses me too much.


> > My current hunch would be to redesign software i2c so one can use it
> > to implement i2c_bus. And deprecate i2c_simple anyway for everything
> > that might remotely have a second controller chip on board.
>
> I'll have a look at this next year.

i2c_simple is still used for all non-x86 devices, and we'll probably want to keep it that way since i2c_bus is specific to devicetree, which is only used on x86. Making software I2C a possible backend for i2c_bus sounds reasonable, but please don't kill i2c_simple.

Yeah, that's why I wrote "for everything that might remotely have a second
controller chip on board". I know there are some simple SoC based boards that
don't need the devicetree complexity. But for all cases where you want to
support multiple chips with one interface, dt is just the way to go, imo.

View Change

To view, visit change 35726. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I7803566b64158405efc04a39f80a0ec98b44e646
Gerrit-Change-Number: 35726
Gerrit-PatchSet: 14
Gerrit-Owner: Patrick Rudolph <patrick.rudolph@9elements.com>
Gerrit-Reviewer: Arthur Heymans <arthur@aheymans.xyz>
Gerrit-Reviewer: Christian Walter <christian.walter@9elements.com>
Gerrit-Reviewer: Julius Werner <jwerner@chromium.org>
Gerrit-Reviewer: Martin Roth <martinroth@google.com>
Gerrit-Reviewer: Michael Niewöhner
Gerrit-Reviewer: Patrick Georgi <pgeorgi@google.com>
Gerrit-Reviewer: Patrick Rudolph <patrick.rudolph@9elements.com>
Gerrit-Reviewer: Patrick Rudolph <siro@das-labor.org>
Gerrit-Reviewer: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Kyösti Mälkki <kyosti.malkki@gmail.com>
Gerrit-CC: Matt DeVillier <matt.devillier@gmail.com>
Gerrit-CC: Nico Huber <nico.h@gmx.de>
Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-CC: Дмитрий Понаморев <dponamorev@gmail.com>
Gerrit-Comment-Date: Sat, 11 Jan 2020 11:25:47 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment