Commit 72317eaa authored by Neil Armstrong's avatar Neil Armstrong

drm/meson: rename venc_cvbs to encoder_cvbs

Rename the cvbs encoder to match the newly introduced meson_encoder_hdmi.
Signed-off-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
Acked-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211020123947.2585572-6-narmstrong@baylibre.com
parent 0af5e0b4
# SPDX-License-Identifier: GPL-2.0-only
meson-drm-y := meson_drv.o meson_plane.o meson_crtc.o meson_venc_cvbs.o
meson-drm-y := meson_drv.o meson_plane.o meson_crtc.o meson_encoder_cvbs.o
meson-drm-y += meson_viu.o meson_vpp.o meson_venc.o meson_vclk.o meson_overlay.o
meson-drm-y += meson_rdma.o meson_osd_afbcd.o
meson-drm-y += meson_encoder_hdmi.o
......
......@@ -31,7 +31,7 @@
#include "meson_plane.h"
#include "meson_osd_afbcd.h"
#include "meson_registers.h"
#include "meson_venc_cvbs.h"
#include "meson_encoder_cvbs.h"
#include "meson_encoder_hdmi.h"
#include "meson_viu.h"
#include "meson_vpp.h"
......@@ -307,7 +307,7 @@ static int meson_drv_bind_master(struct device *dev, bool has_components)
/* Encoder Initialization */
ret = meson_venc_cvbs_create(priv);
ret = meson_encoder_cvbs_init(priv);
if (ret)
goto free_drm;
......
......@@ -20,7 +20,7 @@
#include "meson_registers.h"
#include "meson_vclk.h"
#include "meson_venc_cvbs.h"
#include "meson_encoder_cvbs.h"
/* HHI VDAC Registers */
#define HHI_VDAC_CNTL0 0x2F4 /* 0xbd offset in data sheet */
......@@ -28,16 +28,16 @@
#define HHI_VDAC_CNTL1 0x2F8 /* 0xbe offset in data sheet */
#define HHI_VDAC_CNTL1_G12A 0x2F0 /* 0xbe offset in data sheet */
struct meson_venc_cvbs {
struct meson_encoder_cvbs {
struct drm_encoder encoder;
struct drm_connector connector;
struct meson_drm *priv;
};
#define encoder_to_meson_venc_cvbs(x) \
container_of(x, struct meson_venc_cvbs, encoder)
#define encoder_to_meson_encoder_cvbs(x) \
container_of(x, struct meson_encoder_cvbs, encoder)
#define connector_to_meson_venc_cvbs(x) \
container_of(x, struct meson_venc_cvbs, connector)
#define connector_to_meson_encoder_cvbs(x) \
container_of(x, struct meson_encoder_cvbs, connector)
/* Supported Modes */
......@@ -140,16 +140,16 @@ struct drm_connector_helper_funcs meson_cvbs_connector_helper_funcs = {
/* Encoder */
static void meson_venc_cvbs_encoder_destroy(struct drm_encoder *encoder)
static void meson_encoder_cvbs_encoder_destroy(struct drm_encoder *encoder)
{
drm_encoder_cleanup(encoder);
}
static const struct drm_encoder_funcs meson_venc_cvbs_encoder_funcs = {
.destroy = meson_venc_cvbs_encoder_destroy,
static const struct drm_encoder_funcs meson_encoder_cvbs_encoder_funcs = {
.destroy = meson_encoder_cvbs_encoder_destroy,
};
static int meson_venc_cvbs_encoder_atomic_check(struct drm_encoder *encoder,
static int meson_encoder_cvbs_encoder_atomic_check(struct drm_encoder *encoder,
struct drm_crtc_state *crtc_state,
struct drm_connector_state *conn_state)
{
......@@ -159,11 +159,11 @@ static int meson_venc_cvbs_encoder_atomic_check(struct drm_encoder *encoder,
return -EINVAL;
}
static void meson_venc_cvbs_encoder_disable(struct drm_encoder *encoder)
static void meson_encoder_cvbs_encoder_disable(struct drm_encoder *encoder)
{
struct meson_venc_cvbs *meson_venc_cvbs =
encoder_to_meson_venc_cvbs(encoder);
struct meson_drm *priv = meson_venc_cvbs->priv;
struct meson_encoder_cvbs *meson_encoder_cvbs =
encoder_to_meson_encoder_cvbs(encoder);
struct meson_drm *priv = meson_encoder_cvbs->priv;
/* Disable CVBS VDAC */
if (meson_vpu_is_compatible(priv, VPU_COMPATIBLE_G12A)) {
......@@ -175,11 +175,11 @@ static void meson_venc_cvbs_encoder_disable(struct drm_encoder *encoder)
}
}
static void meson_venc_cvbs_encoder_enable(struct drm_encoder *encoder)
static void meson_encoder_cvbs_encoder_enable(struct drm_encoder *encoder)
{
struct meson_venc_cvbs *meson_venc_cvbs =
encoder_to_meson_venc_cvbs(encoder);
struct meson_drm *priv = meson_venc_cvbs->priv;
struct meson_encoder_cvbs *meson_encoder_cvbs =
encoder_to_meson_encoder_cvbs(encoder);
struct meson_drm *priv = meson_encoder_cvbs->priv;
/* VDAC0 source is not from ATV */
writel_bits_relaxed(VENC_VDAC_SEL_ATV_DMD, 0,
......@@ -198,14 +198,14 @@ static void meson_venc_cvbs_encoder_enable(struct drm_encoder *encoder)
}
}
static void meson_venc_cvbs_encoder_mode_set(struct drm_encoder *encoder,
static void meson_encoder_cvbs_encoder_mode_set(struct drm_encoder *encoder,
struct drm_display_mode *mode,
struct drm_display_mode *adjusted_mode)
{
const struct meson_cvbs_mode *meson_mode = meson_cvbs_get_mode(mode);
struct meson_venc_cvbs *meson_venc_cvbs =
encoder_to_meson_venc_cvbs(encoder);
struct meson_drm *priv = meson_venc_cvbs->priv;
struct meson_encoder_cvbs *meson_encoder_cvbs =
encoder_to_meson_encoder_cvbs(encoder);
struct meson_drm *priv = meson_encoder_cvbs->priv;
if (meson_mode) {
meson_venci_cvbs_mode_set(priv, meson_mode->enci);
......@@ -219,14 +219,14 @@ static void meson_venc_cvbs_encoder_mode_set(struct drm_encoder *encoder,
}
static const struct drm_encoder_helper_funcs
meson_venc_cvbs_encoder_helper_funcs = {
.atomic_check = meson_venc_cvbs_encoder_atomic_check,
.disable = meson_venc_cvbs_encoder_disable,
.enable = meson_venc_cvbs_encoder_enable,
.mode_set = meson_venc_cvbs_encoder_mode_set,
meson_encoder_cvbs_encoder_helper_funcs = {
.atomic_check = meson_encoder_cvbs_encoder_atomic_check,
.disable = meson_encoder_cvbs_encoder_disable,
.enable = meson_encoder_cvbs_encoder_enable,
.mode_set = meson_encoder_cvbs_encoder_mode_set,
};
static bool meson_venc_cvbs_connector_is_available(struct meson_drm *priv)
static bool meson_encoder_cvbs_connector_is_available(struct meson_drm *priv)
{
struct device_node *remote;
......@@ -238,27 +238,27 @@ static bool meson_venc_cvbs_connector_is_available(struct meson_drm *priv)
return true;
}
int meson_venc_cvbs_create(struct meson_drm *priv)
int meson_encoder_cvbs_init(struct meson_drm *priv)
{
struct drm_device *drm = priv->drm;
struct meson_venc_cvbs *meson_venc_cvbs;
struct meson_encoder_cvbs *meson_encoder_cvbs;
struct drm_connector *connector;
struct drm_encoder *encoder;
int ret;
if (!meson_venc_cvbs_connector_is_available(priv)) {
if (!meson_encoder_cvbs_connector_is_available(priv)) {
dev_info(drm->dev, "CVBS Output connector not available\n");
return 0;
}
meson_venc_cvbs = devm_kzalloc(priv->dev, sizeof(*meson_venc_cvbs),
meson_encoder_cvbs = devm_kzalloc(priv->dev, sizeof(*meson_encoder_cvbs),
GFP_KERNEL);
if (!meson_venc_cvbs)
if (!meson_encoder_cvbs)
return -ENOMEM;
meson_venc_cvbs->priv = priv;
encoder = &meson_venc_cvbs->encoder;
connector = &meson_venc_cvbs->connector;
meson_encoder_cvbs->priv = priv;
encoder = &meson_encoder_cvbs->encoder;
connector = &meson_encoder_cvbs->connector;
/* Connector */
......@@ -276,10 +276,10 @@ int meson_venc_cvbs_create(struct meson_drm *priv)
/* Encoder */
drm_encoder_helper_add(encoder, &meson_venc_cvbs_encoder_helper_funcs);
drm_encoder_helper_add(encoder, &meson_encoder_cvbs_encoder_helper_funcs);
ret = drm_encoder_init(drm, encoder, &meson_venc_cvbs_encoder_funcs,
DRM_MODE_ENCODER_TVDAC, "meson_venc_cvbs");
ret = drm_encoder_init(drm, encoder, &meson_encoder_cvbs_encoder_funcs,
DRM_MODE_ENCODER_TVDAC, "meson_encoder_cvbs");
if (ret) {
dev_err(priv->dev, "Failed to init CVBS encoder\n");
return ret;
......
......@@ -24,6 +24,6 @@ struct meson_cvbs_mode {
/* Modes supported by the CVBS output */
extern struct meson_cvbs_mode meson_cvbs_modes[MESON_CVBS_MODES_COUNT];
int meson_venc_cvbs_create(struct meson_drm *priv);
int meson_encoder_cvbs_init(struct meson_drm *priv);
#endif /* __MESON_VENC_CVBS_H */
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