public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] sunxi: twi: enable clocks on sun7i
Date: Thu, 10 Dec 2015 12:32:18 +0100	[thread overview]
Message-ID: <566962C2.10701@redhat.com> (raw)
In-Reply-To: <1449161369-11771-2-git-send-email-oliver@schinagl.nl>

Hi,

On 12/03/2015 05:49 PM, Olliver Schinagl wrote:
> From: Olliver Schinagl <o.schinagl@ultimaker.com>
>
> Commit 6c739c5d added code to enable i2c bus 4 and 5 on the sun7i SoC
> but forgot to enable the clocks for these 2 i2c busses.
>
> This patch enables the clocks for i2c bus 4 and 5 on sun7i.
>
> Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
> ---
>   arch/arm/cpu/armv7/sunxi/clock_sun4i.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/arch/arm/cpu/armv7/sunxi/clock_sun4i.c b/arch/arm/cpu/armv7/sunxi/clock_sun4i.c
> index 7c8eff9..ed910b1 100644
> --- a/arch/arm/cpu/armv7/sunxi/clock_sun4i.c
> +++ b/arch/arm/cpu/armv7/sunxi/clock_sun4i.c
> @@ -67,7 +67,11 @@ int clock_twi_onoff(int port, int state)
>   	struct sunxi_ccm_reg *const ccm =
>   		(struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
>
> +#ifdef CONFIG_MACH_SUN7I
> +	if (port > 4)
> +#else
>   	if (port > 2)
> +#endif
>   		return -1;
>
>   	/* set the apb clock gate for twi */

The range-check is not needed at all, since clock_twi_onoff only gets
called with such high indexes when CONFIG_I2C3_ENABLE / CONFIG_I2C4_ENABLE
is set and Kconfig already only allows these on sun6i / sun7i.

So I've applied a modified version of your patch which simply removes the
range-check all-together.

Regards,

Hans

  parent reply	other threads:[~2015-12-10 11:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-03 16:49 [U-Boot] [PATCH 0/2] arm: sunxi: twi: enable clock for sun7i Olliver Schinagl
2015-12-03 16:49 ` [U-Boot] [PATCH 1/2] sunxi: twi: enable clocks on sun7i Olliver Schinagl
2015-12-03 22:57   ` [U-Boot] [linux-sunxi] " Julian Calaby
2015-12-03 23:01     ` Julian Calaby
2015-12-04  7:32       ` Olliver Schinagl
2015-12-10 11:32   ` Hans de Goede [this message]
2015-12-03 16:49 ` [U-Boot] [PATCH 2/2] sun4i: clock: cleanup some whitespace errors Olliver Schinagl
2015-12-10 11:32   ` Hans de Goede

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=566962C2.10701@redhat.com \
    --to=hdegoede@redhat.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