aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Walleij2017-09-24 18:19:19 +0200
committerStephen Boyd2017-11-02 01:20:40 -0700
commit1b5d1a58a51324b1b6c851abec3bf40bd539cbb2 (patch)
tree901642f1469ebecd7b55ad74e2e12c95c1860f6d /drivers
parent908a543ac7cdf3aa8a283ec42cab3c16e2fc45a2 (diff)
clk: clk-gpio: Request GPIO descriptor as LOW
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 <ce3a@gmx.de> Cc: Jyri Sarha <jsarha@ti.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/clk/clk-gpio.c10
1 files changed, 1 insertions, 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)