diff --git a/bsp/rockchip/dm/clk/clk-rk-gate.h b/bsp/rockchip/dm/clk/clk-rk-gate.h index c4d91072add..d05069b4e78 100755 --- a/bsp/rockchip/dm/clk/clk-rk-gate.h +++ b/bsp/rockchip/dm/clk/clk-rk-gate.h @@ -28,17 +28,17 @@ } #define GATE_NO_SET_RATE(_id, cname, pname, f, o, b, gf) \ -(void *)&(struct rockchip_clk_cell) \ -{ \ - .cell.name = cname, \ - .cell.ops = &rockchip_gate_clk_ops, \ - .cell.parent_name = pname, \ - .cell.parents_nr = 1, \ - .cell.flags = f | RT_CLK_F_SET_RATE_PARENT, \ - .id = _id, \ - .gate_offset = o, \ - .gate_shift = b, \ - .gate_flags = gf, \ +(void *)&(struct rockchip_clk_cell) \ +{ \ + .cell.name = cname, \ + .cell.ops = &rockchip_gate_clk_ops, \ + .cell.parent_name = pname, \ + .cell.parents_nr = 1, \ + .cell.flags = (f) & ~RT_CLK_F_SET_RATE_PARENT, \ + .id = _id, \ + .gate_offset = o, \ + .gate_shift = b, \ + .gate_flags = gf, \ } extern const struct rt_clk_ops rockchip_gate_clk_ops; diff --git a/bsp/rockchip/dm/regulator/regulator-rk8xx.c b/bsp/rockchip/dm/regulator/regulator-rk8xx.c index 3a0c6250a46..7977f462895 100755 --- a/bsp/rockchip/dm/regulator/regulator-rk8xx.c +++ b/bsp/rockchip/dm/regulator/regulator-rk8xx.c @@ -1115,6 +1115,7 @@ static rt_err_t append_rk8xx_regulator(struct rk8xx *rk8xx, struct rt_ofw_node * rgp = &rk8xx_reg->parent; rgp->ops = rk8xx_reg->desc->ops; rgp->param = &rk8xx_reg->param; + rgp->supply_name = rgp->param->name; rgp->dev = &rk8xx_reg->device; rgp->dev->ofw_node = np; diff --git a/bsp/rockchip/rk3500/.config b/bsp/rockchip/rk3500/.config index 4ec0c9be97e..ab1359d1cb1 100644 --- a/bsp/rockchip/rk3500/.config +++ b/bsp/rockchip/rk3500/.config @@ -252,7 +252,31 @@ CONFIG_DFS_USING_POSIX=y CONFIG_DFS_USING_WORKDIR=y CONFIG_DFS_FD_MAX=512 CONFIG_RT_USING_DFS_V2=y -# CONFIG_RT_USING_DFS_ELMFAT is not set +CONFIG_RT_USING_DFS_ELMFAT=y + +# +# elm-chan's FatFs, Generic FAT Filesystem Module +# +CONFIG_RT_DFS_ELM_CODE_PAGE=437 +CONFIG_RT_DFS_ELM_WORD_ACCESS=y +# CONFIG_RT_DFS_ELM_USE_LFN_0 is not set +# CONFIG_RT_DFS_ELM_USE_LFN_1 is not set +# CONFIG_RT_DFS_ELM_USE_LFN_2 is not set +CONFIG_RT_DFS_ELM_USE_LFN_3=y +CONFIG_RT_DFS_ELM_USE_LFN=3 +CONFIG_RT_DFS_ELM_LFN_UNICODE_0=y +# CONFIG_RT_DFS_ELM_LFN_UNICODE_1 is not set +# CONFIG_RT_DFS_ELM_LFN_UNICODE_2 is not set +# CONFIG_RT_DFS_ELM_LFN_UNICODE_3 is not set +CONFIG_RT_DFS_ELM_LFN_UNICODE=0 +CONFIG_RT_DFS_ELM_MAX_LFN=255 +CONFIG_RT_DFS_ELM_DRIVES=4 +CONFIG_RT_DFS_ELM_MAX_SECTOR_SIZE=512 +# CONFIG_RT_DFS_ELM_USE_ERASE is not set +# CONFIG_RT_DFS_ELM_REENTRANT is not set +CONFIG_RT_DFS_ELM_USE_EXFAT=y +# end of elm-chan's FatFs, Generic FAT Filesystem Module + CONFIG_RT_USING_DFS_DEVFS=y # CONFIG_RT_USING_DFS_ROMFS is not set CONFIG_RT_USING_DFS_PTYFS=y diff --git a/bsp/rockchip/rk3500/rtconfig.h b/bsp/rockchip/rk3500/rtconfig.h index 3ba507746d1..4905a15a983 100644 --- a/bsp/rockchip/rk3500/rtconfig.h +++ b/bsp/rockchip/rk3500/rtconfig.h @@ -170,6 +170,21 @@ #define DFS_USING_WORKDIR #define DFS_FD_MAX 512 #define RT_USING_DFS_V2 +#define RT_USING_DFS_ELMFAT + +/* elm-chan's FatFs, Generic FAT Filesystem Module */ + +#define RT_DFS_ELM_CODE_PAGE 437 +#define RT_DFS_ELM_WORD_ACCESS +#define RT_DFS_ELM_USE_LFN_3 +#define RT_DFS_ELM_USE_LFN 3 +#define RT_DFS_ELM_LFN_UNICODE_0 +#define RT_DFS_ELM_LFN_UNICODE 0 +#define RT_DFS_ELM_MAX_LFN 255 +#define RT_DFS_ELM_DRIVES 4 +#define RT_DFS_ELM_MAX_SECTOR_SIZE 512 +#define RT_DFS_ELM_USE_EXFAT +/* end of elm-chan's FatFs, Generic FAT Filesystem Module */ #define RT_USING_DFS_DEVFS #define RT_USING_DFS_PTYFS #define RT_USING_DFS_PROCFS diff --git a/components/drivers/regulator/regulator.c b/components/drivers/regulator/regulator.c index 3a852a0590a..61c429f1dfe 100644 --- a/components/drivers/regulator/regulator.c +++ b/components/drivers/regulator/regulator.c @@ -18,7 +18,6 @@ #define DBG_LVL DBG_INFO #include - struct rt_regulator { struct rt_regulator_node *reg_np; @@ -359,7 +358,6 @@ static rt_err_t regulator_enable(struct rt_regulator_node *reg_np) regulator_delay(enable_delay); } - rt_atomic_add(®_np->enabled_count, 1); err = regulator_notifier_call_chain(reg_np, RT_REGULATOR_MSG_ENABLE, RT_NULL); } } @@ -434,7 +432,7 @@ static rt_err_t regulator_disable(struct rt_regulator_node *reg_np) rt_err_t rt_regulator_disable(struct rt_regulator *reg) { - rt_err_t err; + rt_err_t err = RT_EOK; int enabled_cnt; if (!reg) @@ -450,20 +448,13 @@ rt_err_t rt_regulator_disable(struct rt_regulator *reg) rt_hw_spin_lock(&_regulator_lock.lock); enabled_cnt = rt_atomic_load(®->reg_np->enabled_count); - if (enabled_cnt > 0) - { - rt_atomic_sub(®->reg_np->enabled_count, 1); - enabled_cnt--; + rt_atomic_sub(®->reg_np->enabled_count, 1); - if (enabled_cnt > 0) - { - rt_hw_spin_unlock(&_regulator_lock.lock); - return RT_EOK; - } + if (enabled_cnt == 1) + { + err = regulator_disable(reg->reg_np); } - err = regulator_disable(reg->reg_np); - rt_hw_spin_unlock(&_regulator_lock.lock); return err; @@ -473,7 +464,7 @@ rt_bool_t rt_regulator_is_enabled(struct rt_regulator *reg) { if (!reg) { - return -RT_EINVAL; + return RT_FALSE; } if (reg->reg_np->ops->is_enabled)