Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: iris: Split power on per variants

Current devices use same power up sequence, but starting with Qualcomm
SM8750 (VPU v3.5) the sequence will grow quite a bit, so allow
customizing it. No functional change so far for existing devices.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Mauro Carvalho Chehab
1f01a498 2fbb823a

+14 -4
+2
drivers/media/platform/qcom/iris/iris_vpu2.c
··· 34 34 35 35 const struct vpu_ops iris_vpu2_ops = { 36 36 .power_off_hw = iris_vpu_power_off_hw, 37 + .power_on_hw = iris_vpu_power_on_hw, 37 38 .power_off_controller = iris_vpu_power_off_controller, 39 + .power_on_controller = iris_vpu_power_on_controller, 38 40 .calc_freq = iris_vpu2_calc_freq, 39 41 };
+4
drivers/media/platform/qcom/iris/iris_vpu3x.c
··· 292 292 293 293 const struct vpu_ops iris_vpu3_ops = { 294 294 .power_off_hw = iris_vpu3_power_off_hardware, 295 + .power_on_hw = iris_vpu_power_on_hw, 295 296 .power_off_controller = iris_vpu_power_off_controller, 297 + .power_on_controller = iris_vpu_power_on_controller, 296 298 .calc_freq = iris_vpu3x_calculate_frequency, 297 299 }; 298 300 299 301 const struct vpu_ops iris_vpu33_ops = { 300 302 .power_off_hw = iris_vpu33_power_off_hardware, 303 + .power_on_hw = iris_vpu_power_on_hw, 301 304 .power_off_controller = iris_vpu33_power_off_controller, 305 + .power_on_controller = iris_vpu_power_on_controller, 302 306 .calc_freq = iris_vpu3x_calculate_frequency, 303 307 };
+4 -4
drivers/media/platform/qcom/iris/iris_vpu_common.c
··· 271 271 disable_irq_nosync(core->irq); 272 272 } 273 273 274 - static int iris_vpu_power_on_controller(struct iris_core *core) 274 + int iris_vpu_power_on_controller(struct iris_core *core) 275 275 { 276 276 u32 rst_tbl_size = core->iris_platform_data->clk_rst_tbl_size; 277 277 int ret; ··· 302 302 return ret; 303 303 } 304 304 305 - static int iris_vpu_power_on_hw(struct iris_core *core) 305 + int iris_vpu_power_on_hw(struct iris_core *core) 306 306 { 307 307 int ret; 308 308 ··· 337 337 if (ret) 338 338 goto err; 339 339 340 - ret = iris_vpu_power_on_controller(core); 340 + ret = core->iris_platform_data->vpu_ops->power_on_controller(core); 341 341 if (ret) 342 342 goto err_unvote_icc; 343 343 344 - ret = iris_vpu_power_on_hw(core); 344 + ret = core->iris_platform_data->vpu_ops->power_on_hw(core); 345 345 if (ret) 346 346 goto err_power_off_ctrl; 347 347
+4
drivers/media/platform/qcom/iris/iris_vpu_common.h
··· 14 14 15 15 struct vpu_ops { 16 16 void (*power_off_hw)(struct iris_core *core); 17 + int (*power_on_hw)(struct iris_core *core); 17 18 int (*power_off_controller)(struct iris_core *core); 19 + int (*power_on_controller)(struct iris_core *core); 18 20 u64 (*calc_freq)(struct iris_inst *inst, size_t data_size); 19 21 }; 20 22 ··· 25 23 void iris_vpu_clear_interrupt(struct iris_core *core); 26 24 int iris_vpu_watchdog(struct iris_core *core, u32 intr_status); 27 25 int iris_vpu_prepare_pc(struct iris_core *core); 26 + int iris_vpu_power_on_controller(struct iris_core *core); 27 + int iris_vpu_power_on_hw(struct iris_core *core); 28 28 int iris_vpu_power_on(struct iris_core *core); 29 29 int iris_vpu_power_off_controller(struct iris_core *core); 30 30 void iris_vpu_power_off_hw(struct iris_core *core);