|
Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
|
Common definitions for clock control emul. More...
#include <zephyr/drivers/clock_control.h>#include <zephyr/drivers/clock_control/renesas_cpg_mssr.h>#include <zephyr/sys/util.h>Go to the source code of this file.
Data Structures | |
| union | clock_control_emul_subsys |
| Storage for the different subsystem selector representations. More... | |
Macros | |
| #define | CLOCK_CONTROL_SUBSYS_MATCH_1CELL(compat) |
| Define a subsystem matcher for a one-cell clock selector. | |
| #define | CLOCK_CONTROL_RATE_TO_VALUE_1CELL(compat) |
| Define a rate converter for a one-cell clock selector. | |
| #define | CLOCK_CONTROL_SUBSYS_1CELL(compat) |
| Define a subsystem converter for a one-cell clock selector. | |
| #define | CLOCK_CONTROL_EMUL_DEFINE_1CELL(compat) |
| Define all hooks for a one-cell clock controller compatible. | |
Functions | |
| static bool | clock_control_emul_1cell_subsys_match (clock_control_subsys_t sys, const uint32_t *cells, size_t num_cells) |
| Match a one-cell clock selector against a subsystem. | |
| static int | clock_control_emul_1cell_rate_to_value (clock_control_subsys_rate_t rate, uint32_t *value) |
| Convert a subsystem rate to a one-cell value. | |
| static clock_control_subsys_t | clock_control_emul_1cell_cells_to_subsys (const uint32_t *cells, union clock_control_emul_subsys *storage) |
| Convert one clock-id cell to a subsystem selector. | |
| static bool | zephyr_clock_controller_emul_id_subsys_match (clock_control_subsys_t sys, const uint32_t *cells, size_t num_cells) |
| Match a one-cell clock selector against a subsystem. | |
| static int | zephyr_clock_controller_emul_id_rate_to_value (clock_control_subsys_rate_t rate, uint32_t *value) |
| Convert a subsystem rate to a one-cell value. | |
| static clock_control_subsys_t | zephyr_clock_controller_emul_id_cells_to_subsys (const uint32_t *cells, union clock_control_emul_subsys *storage) |
| Convert one clock-id cell to a subsystem selector. | |
| static bool | zephyr_clock_controller_emul_clkid_subsys_match (clock_control_subsys_t sys, const uint32_t *cells, size_t num_cells) |
| Match a one-cell clock selector against a subsystem. | |
| static int | zephyr_clock_controller_emul_clkid_rate_to_value (clock_control_subsys_rate_t rate, uint32_t *value) |
| Convert a subsystem rate to a one-cell value. | |
| static clock_control_subsys_t | zephyr_clock_controller_emul_clkid_cells_to_subsys (const uint32_t *cells, union clock_control_emul_subsys *storage) |
| Convert one clock-id cell to a subsystem selector. | |
| static bool | zephyr_clock_controller_emul_clk_id_subsys_match (clock_control_subsys_t sys, const uint32_t *cells, size_t num_cells) |
| Match a one-cell clock selector against a subsystem. | |
| static int | zephyr_clock_controller_emul_clk_id_rate_to_value (clock_control_subsys_rate_t rate, uint32_t *value) |
| Convert a subsystem rate to a one-cell value. | |
| static clock_control_subsys_t | zephyr_clock_controller_emul_clk_id_cells_to_subsys (const uint32_t *cells, union clock_control_emul_subsys *storage) |
| Convert one clock-id cell to a subsystem selector. | |
| static bool | zephyr_clock_controller_emul_rcar_cpg_mssr_subsys_match (clock_control_subsys_t sys, const uint32_t *cells, size_t num_cells) |
| Match an R-Car CPG/MSSR selector against devicetree cells. | |
| static int | zephyr_clock_controller_emul_rcar_cpg_mssr_rate_to_value (clock_control_subsys_rate_t rate, uint32_t *value) |
| Convert an R-Car CPG/MSSR rate to a stored value. | |
| static clock_control_subsys_t | zephyr_clock_controller_emul_rcar_cpg_mssr_cells_to_subsys (const uint32_t *cells, union clock_control_emul_subsys *storage) |
| Build an R-Car CPG/MSSR selector from devicetree cells. | |
Common definitions for clock control emul.
Each supported compatible provides three functions, named after the devicetree compatible token so that the driver can reach them with UTIL_CAT():
[compat]_subsys_match() tells whether a subsystem selector refers to a given entry of the clock-ids property,[compat]_rate_to_value() converts a rate argument to a plain value,[compat]_cells_to_subsys() builds a subsystem selector out of the cells of one clock-ids entry.The last one lets a caller drive any variant from its devicetree data alone, without knowing how many cells the selector has or what type it is.
| #define CLOCK_CONTROL_EMUL_DEFINE_1CELL | ( | compat | ) |
Define all hooks for a one-cell clock controller compatible.
| compat | Token naming the devicetree compatible and generated hook functions. |
| #define CLOCK_CONTROL_RATE_TO_VALUE_1CELL | ( | compat | ) |
Define a rate converter for a one-cell clock selector.
| compat | Token used to form the generated function name. |
| #define CLOCK_CONTROL_SUBSYS_1CELL | ( | compat | ) |
Define a subsystem converter for a one-cell clock selector.
| compat | Token used to form the generated function name. |
| #define CLOCK_CONTROL_SUBSYS_MATCH_1CELL | ( | compat | ) |
Define a subsystem matcher for a one-cell clock selector.
| compat | Token used to form the generated function name. |
|
inlinestatic |
Convert one clock-id cell to a subsystem selector.
| cells | One-cell clock identifier from the devicetree clock-ids property. |
| storage | Storage for a structured selector; unused by this scalar variant. |
cells[0].
|
inlinestatic |
Convert a subsystem rate to a one-cell value.
| rate | Scalar rate encoded in the opaque subsystem-rate pointer. | |
| [out] | value | Converted rate value. |
| 0 | Conversion succeeds. |
|
inlinestatic |
Match a one-cell clock selector against a subsystem.
| sys | Subsystem selector encoded as a scalar clock identifier. |
| cells | One-cell clock identifier from the devicetree clock-ids property. |
| num_cells | Number of cells in cells; must be one. |
sys matches the clock identifier in cells, or false otherwise.
|
inlinestatic |
Convert one clock-id cell to a subsystem selector.
| cells | One-cell clock identifier from the devicetree clock-ids property. |
| storage | Storage for a structured selector; unused by this scalar variant. |
cells[0].
|
inlinestatic |
Convert a subsystem rate to a one-cell value.
| rate | Scalar rate encoded in the opaque subsystem-rate pointer. | |
| [out] | value | Converted rate value. |
| 0 | Conversion succeeds. |
|
inlinestatic |
Match a one-cell clock selector against a subsystem.
| sys | Subsystem selector encoded as a scalar clock identifier. |
| cells | One-cell clock identifier from the devicetree clock-ids property. |
| num_cells | Number of cells in cells; must be one. |
sys matches the clock identifier in cells, or false otherwise.
|
inlinestatic |
Convert one clock-id cell to a subsystem selector.
| cells | One-cell clock identifier from the devicetree clock-ids property. |
| storage | Storage for a structured selector; unused by this scalar variant. |
cells[0].
|
inlinestatic |
Convert a subsystem rate to a one-cell value.
| rate | Scalar rate encoded in the opaque subsystem-rate pointer. | |
| [out] | value | Converted rate value. |
| 0 | Conversion succeeds. |
|
inlinestatic |
Match a one-cell clock selector against a subsystem.
| sys | Subsystem selector encoded as a scalar clock identifier. |
| cells | One-cell clock identifier from the devicetree clock-ids property. |
| num_cells | Number of cells in cells; must be one. |
sys matches the clock identifier in cells, or false otherwise.
|
inlinestatic |
Convert one clock-id cell to a subsystem selector.
| cells | One-cell clock identifier from the devicetree clock-ids property. |
| storage | Storage for a structured selector; unused by this scalar variant. |
cells[0].
|
inlinestatic |
Convert a subsystem rate to a one-cell value.
| rate | Scalar rate encoded in the opaque subsystem-rate pointer. | |
| [out] | value | Converted rate value. |
| 0 | Conversion succeeds. |
|
inlinestatic |
Match a one-cell clock selector against a subsystem.
| sys | Subsystem selector encoded as a scalar clock identifier. |
| cells | One-cell clock identifier from the devicetree clock-ids property. |
| num_cells | Number of cells in cells; must be one. |
sys matches the clock identifier in cells, or false otherwise.
|
inlinestatic |
Build an R-Car CPG/MSSR selector from devicetree cells.
| cells | Two-cell clock identifier in domain, module order. | |
| [out] | storage | Storage that receives the selector descriptor. Keep it valid while the returned selector is in use. |
storage.
|
inlinestatic |
Convert an R-Car CPG/MSSR rate to a stored value.
| rate | Scalar rate encoded in the opaque subsystem-rate pointer. | |
| [out] | value | Converted rate value. |
| 0 | Conversion succeeds. |
|
inlinestatic |
Match an R-Car CPG/MSSR selector against devicetree cells.
| sys | R-Car selector pointing to a rcar_cpg_clk descriptor. |
| cells | Two-cell clock identifier in domain, module order. |
| num_cells | Number of cells in cells; must be two. |
cells, or false otherwise.