linux/drivers/clk/clk-gpio.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (C) 2013 - 2014 Texas Instruments Incorporated - https://www.ti.com
 *
 * Authors:
 *    Jyri Sarha <[email protected]>
 *    Sergej Sawazki <[email protected]>
 *
 * Gpio controlled clock implementation
 */

#include <linux/clk-provider.h>
#include <linux/export.h>
#include <linux/slab.h>
#include <linux/gpio/consumer.h>
#include <linux/err.h>
#include <linux/device.h>
#include <linux/of.h>
#include <linux/platform_device.h>

/**
 * DOC: basic gpio gated clock which can be enabled and disabled
 *      with gpio output
 * Traits of this clock:
 * prepare - clk_(un)prepare only ensures parent is (un)prepared
 * enable - clk_enable and clk_disable are functional & control gpio
 * rate - inherits rate from parent.  No clk_set_rate support
 * parent - fixed parent.  No clk_set_parent support
 */

/**
 * struct clk_gpio - 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
 * or switching between two parents by asserting or deasserting the gpio.
 *
 * Implements .enable, .disable and .is_enabled or
 * .get_parent, .set_parent and .determine_rate depending on which clk_ops
 * is used.
 */
struct clk_gpio {};

#define to_clk_gpio(_hw)

static int clk_gpio_gate_enable(struct clk_hw *hw)
{}

static void clk_gpio_gate_disable(struct clk_hw *hw)
{}

static int clk_gpio_gate_is_enabled(struct clk_hw *hw)
{}

static const struct clk_ops clk_gpio_gate_ops =;

static int clk_sleeping_gpio_gate_prepare(struct clk_hw *hw)
{}

static void clk_sleeping_gpio_gate_unprepare(struct clk_hw *hw)
{}

static int clk_sleeping_gpio_gate_is_prepared(struct clk_hw *hw)
{}

static const struct clk_ops clk_sleeping_gpio_gate_ops =;

/**
 * DOC: basic clock multiplexer which can be controlled with a gpio output
 * Traits of this clock:
 * prepare - clk_prepare only ensures that parents are prepared
 * rate - rate is only affected by parent switching.  No clk_set_rate support
 * parent - parent is adjustable through clk_set_parent
 */

static u8 clk_gpio_mux_get_parent(struct clk_hw *hw)
{}

static int clk_gpio_mux_set_parent(struct clk_hw *hw, u8 index)
{}

static const struct clk_ops clk_gpio_mux_ops =;

static struct clk_hw *clk_register_gpio(struct device *dev, u8 num_parents,
					struct gpio_desc *gpiod,
					const struct clk_ops *clk_gpio_ops)
{}

static struct clk_hw *clk_hw_register_gpio_gate(struct device *dev,
						int num_parents,
						struct gpio_desc *gpiod)
{}

static struct clk_hw *clk_hw_register_gpio_mux(struct device *dev,
					       struct gpio_desc *gpiod)
{}

static int gpio_clk_driver_probe(struct platform_device *pdev)
{}

static const struct of_device_id gpio_clk_match_table[] =;

static struct platform_driver gpio_clk_driver =;
builtin_platform_driver();