-struct clk_ops {
- /**
- * get_rate() - Get current clock rate
- *
- * @dev: Device to check (UCLASS_CLK)
- * @return clock rate in Hz, or -ve error code
- */
- ulong (*get_rate)(struct udevice *dev);
-
- /**
- * set_rate() - Set current clock rate
- *
- * @dev: Device to adjust
- * @rate: New clock rate in Hz
- * @return new rate, or -ve error code
- */
- ulong (*set_rate)(struct udevice *dev, ulong rate);
-
- /**
- * clk_set_periph_rate() - Set clock rate for a peripheral
- *
- * @dev: Device to adjust (UCLASS_CLK)
- * @rate: New clock rate in Hz
- * @return new clock rate in Hz, or -ve error code
- */
- ulong (*get_periph_rate)(struct udevice *dev, int periph);
-
- /**
- * clk_set_periph_rate() - Set current clock rate for a peripheral
- *
- * @dev: Device to update (UCLASS_CLK)
- * @periph: Peripheral ID to cupdate
- * @return new clock rate in Hz, or -ve error code
+/**
+ * A clock is a hardware signal that oscillates autonomously at a specific
+ * frequency and duty cycle. Most hardware modules require one or more clock
+ * signal to drive their operation. Clock signals are typically generated
+ * externally to the HW module consuming them, by an entity this API calls a
+ * clock provider. This API provides a standard means for drivers to enable and
+ * disable clocks, and to set the rate at which they oscillate.
+ *
+ * A driver that implements UCLASS_CLOCK is a clock provider. A provider will
+ * often implement multiple separate clocks, since the hardware it manages
+ * often has this capability. clock_uclass.h describes the interface which
+ * clock providers must implement.
+ *
+ * Clock consumers/clients are the HW modules driven by the clock signals. This
+ * header file describes the API used by drivers for those HW modules.
+ */
+
+struct udevice;
+
+/**
+ * struct clk - A handle to (allowing control of) a single clock.
+ *
+ * Clients provide storage for clock handles. The content of the structure is
+ * managed solely by the clock API and clock drivers. A clock struct is
+ * initialized by "get"ing the clock struct. The clock struct is passed to all
+ * other clock APIs to identify which clock signal to operate upon.
+ *
+ * @dev: The device which implements the clock signal.
+ * @id: The clock signal ID within the provider.
+ *
+ * Currently, the clock API assumes that a single integer ID is enough to
+ * identify and configure any clock signal for any clock provider. If this
+ * assumption becomes invalid in the future, the struct could be expanded to
+ * either (a) add more fields to allow clock providers to store additional
+ * information, or (b) replace the id field with an opaque pointer, which the
+ * provider would dynamically allocated during its .of_xlate op, and process
+ * during is .request op. This may require the addition of an extra op to clean
+ * up the allocation.
+ */
+struct clk {
+ struct udevice *dev;
+ /*
+ * Written by of_xlate. We assume a single id is enough for now. In the
+ * future, we might add more fields here.