/* Change Logs: Date Author Notes  GuEe-GUI first version  */
static rt_err_t fixed_clk_ofw_init(struct rt_platform_device *pdev, struct rt_clk_fixed_rate *clk_fixed)
/* Change Logs: Date Author Notes  GuEe-GUI first version  */
static rt_err_t fixed_clk_ofw_init(struct rt_platform_device *pdev, struct rt_clk_fixed_rate *clk_fixed)
{
    rt_err_t err = RT_EOK;
    rt_uint32_t rate, accuracy;
    struct rt_ofw_node *np = pdev->parent.ofw_node;
    const char *clk_name = np->name;
    if (!rt_ofw_prop_read_u32(np, "clock-frequency", &rate))
    {
        rt_ofw_prop_read_u32(np, "clock-accuracy", &accuracy);
        rt_ofw_prop_read_string(np, "clock-output-names", &clk_name);
        clk_fixed->clk.name = clk_name;
        clk_fixed->clk.rate = rate;
        clk_fixed->clk.min_rate = rate;
        clk_fixed->clk.max_rate = rate;
        clk_fixed->fixed_rate = rate;
        clk_fixed->fixed_accuracy = accuracy;
        rt_ofw_data(np) = &clk_fixed->clk;
    }
    else
    {
        err = -RT_EIO;
    }
    return err;
}