From: Masahiro Yamada <yamada.m@jp.panasonic.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 08/17] dm: i2c: Add a uclass for I2C
Date: Wed, 19 Nov 2014 18:02:12 +0900 [thread overview]
Message-ID: <20141119180212.653C.AA925319@jp.panasonic.com> (raw)
In-Reply-To: <20141119175634.9405.AA925319@jp.panasonic.com>
Hi Simon,
Let me correct my question.
(I should have read my mail three times before sending.)
On Wed, 19 Nov 2014 17:56:34 +0900
Masahiro Yamada <yamada.m@jp.panasonic.com> wrote:
>
>
> > +
> > +int i2c_get_chip(struct udevice *bus, uint chip_addr, struct udevice **devp)
> > +{
> > + struct udevice *dev;
> > +
> > + debug("%s: Searching bus '%s' for address %02x: ", __func__,
> > + bus->name, chip_addr);
> > + for (device_find_first_child(bus, &dev); dev;
> > + device_find_next_child(&dev)) {
> > + struct dm_i2c_chip store;
> > + struct dm_i2c_chip *chip = dev_get_parentdata(dev);
> > + int ret;
> > +
> > + if (!chip) {
> > + chip = &store;
> > + i2c_chip_ofdata_to_platdata(gd->fdt_blob,
> > + dev->of_offset, chip);
> > + }
> > + if (chip->chip_addr == chip_addr) {
> > + ret = device_probe(dev);
> > + debug("found, ret=%d\n", ret);
> > + if (ret)
> > + return ret;
> > + *devp = dev;
> > + return 0;
> > + }
>
>
> If "chip" is "NULL", i2c_chip_ofdata_to_platdata() is called to create
> struct dm_i2c_chip, but it is not thrown away soon. It is not efficient.
I mean:
but it *is* thrown away soon.
Best Regards
Masahiro Yamada
next prev parent reply other threads:[~2014-11-19 9:02 UTC|newest]
Thread overview: 87+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-11 17:46 [U-Boot] [PATCH v2 0/17] dm: Add I2C support and convert sandbox, tegra Simon Glass
2014-11-11 17:46 ` [U-Boot] [PATCH v2 01/17] dm: i2c: Move error reporting into a common function Simon Glass
2014-11-17 0:46 ` Tom Rini
2014-11-17 6:27 ` Heiko Schocher
2014-11-23 12:59 ` Simon Glass
2014-11-11 17:46 ` [U-Boot] [PATCH v2 02/17] dm: core: Allow access to the device's driver_id data Simon Glass
2014-11-17 0:46 ` Tom Rini
2014-11-17 6:28 ` Heiko Schocher
2014-11-19 8:25 ` Masahiro Yamada
2014-11-19 9:35 ` Simon Glass
2014-11-20 6:06 ` Masahiro Yamada
2014-11-20 18:39 ` Simon Glass
2014-11-23 12:59 ` Simon Glass
2014-11-11 17:46 ` [U-Boot] [PATCH v2 03/17] dm: core: Add functions to find parent and OF data Simon Glass
2014-11-17 0:46 ` Tom Rini
2014-11-17 6:28 ` Heiko Schocher
2014-11-19 8:27 ` Masahiro Yamada
2014-11-19 9:37 ` Simon Glass
2014-11-23 13:00 ` Simon Glass
2014-11-11 17:46 ` [U-Boot] [PATCH v2 04/17] dm: fdt: Correct handling of aliases with embedded digits Simon Glass
2014-11-17 0:46 ` Tom Rini
2014-11-17 5:57 ` Simon Glass
2014-11-17 18:32 ` Tom Rini
2014-11-23 13:00 ` Simon Glass
2014-11-17 6:28 ` Heiko Schocher
2014-11-11 17:46 ` [U-Boot] [PATCH v2 05/17] dm: Add a function to bind a device by driver name Simon Glass
2014-11-11 18:23 ` Jagan Teki
2014-11-17 6:29 ` Heiko Schocher
2014-11-23 13:00 ` Simon Glass
2014-11-11 17:46 ` [U-Boot] [PATCH v2 06/17] dm: spi: Correct handling of SPI chip selects in sandbox Simon Glass
2014-11-11 18:20 ` Jagan Teki
2014-11-17 6:29 ` Heiko Schocher
2014-11-23 13:00 ` Simon Glass
2014-11-11 17:46 ` [U-Boot] [PATCH v2 07/17] dm: spi: Use device_bind_driver() instead of our own function Simon Glass
2014-11-11 18:24 ` Jagan Teki
2014-11-17 6:29 ` Heiko Schocher
2014-11-23 13:00 ` Simon Glass
2014-11-11 17:46 ` [U-Boot] [PATCH v2 08/17] dm: i2c: Add a uclass for I2C Simon Glass
2014-11-17 0:46 ` Tom Rini
2014-11-17 6:37 ` Heiko Schocher
2014-11-18 12:32 ` Masahiro Yamada
2014-11-18 12:35 ` Heiko Schocher
2014-11-19 8:56 ` Masahiro Yamada
2014-11-19 9:02 ` Masahiro Yamada [this message]
2014-11-19 10:24 ` Simon Glass
2014-11-20 6:05 ` Masahiro Yamada
2014-11-20 14:04 ` Simon Glass
2014-11-21 7:24 ` Heiko Schocher
2014-11-21 8:18 ` Masahiro Yamada
2014-11-21 22:30 ` Simon Glass
2014-11-21 8:04 ` Masahiro Yamada
2014-11-21 22:29 ` Simon Glass
2014-11-23 12:04 ` Albert ARIBAUD
2014-11-11 17:46 ` [U-Boot] [PATCH v2 09/17] dm: i2c: Implement driver model support in the i2c command Simon Glass
2014-11-17 0:46 ` Tom Rini
2014-11-17 6:38 ` Heiko Schocher
2014-11-11 17:46 ` [U-Boot] [PATCH v2 10/17] dm: i2c: Add I2C emulation driver for sandbox Simon Glass
2014-11-17 0:46 ` Tom Rini
2014-11-17 6:39 ` Heiko Schocher
2014-11-11 17:46 ` [U-Boot] [PATCH v2 11/17] dm: i2c: Add a sandbox I2C driver Simon Glass
2014-11-17 0:46 ` Tom Rini
2014-11-17 6:39 ` Heiko Schocher
2014-11-11 17:46 ` [U-Boot] [PATCH v2 12/17] dm: i2c: Add an I2C EEPROM simulator Simon Glass
2014-11-17 0:46 ` Tom Rini
2014-11-17 6:39 ` Heiko Schocher
2014-11-11 17:46 ` [U-Boot] [PATCH v2 13/17] dm: i2c: config: Enable I2C for sandbox using driver model Simon Glass
2014-11-17 0:47 ` Tom Rini
2014-11-17 6:39 ` Heiko Schocher
2014-11-11 17:46 ` [U-Boot] [PATCH v2 14/17] dm: i2c: dts: Add an I2C bus for sandbox Simon Glass
2014-11-17 0:47 ` Tom Rini
2014-11-17 6:40 ` Heiko Schocher
2014-11-19 8:29 ` Masahiro Yamada
2014-11-19 10:36 ` Simon Glass
2014-11-11 17:46 ` [U-Boot] [PATCH v2 15/17] dm: Add a simple EEPROM driver Simon Glass
2014-11-17 0:47 ` Tom Rini
2014-11-17 6:40 ` Heiko Schocher
2014-11-11 17:46 ` [U-Boot] [PATCH v2 16/17] dm: i2c: Add tests for I2C Simon Glass
2014-11-17 0:47 ` Tom Rini
2014-11-17 6:40 ` Heiko Schocher
2014-11-11 17:46 ` [U-Boot] [PATCH v2 17/17] dm: i2c: tegra: Convert to driver model Simon Glass
2014-11-17 6:41 ` Heiko Schocher
2014-11-17 6:42 ` [U-Boot] [PATCH v2 0/17] dm: Add I2C support and convert sandbox, tegra Heiko Schocher
2014-11-17 6:52 ` Simon Glass
2014-11-19 8:27 ` Masahiro Yamada
2014-11-19 13:08 ` Heiko Schocher
2014-11-20 17:31 ` Simon Glass
2014-11-21 7:27 ` Heiko Schocher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141119180212.653C.AA925319@jp.panasonic.com \
--to=yamada.m@jp.panasonic.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox