From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko Schocher Date: Tue, 18 Nov 2014 13:35:17 +0100 Subject: [U-Boot] [PATCH v2 08/17] dm: i2c: Add a uclass for I2C In-Reply-To: <20141118213240.7D3B.AA925319@jp.panasonic.com> References: <1415727993-22032-1-git-send-email-sjg@chromium.org> <1415727993-22032-9-git-send-email-sjg@chromium.org> <20141118213240.7D3B.AA925319@jp.panasonic.com> Message-ID: <546B3D05.10603@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Masahiro, Am 18.11.2014 13:32, schrieb Masahiro Yamada: > Hi Simon, > > > On Tue, 11 Nov 2014 10:46:24 -0700 > Simon Glass wrote: > >> The uclass implements the same operations as the current I2C framework but >> makes some changes to make it fit driver model better: >> >> - Remove the chip address from API calls >> - Remove the address length from API calls >> - Remove concept of 'current' I2C bus >> - Drop all existing init functions >> >> Signed-off-by: Simon Glass >> --- >> > >> +static int i2c_post_probe(struct udevice *dev) >> +{ >> + struct dm_i2c_bus *i2c = dev->uclass_priv; >> + >> + i2c->speed_hz = fdtdec_get_int(gd->fdt_blob, dev->of_offset, >> + "clock-frequency", 100000); >> + >> + return i2c_set_bus_speed(dev, i2c->speed_hz); >> +} > > This code in drivers/i2c/i2c-uclass.c seems to highly depends on Device Tree. > > I am not sure if I understood correctly, but > does this work on non Device Tree SoCs? No. Devie Model is currently (as I understand) useable with Device Tree ... bye, Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany