]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
drm/vc4: hdmi: Store the encoder type in the variant structure
authorMaxime Ripard <maxime@cerno.tech>
Thu, 3 Sep 2020 08:01:29 +0000 (10:01 +0200)
committerMaxime Ripard <maxime@cerno.tech>
Mon, 7 Sep 2020 16:14:52 +0000 (18:14 +0200)
The vc4 CRTC will use the encoder type to control its output clock
muxing. However, this will be different from HDMI0 to HDMI1, so let's
store our type in the variant structure so that we can support multiple
controllers later on.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Tested-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://patchwork.freedesktop.org/patch/msgid/2736a86b498551ba9dbc5803c5bb910627a2550c.1599120059.git-series.maxime@cerno.tech
drivers/gpu/drm/vc4/vc4_hdmi.c
drivers/gpu/drm/vc4/vc4_hdmi.h

index 9e2bc6cb690e77954e673e001b2ee4eb4d07327f..f6d18bdbd1bb3e97aa415d4a7ec48a96e2610b8d 100644 (file)
@@ -1267,7 +1267,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
 
        dev_set_drvdata(dev, vc4_hdmi);
        encoder = &vc4_hdmi->encoder.base.base;
-       vc4_hdmi->encoder.base.type = VC4_ENCODER_TYPE_HDMI0;
+       vc4_hdmi->encoder.base.type = variant->encoder_type;
        vc4_hdmi->pdev = pdev;
        vc4_hdmi->variant = variant;
 
@@ -1446,6 +1446,7 @@ static int vc4_hdmi_dev_remove(struct platform_device *pdev)
 }
 
 static const struct vc4_hdmi_variant bcm2835_variant = {
+       .encoder_type           = VC4_ENCODER_TYPE_HDMI0,
        .registers              = vc4_hdmi_fields,
        .num_registers          = ARRAY_SIZE(vc4_hdmi_fields),
 
index 0c32dc46d289a2a2be5c49b5e9a5eb909b616b11..0d529db4b3ab39415912e4e0e9fee4653b836e74 100644 (file)
@@ -27,6 +27,9 @@ struct vc4_hdmi;
 struct vc4_hdmi_register;
 
 struct vc4_hdmi_variant {
+       /* Encoder Type for that controller */
+       enum vc4_encoder_type encoder_type;
+
        /* List of the registers available on that variant */
        const struct vc4_hdmi_register *registers;