diff options
author | Jyri Sarha <jsarha@ti.com> | 2014-09-05 15:21:34 +0300 |
---|---|---|
committer | Mike Turquette <mturquette@linaro.org> | 2014-09-26 16:51:42 -0700 |
commit | c873d14d30b838a516a94967242322d4b73e79e7 (patch) | |
tree | 2f9768c73c55c7667b93bca59eefb6dfd5af1f81 /include/linux/clk-provider.h | |
parent | db0bcc33a8aabab462c996baeac619f21616d938 (diff) | |
download | lwn-c873d14d30b838a516a94967242322d4b73e79e7.tar.gz lwn-c873d14d30b838a516a94967242322d4b73e79e7.zip |
clk: add gpio gated clock
The added gpio-gate-clock is a basic clock that can be enabled and
disabled trough a gpio output. The DT binding document for the clock
is also added. For EPROBE_DEFER handling the registering of the clock
has to be delayed until of_clk_get() call time.
Signed-off-by: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'include/linux/clk-provider.h')
-rw-r--r-- | include/linux/clk-provider.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 411dd7eb2653..ec1581bd94cd 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -488,6 +488,28 @@ struct clk *clk_register_composite(struct device *dev, const char *name, struct clk_hw *gate_hw, const struct clk_ops *gate_ops, unsigned long flags); +/*** + * struct clk_gpio_gate - gpio gated clock + * + * @hw: handle between common and hardware-specific interfaces + * @gpiod: gpio descriptor + * + * Clock with a gpio control for enabling and disabling the parent clock. + * Implements .enable, .disable and .is_enabled + */ + +struct clk_gpio { + struct clk_hw hw; + struct gpio_desc *gpiod; +}; + +extern const struct clk_ops clk_gpio_gate_ops; +struct clk *clk_register_gpio_gate(struct device *dev, const char *name, + const char *parent_name, struct gpio_desc *gpio, + unsigned long flags); + +void of_gpio_clk_gate_setup(struct device_node *node); + /** * clk_register - allocate a new clock, register it and return an opaque cookie * @dev: device that is registering this clock |