mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-05 13:29:17 -04:00
drm/bridge: ite-it6263: Support VESA-24 input format
Introduce it6263_is_input_bus_fmt_valid() and refactor the it6263_bridge_atomic_get_input_bus_fmts() function to support VESA-24 format by selecting the LVDS input format based on the LVDS data mapping and thereby support both JEIDA-24 and VESA-24 input formats. Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com> Reviewed-by: Liu Ying <victor.liu@nxp.com> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241205080210.1285385-1-tommaso.merciai.xr@bp.renesas.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
This commit is contained in:
committed by
Dmitry Baryshkov
parent
33f029af89
commit
919b1458cc
@@ -48,6 +48,7 @@
|
||||
#define REG_COL_DEP GENMASK(1, 0)
|
||||
#define BIT8 FIELD_PREP(REG_COL_DEP, 1)
|
||||
#define OUT_MAP BIT(4)
|
||||
#define VESA BIT(4)
|
||||
#define JEIDA 0
|
||||
#define REG_DESSC_ENB BIT(6)
|
||||
#define DMODE BIT(7)
|
||||
@@ -428,12 +429,30 @@ static inline void it6263_lvds_reset(struct it6263 *it)
|
||||
fsleep(10000);
|
||||
}
|
||||
|
||||
static inline bool it6263_is_input_bus_fmt_valid(int input_fmt)
|
||||
{
|
||||
switch (input_fmt) {
|
||||
case MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA:
|
||||
case MEDIA_BUS_FMT_RGB888_1X7X4_SPWG:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline void it6263_lvds_set_interface(struct it6263 *it)
|
||||
{
|
||||
u8 fmt;
|
||||
|
||||
/* color depth */
|
||||
regmap_write_bits(it->lvds_regmap, LVDS_REG_2C, REG_COL_DEP, BIT8);
|
||||
|
||||
if (it->lvds_data_mapping == MEDIA_BUS_FMT_RGB888_1X7X4_SPWG)
|
||||
fmt = VESA;
|
||||
else
|
||||
fmt = JEIDA;
|
||||
|
||||
/* output mapping */
|
||||
regmap_write_bits(it->lvds_regmap, LVDS_REG_2C, OUT_MAP, JEIDA);
|
||||
regmap_write_bits(it->lvds_regmap, LVDS_REG_2C, OUT_MAP, fmt);
|
||||
|
||||
if (it->lvds_dual_link) {
|
||||
regmap_write_bits(it->lvds_regmap, LVDS_REG_2C, DMODE, DISO);
|
||||
@@ -714,14 +733,14 @@ it6263_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge,
|
||||
|
||||
*num_input_fmts = 0;
|
||||
|
||||
if (it->lvds_data_mapping != MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA)
|
||||
if (!it6263_is_input_bus_fmt_valid(it->lvds_data_mapping))
|
||||
return NULL;
|
||||
|
||||
input_fmts = kmalloc(sizeof(*input_fmts), GFP_KERNEL);
|
||||
if (!input_fmts)
|
||||
return NULL;
|
||||
|
||||
input_fmts[0] = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA;
|
||||
input_fmts[0] = it->lvds_data_mapping;
|
||||
*num_input_fmts = 1;
|
||||
|
||||
return input_fmts;
|
||||
|
||||
Reference in New Issue
Block a user