Lines Matching +full:de +full:- +full:asserting
1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2013 - 2014 Texas Instruments Incorporated - https://www.ti.com
7 * Sergej Sawazki <ce3a@gmx.de>
12 #include <linux/clk-provider.h>
25 * prepare - clk_(un)prepare only ensures parent is (un)prepared
26 * enable - clk_enable and clk_disable are functional & control gpio
27 * rate - inherits rate from parent. No clk_set_rate support
28 * parent - fixed parent. No clk_set_parent support
32 * struct clk_gpio - gpio gated clock
34 * @hw: handle between common and hardware-specific interfaces
38 * or switching between two parents by asserting or deasserting the gpio.
55 gpiod_set_value(clk->gpiod, 1); in clk_gpio_gate_enable()
64 gpiod_set_value(clk->gpiod, 0); in clk_gpio_gate_disable()
71 return gpiod_get_value(clk->gpiod); in clk_gpio_gate_is_enabled()
84 gpiod_set_value_cansleep(clk->gpiod, 1); in clk_sleeping_gpio_gate_prepare()
93 gpiod_set_value_cansleep(clk->gpiod, 0); in clk_sleeping_gpio_gate_unprepare()
100 return gpiod_get_value_cansleep(clk->gpiod); in clk_sleeping_gpio_gate_is_prepared()
112 * prepare - clk_prepare only ensures that parents are prepared
113 * rate - rate is only affected by parent switching. No clk_set_rate support
114 * parent - parent is adjustable through clk_set_parent
121 return gpiod_get_value_cansleep(clk->gpiod); in clk_gpio_mux_get_parent()
128 gpiod_set_value_cansleep(clk->gpiod, index); in clk_gpio_mux_set_parent()
154 return ERR_PTR(-ENOMEM); in clk_register_gpio()
156 init.name = dev->of_node->name; in clk_register_gpio()
162 clk_gpio->gpiod = gpiod; in clk_register_gpio()
163 clk_gpio->hw.init = &init; in clk_register_gpio()
165 hw = &clk_gpio->hw; in clk_register_gpio()
195 struct device *dev = &pdev->dev; in gpio_clk_driver_probe()
196 struct device_node *node = dev->of_node; in gpio_clk_driver_probe()
204 is_mux = of_device_is_compatible(node, "gpio-mux-clock"); in gpio_clk_driver_probe()
208 dev_err(dev, "mux-clock must have 2 parents\n"); in gpio_clk_driver_probe()
209 return -EINVAL; in gpio_clk_driver_probe()
216 if (ret == -EPROBE_DEFER) in gpio_clk_driver_probe()
237 { .compatible = "gpio-mux-clock" },
238 { .compatible = "gpio-gate-clock" },
245 .name = "gpio-clk",