Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9299918ybl; Wed, 25 Dec 2019 18:38:38 -0800 (PST) X-Google-Smtp-Source: APXvYqz0wosDSPzpgRkdsYsgxAedkPXFTK0o6xYCAvBkQtKAMgHyucJJp/3B8GYMUC6ClDnBNk3X X-Received: by 2002:a05:6830:1185:: with SMTP id u5mr44840144otq.147.1577327918315; Wed, 25 Dec 2019 18:38:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577327918; cv=none; d=google.com; s=arc-20160816; b=xqAwGQ1lJPQTOwghROvAm2vubuXcxgif4FJfjthkCE6R6ROYYdRhk8/dSzyc2ve3iu DtiWxvGJpPUP9L6MDoB0iY6XZ58UFMY52Mo9fR+RiMiavxnBbCBSHQkBjT5okOQOu80L Jxf9nJUA9VvVoOoxrpKq+uq883U0z7+xNGXRupq4i8nBoBspof+xlQFOztsEQM/0mKMy 6+P3u4qFhbfQjuGUjoy7ffDzfDlbmFVn7MuUBU6tCP1NWd64JBzz89UDlDTv4kWw4aHh j7CMPI2JjOoA5mHnIaI3kzvI/bgdeQ8rFQrf7iOc7dRseo7KCP9C7bck+ZaEOvK41wDf vEeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=R066sDfDnAQ3ye/AmQx3BYv9XIL38F2sOLtO4hC1Go8=; b=F7R7JmDqN1Jy7PsM/2IqYa20eM1+M8ZxNlGy9a1eBXOT9kQ85irEalE9Wbu6GJtT2F n7WdVmwZjWftPq+ss1ad94Iy6f/YWusdz9SZUP8bhIgIPhjKuInGc/aA/Rj6cM04yTzW K8+2NRiqnpR4/GWi5medPqYxH5E7+VkUaW/hnV9tK57OXFmIjO80EZG1HL7hf5FRv0Ea jxeMf1DCQLAuw8ICmcKHwJu5bYo6dpGVQ02Y96zCaWklpgIaCz41yEVEvIediLJ4POSv m4HcMYOKDRTe6YAxxPcug2WN/x8sN4pP//CMJKjZVVZjvRQBHOwoJVUdkQl6EQwzaqLl VawQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m17si13034665otr.17.2019.12.25.18.38.26; Wed, 25 Dec 2019 18:38:38 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726933AbfLZChm (ORCPT + 99 others); Wed, 25 Dec 2019 21:37:42 -0500 Received: from mail-sz.amlogic.com ([211.162.65.117]:49768 "EHLO mail-sz.amlogic.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726893AbfLZChm (ORCPT ); Wed, 25 Dec 2019 21:37:42 -0500 Received: from localhost.localdomain (10.28.8.19) by mail-sz.amlogic.com (10.28.11.5) with Microsoft SMTP Server id 15.1.1591.10; Thu, 26 Dec 2019 10:37:57 +0800 From: Qianggui Song To: Linus Walleij , CC: Qianggui Song , Neil Armstrong , Jerome Brunet , Kevin Hilman , Martin Blumenstingl , Xingyu Chen , Jianxin Pan , Guillaume La Roque , , , Subject: [PATCH] pinctrl: meson: Fix wrong shift value when get drive-strength Date: Thu, 26 Dec 2019 10:37:34 +0800 Message-ID: <20191226023734.9631-1-qianggui.song@amlogic.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.28.8.19] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In meson_pinconf_get_drive_strength, variable bit is calculated by meson_calc_reg_and_bit, this value is the offset from the first pin of a certain bank to current pin, while Meson SoCs use two bits for each pin to depict drive-strength. So a left shift by 1 should be done or node pinconf-pins shows wrong message. Fixes: 6ea3e3bbef37 ("pinctrl: meson: add support of drive-strength-microamp") Signed-off-by: Qianggui Song --- drivers/pinctrl/meson/pinctrl-meson.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c index 3c80828a5e50..bbc919bef2bf 100644 --- a/drivers/pinctrl/meson/pinctrl-meson.c +++ b/drivers/pinctrl/meson/pinctrl-meson.c @@ -441,6 +441,7 @@ static int meson_pinconf_get_drive_strength(struct meson_pinctrl *pc, return ret; meson_calc_reg_and_bit(bank, pin, REG_DS, ®, &bit); + bit = bit << 1; ret = regmap_read(pc->reg_ds, reg, &val); if (ret) -- 2.24.0