Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp380698ybb; Wed, 25 Mar 2020 01:26:19 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsjefeNwCVdkdd2NoWRBdKfrvrSlsaaL3Zqaj4MND9R1ohhdSO2U5yHIPGPFXKM1WLDs+1X X-Received: by 2002:a05:6830:1c7:: with SMTP id r7mr1698306ota.58.1585124778871; Wed, 25 Mar 2020 01:26:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585124778; cv=none; d=google.com; s=arc-20160816; b=njiIAZULJjzim8DqNLyBAem4pxkqzyJMZHL18BQ7KgvYVb0qOvlSGdwffsZi/GPhc3 +qCfYBLXPSp0uCUlYRi0SnvghBCZVI67g2LLhgtTChVkp7HZtb0e5hYQpNkTVv6GOCby T0yev05+6HUVMERnortF9o21bl0wjjagESfqgHQsYagU89NgP/35EtDxneXgUyhQ2KGA ujk4YnZ3flQn/WKE6M3gYD+bAXMiA3iSqcmQ0O/N+8GzsP/Ubc9fgyMJOfeEDWCElZlO s4tGQK1jFe69Uq58Fs1IK9+haMY8MJiSKPVibgVBf48Olp+wfVWraU49GvkNwEkkVdid EaxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=S+Dk0bFK1Q3svp1qfNTAarWkbHyCyaSYslWB9mx1I/A=; b=JxOpBAMKousWfYQUNygqHcyOWd01rIYlDZvZrAg0BKALGLOmW0HOWA3b/m15jv3wh3 q6Y2ye1lbeD/HmwbUR1APgjquII7xo9QevnxcgPJzzfyD29vHGKVONaW0+WHrTMS4Rd8 n3ngwEdfWSAjyAmkiV9KC9qUkX+G3a4id7XqTfG/6CQeBDMhxXe/XaPKdWrGOh+FSu23 +B+sJnNiIOtYJMKYRYLG7nLimQU2SXTEOJ5iPu9MusMhHKx6xB1OlKCZuOiPdfaFY0ux pkvxXQKIoxKVS0zUJ9H0DN4f20QTPPM7haobCY9/BLLewVDGDTJxHFEin9SazQABg/R8 iZjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sCYghVET; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l3si1329377oie.6.2020.03.25.01.26.06; Wed, 25 Mar 2020 01:26:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sCYghVET; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727279AbgCYIZm (ORCPT + 99 others); Wed, 25 Mar 2020 04:25:42 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:34580 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726105AbgCYIZm (ORCPT ); Wed, 25 Mar 2020 04:25:42 -0400 Received: by mail-pl1-f193.google.com with SMTP id a23so542380plm.1; Wed, 25 Mar 2020 01:25:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=S+Dk0bFK1Q3svp1qfNTAarWkbHyCyaSYslWB9mx1I/A=; b=sCYghVETzCgeR8Ekhd48Y2EKedeDKHbepqjXlFowKwav4qnxR0KE7qwVm66xFWT1R4 8qY8O7dNmemKZwZ/Noo3VFUuO0srvFGvPWMMV1P2m33+2EgeGlIkjbRiVIWHsQpeEZg0 4nwSff0SXh3VbME347jGE3fb+e6GjfxLuesoxtjZxgFrdf+uFbkk027GTFNfWAmJwHIS jFDn8ktkc+hnmmSKNFNlov2wLpG33WONIWq5agayBMfFFAwmAMB84xOuHJOCa48fBrRt PP5OIDus152Cv3K1op8REDxObfdictqllcbpZ/+Ml747zcFL0RF+Yks8DiuMZJ5Oyyc+ lQPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=S+Dk0bFK1Q3svp1qfNTAarWkbHyCyaSYslWB9mx1I/A=; b=eyAQtN3nvZRI+2zT3XGC7Zf5tDpMELknp3Vr7brHNLY4uOT7e1juOKofxRsB7agix4 ubOg9heyyDey//GKokMtFh92FBmeyz+lVpaseF6TxP92CxWvXcTexz8NGsLmoNo3ybFz VFpkrswJ0GCZzUG+yEgr/QtkgOjG7Pr4aKAMdMU0wPUN9QUhQ83w2GHSrZfTlcMZfuky 4SOP55CoKDldsMgaDox//G1SQiomp2qxjK2ch9E00N+bXXC7Dz26jLD8sMmY1eJL37mT MnNEoz+5GCnOdA6GcQZxiYy5JzmzlNg20LPIrIsdXN870aoYFuzB6Q3oUrAkwnq1Eeji F9yg== X-Gm-Message-State: ANhLgQ3wHbtC+68yvueSw0Id0saZu+cLoI7yOoOOJEEbqoi0+/qATsmo FbH6xC0ZaFU8+w7LYllFAk4= X-Received: by 2002:a17:90a:9b06:: with SMTP id f6mr2376641pjp.76.1585124740675; Wed, 25 Mar 2020 01:25:40 -0700 (PDT) Received: from sh03840pcu.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id v123sm15764340pfv.41.2020.03.25.01.25.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Mar 2020 01:25:39 -0700 (PDT) From: Baolin Wang To: linus.walleij@linaro.org Cc: linhua.xu@unisoc.com, orsonzhai@gmail.com, zhang.lyra@gmail.com, baolin.wang7@gmail.com, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] pinctrl: sprd: Use the correct pin output configuration Date: Wed, 25 Mar 2020 16:25:27 +0800 Message-Id: <8a6f91b49c17beb218e46b23084f59a7c7260f86.1585124562.git.baolin.wang7@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Linhua Xu The Spreadtrum pin controller did not supply registers to set high level or low level for output mode, instead we should let the pin controller current configuration drive values on the line. So we should use the PIN_CONFIG_OUTPUT_ENABLE configuration to enable or disable the output mode. [Baolin Wang changes the commit message] Fixes: 41d32cfce1ae ("pinctrl: sprd: Add Spreadtrum pin control driver") Signed-off-by: Linhua Xu Signed-off-by: Baolin Wang --- drivers/pinctrl/sprd/pinctrl-sprd.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/sprd/pinctrl-sprd.c b/drivers/pinctrl/sprd/pinctrl-sprd.c index ea04bac..8e39610 100644 --- a/drivers/pinctrl/sprd/pinctrl-sprd.c +++ b/drivers/pinctrl/sprd/pinctrl-sprd.c @@ -464,7 +464,7 @@ static int sprd_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin_id, case PIN_CONFIG_INPUT_ENABLE: arg = (reg >> SLEEP_INPUT_SHIFT) & SLEEP_INPUT_MASK; break; - case PIN_CONFIG_OUTPUT: + case PIN_CONFIG_OUTPUT_ENABLE: arg = reg & SLEEP_OUTPUT_MASK; break; case PIN_CONFIG_DRIVE_STRENGTH: @@ -635,9 +635,13 @@ static int sprd_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin_id, shift = SLEEP_INPUT_SHIFT; } break; - case PIN_CONFIG_OUTPUT: + case PIN_CONFIG_OUTPUT_ENABLE: if (is_sleep_config == true) { - val |= SLEEP_OUTPUT; + if (arg > 0) + val |= SLEEP_OUTPUT; + else + val &= ~SLEEP_OUTPUT; + mask = SLEEP_OUTPUT_MASK; shift = SLEEP_OUTPUT_SHIFT; } -- 1.9.1