[PATCH v4 0/8] Add MT8195 HDMI support

From: Guillaume Ranquet
Date: Mon May 29 2023 - 10:36:46 EST


Add support for HDMI Tx on MT8195.

This includes a split of the current "legacy" hdmi driver into a common
library of functions and two dedicated compilation units with specific
code for mt8167 and another for the "v2" mt8195 SoC.

Support for the new mt8195 dpi/drm_drv adjustments to support hdmi.

Based on next-20230523

Still in my TODO-list for v5:

- Removal of the 'is_internal_hdmi' flag in mtk_dpi. [1]
I Couldn't find a way to get rid of it with the way things are done
in mtk_drm_drv/mtk_ddp_comp.
- Do not use a "virtual" device for the ddc v2 hw as it is embedded in
the hdmi IP. [2]
Seems that a lot of work is done by the framework when using a
proper device-tree entry that can be linked as the ddc-i2c-bus of
the hdmi-connector.
I will keep the virtual device unless I find a way to avoid
rewriting the framework code that handles this.

[1] : https://lore.kernel.org/all/988b0a7a-69bb-34e4-e777-1d9516221077@xxxxxxxxxxxxx/
[2] : https://lore.kernel.org/all/7da1e73a0cca6867a060d5b69d45e8d4dfc89748.camel@xxxxxxxxxxxx/

Signed-off-by: Guillaume Ranquet <granquet@xxxxxxxxxxxx>
---

Changes in v4:
- Split phy related patches to another series (merged)
- Removed regmap wrappers in mtk_hdmi
- Removed colorimetry related changes as this initial version only
support one color depth
- Fixed dt-bindings properties
- Removed some now useless clocks from mtk_hdmi_v2 and mtk_dpi
- Link to v3: https://lore.kernel.org/r/20220919-v3-0-a803f2660127@xxxxxxxxxxxx

Changes in v3:
- phy: Grouped register and bit definition together to add clarity
- dt-bindings: Addressed comments
- Link to v2: https://lore.kernel.org/r/20220919-v2-0-8419dcf4f09d@xxxxxxxxxxxx

Changes in v2:
- Removed syscon requirement from the hdmi node
- Use as much as possible bit FIELD_PREP/FIELD_GET macros across all the
patches
- Make cec optional dynamically instead of hardcoded with a flag
- Renamed hdmi variants to v1 (legacy) and v2 (mt8195) while waiting for
a better name
- Rework hdmi v2 code to use a connector (same as v1)
- Remove "magic" 0x43 addr special handling in hdmi ddc code
- Link to v1: https://lore.kernel.org/r/20220919-v1-0-4844816c9808@xxxxxxxxxxxx

---
Guillaume Ranquet (8):
dt-bindings: display: mediatek: add MT8195 hdmi bindings
drm/mediatek: hdmi: use a regmap instead of iomem
drm/mediatek: extract common functions from the mtk hdmi driver
drm/mediatek: hdmi: make the cec dev optional
drm/mediatek: hdmi: add v2 support
drm/mediatek: hdmi: v2: add audio support
dt-bindings: display: mediatek: dpi: Add compatible for MediaTek MT8195
drm/mediatek: dpi: Add mt8195 hdmi to DPI driver

.../bindings/display/mediatek/mediatek,dpi.yaml | 1 +
.../bindings/display/mediatek/mediatek,hdmi.yaml | 59 +-
.../display/mediatek/mediatek,mt8195-hdmi-ddc.yaml | 45 +
drivers/gpu/drm/mediatek/Kconfig | 2 +
drivers/gpu/drm/mediatek/Makefile | 5 +-
drivers/gpu/drm/mediatek/mtk_dpi.c | 121 +-
drivers/gpu/drm/mediatek/mtk_dpi_regs.h | 5 +
drivers/gpu/drm/mediatek/mtk_hdmi.c | 773 ++----------
drivers/gpu/drm/mediatek/mtk_hdmi.h | 18 +
drivers/gpu/drm/mediatek/mtk_hdmi_common.c | 437 +++++++
drivers/gpu/drm/mediatek/mtk_hdmi_common.h | 208 ++++
drivers/gpu/drm/mediatek/mtk_hdmi_ddc_v2.c | 362 ++++++
drivers/gpu/drm/mediatek/mtk_hdmi_regs_v2.h | 276 +++++
drivers/gpu/drm/mediatek/mtk_hdmi_v2.c | 1303 ++++++++++++++++++++
drivers/gpu/drm/mediatek/mtk_hdmi_v2.h | 32 +
15 files changed, 2955 insertions(+), 692 deletions(-)
---
base-commit: c8a64c6a78c54887da437098d97dc2accc689e89
change-id: 20220919-hdmi_mtk

Best regards,
--
Guillaume Ranquet <granquet@xxxxxxxxxxxx>