From patchwork Thu Oct 16 17:11:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Soren Brinkmann X-Patchwork-Id: 5092951 Return-Path: X-Original-To: patchwork-linux-arm@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 683269F30B for ; Thu, 16 Oct 2014 17:15:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 573A3201F4 for ; Thu, 16 Oct 2014 17:15:56 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7946C201ED for ; Thu, 16 Oct 2014 17:15:55 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xeoc7-0007iz-0H; Thu, 16 Oct 2014 17:13:23 +0000 Received: from mail-pa0-x229.google.com ([2607:f8b0:400e:c03::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XeobF-0007I8-0m for linux-arm-kernel@lists.infradead.org; Thu, 16 Oct 2014 17:12:29 +0000 Received: by mail-pa0-f41.google.com with SMTP id eu11so3847297pac.0 for ; Thu, 16 Oct 2014 10:12:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=oHlZNId3NS0xc60k4hiEC9bHwmE/XG3TNHwmYlhmEtI=; b=fMMd/NXyGR2p68db28834N0Hyv7W/DjRyeEVETMPQs8pvgdqYFI1qUROY7ZjaNqeG9 JkECu/K+W21CiLGvW5s4UY0U8TAKGZmhA+P6Q+SlpPAIgEijJLdgxCMInIqKWL9Gryb/ YT3z83vG9+uid6rKkdfHEyE+ubtKvmr+PsS2X/zMpR4d9oxSSEMJXkpbllCcuHZfmpl+ u1Axmp96eN8K8dBAmCgyNN8zRxavUWbVSAV7b+2o1IWFRRWTsKswuMqaNAvGLKkCaWvu YyjR5SK2TdB3931mJgfZuT6OpTqVnUypQXbwrMfykty1v2K8So8EJh9Vg7cTa4FEFMmX S3cg== X-Received: by 10.70.90.235 with SMTP id bz11mr311218pdb.74.1413479527816; Thu, 16 Oct 2014 10:12:07 -0700 (PDT) Received: from localhost ([149.199.62.254]) by mx.google.com with ESMTPSA id ar1sm13468304pbc.20.2014.10.16.10.12.06 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 16 Oct 2014 10:12:07 -0700 (PDT) From: Soren Brinkmann To: Linus Walleij Subject: [PATCH RFC v2 3/8] pinctrl: pinconf-generic: Add parameter 'IO standard' Date: Thu, 16 Oct 2014 10:11:30 -0700 Message-Id: <1413479495-14206-4-git-send-email-soren.brinkmann@xilinx.com> X-Mailer: git-send-email 2.1.2.1.g5e69ed6 In-Reply-To: <1413479495-14206-1-git-send-email-soren.brinkmann@xilinx.com> References: <1413479495-14206-1-git-send-email-soren.brinkmann@xilinx.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141016_101229_167332_7BFC5115 X-CRM114-Status: GOOD ( 12.40 ) X-Spam-Score: -0.7 (/) Cc: linux-arm-kernel@lists.infradead.org, Steffen Trumtrar , Michal Simek , =?UTF-8?q?S=C3=B6ren=20Brinkmann?= , linux-kernel@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=no 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 For HW that can select the IO standard for pins, add the infrastructure in pinconf generic to parse this parameter. Signed-off-by: Soren Brinkmann --- Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt | 3 +++ drivers/pinctrl/pinconf-generic.c | 2 ++ include/linux/pinctrl/pinconf-generic.h | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt index 98eb94d91a1c..862c4fe17d04 100644 --- a/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt @@ -184,6 +184,7 @@ low-power-disable - disable low power mode output-low - set the pin to output mode with low level output-high - set the pin to output mode with high level slew-rate - set the slew rate +io-standard - set the IO standard For example: @@ -215,5 +216,7 @@ arguments are described below. - input-debounce takes the debounce time in usec as argument or 0 to disable debouncing +- io-standard takes a driver specific argument to select an IO standard + More in-depth documentation on these parameters can be found in diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c index e28ef957ca2d..17ac8f00e16b 100644 --- a/drivers/pinctrl/pinconf-generic.c +++ b/drivers/pinctrl/pinconf-generic.c @@ -58,6 +58,7 @@ static struct pin_config_item conf_items[] = { PCONFDUMP(PIN_CONFIG_SLEW_RATE, "slew rate", NULL, true), PCONFDUMP(PIN_CONFIG_LOW_POWER_MODE, "pin low power", "mode", true), PCONFDUMP(PIN_CONFIG_OUTPUT, "pin output", "level", true), + PCONFDUMP(PIN_CONFIG_IOSTANDARD, "io standard", NULL, true), }; void pinconf_generic_dump_pin(struct pinctrl_dev *pctldev, @@ -181,6 +182,7 @@ static struct pinconf_generic_dt_params dt_params[] = { { "output-low", PIN_CONFIG_OUTPUT, 0, }, { "output-high", PIN_CONFIG_OUTPUT, 1, }, { "slew-rate", PIN_CONFIG_SLEW_RATE, 0}, + { "io-standard", PIN_CONFIG_IOSTANDARD, 0}, }; /** diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h index d578a60eff23..dd1d3251fb93 100644 --- a/include/linux/pinctrl/pinconf-generic.h +++ b/include/linux/pinctrl/pinconf-generic.h @@ -92,6 +92,9 @@ * @PIN_CONFIG_END: this is the last enumerator for pin configurations, if * you need to pass in custom configurations to the pin controller, use * PIN_CONFIG_END+1 as the base offset. + * @PIN_CONFIG_IOSTANDARD: if the pin can select an IO standard, the argument to + * this parameter (on a custom format) tells the driver which alternative + * IO standard to use. */ enum pin_config_param { PIN_CONFIG_BIAS_DISABLE, @@ -112,6 +115,7 @@ enum pin_config_param { PIN_CONFIG_SLEW_RATE, PIN_CONFIG_LOW_POWER_MODE, PIN_CONFIG_OUTPUT, + PIN_CONFIG_IOSTANDARD, PIN_CONFIG_END = 0x7FFF, };