From patchwork Tue Oct 28 20:57:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 5179861 Return-Path: X-Original-To: patchwork-linux-rockchip@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 D07A09F387 for ; Tue, 28 Oct 2014 20:58:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 18CBF2017A for ; Tue, 28 Oct 2014 20:58:19 +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 5C8602016C for ; Tue, 28 Oct 2014 20:58:18 +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 1XjDqL-0007xj-OO; Tue, 28 Oct 2014 20:58:17 +0000 Received: from mail-pd0-x22e.google.com ([2607:f8b0:400e:c02::22e]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XjDq1-0007q1-7j for linux-rockchip@lists.infradead.org; Tue, 28 Oct 2014 20:57:58 +0000 Received: by mail-pd0-f174.google.com with SMTP id p10so1498579pdj.5 for ; Tue, 28 Oct 2014 13:57:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=p0xvMpYpKSQ8+2EgNuOVM0ixfr6HjjMrjrKKZ0B8w10=; b=JIwshSqiLfjReyDBjkwPclYZhQ0v7GTV/ackRSpGM02bkuPES+rO2zDK1nQ6uotPT6 fGCsi/36O0rsZOC9xSR8s/CsulbDavHIvACKgtb/3FGiz+vwsujH2LwHJ/BJM1iRhNYB dxazu2XNiydBndggYH12BERrhBy9Q5szJ3Yfs= 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:in-reply-to :references; bh=p0xvMpYpKSQ8+2EgNuOVM0ixfr6HjjMrjrKKZ0B8w10=; b=gD8XxFM37aya18YHAdt4UabEs7yvuGkCw9zuwedYEBawM6nXo419+gRoth6kXP6F5o QbrHIirss2Z1ehxfqLjj26dTf7jy2tyJIh6prPEZwO3TwvuLon0cxwLwTkvhtZ6iyIUt e9mzCdpsgPWFd6vb4FNz8fCPDoT6VxyqW54lxuhVXs3EP6HqehFVVLGUgoKhDIf08AC0 bxmk1aRgYOI9L48p7QsMd9dc3yhWVQuWh+Ud2HilBptceped8G5EBGYnP/N+jbnazBvJ rUwtZRCkk9VAkGzjeazYV3lXj0vh0ri+FgV6YEgwBvS709NA3xmYbQiH+fUEA4HOh9Tr Rr4A== X-Gm-Message-State: ALoCoQn2/e2iSm/koLe8npUtn0NT7h5QM7QpFt84UfsH4Z1AfosINTXmqp3685zvjRFoAeTJeigg X-Received: by 10.68.164.65 with SMTP id yo1mr6014291pbb.126.1414529856126; Tue, 28 Oct 2014 13:57:36 -0700 (PDT) Received: from tictac.mtv.corp.google.com ([172.22.65.76]) by mx.google.com with ESMTPSA id i10sm2464334pdr.21.2014.10.28.13.57.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Oct 2014 13:57:35 -0700 (PDT) From: Doug Anderson To: Linus Walleij , Heiko Stuebner Subject: [RFC PATCH 2/2] pinctrl: rockchip: Implement PIN_CONFIG_OUTPUT_DISABLE Date: Tue, 28 Oct 2014 13:57:15 -0700 Message-Id: <1414529835-16207-2-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 2.1.0.rc2.206.gedb03e5 In-Reply-To: <1414529835-16207-1-git-send-email-dianders@chromium.org> References: <1414529835-16207-1-git-send-email-dianders@chromium.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141028_135757_344294_25D60E48 X-CRM114-Status: UNSURE ( 8.92 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.8 (/) Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Doug Anderson , linux-rockchip@lists.infradead.org, Sonny Rao , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 If someone requests us to disable output for a pin, we'll configure it as an input. Signed-off-by: Doug Anderson --- drivers/pinctrl/pinctrl-rockchip.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c index 40970c3..c1ac14c 100644 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c @@ -971,6 +971,12 @@ static int rockchip_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin, if (rc) return rc; break; + case PIN_CONFIG_OUTPUT_DISABLE: + rc = _rockchip_pmx_gpio_set_direction(&bank->gpio_chip, + pin - bank->pin_base, true); + if (rc) + return rc; + break; case PIN_CONFIG_OUTPUT: rockchip_gpio_set(&bank->gpio_chip, pin - bank->pin_base, arg);