[PATCH v2 05/14] video: mediatek: add padding component
Julien Stephan <[email protected]>
| Newsgroups | org.u-boot-project.lists.u-boot |
|---|---|
| Message-ID | <20260826-add-genio-510-and-genio-700-hdmi-v2-5-68ebb1bf17df@baylibre.com> |
The padding block is one of the components of the video pipeline on some MediaTek SoCs, such as the MT8188. It is configured in bypass mode. Signed-off-by: Julien Stephan <[email protected]> --- drivers/video/mediatek/mtk_disp_padding.c | 37 +++++++++++++++++++++++++++++++ drivers/video/mediatek/mtk_disp_padding.h | 16 +++++++++++++ 2 files changed, 53 insertions(+) diff --git a/drivers/video/mediatek/mtk_disp_padding.c b/drivers/video/mediatek/mtk_disp_padding.c new file mode 100644 index 00000000000..2f94e55c05b --- /dev/null +++ b/drivers/video/mediatek/mtk_disp_padding.c @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Mediatek Video Disp Padding Support + * + * Copyright (c) 2026 BayLibre, SAS. + * Author: Julien Stephan <[email protected]> + */ + +#include <dm.h> + +#include "mtk_disp_comp.h" +#include "mtk_disp_padding.h" + +#define PADDING_CON 0x0 +#define PADDING_EN BIT(1) +#define PADDING_BYPASS BIT(0) + +#define PADDING_PIC_SIZE 0x4 + +void mtk_disp_padding_config(struct udevice *dev) +{ + mtk_disp_comp_write(dev, PADDING_CON, PADDING_EN | PADDING_BYPASS); + mtk_disp_comp_write(dev, PADDING_PIC_SIZE, 0x0); +} + +static const struct udevice_id mtk_disp_padding_ids[] = { + { .compatible = "mediatek,mt8188-disp-padding" }, + {} +}; + +U_BOOT_DRIVER(mtk_disp_padding) = { + .name = "mtk_disp_padding", + .id = UCLASS_MISC, + .of_match = mtk_disp_padding_ids, + .probe = mtk_disp_comp_probe, + .priv_auto = sizeof(struct mtk_disp_comp_priv), +}; diff --git a/drivers/video/mediatek/mtk_disp_padding.h b/drivers/video/mediatek/mtk_disp_padding.h new file mode 100644 index 00000000000..42ff177f307 --- /dev/null +++ b/drivers/video/mediatek/mtk_disp_padding.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Mediatek Video Disp Padding Support + * + * Copyright (c) 2026 BayLibre, SAS. + * Author: Julien Stephan <[email protected]> + */ + +#ifndef _MTK_DISP_PADDING_H +#define _MTK_DISP_PADDING_H + +struct udevice; + +void mtk_disp_padding_config(struct udevice *dev); + +#endif -- 2.54.0