From patchwork Thu Oct 28 09:56:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manuel Dipolt X-Patchwork-Id: 1547400 X-Patchwork-Delegate: andre.przywara@arm.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=robart.cc header.i=@robart.cc header.a=rsa-sha256 header.s=B016B336-104E-11EA-8E2D-E36DD02BB770 header.b=hWOrPhTS; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Hg1FK4hVYz9sRK for ; Thu, 28 Oct 2021 20:57:23 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 184B38327E; Thu, 28 Oct 2021 11:57:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=robart.cc Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=robart.cc header.i=@robart.cc header.b="hWOrPhTS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 56C658327E; Thu, 28 Oct 2021 11:57:12 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: * X-Spam-Status: No, score=1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_PBL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from srv-mta-01.robart.cc (mail.robart.cc [81.10.172.252]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 097A282F33 for ; Thu, 28 Oct 2021 11:57:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=robart.cc Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=manuel.dipolt@robart.cc Received: from localhost (localhost [127.0.0.1]) by srv-mta-01.robart.cc (Postfix) with ESMTP id 568851C052E; Thu, 28 Oct 2021 11:57:08 +0200 (CEST) Received: from srv-mta-01.robart.cc ([127.0.0.1]) by localhost (srv-mta-01.robart.cc [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id nS2jEv6UV4mp; Thu, 28 Oct 2021 11:57:08 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by srv-mta-01.robart.cc (Postfix) with ESMTP id 24DE71C052F; Thu, 28 Oct 2021 11:57:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.10.3 srv-mta-01.robart.cc 24DE71C052F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=robart.cc; s=B016B336-104E-11EA-8E2D-E36DD02BB770; t=1635415028; bh=pa+EpYs3Q0EGOMJdrcOKtaQI5jHjMaokDDjPMznEOWw=; h=From:To:Date:Message-Id:MIME-Version; b=hWOrPhTS7YnpyyANUIQX1yO5nwnVHiEesfvK/BDlZEdp1DJfAky1r0uUyFVF9sahq hZ8rcMjEo+EIkafGXwn9lsp2PEXpd74Ttw2CCPwESUVtGiOjNPv2US4rpSJ7v0BTTh 9ReWc2OV1oMBk2/k/w4JQLADJUuVT4T1bWMGL/o4xuh9RWdILmSQ39JfJwoTF5T4gc T0/W0yiWxhnNGIR8L3g74nvW+sqlllUMl8yPCT63c4wcqryHRvmZldcthY5mIB+gjs RdhhApBWcxJrbsdLIZiIr0hH0u20HHT4oxgi0v6a5oJXxqmFVCCpR11tHRXnUrfST0 BedQoCnzsca2Q== Received: from srv-mta-01.robart.cc ([127.0.0.1]) by localhost (srv-mta-01.robart.cc [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id HS_Z42BQ94Nw; Thu, 28 Oct 2021 11:57:08 +0200 (CEST) Received: from workbot40.intern.robart.cc (workbot40.intern.robart.cc [10.0.20.40]) by srv-mta-01.robart.cc (Postfix) with ESMTPSA id EE8091C052E; Thu, 28 Oct 2021 11:57:07 +0200 (CEST) From: Manuel Dipolt To: andre.przywara@arm.com Cc: u-boot@lists.denx.de, jagan@amarulasolutions.com, Manuel Dipolt Subject: [PATCH v3] sunxi: h3: enable clock support for r_pio gpios Date: Thu, 28 Oct 2021 11:56:40 +0200 Message-Id: <20211028095640.12070-1-manuel.dipolt@robart.cc> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean This patch enables clock for the r_pio gpios for the h3 r_pio is required to access gpios from port L readout or setting of gpio PL10 (for example to control a led): => gpio input PL10 gpio: pin PL10 (gpio 298) value is 0 => gpio set PL10 gpio: pin PL10 (gpio 298) value is 1 before: => gpio input PL10 gpio: pin PL10 (gpio 298) value is 0 => gpio set PL10 gpio: pin PL10 (gpio 298) value is 1 Warning: value of pin is still 0 Signed-off-by: Manuel Dipolt --- drivers/gpio/sunxi_gpio.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpio/sunxi_gpio.c b/drivers/gpio/sunxi_gpio.c index cdbc40d48f..0185eda70d 100644 --- a/drivers/gpio/sunxi_gpio.c +++ b/drivers/gpio/sunxi_gpio.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -245,6 +246,13 @@ static int gpio_sunxi_probe(struct udevice *dev) { struct sunxi_gpio_plat *plat = dev_get_plat(dev); struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev); + struct clk gate_clk; + int ret; + + ret = clk_get_by_name(dev, "apb", &gate_clk); + + if (!ret) + clk_enable(&gate_clk); /* Tell the uclass how many GPIOs we have */ if (plat) {