public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] i2c: Instantiate I2C controllers when selected
Date: Wed, 28 Oct 2015 06:56:35 +0100	[thread overview]
Message-ID: <56306393.3010809@denx.de> (raw)
In-Reply-To: <e8468d8edf15e36b189ecd4dfb06f11591aa3710.1445958154.git.michal.simek@xilinx.com>

Hello Michal,

Am 27.10.2015 um 16:02 schrieb Michal Simek:
> Do not enable both I2C controllers by default. Enable them only when
> they are selected.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
>   drivers/i2c/zynq_i2c.c | 4 ++++
>   1 file changed, 4 insertions(+)

Thanks!

I will accept this patch, but it is a fix for the old style
I2C driver. I would prefer a patch, which converts this driver
to DM ;-)

What do you mean with "enabled"? The old style i2c driver,
does not initialize (call zynq_i2c_init()) the i2c driver, until
it is used ... nevertheless, you save some bytes, which is always
good.

Reviewed-by: Heiko Schocher <hs@denx.de>

bye,
Heiko
>
> diff --git a/drivers/i2c/zynq_i2c.c b/drivers/i2c/zynq_i2c.c
> index b3264af4526e..380863bde148 100644
> --- a/drivers/i2c/zynq_i2c.c
> +++ b/drivers/i2c/zynq_i2c.c
> @@ -297,11 +297,15 @@ static unsigned int zynq_i2c_set_bus_speed(struct i2c_adapter *adap,
>   	return 0;
>   }
>
> +#ifdef CONFIG_ZYNQ_I2C0
>   U_BOOT_I2C_ADAP_COMPLETE(zynq_0, zynq_i2c_init, zynq_i2c_probe, zynq_i2c_read,
>   			 zynq_i2c_write, zynq_i2c_set_bus_speed,
>   			 CONFIG_SYS_I2C_ZYNQ_SPEED, CONFIG_SYS_I2C_ZYNQ_SLAVE,
>   			 0)
> +#endif
> +#ifdef CONFIG_ZYNQ_I2C1
>   U_BOOT_I2C_ADAP_COMPLETE(zynq_1, zynq_i2c_init, zynq_i2c_probe, zynq_i2c_read,
>   			 zynq_i2c_write, zynq_i2c_set_bus_speed,
>   			 CONFIG_SYS_I2C_ZYNQ_SPEED, CONFIG_SYS_I2C_ZYNQ_SLAVE,
>   			 1)
> +#endif
>

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

  reply	other threads:[~2015-10-28  5:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-27 15:02 [U-Boot] [PATCH] i2c: Instantiate I2C controllers when selected Michal Simek
2015-10-28  5:56 ` Heiko Schocher [this message]
2015-10-28  7:08   ` Michal Simek
2015-10-28  8:55     ` 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=56306393.3010809@denx.de \
    --to=hs@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