Thread (7 messages) flat view 7 messages, 2 authors, 2021-02-02

Re: [PATCH 2/2] drm/aspeed: Use dt matching for default register values

From: Joel Stanley <joel@jms.id.au>
Date: 2021-02-02 05:01:57
Also in: dri-devel, linux-aspeed

On Tue, 2 Feb 2021 at 04:46, Jeremy Kerr [off-list ref] wrote:
Hi Joel,
quoted
There are minor differences in the values for the threshold value and
the scan line size between families of ASPEED SoC. Additionally the
SCU register for the output control differs between families.

This adds device tree matching to parameterise these values, allowing
us to add support for the AST2400 now, and in the future the AST2600.
Looks good to me. Two super minor things:
quoted
--- a/drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c
+++ b/drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c
@@ -60,7 +60,8 @@ static void aspeed_gfx_enable_controller(struct
aspeed_gfx *priv)
        u32 ctrl2 = readl(priv->base + CRT_CTRL2);

        /* SCU2C: set DAC source for display output to Graphics CRT (GFX) */
-       regmap_update_bits(priv->scu, 0x2c, BIT(16), BIT(16));
+       regmap_update_bits(priv->scu, priv->dac_reg, BIT(16), BIT(16));
The comment references SCU2C; but you've implied that this will
change...
quoted
@@ -228,7 +258,7 @@ static ssize_t dac_mux_store(struct device *dev,
struct device_attribute *attr,
        if (val > 3)
                return -EINVAL;

-       rc = regmap_update_bits(priv->scu, ASPEED_SCU_MISC_CTRL, 0x30000, val << 16);
+       rc = regmap_update_bits(priv->scu, priv->dac_reg, 0x30000, val << 16);
        if (rc < 0)
                return 0;
@@ -241,7 +271,7 @@ static ssize_t dac_mux_show(struct device *dev,
struct device_attribute *attr, c
        u32 reg;
        int rc;

-       rc = regmap_read(priv->scu, ASPEED_SCU_MISC_CTRL, &reg);
+       rc = regmap_read(priv->scu, priv->dac_reg, &reg);
        if (rc)
                return rc;
You've removed the only uses of ASPEED_SCU_MISC_CTRL here, maybe drop
the #define too?
Good idea. I'll implement both of your suggestions.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help