Skip to content

Commit a9c1132

Browse files
committed
drivers: clock_control: sf32lb: add SF32LB_CLOCK_DT_INST_PARENT_SPEC_GET
Add SF32LB_CLOCK_DT_INST_PARENT_SPEC_GET clock macro Signed-off-by: Qingsong Gou <[email protected]>
1 parent 6ceaf80 commit a9c1132

File tree

1 file changed

+11
-0
lines changed
  • include/zephyr/drivers/clock_control

1 file changed

+11
-0
lines changed

include/zephyr/drivers/clock_control/sf32lb.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,17 @@ struct sf32lb_clock_dt_spec {
5656
*/
5757
#define SF32LB_CLOCK_DT_INST_SPEC_GET(index) SF32LB_CLOCK_DT_SPEC_GET(DT_DRV_INST(index))
5858

59+
/**
60+
* @brief Initialize a `sf32lb_clock_dt_spec` structure from a parent DT instance.
61+
*
62+
* @param index DT instance index
63+
*/
64+
#define SF32LB_CLOCK_DT_INST_PARENT_SPEC_GET(index) \
65+
{ \
66+
.dev = DEVICE_DT_GET(DT_CLOCKS_CTLR(DT_INST_PARENT(index))), \
67+
.id = DT_CLOCKS_CELL(DT_INST_PARENT(index), id), \
68+
}
69+
5970
/**
6071
* @brief Same as SF32LB_CLOCK_DT_INST_SPEC_GET but with a default value.
6172
*

0 commit comments

Comments
 (0)