From patchwork Fri Aug 31 00:58:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 10582995 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8538A139B for ; Fri, 31 Aug 2018 00:58:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C6C22BEB3 for ; Fri, 31 Aug 2018 00:58:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 60ABD2BEB9; Fri, 31 Aug 2018 00:58:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA84B2BEB3 for ; Fri, 31 Aug 2018 00:58:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726727AbeHaFDo (ORCPT ); Fri, 31 Aug 2018 01:03:44 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:39930 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725787AbeHaFDo (ORCPT ); Fri, 31 Aug 2018 01:03:44 -0400 Received: by mail-pf1-f196.google.com with SMTP id j8-v6so4668995pff.6 for ; Thu, 30 Aug 2018 17:58:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xiUYqLA8pwRZZ+8OgMWkETx5wfqrEJiqGUlOhx1CtX4=; b=R4C3aQsaa0CfGeboDyrGQHh0hreGPRhiqOYdjRIuGW3YRpUaW8NX8AnbPAe7UYzueu tbD9TMscgkbIB7b4W4ZaAGhXB56Rkt0t8LR7Y0+IVx4QtdtgGGkoAr/MmNZLOBZS8vZe KSqVaOP5XcpjmXknrKLn/eLN8uJvvmqcu1Fbw= 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:mime-version :content-transfer-encoding; bh=xiUYqLA8pwRZZ+8OgMWkETx5wfqrEJiqGUlOhx1CtX4=; b=pOhjI6QZNRIvuz4acoab67M5Pekte9ZXRszdyyx8IEFUACNkFo4zfZIQ769VMIxUqT QsVvHLmnqGGHR42DyEH/Yj0VSEUwJwvtTvLr3lexC7NmbC6sKXBOGXvAFZMZANVo9Dr5 xyouuuqQ5n46hqThtQybPI+92+fIsl8TtYpcYQ/d13DwrJ8BQPxoT6nuD0T8rlQL8jZz Cakb+eO9IGAdAizN1fCQ4kVkD3RIIatNRFM3h5NXhScIZkXQbooQbai7LQfe5DGTYu+y 9/Cux1LsY3WjezgtE1bATpaVBbayywb36bc9cduaXwQsjpdtr0tiimP327RpRbIRPxEJ fuPw== X-Gm-Message-State: APzg51Ci/mxC/cqUVI0LqhrUFkKoa+RCA+Xt6MV0fsypRbf04eLkn0b0 SLN+aG4XFYVwZbvFmAxVZ93npg== X-Google-Smtp-Source: ANB0VdacGlOtTDLiMZegyPCyiJ5f2sTdSi4Eot/EhwLiHmHlS0i2wzaDC1UFfKP2eRCf6fBWF/WyGg== X-Received: by 2002:a63:8442:: with SMTP id k63-v6mr12002531pgd.388.1535677133443; Thu, 30 Aug 2018 17:58:53 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:201:7e28:b9f3:6afc:5326]) by smtp.gmail.com with ESMTPSA id 83-v6sm17929914pft.40.2018.08.30.17.58.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 17:58:52 -0700 (PDT) From: Stephen Boyd To: Linus Walleij Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-msm@vger.kernel.org, Bjorn Andersson , Doug Anderson Subject: [PATCH] pinctrl: qcom: spmi-mpp: Fix drive strength setting Date: Thu, 30 Aug 2018 17:58:52 -0700 Message-Id: <20180831005852.156465-1-swboyd@chromium.org> X-Mailer: git-send-email 2.19.0.rc1.350.ge57e33dbd1-goog MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It looks like we parse the drive strength setting here, but never actually write it into the hardware to update it. Parse the setting and then write it at the end of the pinconf setting function so that it actually sticks in the hardware. Fixes: 0e948042c420 ("pinctrl: qcom: spmi-mpp: Implement support for sink mode") Cc: Bjorn Andersson Cc: Doug Anderson Signed-off-by: Stephen Boyd Reviewed-by: Bjorn Andersson --- drivers/pinctrl/qcom/pinctrl-spmi-mpp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c index 6556dbeae65e..1793a4d05e15 100644 --- a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c +++ b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c @@ -455,7 +455,7 @@ static int pmic_mpp_config_set(struct pinctrl_dev *pctldev, unsigned int pin, pad->dtest = arg; break; case PIN_CONFIG_DRIVE_STRENGTH: - arg = pad->drive_strength; + pad->drive_strength = arg; break; case PMIC_MPP_CONF_AMUX_ROUTE: if (arg >= PMIC_MPP_AMUX_ROUTE_ABUS4) @@ -502,6 +502,10 @@ static int pmic_mpp_config_set(struct pinctrl_dev *pctldev, unsigned int pin, if (ret < 0) return ret; + ret = pmic_mpp_write(state, pad, PMIC_MPP_REG_SINK_CTL, pad->drive_strength); + if (ret < 0) + return ret; + val = pad->is_enabled << PMIC_MPP_REG_MASTER_EN_SHIFT; return pmic_mpp_write(state, pad, PMIC_MPP_REG_EN_CTL, val);