From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hans de Goede Date: Tue, 07 Apr 2015 11:09:08 +0200 Subject: [U-Boot] [PATCH v3 0/3] i2c: sunxi: Support every i2c controller on each supported platform In-Reply-To: <1428393085.2527.11.camel@collins> References: <1428220288-3829-1-git-send-email-contact@paulk.fr> <5520F5E0.80406@redhat.com> <1428267580.2501.22.camel@collins> <1428393085.2527.11.camel@collins> Message-ID: <55239EB4.30502@redhat.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, On 07-04-15 09:51, Paul Kocialkowski wrote: > Le dimanche 05 avril 2015 ? 22:59 +0200, Paul Kocialkowski a ?crit : >> Hi Hans, >> >> Le dimanche 05 avril 2015 ? 10:44 +0200, Hans de Goede a ?crit : >>> Hi, > > [snip] > >>> Thanks for your work on this, may I request one more change ? For sunxi I would >>> like to also see a CONFIG_I2C0_ENABLE, the reason for this is that on sun6i / sun8i >>> we do not really use i2c0 as we use p2wi resp. rsb to talk to the axp pmic there. >>> >>> This way we will not end up messing with the muxing of the PH14/15 (sun6i) resp. >>> PH2/3 (sun8i) which may be used in some other fashion. >>> >>> This also means making a small change to the first patch to also make registering >>> of twsi0 #ifdef CONFIG_I2C_MVTWSI_BASE0 . >>> >>> Can you please make the default for CONFIG_I2C0_ENABLE y on sun4i / sun5i / sun7i and n >>> on others? >> >> Ack that, it makes sense to me. > > Implementing this leads to build errors: > drivers/i2c/mvtwsi.c:319:13: attention : ?twsi_i2c_init? defined but not > used [-Wunused-function] > drivers/i2c/mvtwsi.c:362:12: attention : ?twsi_i2c_probe? defined but > not used [-Wunused-function] > drivers/i2c/mvtwsi.c:388:12: attention : ?twsi_i2c_read? defined but not > used [-Wunused-function] > drivers/i2c/mvtwsi.c:424:12: attention : ?twsi_i2c_write? defined but > not used [-Wunused-function] > > Ways to get rid of those include: > * not building the driver at all when no controller 0 base is defined, > which involves moving moving SYS_I2C_MVTWSI to Kconfig and selecting it > when at least one i2c controller is selected in the sunxi Kconfig > * having twsi0 enabled on all sunxi devices, as it was before > > What do you prefer? I would prefer for the driver to not be build at all then, thank you for working on this. Regards, Hans > >>> Also I'm not entirely convinced that patch 3/3 is a good idea, on the olimex boards >>> which have a i2c eeprom enabling the attached i2c controller makes sense, but on the >>> other boards the i2c pins are really just gpio pins, any daughter board can be connected >>> including one which uses them differently. I believe that in the defconfig the i2c >>> controllers should thus be left off. It is after all a default config, users with >>> a daughter board which they want to use in u-boot can easily change the config after >>> running make foo_defconfig. >> >> I think the right bargain here would be to enable i2c lines that already >> have something useful for U-Boot attached (e.g. not an accelerometer >> sensor). I concur to your point otherwise.