Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 243B1C433F5 for ; Thu, 28 Oct 2021 09:57:18 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 01FE66044F for ; Thu, 28 Oct 2021 09:57:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 01FE66044F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=robart.cc Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de 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) 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 Content-Transfer-Encoding: quoted-printable 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=20 readout or setting of gpio PL10 (for example to control a led): =3D> gpio input PL10=20 gpio: pin PL10 (gpio 298) value is 0 =3D> gpio set PL10 =20 gpio: pin PL10 (gpio 298) value is 1 before: =3D> gpio input PL10 =20 gpio: pin PL10 (gpio 298) value is 0 =3D> gpio set PL10 =20 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 =3D dev_get_plat(dev); struct gpio_dev_priv *uc_priv =3D dev_get_uclass_priv(dev); + struct clk gate_clk; + int ret; + + ret =3D clk_get_by_name(dev, "apb", &gate_clk); + + if (!ret) + clk_enable(&gate_clk);=20 =20 /* Tell the uclass how many GPIOs we have */ if (plat) { --=20 2.20.1