From patchwork Fri Jan 4 17:00:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13809 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id ED60923EC8 for ; Fri, 4 Jan 2013 17:01:09 +0000 (UTC) Received: from mail-vb0-f44.google.com (mail-vb0-f44.google.com [209.85.212.44]) by fiordland.canonical.com (Postfix) with ESMTP id 93C29A197DC for ; Fri, 4 Jan 2013 17:01:09 +0000 (UTC) Received: by mail-vb0-f44.google.com with SMTP id fc26so17067354vbb.3 for ; Fri, 04 Jan 2013 09:01:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:from:to:cc:subject:date:message-id:x-mailer :mime-version:content-type:x-gm-message-state; bh=27e2Dz4nY6HquQeTjZ2hJdPFfAGdDzc6eSeVP4CHv1g=; b=FAv5Zh4+h3U3yF1YPdEGwfDYSQGl3DF0AsYW60zqSqNus2F31c316z+KAT6bA4nPAB mbN3MTt7po0Z/v3JBU082JE5rh0XsFVW1u7XnZEpI+qit1TzbPT++TgyfVixcpLIQjSd lgkK8pCGJ7vIYiOBGexzTtPQwNzjJNtraauS5qVsLvXGMCedhsLMTf1zFuyWh+undRfe k7Yc3FFyNEA4nlI6wZbnhCk7Tk+IkgMOPnPfk56PLsLpeJM8zajbb1JZkEis3V2bNmOp F0VhtpqzFFufxmMjVI7ZeWU9HiaGUnQmeFAD1QZG2ZWrbIXcnhlEnKFIKB+Es1YoUlM2 Qbww== X-Received: by 10.58.210.65 with SMTP id ms1mr77892875vec.59.1357318869068; Fri, 04 Jan 2013 09:01:09 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp146478veb; Fri, 4 Jan 2013 09:01:08 -0800 (PST) X-Received: by 10.14.2.196 with SMTP id 44mr144532450eef.25.1357318867737; Fri, 04 Jan 2013 09:01:07 -0800 (PST) Received: from eu1sys200aog112.obsmtp.com (eu1sys200aog112.obsmtp.com [207.126.144.133]) by mx.google.com with SMTP id g47si136030029eep.135.2013.01.04.09.01.01 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Jan 2013 09:01:07 -0800 (PST) Received-SPF: neutral (google.com: 207.126.144.133 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.133; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.133 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob112.postini.com ([207.126.147.11]) with SMTP ID DSNKUOcKzR5acvuTYsbH0XyoRPaiQ6SN3Epy@postini.com; Fri, 04 Jan 2013 17:01:07 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 4608A114; Fri, 4 Jan 2013 17:01:00 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id CAD424E96; Fri, 4 Jan 2013 17:00:59 +0000 (GMT) Received: from exdcvycastm004.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm004", Issuer "exdcvycastm004" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id 1CFF324C07C; Fri, 4 Jan 2013 18:00:46 +0100 (CET) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.2) with Microsoft SMTP Server (TLS) id 8.3.83.0; Fri, 4 Jan 2013 18:00:54 +0100 From: Linus Walleij To: , Cc: Stephen Warren , Anmar Oueja , Linus Walleij , Patrice Chotard Subject: [PATCH] pinctrl: add pinconf-generic defines for output Date: Fri, 4 Jan 2013 18:00:49 +0100 Message-ID: <1357318849-12616-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.11.3 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQkg//h0rdyODYJ93lC6U1gS0FkCUHLxMaT1FYfb9c+QjPJxm6u0Rmfd0V3H2tI5zInMXp/l From: Linus Walleij This adds a definition of a generic output configuration for a certain pin when using the generic pin configuration library. Whereas driving pins low/high is usually a GPIO business, you may want to set up pins into a default state using hogs, and never touch them again. This helps out with that scenario. Based on a patch from Patrice Chotard. Signed-off-by: Patrice Chotard Signed-off-by: Linus Walleij --- drivers/pinctrl/pinconf-generic.c | 1 + include/linux/pinctrl/pinconf-generic.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c index 833a364..bcf8157 100644 --- a/drivers/pinctrl/pinconf-generic.c +++ b/drivers/pinctrl/pinconf-generic.c @@ -46,6 +46,7 @@ struct pin_config_item conf_items[] = { PCONFDUMP(PIN_CONFIG_INPUT_DEBOUNCE, "input debounce", "time units"), PCONFDUMP(PIN_CONFIG_POWER_SOURCE, "pin power source", "selector"), PCONFDUMP(PIN_CONFIG_LOW_POWER_MODE, "pin low power", "mode"), + PCONFDUMP(PIN_CONFIG_OUTPUT, "pin output", "level"), }; void pinconf_generic_dump_pin(struct pinctrl_dev *pctldev, diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h index 47a1bdd..b23d99d 100644 --- a/include/linux/pinctrl/pinconf-generic.h +++ b/include/linux/pinctrl/pinconf-generic.h @@ -62,6 +62,8 @@ * operation, if several modes of operation are supported these can be * passed in the argument on a custom form, else just use argument 1 * to indicate low power mode, argument 0 turns low power mode off. + * @PIN_CONFIG_OUTPUT: this will configure the pin in output, use argument + * 1 to indicate high level, argument 0 to indicate low level. * @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. @@ -79,6 +81,7 @@ enum pin_config_param { PIN_CONFIG_INPUT_DEBOUNCE, PIN_CONFIG_POWER_SOURCE, PIN_CONFIG_LOW_POWER_MODE, + PIN_CONFIG_OUTPUT, PIN_CONFIG_END = 0x7FFF, };