From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] dm: i2c: mxc support DM
Date: Wed, 15 Apr 2015 13:38:24 +0200 [thread overview]
Message-ID: <201504151338.24947.marex@denx.de> (raw)
In-Reply-To: <1429090554-24295-1-git-send-email-Peng.Fan@freescale.com>
On Wednesday, April 15, 2015 at 11:35:54 AM, Peng Fan wrote:
> Add support when CONFIG_DM_I2C configured.
>
> Test results:
> => i2c dev 0
> Setting bus to 0
> => i2c probe
> Valid chip addresses: 08 50
> => i2c md 8 38
> 0038: 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 ................
> => i2c mw 8 38 5 1
> => i2c md 8 38
> 0038: 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 ................
> => dm tree
> Class Probed Name
> ----------------------------------------
> root [ + ] root_driver
> thermal [ ] |-- imx_thermal
> simple_bus [ + ] |-- soc
> simple_bus [ ] | |-- aips-bus at 30000000
> simple_bus [ ] | | |-- anatop at 30360000
> simple_bus [ ] | | `-- snvs at 30370000
> simple_bus [ ] | |-- aips-bus at 30400000
> simple_bus [ + ] | `-- aips-bus at 30800000
> i2c [ + ] | |-- i2c at 30a20000
> i2c_generic [ + ] | | |-- generic_8
> i2c_generic [ + ] | | `-- generic_50
> i2c [ ] | |-- i2c at 30a40000
> spi [ ] | `-- qspi at 30bb0000
> simple_bus [ ] `-- regulators
>
> Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Hi,
[...]
> +static int i2c_init_transfer_(struct i2c_bus *i2c_bus, u32 chip,
> + bool read)
> +{
> + unsigned int temp;
> + int ret;
> + struct mxc_i2c_regs *i2c_regs = i2c_bus->regs;
> +
> + /* Enable I2C controller */
> +#ifdef I2C_QUIRK_REG
> + if (readb(&i2c_regs->i2cr) & I2CR_IDIS) {
> +#else
> + if (!(readb(&i2c_regs->i2cr) & I2CR_IEN)) {
> +#endif
This is a little odd, maybe you can rename this to some sensible name
since it's IMX specific ?
next prev parent reply other threads:[~2015-04-15 11:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-15 9:35 [U-Boot] [PATCH] dm: i2c: mxc support DM Peng Fan
2015-04-15 11:38 ` Marek Vasut [this message]
2015-04-19 13:53 ` Simon Glass
2015-04-20 5:49 ` Peng Fan
2015-04-24 4:40 ` Simon Glass
2015-04-26 7:37 ` Peng Fan
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=201504151338.24947.marex@denx.de \
--to=marex@denx.de \
--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