diff options
author | Julien Masson <jmasson@baylibre.com> | 2019-08-22 16:43:41 +0200 |
---|---|---|
committer | Neil Armstrong <narmstrong@baylibre.com> | 2019-08-22 17:54:05 +0200 |
commit | 528a25d040bc2123fe5a9f8697a60f8bff40af0a (patch) | |
tree | 506b2ee5efb635bef3ab47a7cd8e2355d43af74a /drivers/gpu/drm/meson/meson_drv.h | |
parent | ade925995b172f1d7410d1c665b2f47c5e99bef0 (diff) | |
download | lwn-528a25d040bc2123fe5a9f8697a60f8bff40af0a.tar.gz lwn-528a25d040bc2123fe5a9f8697a60f8bff40af0a.zip |
drm: meson: use match data to detect vpu compatibility
This patch introduce new enum which contains all VPU family (GXBB,
GXL, GXM and G12A).
This enum is used to detect the VPU compatible with the device.
We only need to set .data to the corresponding enum in the device
table, no need to check .compatible string anymore.
Signed-off-by: Julien Masson <jmasson@baylibre.com>
Tested-by: Neil Armstrong <narmstrong@baylibre.com>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://patchwork.freedesktop.org/patch/msgid/87imqpz21w.fsf@masson.i-did-not-set--mail-host-address--so-tickle-me
Diffstat (limited to 'drivers/gpu/drm/meson/meson_drv.h')
-rw-r--r-- | drivers/gpu/drm/meson/meson_drv.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/gpu/drm/meson/meson_drv.h b/drivers/gpu/drm/meson/meson_drv.h index c9aaec1a846e..820d07bdd42a 100644 --- a/drivers/gpu/drm/meson/meson_drv.h +++ b/drivers/gpu/drm/meson/meson_drv.h @@ -9,6 +9,7 @@ #include <linux/device.h> #include <linux/of.h> +#include <linux/of_device.h> #include <linux/regmap.h> struct drm_crtc; @@ -16,8 +17,16 @@ struct drm_device; struct drm_plane; struct meson_drm; +enum vpu_compatible { + VPU_COMPATIBLE_GXBB = 0, + VPU_COMPATIBLE_GXL = 1, + VPU_COMPATIBLE_GXM = 2, + VPU_COMPATIBLE_G12A = 3, +}; + struct meson_drm { struct device *dev; + enum vpu_compatible compat; void __iomem *io_base; struct regmap *hhi; int vsync_irq; @@ -116,9 +125,9 @@ struct meson_drm { }; static inline int meson_vpu_is_compatible(struct meson_drm *priv, - const char *compat) + enum vpu_compatible family) { - return of_device_is_compatible(priv->dev->of_node, compat); + return priv->compat == family; } #endif /* __MESON_DRV_H */ |