mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
soc: rockchip: pvtm: Stop calculating cycles first if last status is enabled
Change-Id: I7a2188c9f94d776f5421aa25ac2e6e5f0f3042c8 Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
This commit is contained in:
@@ -45,6 +45,8 @@
|
||||
#define RK3399_PVTM_GPU 3
|
||||
#define RK3399_PVTM_PMU 4
|
||||
|
||||
#define PVTM_START_EN 0x1
|
||||
|
||||
#define wr_mask_bit(v, off, mask) ((v) << (off) | (mask) << (16 + off))
|
||||
|
||||
#define PVTM(_ch, _name, _num_sub, _start, _en, _cal, _done, _freq) \
|
||||
@@ -285,6 +287,12 @@ static u32 rockchip_pvtm_get_value(struct rockchip_pvtm *pvtm,
|
||||
}
|
||||
}
|
||||
|
||||
/* if last status is enabled, stop calculating cycles first*/
|
||||
regmap_read(pvtm->grf, pvtm->con, &sta);
|
||||
if (sta & PVTM_START_EN)
|
||||
regmap_write(pvtm->grf, pvtm->con,
|
||||
wr_mask_bit(0, channel->bit_start, 0x1));
|
||||
|
||||
regmap_write(pvtm->grf, pvtm->con,
|
||||
wr_mask_bit(0x1, channel->bit_en, 0x1));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user