From patchwork Fri Apr 17 14:50:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ivan T. Ivanov" X-Patchwork-Id: 462117 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 63A2D1401AB for ; Sat, 18 Apr 2015 00:51:10 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934884AbbDQOvF (ORCPT ); Fri, 17 Apr 2015 10:51:05 -0400 Received: from mail-wg0-f51.google.com ([74.125.82.51]:36762 "EHLO mail-wg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934883AbbDQOvD (ORCPT ); Fri, 17 Apr 2015 10:51:03 -0400 Received: by wgsk9 with SMTP id k9so115568110wgs.3 for ; Fri, 17 Apr 2015 07:50:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=b+MZ4hpSudn5iXkk8JZUeiaRqp60aDydHw3g+zJoD7E=; b=PgTWIw7LP6062sfkh9q7Q/+RUquiclpLGlOXKlSv5xfie4bTpv2z5AKkEWdDZeLz03 f2w0uZfzd2nvVea7iD1b4IpZxEq89lUbVOJOzSm7MzuTCK0f03pJOC8e0qsYoDE0Rd9L T2/x/5FQ6M4cE58oO/hwPbrAF7a0/0tf6QyA8A4NA1smXaG7IR+W7MDjeFRsDsE1iORp IXIw3s809u5KiXAtOQF25nqkLcu7CrwM95WPGe3XVP1NaVPqCrV2cf2DBzVYOdD84qpa 9xOK3i7rXKnbCK0QuI2ebP7AMGbNJ2vwfXL6nymg1JKGtOlCe5QIG4kjDHfBP2YZ1HKK Bf/A== X-Gm-Message-State: ALoCoQlXn9WbwvqklW0BJFmxEBdDA34rSCbnaan1M5RKjw9X72P1KpSOxmbQGVouEbuhelZ3MmXC X-Received: by 10.194.59.4 with SMTP id v4mr6969937wjq.54.1429282259286; Fri, 17 Apr 2015 07:50:59 -0700 (PDT) Received: from localhost.localdomain ([37.157.136.206]) by mx.google.com with ESMTPSA id m1sm2980798wiw.7.2015.04.17.07.50.57 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Apr 2015 07:50:58 -0700 (PDT) From: "Ivan T. Ivanov" To: Linus Walleij , Bjorn Andersson Cc: Soren Brinkmann , Arnd Bergmann , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH] pinctrl: qcom-spmi: Fix pin direction configuration Date: Fri, 17 Apr 2015 17:50:49 +0300 Message-Id: <1429282249-30450-1-git-send-email-ivan.ivanov@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Pin direction configuration was incorrectly overwritten by output and function values in set_mux(). Fix this. Signed-off-by: Ivan T. Ivanov --- drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 1 + drivers/pinctrl/qcom/pinctrl-spmi-mpp.c | 1 + 2 files changed, 2 insertions(+) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c index e8b74c6..ae4115e 100644 --- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c +++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c @@ -260,6 +260,7 @@ static int pmic_gpio_set_mux(struct pinctrl_dev *pctldev, unsigned function, val = 1; } + val = val << PMIC_GPIO_REG_MODE_DIR_SHIFT; val |= pad->function << PMIC_GPIO_REG_MODE_FUNCTION_SHIFT; val |= pad->out_value & PMIC_GPIO_REG_MODE_VALUE_SHIFT; diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c index 8f6c7be..211b942 100644 --- a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c +++ b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c @@ -370,6 +370,7 @@ static int pmic_mpp_set_mux(struct pinctrl_dev *pctldev, unsigned function, } } + val = val << PMIC_MPP_REG_MODE_DIR_SHIFT; val |= pad->function << PMIC_MPP_REG_MODE_FUNCTION_SHIFT; val |= pad->out_value & PMIC_MPP_REG_MODE_VALUE_MASK;