Skip to content

Commit 1379e83

Browse files
committed
drm/sun4i: frontend: Move the FIR filter phases to our quirks
The FIR filters phase depend on the SoC, so let's move it to our quirks structure instead of removing them. Reviewed-by: Paul Kocialkowski <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 38ffb16 commit 1379e83

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

drivers/gpu/drm/sun4i/sun4i_frontend.c

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -438,12 +438,18 @@ int sun4i_frontend_update_formats(struct sun4i_frontend *frontend,
438438
* I have no idea what this does exactly, but it seems to be
439439
* related to the scaler FIR filter phase parameters.
440440
*/
441-
regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_HORZPHASE_REG, 0x400);
442-
regmap_write(frontend->regs, SUN4I_FRONTEND_CH1_HORZPHASE_REG, 0x400);
443-
regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_VERTPHASE0_REG, 0x400);
444-
regmap_write(frontend->regs, SUN4I_FRONTEND_CH1_VERTPHASE0_REG, 0x400);
445-
regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_VERTPHASE1_REG, 0x400);
446-
regmap_write(frontend->regs, SUN4I_FRONTEND_CH1_VERTPHASE1_REG, 0x400);
441+
regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_HORZPHASE_REG,
442+
frontend->data->ch_phase[0].horzphase);
443+
regmap_write(frontend->regs, SUN4I_FRONTEND_CH1_HORZPHASE_REG,
444+
frontend->data->ch_phase[1].horzphase);
445+
regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_VERTPHASE0_REG,
446+
frontend->data->ch_phase[0].vertphase[0]);
447+
regmap_write(frontend->regs, SUN4I_FRONTEND_CH1_VERTPHASE0_REG,
448+
frontend->data->ch_phase[1].vertphase[0]);
449+
regmap_write(frontend->regs, SUN4I_FRONTEND_CH0_VERTPHASE1_REG,
450+
frontend->data->ch_phase[0].vertphase[1]);
451+
regmap_write(frontend->regs, SUN4I_FRONTEND_CH1_VERTPHASE1_REG,
452+
frontend->data->ch_phase[1].vertphase[1]);
447453

448454
/*
449455
* Checking the input format is sufficient since we currently only
@@ -677,6 +683,16 @@ static const struct dev_pm_ops sun4i_frontend_pm_ops = {
677683
};
678684

679685
static const struct sun4i_frontend_data sun8i_a33_frontend = {
686+
.ch_phase = {
687+
{
688+
.horzphase = 0x400,
689+
.vertphase = { 0x400, 0x400 },
690+
},
691+
{
692+
.horzphase = 0x400,
693+
.vertphase = { 0x400, 0x400 },
694+
},
695+
},
680696
.has_coef_access_ctrl = true,
681697
};
682698

drivers/gpu/drm/sun4i/sun4i_frontend.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ struct reset_control;
115115
struct sun4i_frontend_data {
116116
bool has_coef_access_ctrl;
117117
bool has_coef_rdy;
118+
119+
struct {
120+
u32 horzphase;
121+
u32 vertphase[2];
122+
} ch_phase[2];
118123
};
119124

120125
struct sun4i_frontend {

0 commit comments

Comments
 (0)