From patchwork Mon Aug 18 07:16:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ivan T. Ivanov" X-Patchwork-Id: 4732671 Return-Path: X-Original-To: patchwork-linux-arm-msm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 055409F377 for ; Mon, 18 Aug 2014 07:16:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 37D8F20120 for ; Mon, 18 Aug 2014 07:16:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 614212011E for ; Mon, 18 Aug 2014 07:16:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751417AbaHRHQQ (ORCPT ); Mon, 18 Aug 2014 03:16:16 -0400 Received: from ns.mm-sol.com ([37.157.136.199]:36634 "EHLO extserv.mm-sol.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751013AbaHRHQP (ORCPT ); Mon, 18 Aug 2014 03:16:15 -0400 Received: from [192.168.27.192] (unknown [37.157.136.206]) by extserv.mm-sol.com (Postfix) with ESMTPSA id 70BB6C7D3; Mon, 18 Aug 2014 10:16:13 +0300 (EEST) Message-ID: <1408346162.2695.33.camel@iivanov-dev> Subject: Re: [PATCH v3 1/6] pinctrl: Device tree bindings for Qualcomm pm8xxx gpio block From: "Ivan T. Ivanov" To: Daniel Cc: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Bjorn Andersson , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 18 Aug 2014 10:16:02 +0300 In-Reply-To: References: <1407771634-14946-1-git-send-email-iivanov@mm-sol.com> <1407771634-14946-2-git-send-email-iivanov@mm-sol.com> X-Mailer: Evolution 3.10.1-2ubuntu2~saucy1 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-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 On Sat, 2014-08-16 at 16:24 +0100, Daniel wrote: > @Ivan: sorry about the double post. > > Am 11.08.2014 um 16:40 schrieb Ivan T. Ivanov : > > diff --git a/include/dt-bindings/pinctrl/qcom,pmic-gpio.h b/include/dt-bindings/pinctrl/qcom,pmic-gpio.h > > new file mode 100644 > > index 0000000..994e748 > > --- /dev/null > > +++ b/include/dt-bindings/pinctrl/qcom,pmic-gpio.h > > @@ -0,0 +1,107 @@ > > +/* > > + * This header provides constants for the Qualcomm PMIC gpio binding. > > + */ > > + > > +#ifndef _DT_BINDINGS_PINCTRL_QCOM_PMIC_GPIO_H > > +#define _DT_BINDINGS_PINCTRL_QCOM_PMIC_GPIO_H > > + > > +#define PMIC_GPIO_PULL_UP_30 1 > > +#define PMIC_GPIO_PULL_UP_1P5 2 > > +#define PMIC_GPIO_PULL_UP_31P5 3 > > +#define PMIC_GPIO_PULL_UP_1P5_30 4 > > Looking at drivers/pinctrl/qcom/pinctrl-ssbi-pmic.c, shouldn't these defines start at 0? > e.g. #define PMIC_GPIO_PULL_UP_30 0 > Initially "bias-pull-up" was used to set this parameter. Zero value for "bias-pull-up" has special meaning "...the pin is connected to VDD...". So values in DTS have to have offset by one. Micro Amps are non-standard for pull-ups, thats why I have changed this to "qcom,pull-up-strength", but I have made mistake in config_set function. Following patch should fix the issue. I will send updated version soon. > However, I still cannot get any data from those 2 pins if I export them through /sys/class/gpio... Ensure that you are exporting the right gpio number. # cat /sys/kernel/debug/gpio Will tell you correct gpio range for registered gpio chips. > > Device: Nexus 7 2013 WiFi > Board: APQ8064 Thanks for testing this. Regards, Ivan --- drivers/pinctrl/qcom/pinctrl-ssbi-pmic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) banks |= BIT(3); -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" 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-ssbi-pmic.c b/drivers/pinctrl/qcom/pinctrl-ssbi-pmic.c index 9a1b443..dd424f4 100644 --- a/drivers/pinctrl/qcom/pinctrl-ssbi-pmic.c +++ b/drivers/pinctrl/qcom/pinctrl-ssbi-pmic.c @@ -446,7 +446,7 @@ static int pm8xxx_gpio_config_set(struct pinctrl_dev *pctldev, dev_err(pctrl->dev, "invalid pull-up level\n"); return -EINVAL; } - pin->bias = arg - PM8XXX_GPIO_BIAS_PU_30; + pin->bias = arg - PMIC_GPIO_PULL_UP_30; banks |= BIT(2); pin->disable = 0;