Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3321374rwa; Tue, 23 Aug 2022 02:47:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR4FzZ4tBm5glkDHkEN3HUuikBW28sPdK8gokADwtJeS+/w6lezjhHZOqlbb7PI4ttBMyvsY X-Received: by 2002:a05:6402:50cb:b0:440:87d4:3ad2 with SMTP id h11-20020a05640250cb00b0044087d43ad2mr2937330edb.219.1661248066392; Tue, 23 Aug 2022 02:47:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661248066; cv=none; d=google.com; s=arc-20160816; b=Nd7ehnskSepX8kziPhnztKEJ417egtNVcWIjmhKgyYmNGekfSjKgK/zs0B67mwzYnt taB9f8ZDWcgr/VpdBDPt+teIBiGUlFaF2kyfJvftJ+6o/X5C2ZgmfEAfplHpFceoIJ8g sCNKJO0vSRF02zfDQuR4M0pJS0HPRIFGgFMndHZ72s5lfa/rvvVUR7hsr88XLcx+CFuj FMb8bIWgInBNxD/3Azals2DsxL/Ne8CB/A7QtVsNc3yCSy5ms1pHzjCvHjZDIIW7EO1Y s+Pk1Yl/Vr4Zpkfj4gw9ZiF8qYRNf8CTj4K6KSOlVzXoc14oswQ7rah3oh2YGfSYngWB hdcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mmNrjm/99UyP2in60b/kE26vO4uJbdHC8GAJuV8HNeM=; b=dUBP8wtt/kDlof2OcOuC3DOTxjzY1RHbNj/e0Pnr+TjO2hexbWuZ3/NUQiTEBDrvw/ /L/XpGidnbmfMq92ZOJJRy0Awi/+d+u6P77q7nEqADGUrS9CIHnSaue7TYa1y2spL0p7 ZkytpQjGySXj2wXoaYXahyklCR1jgvvlQQYIQrV/T9g7Ud4jQw9BAX6pu8zqjnS3sk2L b+/J0v5WuZnNrIzVEf9rfcI1cuOV6rDc74mv2jGuWSueouwed1GnQms3TiUuvbrWSNO/ xoKFqApYYy6wGszEct6bb8qLoyyq3CZvp9hTgIyGQsC6Vowm2FOaWJ+SuVpQrMDpCSVg tlYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="euY9V/DV"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hd33-20020a17090796a100b0073d68cb42f0si1626147ejc.717.2022.08.23.02.47.20; Tue, 23 Aug 2022 02:47:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="euY9V/DV"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243779AbiHWI3r (ORCPT + 99 others); Tue, 23 Aug 2022 04:29:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243793AbiHWIZ7 (ORCPT ); Tue, 23 Aug 2022 04:25:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 222B27287D; Tue, 23 Aug 2022 01:14:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 09CD66132D; Tue, 23 Aug 2022 08:13:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B330C433C1; Tue, 23 Aug 2022 08:13:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661242413; bh=yMB+nDLTD/CtAiCCGvVNDEAEOnYChjmtyxH/gkHlNcw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=euY9V/DV2othFdOXHCmAbDWXZWIpc/vqyWCxI67j3CE0w8raEBuuTfnyb1DtKhXWI EJ5C6PCW3Qj4BYsIkgqYA9yt1AP+4GU0jEJ7hahaHMhpzdVBinib+D3iL+lNXBrBwS Wy7RxbniHWdSzxV01h3klvBbmTQjm6Be7Zo8668o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jernej Skrabec , Heiko Stuebner , Samuel Holland , Linus Walleij Subject: [PATCH 5.19 098/365] pinctrl: sunxi: Add I/O bias setting for H6 R-PIO Date: Tue, 23 Aug 2022 09:59:59 +0200 Message-Id: <20220823080122.301567818@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080118.128342613@linuxfoundation.org> References: <20220823080118.128342613@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Samuel Holland commit fc153c8f283bf5925615195fc9d4056414d7b168 upstream. H6 requires I/O bias configuration on both of its PIO devices. Previously it was only done for the main PIO. The setting for Port L is at bit 0, so the bank calculation needs to account for the pin base. Otherwise the wrong bit is used. Fixes: cc62383fcebe ("pinctrl: sunxi: Support I/O bias voltage setting on H6") Reviewed-by: Jernej Skrabec Tested-by: Heiko Stuebner Signed-off-by: Samuel Holland Link: https://lore.kernel.org/r/20220713025233.27248-3-samuel@sholland.org Signed-off-by: Linus Walleij Signed-off-by: Greg Kroah-Hartman --- drivers/pinctrl/sunxi/pinctrl-sun50i-h6-r.c | 1 + drivers/pinctrl/sunxi/pinctrl-sunxi.c | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) --- a/drivers/pinctrl/sunxi/pinctrl-sun50i-h6-r.c +++ b/drivers/pinctrl/sunxi/pinctrl-sun50i-h6-r.c @@ -107,6 +107,7 @@ static const struct sunxi_pinctrl_desc s .npins = ARRAY_SIZE(sun50i_h6_r_pins), .pin_base = PL_BASE, .irq_banks = 2, + .io_bias_cfg_variant = BIAS_VOLTAGE_PIO_POW_MODE_SEL, }; static int sun50i_h6_r_pinctrl_probe(struct platform_device *pdev) --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c @@ -624,7 +624,7 @@ static int sunxi_pinctrl_set_io_bias_cfg unsigned pin, struct regulator *supply) { - unsigned short bank = pin / PINS_PER_BANK; + unsigned short bank; unsigned long flags; u32 val, reg; int uV; @@ -640,6 +640,9 @@ static int sunxi_pinctrl_set_io_bias_cfg if (uV == 0) return 0; + pin -= pctl->desc->pin_base; + bank = pin / PINS_PER_BANK; + switch (pctl->desc->io_bias_cfg_variant) { case BIAS_VOLTAGE_GRP_CONFIG: /* @@ -657,8 +660,6 @@ static int sunxi_pinctrl_set_io_bias_cfg else val = 0xD; /* 3.3V */ - pin -= pctl->desc->pin_base; - reg = readl(pctl->membase + sunxi_grp_config_reg(pin)); reg &= ~IO_BIAS_MASK; writel(reg | val, pctl->membase + sunxi_grp_config_reg(pin));