]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
sandbox: i2c: search child emul dev and check its uclass id
authorPrzemyslaw Marczak <p.marczak@samsung.com>
Wed, 13 May 2015 11:38:31 +0000 (13:38 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 8 Sep 2015 20:40:26 +0000 (22:40 +0200)
commitff8a35bd2ff32104842a39460bf5f48324c182a2
treed94dc8a3b294a57e48debe17c65030e7b3f1ba38
parentf2c214389258e2f1d68690d184a9f4d1596bb8a5
sandbox: i2c: search child emul dev and check its uclass id

The function get_emul() in sandbox i2c bus driver, always returns
first child as i2c emul device. This may only work for i2c devices
with a single child, which is an only i2c emul device.

In case when i2c device has more than one child (e.g. PMIC), and
one is i2c emul, then the function should search it by check uclass
id for each child. This patch add this change to the get_emul().

Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
Tested on sandbox:
Tested-by: Simon Glass <sjg@chromium.org>
drivers/i2c/sandbox_i2c.c