[PATCH v3 0/3] phy: mtk-mipi-csi: add driver for CSI phy

From: Julien Stephan
Date: Wed May 24 2023 - 04:30:50 EST

Adding a new driver for the MIPI CSI CD-PHY module v 0.5 embedded in
some Mediatek soc, such as the MT8365

This driver was adapted from https://patchwork.kernel.org/project/linux-mediatek/cover/20200708104023.3225-1-louis.kuo@xxxxxxxxxxxx/

v1 can be found here: https://lore.kernel.org/all/20230403071929.360911-1-jstephan@xxxxxxxxxxxx/

v2 can be found here: https://lore.kernel.org/all/20230515090551.1251389-1-jstephan@xxxxxxxxxxxx/

Changes in v3:
Binding file:
- rename compatible string
mediatek,phy-mipi-csi-0-5 -> mediatek,mt8365-csi-rx
- rename binding file to be as compatible string
- change property mediatek,is_cdphy -> mediatek,phy-type using an
enum value instead of boolean for scalability
- remove status property from example nodes
- rename example node name 'mipi_rx_csi0: mipi_rx_csi0@11c10000' ->
'csi0_rx: phy@11c10000'
- put reg address in lower case

- add PHY_TYPE_CDPHY definition

- rename compatible string
- rename property mediatek,is_cdphy -> mediatek,phy-type
- rename CSIx* macro to CSIX* (x -> X)
- fix style issue on the driver data structure
- update MODULE_DESCRIPTION as suggested by Angelo
and update the kconfig module description to match it
- add dphy /cdphy eq tuning function to factor the code
and increase readability
- fix typo __PHY_MTK__MIPI_CSI__C_0_5_RX_REG_H_ -->
- reword commit message to update my contributions
- added missing copyright
- added module name in Kconfig

Changes in v2:
- fix all comments on bindings
- move the binding chunk from driver to binding commit
- fix dt_binding_check error (reported by DT_CHECKER_FLAGS)
- use a more generic compatible string
- add a new dt properties to simplify the driver
- rename the driver and the corresponding file to include
- drop of_match_ptr()
- use devm_platform_ioremap_resource
- use phy-mtk-io.h api instead of regmap
- rework the driver to use dt nodes to declare PHY instead of an
array in the driver
- remove useless define for unused registers
- remove support for CSI0A/B because it cannot be tested, and it
simplifies the driver for a first review
- edit commit message and bindings to be more descriptive about the

Florian Sylvestre (1):
dt-bindings: phy: add mediatek MIPI CD-PHY module v0.5

Julien Stephan (1):
dt-bindings: phy: add PHY_TYPE_CDPHY definition

Phi-bang Nguyen (1):
phy: mtk-mipi-csi: add driver for CSI phy

.../bindings/phy/mediatek,mt8365-csi-rx.yaml | 68 +++++
drivers/phy/mediatek/Kconfig | 8 +
drivers/phy/mediatek/Makefile | 2 +
.../mediatek/phy-mtk-mipi-csi-0-5-rx-reg.h | 58 ++++
drivers/phy/mediatek/phy-mtk-mipi-csi-0-5.c | 272 ++++++++++++++++++
include/dt-bindings/phy/phy.h | 3 +-
7 files changed, 417 insertions(+), 1 deletion(-)
create mode 100644 Documentation/devicetree/bindings/phy/mediatek,mt8365-csi-rx.yaml
create mode 100644 drivers/phy/mediatek/phy-mtk-mipi-csi-0-5-rx-reg.h
create mode 100644 drivers/phy/mediatek/phy-mtk-mipi-csi-0-5.c