From patchwork Wed Mar 16 20:07:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 598703 X-Patchwork-Delegate: hdegoede@redhat.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3qQMwm34bTz9t3Y for ; Thu, 17 Mar 2016 07:07:52 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 346B9A766A; Wed, 16 Mar 2016 21:07:44 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UgLa35tLurki; Wed, 16 Mar 2016 21:07:43 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 951D9A75C5; Wed, 16 Mar 2016 21:07:43 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 26506A75C5 for ; Wed, 16 Mar 2016 21:07:36 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JxgoxjSGkcfO for ; Wed, 16 Mar 2016 21:07:36 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by theia.denx.de (Postfix) with ESMTPS id BE882A74DE for ; Wed, 16 Mar 2016 21:07:29 +0100 (CET) Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 8579E711C6; Wed, 16 Mar 2016 20:07:27 +0000 (UTC) Received: from shalem.localdomain.com (vpn1-6-119.ams2.redhat.com [10.36.6.119]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2GK7Opk018207; Wed, 16 Mar 2016 16:07:25 -0400 From: Hans de Goede To: Ian Campbell Date: Wed, 16 Mar 2016 21:07:19 +0100 Message-Id: <1458158841-26812-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 16 Mar 2016 20:07:27 +0000 (UTC) Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 1/3] sunxi: Fix clock_twi_onoff for sun6i X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The clock_sun6i.c implementation was not deasserting the reset for the regular i2c controllers, this commit fixes this. Signed-off-by: Hans de Goede --- arch/arm/cpu/armv7/sunxi/clock_sun6i.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/arch/arm/cpu/armv7/sunxi/clock_sun6i.c b/arch/arm/cpu/armv7/sunxi/clock_sun6i.c index 700b605..4e1e1a4 100644 --- a/arch/arm/cpu/armv7/sunxi/clock_sun6i.c +++ b/arch/arm/cpu/armv7/sunxi/clock_sun6i.c @@ -100,13 +100,18 @@ int clock_twi_onoff(int port, int state) return 0; } - /* set the apb clock gate for twi */ - if (state) + /* set the apb clock gate and reset for twi */ + if (state) { setbits_le32(&ccm->apb2_gate, CLK_GATE_OPEN << (APB2_GATE_TWI_SHIFT+port)); - else + setbits_le32(&ccm->apb2_reset_cfg, + 1 << (APB2_RESET_TWI_SHIFT + port)); + } else { + clrbits_le32(&ccm->apb2_reset_cfg, + 1 << (APB2_RESET_TWI_SHIFT + port)); clrbits_le32(&ccm->apb2_gate, CLK_GATE_OPEN << (APB2_GATE_TWI_SHIFT+port)); + } return 0; }