Skip to content

Commit 5bdbf65

Browse files
mripardpopcornmix
authored andcommitted
drm/vc4: hdmi: Add reset callback
The BCM2711 and BCM283x HDMI controllers use a slightly different reset sequence, so let's add a callback to reset the controller. Signed-off-by: Maxime Ripard <maxime@cerno.tech>
1 parent 8d5bcc5 commit 5bdbf65

2 files changed

Lines changed: 15 additions & 5 deletions

File tree

‎drivers/gpu/drm/vc4/vc4_hdmi.c‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@ static int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused)
6868
return 0;
6969
}
7070

71+
static void vc4_hdmi_reset(struct vc4_hdmi *vc4_hdmi)
72+
{
73+
HDMI_WRITE(HDMI_SW_RESET_CONTROL,
74+
VC4_HDMI_SW_RESET_HDMI |
75+
VC4_HDMI_SW_RESET_FORMAT_DETECT);
76+
77+
HDMI_WRITE(HDMI_SW_RESET_CONTROL, 0);
78+
}
79+
7180
static enum drm_connector_status
7281
vc4_hdmi_connector_detect(struct drm_connector *connector, bool force)
7382
{
@@ -369,11 +378,8 @@ static void vc4_hdmi_encoder_enable(struct drm_encoder *encoder)
369378
return;
370379
}
371380

372-
HDMI_WRITE(HDMI_SW_RESET_CONTROL,
373-
VC4_HDMI_SW_RESET_HDMI |
374-
VC4_HDMI_SW_RESET_FORMAT_DETECT);
375-
376-
HDMI_WRITE(HDMI_SW_RESET_CONTROL, 0);
381+
if (vc4_hdmi->variant->reset)
382+
vc4_hdmi->variant->reset(vc4_hdmi);
377383

378384
/* PHY should be in reset, like
379385
* vc4_hdmi_encoder_disable() does.
@@ -1406,6 +1412,7 @@ static const struct vc4_hdmi_variant bcm2835_variant = {
14061412
.num_registers = ARRAY_SIZE(vc4_hdmi_fields),
14071413

14081414
.init_resources = vc4_hdmi_init_resources,
1415+
.reset = vc4_hdmi_reset,
14091416
};
14101417

14111418
static const struct of_device_id vc4_hdmi_dt_match[] = {

‎drivers/gpu/drm/vc4/vc4_hdmi.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ struct vc4_hdmi_variant {
3535
* clocks, etc) for that variant.
3636
*/
3737
int (*init_resources)(struct vc4_hdmi *vc4_hdmi);
38+
39+
/* Callback to reset the HDMI block */
40+
void (*reset)(struct vc4_hdmi *vc4_hdmi);
3841
};
3942

4043
/* HDMI audio information */

0 commit comments

Comments
 (0)