mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
media: venus: pm_helpers: add fallback for the opp-table
commitafb100a5eaupstream. Since the device trees for both HFI_VERSION_1XX and HFI_VERSION_3XX do not include an opp-table and have not configured opp-pmdomain, they still need to use the frequencies defined in the driver's freq_tbl. Both core_power_v1 and core_power_v4 functions require core_clks_enable function during POWER_ON. Therefore, in the core_clks_enable function, if calling dev_pm_opp_find_freq_ceil to obtain the frequency fails, it needs to fall back to the freq_tbl to retrieve the frequency. Fixes:b179234b5e("media: venus: pm_helpers: use opp-table for the frequency") Cc: stable@vger.kernel.org Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: Vikash Garodia <quic_vgarodia@quicinc.com> Closes: https://lore.kernel.org/linux-media/CA+G9fYu5=3n84VY+vTbCAcfFKOq7Us5vgBZgpypY4MveM=eVwg@mail.gmail.com Signed-off-by: Renjiang Han <quic_renjiang@quicinc.com> Signed-off-by: Bryan O'Donoghue <bod@kernel.org> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a1362af5ac
commit
f48b72d72c
@@ -40,6 +40,8 @@ static int core_clks_get(struct venus_core *core)
|
|||||||
|
|
||||||
static int core_clks_enable(struct venus_core *core)
|
static int core_clks_enable(struct venus_core *core)
|
||||||
{
|
{
|
||||||
|
const struct freq_tbl *freq_tbl = core->res->freq_tbl;
|
||||||
|
unsigned int freq_tbl_size = core->res->freq_tbl_size;
|
||||||
const struct venus_resources *res = core->res;
|
const struct venus_resources *res = core->res;
|
||||||
struct device *dev = core->dev;
|
struct device *dev = core->dev;
|
||||||
unsigned long freq = 0;
|
unsigned long freq = 0;
|
||||||
@@ -48,8 +50,13 @@ static int core_clks_enable(struct venus_core *core)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
opp = dev_pm_opp_find_freq_ceil(dev, &freq);
|
opp = dev_pm_opp_find_freq_ceil(dev, &freq);
|
||||||
if (!IS_ERR(opp))
|
if (IS_ERR(opp)) {
|
||||||
|
if (!freq_tbl)
|
||||||
|
return -ENODEV;
|
||||||
|
freq = freq_tbl[freq_tbl_size - 1].freq;
|
||||||
|
} else {
|
||||||
dev_pm_opp_put(opp);
|
dev_pm_opp_put(opp);
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < res->clks_num; i++) {
|
for (i = 0; i < res->clks_num; i++) {
|
||||||
if (IS_V6(core)) {
|
if (IS_V6(core)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user