From patchwork Sun Sep 24 16:19:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9968083 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E3A526020C for ; Sun, 24 Sep 2017 16:19:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D59A828B91 for ; Sun, 24 Sep 2017 16:19:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C960B28C3B; Sun, 24 Sep 2017 16:19:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_WEB, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB85C28B91 for ; Sun, 24 Sep 2017 16:19:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752595AbdIXQTx (ORCPT ); Sun, 24 Sep 2017 12:19:53 -0400 Received: from mail-pf0-f171.google.com ([209.85.192.171]:56255 "EHLO mail-pf0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752416AbdIXQTw (ORCPT ); Sun, 24 Sep 2017 12:19:52 -0400 Received: by mail-pf0-f171.google.com with SMTP id r71so2647259pfe.12 for ; Sun, 24 Sep 2017 09:19:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IdHFZXVMzu+O5VuYEbyWRrqt0DX9F0OHFgQpI/M7HjM=; b=cGCWw9DTs7D+hUW/NDgEGCw4J8aNUSqsor6zPl0a9hi0WtrxG+Gzjf/5LAIi3UcNtq TjYIboTiL3muMTmivJElXG+Oh2RlVx1AC6+dybIq3KyN6DNspa+4JXdk3Qcp43iX8vep eIV3P57rHAJRXgsT/LTKjK7hCSbUDBuzC3yFg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=IdHFZXVMzu+O5VuYEbyWRrqt0DX9F0OHFgQpI/M7HjM=; b=FLEj7e85fEfmINqLcvjDetaUW2UxNnqhvuJZz6VX7JsH2d8V6lUwxKOMFhWknKqoY0 AGKQAUwDQ64ueZMHUJDsUYZ0PfnaAcJw3YtdmWweokG/j2hYp7ii0ZKy18wmW8XR3tQz ucfNTH9nX3TDji1X1ZiV3tZIYXHjZgxa9LMbf9WOhLA6xbINc/cTOq03EE7s6zf3Mhz3 Y7WwUPddfPX1Hn42FV9WdBNTTgG40KW2AJtmgwrsd0HdTRS9rlQSJE1AIqnPpGeOPX7x ApL+JQc2//jNQVUFlvIO3nGvxZjufHuejJGZbcGIkLGEEtv0e2VFcOCqkLax94WANeDp RKRQ== X-Gm-Message-State: AHPjjUhonygzXc7b+LWMxsE8Yw2cWT0pEiwvTrsprdkvUOggY5z12T9Q 62UBnFj7j+eNhQ7NfXhiETEiaCht83U= X-Google-Smtp-Source: AOwi7QCzKh/+n85z2RBi/6olryH7DY9LhfpOM6FArK3U6htQwAC6DOK9hqOk5vy9IJcQjFRhfjr4Rg== X-Received: by 10.99.4.8 with SMTP id 8mr5224364pge.123.1506269992296; Sun, 24 Sep 2017 09:19:52 -0700 (PDT) Received: from genomnajs.saswifi.com ([104.153.224.168]) by smtp.gmail.com with ESMTPSA id 125sm7538672pff.5.2017.09.24.09.19.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 24 Sep 2017 09:19:51 -0700 (PDT) From: Linus Walleij To: Michael Turquette , Stephen Boyd Cc: linux-clk@vger.kernel.org, Linus Walleij , Sergej Sawazki , Jyri Sarha Subject: [PATCH 2/2] clk: clk-gpio: Request GPIO descriptor as LOW Date: Sun, 24 Sep 2017 18:19:19 +0200 Message-Id: <20170924161919.24832-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170924161919.24832-1-linus.walleij@linaro.org> References: <20170924161919.24832-1-linus.walleij@linaro.org> Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Requesting the GPIOD_OUT_LOW low will make sure the GPIO is deasserted when requested. The gpiolib core will make sure that if the GPIO line is active low, it will be logically driven high when deasserted, see drivers/gpiolib.c gpiod_configure_flags(). Cc: Sergej Sawazki Cc: Jyri Sarha Signed-off-by: Linus Walleij --- drivers/clk/clk-gpio.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/clk/clk-gpio.c b/drivers/clk/clk-gpio.c index 9d057073e110..151513c655c3 100644 --- a/drivers/clk/clk-gpio.c +++ b/drivers/clk/clk-gpio.c @@ -109,14 +109,6 @@ static struct clk_hw *clk_register_gpio(struct device *dev, const char *name, if (!clk_gpio) return ERR_PTR(-ENOMEM); - /* - * Set to disabled no matter what: NOTE if the GPIO line is active low - * the GPIO descriptor knows this and will set it high to deassert the - * line. This assumes the GPIO descriptor has been requested using - * GPIOD_ASIS by the callers so we need to initialize it as disabled here. - */ - gpiod_set_value(gpiod, 0); - init.name = name; init.ops = clk_gpio_ops; init.flags = flags | CLK_IS_BASIC; @@ -237,7 +229,7 @@ static int gpio_clk_driver_probe(struct platform_device *pdev) is_mux = of_device_is_compatible(node, "gpio-mux-clock"); gpio_name = is_mux ? "select" : "enable"; - gpiod = devm_gpiod_get(&pdev->dev, gpio_name, GPIOD_ASIS); + gpiod = devm_gpiod_get(&pdev->dev, gpio_name, GPIOD_OUT_LOW); if (IS_ERR(gpiod)) { ret = PTR_ERR(gpiod); if (ret == -EPROBE_DEFER)