Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions bsp/rockchip/dm/clk/clk-rk-gate.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions bsp/rockchip/dm/regulator/regulator-rk8xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
26 changes: 25 additions & 1 deletion bsp/rockchip/rk3500/.config
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions bsp/rockchip/rk3500/rtconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 6 additions & 15 deletions components/drivers/regulator/regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#define DBG_LVL DBG_INFO
#include <rtdbg.h>


struct rt_regulator
{
struct rt_regulator_node *reg_np;
Expand Down Expand Up @@ -359,7 +358,6 @@ static rt_err_t regulator_enable(struct rt_regulator_node *reg_np)
regulator_delay(enable_delay);
}

rt_atomic_add(&reg_np->enabled_count, 1);
err = regulator_notifier_call_chain(reg_np, RT_REGULATOR_MSG_ENABLE, RT_NULL);
}
}
Expand Down Expand Up @@ -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)
Expand All @@ -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->reg_np->enabled_count);
if (enabled_cnt > 0)
{
rt_atomic_sub(&reg->reg_np->enabled_count, 1);
enabled_cnt--;
rt_atomic_sub(&reg->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;
Expand All @@ -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)
Expand Down
Loading