summaryrefslogtreecommitdiff
path: root/drivers/soc/amlogic/meson-canvas.c
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2019-06-25 05:40:57 -0700
committerOlof Johansson <olof@lixom.net>2019-06-25 05:40:57 -0700
commit71a34b7cc7b3e3509e7894d1d28245f5040e6910 (patch)
treec455fe345531a2e7c74e313dc81fcdb4f2b1e728 /drivers/soc/amlogic/meson-canvas.c
parentc616ea191d59a2fc374b17b80073f6464ee54460 (diff)
parent9a98fdf5b6e635d9d9710f87e1da42aeab12ff0d (diff)
Merge tag 'amlogic-drivers' of https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic into arm/drivers
soc: Amlogic driver updates for v5.3 - canvas: add support for Meson8* * tag 'amlogic-drivers' of https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic: soc: amlogic: canvas: add support for Meson8, Meson8b and Meson8m2 dt-bindings: soc: amlogic: canvas: document support for Meson8/8b/8m2 Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'drivers/soc/amlogic/meson-canvas.c')
-rw-r--r--drivers/soc/amlogic/meson-canvas.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/soc/amlogic/meson-canvas.c b/drivers/soc/amlogic/meson-canvas.c
index be95a37c3fec..c655f5f92b12 100644
--- a/drivers/soc/amlogic/meson-canvas.c
+++ b/drivers/soc/amlogic/meson-canvas.c
@@ -35,6 +35,7 @@ struct meson_canvas {
void __iomem *reg_base;
spinlock_t lock; /* canvas device lock */
u8 used[NUM_CANVAS];
+ bool supports_endianness;
};
static void canvas_write(struct meson_canvas *canvas, u32 reg, u32 val)
@@ -86,6 +87,12 @@ int meson_canvas_config(struct meson_canvas *canvas, u8 canvas_index,
{
unsigned long flags;
+ if (endian && !canvas->supports_endianness) {
+ dev_err(canvas->dev,
+ "Endianness is not supported on this SoC\n");
+ return -EINVAL;
+ }
+
spin_lock_irqsave(&canvas->lock, flags);
if (!canvas->used[canvas_index]) {
dev_err(canvas->dev,
@@ -172,6 +179,8 @@ static int meson_canvas_probe(struct platform_device *pdev)
if (IS_ERR(canvas->reg_base))
return PTR_ERR(canvas->reg_base);
+ canvas->supports_endianness = of_device_get_match_data(dev);
+
canvas->dev = dev;
spin_lock_init(&canvas->lock);
dev_set_drvdata(dev, canvas);
@@ -180,7 +189,10 @@ static int meson_canvas_probe(struct platform_device *pdev)
}
static const struct of_device_id canvas_dt_match[] = {
- { .compatible = "amlogic,canvas" },
+ { .compatible = "amlogic,meson8-canvas", .data = (void *)false, },
+ { .compatible = "amlogic,meson8b-canvas", .data = (void *)false, },
+ { .compatible = "amlogic,meson8m2-canvas", .data = (void *)false, },
+ { .compatible = "amlogic,canvas", .data = (void *)true, },
{}
};
MODULE_DEVICE_TABLE(of, canvas_dt_match);