Commit e0db0269 authored by Sean Anderson's avatar Sean Anderson Committed by Tomi Valkeinen

drm: xlnx: Store base pointers in zynqmp_disp directly

The blend, avbuf, and audio members of zynqmp_disp are anonymous structs
with only one member each. This is rather pointless, so move the members
up a level.
Signed-off-by: default avatarSean Anderson <sean.anderson@linux.dev>
Reviewed-by: default avatarTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240423171859.3953024-2-sean.anderson@linux.dev
parent b58a0bc9
...@@ -141,24 +141,18 @@ struct zynqmp_disp_layer { ...@@ -141,24 +141,18 @@ struct zynqmp_disp_layer {
* struct zynqmp_disp - Display controller * struct zynqmp_disp - Display controller
* @dev: Device structure * @dev: Device structure
* @dpsub: Display subsystem * @dpsub: Display subsystem
* @blend.base: Register I/O base address for the blender * @blend: Register I/O base address for the blender
* @avbuf.base: Register I/O base address for the audio/video buffer manager * @avbuf: Register I/O base address for the audio/video buffer manager
* @audio.base: Registers I/O base address for the audio mixer * @audio: Registers I/O base address for the audio mixer
* @layers: Layers (planes) * @layers: Layers (planes)
*/ */
struct zynqmp_disp { struct zynqmp_disp {
struct device *dev; struct device *dev;
struct zynqmp_dpsub *dpsub; struct zynqmp_dpsub *dpsub;
struct { void __iomem *blend;
void __iomem *base; void __iomem *avbuf;
} blend; void __iomem *audio;
struct {
void __iomem *base;
} avbuf;
struct {
void __iomem *base;
} audio;
struct zynqmp_disp_layer layers[ZYNQMP_DPSUB_NUM_LAYERS]; struct zynqmp_disp_layer layers[ZYNQMP_DPSUB_NUM_LAYERS];
}; };
...@@ -410,12 +404,12 @@ static const struct zynqmp_disp_format avbuf_live_fmts[] = { ...@@ -410,12 +404,12 @@ static const struct zynqmp_disp_format avbuf_live_fmts[] = {
static u32 zynqmp_disp_avbuf_read(struct zynqmp_disp *disp, int reg) static u32 zynqmp_disp_avbuf_read(struct zynqmp_disp *disp, int reg)
{ {
return readl(disp->avbuf.base + reg); return readl(disp->avbuf + reg);
} }
static void zynqmp_disp_avbuf_write(struct zynqmp_disp *disp, int reg, u32 val) static void zynqmp_disp_avbuf_write(struct zynqmp_disp *disp, int reg, u32 val)
{ {
writel(val, disp->avbuf.base + reg); writel(val, disp->avbuf + reg);
} }
static bool zynqmp_disp_layer_is_video(const struct zynqmp_disp_layer *layer) static bool zynqmp_disp_layer_is_video(const struct zynqmp_disp_layer *layer)
...@@ -651,7 +645,7 @@ static void zynqmp_disp_avbuf_disable(struct zynqmp_disp *disp) ...@@ -651,7 +645,7 @@ static void zynqmp_disp_avbuf_disable(struct zynqmp_disp *disp)
static void zynqmp_disp_blend_write(struct zynqmp_disp *disp, int reg, u32 val) static void zynqmp_disp_blend_write(struct zynqmp_disp *disp, int reg, u32 val)
{ {
writel(val, disp->blend.base + reg); writel(val, disp->blend + reg);
} }
/* /*
...@@ -877,7 +871,7 @@ static void zynqmp_disp_blend_layer_disable(struct zynqmp_disp *disp, ...@@ -877,7 +871,7 @@ static void zynqmp_disp_blend_layer_disable(struct zynqmp_disp *disp,
static void zynqmp_disp_audio_write(struct zynqmp_disp *disp, int reg, u32 val) static void zynqmp_disp_audio_write(struct zynqmp_disp *disp, int reg, u32 val)
{ {
writel(val, disp->audio.base + reg); writel(val, disp->audio + reg);
} }
/** /**
...@@ -1412,21 +1406,21 @@ int zynqmp_disp_probe(struct zynqmp_dpsub *dpsub) ...@@ -1412,21 +1406,21 @@ int zynqmp_disp_probe(struct zynqmp_dpsub *dpsub)
disp->dev = &pdev->dev; disp->dev = &pdev->dev;
disp->dpsub = dpsub; disp->dpsub = dpsub;
disp->blend.base = devm_platform_ioremap_resource_byname(pdev, "blend"); disp->blend = devm_platform_ioremap_resource_byname(pdev, "blend");
if (IS_ERR(disp->blend.base)) { if (IS_ERR(disp->blend)) {
ret = PTR_ERR(disp->blend.base); ret = PTR_ERR(disp->blend);
goto error; goto error;
} }
disp->avbuf.base = devm_platform_ioremap_resource_byname(pdev, "av_buf"); disp->avbuf = devm_platform_ioremap_resource_byname(pdev, "av_buf");
if (IS_ERR(disp->avbuf.base)) { if (IS_ERR(disp->avbuf)) {
ret = PTR_ERR(disp->avbuf.base); ret = PTR_ERR(disp->avbuf);
goto error; goto error;
} }
disp->audio.base = devm_platform_ioremap_resource_byname(pdev, "aud"); disp->audio = devm_platform_ioremap_resource_byname(pdev, "aud");
if (IS_ERR(disp->audio.base)) { if (IS_ERR(disp->audio)) {
ret = PTR_ERR(disp->audio.base); ret = PTR_ERR(disp->audio);
goto error; goto error;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment