From patchwork Mon Jan 26 16:24:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 5711131 Return-Path: X-Original-To: patchwork-linux-arm-msm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CA525C058D for ; Mon, 26 Jan 2015 16:25:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 17BCB20142 for ; Mon, 26 Jan 2015 16:25:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 348F5200FF for ; Mon, 26 Jan 2015 16:25:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756620AbbAZQZR (ORCPT ); Mon, 26 Jan 2015 11:25:17 -0500 Received: from ns.mm-sol.com ([37.157.136.199]:47220 "EHLO extserv.mm-sol.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756029AbbAZQZP (ORCPT ); Mon, 26 Jan 2015 11:25:15 -0500 Received: from localhost.localdomain (unknown [37.157.136.206]) by extserv.mm-sol.com (Postfix) with ESMTPSA id A1485C853; Mon, 26 Jan 2015 18:25:12 +0200 (EET) From: Stanimir Varbanov To: Linus Walleij Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Bjorn Andersson , Stephen Boyd , Stanimir Varbanov Subject: [PATCH] pinctrl: qcom: enable generic support and input-enable pinctrl conf Date: Mon, 26 Jan 2015 18:24:54 +0200 Message-Id: <1422289494-31461-1-git-send-email-svarbanov@mm-sol.com> X-Mailer: git-send-email 1.7.0.4 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Enables generic pinconf support and add handling for 'input-enable' pinconf property. Signed-off-by: Stanimir Varbanov --- drivers/pinctrl/qcom/pinctrl-msm.c | 17 ++++++++++++----- 1 files changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c index e730935..4a47eb1 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm.c +++ b/drivers/pinctrl/qcom/pinctrl-msm.c @@ -193,11 +193,11 @@ static int msm_config_reg(struct msm_pinctrl *pctrl, *mask = 7; break; case PIN_CONFIG_OUTPUT: + case PIN_CONFIG_INPUT_ENABLE: *bit = g->oe_bit; *mask = 1; break; default: - dev_err(pctrl->dev, "Invalid config param %04x\n", param); return -ENOTSUPP; } @@ -208,14 +208,12 @@ static int msm_config_get(struct pinctrl_dev *pctldev, unsigned int pin, unsigned long *config) { - dev_err(pctldev->dev, "pin_config_set op not supported\n"); return -ENOTSUPP; } static int msm_config_set(struct pinctrl_dev *pctldev, unsigned int pin, unsigned long *configs, unsigned num_configs) { - dev_err(pctldev->dev, "pin_config_set op not supported\n"); return -ENOTSUPP; } @@ -276,9 +274,11 @@ static int msm_config_group_get(struct pinctrl_dev *pctldev, val = readl(pctrl->regs + g->io_reg); arg = !!(val & BIT(g->in_bit)); break; + case PIN_CONFIG_INPUT_ENABLE: + val = readl(pctrl->regs + g->io_reg); + arg = !!(val & BIT(g->in_bit)); + break; default: - dev_err(pctrl->dev, "Unsupported config parameter: %x\n", - param); return -EINVAL; } @@ -348,6 +348,10 @@ static int msm_config_group_set(struct pinctrl_dev *pctldev, /* enable output */ arg = 1; break; + case PIN_CONFIG_INPUT_ENABLE: + /* disable output */ + arg = 0; + break; default: dev_err(pctrl->dev, "Unsupported config parameter: %x\n", param); @@ -372,6 +376,9 @@ static int msm_config_group_set(struct pinctrl_dev *pctldev, } static const struct pinconf_ops msm_pinconf_ops = { +#ifdef CONFIG_GENERIC_PINCONF + .is_generic = true, +#endif .pin_config_get = msm_config_get, .pin_config_set = msm_config_set, .pin_config_group_get = msm_config_group_get,