From nobody Fri Oct 3 08:51:14 2025 Received: from m16.mail.163.com (m16.mail.163.com [220.197.31.5]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1F1E72F658E; Wed, 3 Sep 2025 11:09:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.31.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756897790; cv=none; b=EZXFoUNlU/sYQcGI+wvj3OfXBjwZArNje1cmaWRJ1y93TR/Kx1dbx7wqJvc6SGRMVlJbIW7rXg+CIZJbpBWrkuVrTLSpRJm9Cn5rCYtqImmBv+aSr6+wO1k+M/MvJOKPx0G3pxUqUDTPkCuGx58Hx3+bFrrDAeqwn1P/YYgV+A4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756897790; c=relaxed/simple; bh=Pf7Zuyhtp5dDEFh5AQz7wufe2LKq48stYJdvBxM8Pso=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cksuuo26zMLjZPb1a8saP+xGKu7NHdSaRcNA9tjKKjcpoVdYAIVFRakrxczl6tWV1oQTwcAL+eQ7WeyNnrXpnHoOOLIPWehu/mtBqFVPVfNKoA9/OMDlCNy8e6pAueVipq2AhVV/MxYrsHUM3Y3QvO8RutQpklUHOrUccEqcFRo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=aGiseXeY; arc=none smtp.client-ip=220.197.31.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="aGiseXeY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=w+ YFILZ09hDE7uhPppDTedo0FA7XkYeemu7K3M7CyI4=; b=aGiseXeYgE8b37dozA lM3/ijkpdYDSuEG7wY4xVEix53kGXB7yaevpQpqDRd4IdKmIR39jh6pVge2N+74r ZcaVXY4Rv09KHOtH7CZyBnC9a+Ulwrgk6c5ZH/CGVXC6Ej9Cl+YYOZf9wun+TOap 0vJGYohe0q5xQApM9XyOYBj+o= Received: from ProDesk.. (unknown []) by gzga-smtp-mtada-g1-4 (Coremail) with SMTP id _____wC3ZLuqIbhoXAZsFw--.3268S3; Wed, 03 Sep 2025 19:08:33 +0800 (CST) From: Andy Yan To: dmitry.baryshkov@oss.qualcomm.com, heiko@sntech.de Cc: mripard@kernel.org, neil.armstrong@linaro.org, andrzej.hajda@intel.com, jernej.skrabec@gmail.com, jonas@kwiboo.se, Laurent.pinchart@ideasonboard.com, maarten.lankhorst@linux.intel.com, rfoss@kernel.org, simona@ffwll.ch, tzimmermann@suse.de, knaerzche@gmail.com, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Andy Yan Subject: [PATCH v7 1/2] drm/rockchip: inno-hdmi: Convert to drm bridge Date: Wed, 3 Sep 2025 19:07:38 +0800 Message-ID: <20250903110825.776807-2-andyshrk@163.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250903110825.776807-1-andyshrk@163.com> References: <20250903110825.776807-1-andyshrk@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: _____wC3ZLuqIbhoXAZsFw--.3268S3 X-Coremail-Antispam: 1Uf129KBjvAXoWfWF17Zw48Wr4DZryUtr15CFg_yoW5KFy3Co Z7JFn8Xr4xuryxWrWUKF10kF4jva1ayrn3Z3WrArWDZan8Gw4jga47KryrZFZrXF1avrW2 kw1kKrs3Xrn7Jr4kn29KB7ZKAUJUUUU8529EdanIXcx71UUUUU7v73VFW2AGmfu7bjvjm3 AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvjxUseT5DUUUU X-CM-SenderInfo: 5dqg52xkunqiywtou0bp/xtbBEgO9Xmi4G1HLPQAAse Content-Type: text/plain; charset="utf-8" From: Andy Yan Convert it to drm bridge driver, it will be convenient for us to migrate the connector part to the display driver later. Signed-off-by: Andy Yan --- Changes in v7: - Rebase on latest drm-misc-next Changes in v6: - Rebase on latest drm-misc-next - Link to V5: https://lore.kernel.org/linux-rockchip/20250512124615.2848731= -1-andyshrk@163.com/ Changes in v5: - Split cleanup code to seperate patch - Switch to devm_drm_bridge_alloc() API - Link to V4: https://lore.kernel.org/linux-rockchip/20250422070455.432666-= 1-andyshrk@163.com/ Changes in v4: - Do not store colorimetry within inno_hdmi struct - Link to V3: https://lore.kernel.org/linux-rockchip/20250402123150.238234-= 1-andyshrk@163.com/ Changes in v3: - First included in v3 - Link to V2: https://lore.kernel.org/dri-devel/20250325132944.171111-1-and= yshrk@163.com/ drivers/gpu/drm/bridge/Kconfig | 7 + drivers/gpu/drm/bridge/Makefile | 1 + .../inno_hdmi.c =3D> bridge/inno-hdmi.c} | 502 +++++------------- drivers/gpu/drm/rockchip/Kconfig | 1 + drivers/gpu/drm/rockchip/Makefile | 2 +- drivers/gpu/drm/rockchip/inno_hdmi-rockchip.c | 188 +++++++ include/drm/bridge/inno_hdmi.h | 33 ++ 7 files changed, 366 insertions(+), 368 deletions(-) rename drivers/gpu/drm/{rockchip/inno_hdmi.c =3D> bridge/inno-hdmi.c} (69%) create mode 100644 drivers/gpu/drm/rockchip/inno_hdmi-rockchip.c create mode 100644 include/drm/bridge/inno_hdmi.h diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig index 6945029b35929..f3d0503ee4c35 100644 --- a/drivers/gpu/drm/bridge/Kconfig +++ b/drivers/gpu/drm/bridge/Kconfig @@ -100,6 +100,13 @@ config DRM_I2C_NXP_TDA998X help Support for NXP Semiconductors TDA998X HDMI encoders. =20 +config DRM_INNO_HDMI + tristate + select DRM_BRIDGE_CONNECTOR + select DRM_DISPLAY_HDMI_HELPER + select DRM_DISPLAY_HELPER + select DRM_KMS_HELPER + config DRM_ITE_IT6263 tristate "ITE IT6263 LVDS/HDMI bridge" depends on OF diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makef= ile index c7dc03182e592..909c21cc3acd3 100644 --- a/drivers/gpu/drm/bridge/Makefile +++ b/drivers/gpu/drm/bridge/Makefile @@ -10,6 +10,7 @@ obj-$(CONFIG_DRM_FSL_LDB) +=3D fsl-ldb.o tda998x-y :=3D tda998x_drv.o obj-$(CONFIG_DRM_I2C_NXP_TDA998X) +=3D tda998x.o =20 +obj-$(CONFIG_DRM_INNO_HDMI) +=3D inno-hdmi.o obj-$(CONFIG_DRM_ITE_IT6263) +=3D ite-it6263.o obj-$(CONFIG_DRM_ITE_IT6505) +=3D ite-it6505.o obj-$(CONFIG_DRM_LONTIUM_LT8912B) +=3D lontium-lt8912b.o diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/bridge/= inno-hdmi.c similarity index 69% rename from drivers/gpu/drm/rockchip/inno_hdmi.c rename to drivers/gpu/drm/bridge/inno-hdmi.c index 1ab3ad4bde9ea..ab4572eb83950 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/bridge/inno-hdmi.c @@ -3,12 +3,14 @@ * Copyright (C) Rockchip Electronics Co., Ltd. * Zheng Yang * Yakir Yang + * Andy Yan */ =20 #include #include #include #include +#include #include #include #include @@ -17,18 +19,18 @@ #include #include =20 +#include #include #include #include #include +#include #include #include =20 #include #include =20 -#include "rockchip_drm_drv.h" - #define INNO_HDMI_MIN_TMDS_CLOCK 25000000U =20 #define DDC_SEGMENT_ADDR 0x30 @@ -382,29 +384,6 @@ enum { #define HDMI_CEC_BUSFREETIME_H 0xdd #define HDMI_CEC_LOGICADDR 0xde =20 -#define HIWORD_UPDATE(val, mask) ((val) | (mask) << 16) - -#define RK3036_GRF_SOC_CON2 0x148 -#define RK3036_HDMI_PHSYNC BIT(4) -#define RK3036_HDMI_PVSYNC BIT(5) - -enum inno_hdmi_dev_type { - RK3036_HDMI, - RK3128_HDMI, -}; - -struct inno_hdmi_phy_config { - unsigned long pixelclock; - u8 pre_emphasis; - u8 voltage_level_control; -}; - -struct inno_hdmi_variant { - enum inno_hdmi_dev_type dev_type; - struct inno_hdmi_phy_config *phy_configs; - struct inno_hdmi_phy_config *default_phy_config; -}; - struct inno_hdmi_i2c { struct i2c_adapter adap; =20 @@ -417,41 +396,17 @@ struct inno_hdmi_i2c { =20 struct inno_hdmi { struct device *dev; - + struct drm_bridge bridge; struct clk *pclk; struct clk *refclk; void __iomem *regs; struct regmap *grf; =20 - struct drm_connector connector; - struct rockchip_encoder encoder; - struct inno_hdmi_i2c *i2c; struct i2c_adapter *ddc; - - const struct inno_hdmi_variant *variant; -}; - -struct inno_hdmi_connector_state { - struct drm_connector_state base; - unsigned int colorimetry; + const struct inno_hdmi_plat_data *plat_data; }; =20 -static struct inno_hdmi *encoder_to_inno_hdmi(struct drm_encoder *encoder) -{ - struct rockchip_encoder *rkencoder =3D to_rockchip_encoder(encoder); - - return container_of(rkencoder, struct inno_hdmi, encoder); -} - -static struct inno_hdmi *connector_to_inno_hdmi(struct drm_connector *conn= ector) -{ - return container_of(connector, struct inno_hdmi, connector); -} - -#define to_inno_hdmi_conn_state(conn_state) \ - container_of_const(conn_state, struct inno_hdmi_connector_state, base) - enum { CSC_RGB_0_255_TO_ITU601_16_235_8BIT, CSC_RGB_0_255_TO_ITU709_16_235_8BIT, @@ -494,23 +449,15 @@ static const char coeff_csc[][24] =3D { }, }; =20 -static struct inno_hdmi_phy_config rk3036_hdmi_phy_configs[] =3D { - { 74250000, 0x3f, 0xbb }, - { 165000000, 0x6f, 0xbb }, - { ~0UL, 0x00, 0x00 } -}; - -static struct inno_hdmi_phy_config rk3128_hdmi_phy_configs[] =3D { - { 74250000, 0x3f, 0xaa }, - { 165000000, 0x5f, 0xaa }, - { ~0UL, 0x00, 0x00 } -}; +static struct inno_hdmi *bridge_to_inno_hdmi(struct drm_bridge *bridge) +{ + return container_of(bridge, struct inno_hdmi, bridge); +} =20 static int inno_hdmi_find_phy_config(struct inno_hdmi *hdmi, unsigned long pixelclk) { - const struct inno_hdmi_phy_config *phy_configs =3D - hdmi->variant->phy_configs; + const struct inno_hdmi_phy_config *phy_configs =3D hdmi->plat_data->phy_c= onfigs; int i; =20 for (i =3D 0; phy_configs[i].pixelclock !=3D ~0UL; i++) { @@ -582,12 +529,12 @@ static void inno_hdmi_power_up(struct inno_hdmi *hdmi, int ret =3D inno_hdmi_find_phy_config(hdmi, mpixelclock); =20 if (ret < 0) { - phy_config =3D hdmi->variant->default_phy_config; + phy_config =3D hdmi->plat_data->default_phy_config; DRM_DEV_ERROR(hdmi->dev, "Using default phy configuration for TMDS rate %lu", mpixelclock); } else { - phy_config =3D &hdmi->variant->phy_configs[ret]; + phy_config =3D &hdmi->plat_data->phy_configs[ret]; } =20 inno_hdmi_sys_power(hdmi, false); @@ -637,14 +584,13 @@ static void inno_hdmi_init_hw(struct inno_hdmi *hdmi) hdmi_modb(hdmi, HDMI_STATUS, m_MASK_INT_HOTPLUG, v_MASK_INT_HOTPLUG(1)); } =20 -static int inno_hdmi_disable_frame(struct drm_connector *connector, - enum hdmi_infoframe_type type) +static int inno_hdmi_bridge_clear_infoframe(struct drm_bridge *bridge, + enum hdmi_infoframe_type type) { - struct inno_hdmi *hdmi =3D connector_to_inno_hdmi(connector); + struct inno_hdmi *hdmi =3D bridge_to_inno_hdmi(bridge); =20 if (type !=3D HDMI_INFOFRAME_TYPE_AVI) { - drm_err(connector->dev, - "Unsupported infoframe type: %u\n", type); + drm_err(bridge->dev, "Unsupported infoframe type: %u\n", type); return 0; } =20 @@ -653,20 +599,19 @@ static int inno_hdmi_disable_frame(struct drm_connect= or *connector, return 0; } =20 -static int inno_hdmi_upload_frame(struct drm_connector *connector, - enum hdmi_infoframe_type type, - const u8 *buffer, size_t len) +static int inno_hdmi_bridge_write_infoframe(struct drm_bridge *bridge, + enum hdmi_infoframe_type type, + const u8 *buffer, size_t len) { - struct inno_hdmi *hdmi =3D connector_to_inno_hdmi(connector); + struct inno_hdmi *hdmi =3D bridge_to_inno_hdmi(bridge); ssize_t i; =20 if (type !=3D HDMI_INFOFRAME_TYPE_AVI) { - drm_err(connector->dev, - "Unsupported infoframe type: %u\n", type); + drm_err(bridge->dev, "Unsupported infoframe type: %u\n", type); return 0; } =20 - inno_hdmi_disable_frame(connector, type); + inno_hdmi_bridge_clear_infoframe(bridge, type); =20 for (i =3D 0; i < len; i++) hdmi_writeb(hdmi, HDMI_CONTROL_PACKET_ADDR + i, buffer[i]); @@ -674,23 +619,26 @@ static int inno_hdmi_upload_frame(struct drm_connecto= r *connector, return 0; } =20 -static const struct drm_connector_hdmi_funcs inno_hdmi_hdmi_connector_func= s =3D { - .clear_infoframe =3D inno_hdmi_disable_frame, - .write_infoframe =3D inno_hdmi_upload_frame, -}; - -static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi) +static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi, + struct drm_connector *connector, + struct drm_display_mode *mode) { - struct drm_connector *connector =3D &hdmi->connector; struct drm_connector_state *conn_state =3D connector->state; - struct inno_hdmi_connector_state *inno_conn_state =3D - to_inno_hdmi_conn_state(conn_state); int c0_c2_change =3D 0; int csc_enable =3D 0; int csc_mode =3D 0; int auto_csc =3D 0; int value; int i; + int colorimetry; + u8 vic =3D drm_match_cea_mode(mode); + + if (vic =3D=3D 6 || vic =3D=3D 7 || vic =3D=3D 21 || vic =3D=3D 22 || + vic =3D=3D 2 || vic =3D=3D 3 || vic =3D=3D 17 || vic =3D=3D 18) + colorimetry =3D HDMI_COLORIMETRY_ITU_601; + else + colorimetry =3D HDMI_COLORIMETRY_ITU_709; + =20 /* Input video mode is SDR RGB24bit, data enable signal from external */ hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL1, v_DE_EXTERNAL | @@ -720,7 +668,7 @@ static int inno_hdmi_config_video_csc(struct inno_hdmi = *hdmi) return 0; } } else { - if (inno_conn_state->colorimetry =3D=3D HDMI_COLORIMETRY_ITU_601) { + if (colorimetry =3D=3D HDMI_COLORIMETRY_ITU_601) { if (conn_state->hdmi.output_format =3D=3D HDMI_COLORSPACE_YUV444) { csc_mode =3D CSC_RGB_0_255_TO_ITU601_16_235_8BIT; auto_csc =3D AUTO_CSC_DISABLE; @@ -738,8 +686,7 @@ static int inno_hdmi_config_video_csc(struct inno_hdmi = *hdmi) } =20 for (i =3D 0; i < 24; i++) - hdmi_writeb(hdmi, HDMI_VIDEO_CSC_COEF + i, - coeff_csc[csc_mode][i]); + hdmi_writeb(hdmi, HDMI_VIDEO_CSC_COEF + i, coeff_csc[csc_mode][i]); =20 value =3D v_SOF_DISABLE | csc_enable | v_COLOR_DEPTH_NOT_INDICATED(1); hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL3, value); @@ -753,15 +700,11 @@ static int inno_hdmi_config_video_csc(struct inno_hdm= i *hdmi) static int inno_hdmi_config_video_timing(struct inno_hdmi *hdmi, struct drm_display_mode *mode) { - int value, psync; - - if (hdmi->variant->dev_type =3D=3D RK3036_HDMI) { - psync =3D mode->flags & DRM_MODE_FLAG_PHSYNC ? RK3036_HDMI_PHSYNC : 0; - value =3D HIWORD_UPDATE(psync, RK3036_HDMI_PHSYNC); - psync =3D mode->flags & DRM_MODE_FLAG_PVSYNC ? RK3036_HDMI_PVSYNC : 0; - value |=3D HIWORD_UPDATE(psync, RK3036_HDMI_PVSYNC); - regmap_write(hdmi->grf, RK3036_GRF_SOC_CON2, value); - } + const struct inno_hdmi_plat_ops *plat_ops =3D hdmi->plat_data->ops; + u32 value; + + if (plat_ops && plat_ops->enable) + plat_ops->enable(hdmi->dev, mode); =20 /* Set detail external video timing polarity and interlace mode */ value =3D v_EXTERANL_VIDEO(1); @@ -810,14 +753,16 @@ static int inno_hdmi_config_video_timing(struct inno_= hdmi *hdmi, return 0; } =20 -static int inno_hdmi_setup(struct inno_hdmi *hdmi, - struct drm_atomic_state *state) +static int inno_hdmi_setup(struct inno_hdmi *hdmi, struct drm_atomic_state= *state) { - struct drm_connector *connector =3D &hdmi->connector; - struct drm_display_info *display =3D &connector->display_info; + struct drm_bridge *bridge =3D &hdmi->bridge; + struct drm_connector *connector; + struct drm_display_info *info; struct drm_connector_state *new_conn_state; struct drm_crtc_state *new_crtc_state; =20 + connector =3D drm_atomic_get_new_connector_for_encoder(state, bridge->enc= oder); + new_conn_state =3D drm_atomic_get_new_connector_state(state, connector); if (WARN_ON(!new_conn_state)) return -EINVAL; @@ -826,17 +771,18 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, if (WARN_ON(!new_crtc_state)) return -EINVAL; =20 + info =3D &connector->display_info; + /* Mute video and audio output */ hdmi_modb(hdmi, HDMI_AV_MUTE, m_AUDIO_MUTE | m_VIDEO_BLACK, v_AUDIO_MUTE(1) | v_VIDEO_MUTE(1)); =20 /* Set HDMI Mode */ - hdmi_writeb(hdmi, HDMI_HDCP_CTRL, - v_HDMI_DVI(display->is_hdmi)); + hdmi_writeb(hdmi, HDMI_HDCP_CTRL, v_HDMI_DVI(info->is_hdmi)); =20 inno_hdmi_config_video_timing(hdmi, &new_crtc_state->adjusted_mode); =20 - inno_hdmi_config_video_csc(hdmi); + inno_hdmi_config_video_csc(hdmi, connector, &new_crtc_state->adjusted_mod= e); =20 drm_atomic_helper_connector_hdmi_update_infoframes(connector, state); =20 @@ -857,9 +803,11 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, return 0; } =20 -static enum drm_mode_status inno_hdmi_display_mode_valid(struct inno_hdmi = *hdmi, - const struct drm_display_mode *mode) +static enum drm_mode_status inno_hdmi_bridge_mode_valid(struct drm_bridge = *bridge, + const struct drm_display_info *info, + const struct drm_display_mode *mode) { + struct inno_hdmi *hdmi =3D bridge_to_inno_hdmi(bridge); unsigned long mpixelclk, max_tolerance; long rounded_refclk; =20 @@ -889,189 +837,57 @@ static enum drm_mode_status inno_hdmi_display_mode_v= alid(struct inno_hdmi *hdmi, return MODE_OK; } =20 -static void inno_hdmi_encoder_enable(struct drm_encoder *encoder, - struct drm_atomic_state *state) -{ - struct inno_hdmi *hdmi =3D encoder_to_inno_hdmi(encoder); - - inno_hdmi_setup(hdmi, state); -} - -static void inno_hdmi_encoder_disable(struct drm_encoder *encoder, - struct drm_atomic_state *state) -{ - struct inno_hdmi *hdmi =3D encoder_to_inno_hdmi(encoder); - - inno_hdmi_standby(hdmi); -} - -static int -inno_hdmi_encoder_atomic_check(struct drm_encoder *encoder, - struct drm_crtc_state *crtc_state, - struct drm_connector_state *conn_state) -{ - struct rockchip_crtc_state *s =3D to_rockchip_crtc_state(crtc_state); - struct drm_display_mode *mode =3D &crtc_state->adjusted_mode; - u8 vic =3D drm_match_cea_mode(mode); - struct inno_hdmi_connector_state *inno_conn_state =3D - to_inno_hdmi_conn_state(conn_state); - - s->output_mode =3D ROCKCHIP_OUT_MODE_P888; - s->output_type =3D DRM_MODE_CONNECTOR_HDMIA; - - if (vic =3D=3D 6 || vic =3D=3D 7 || - vic =3D=3D 21 || vic =3D=3D 22 || - vic =3D=3D 2 || vic =3D=3D 3 || - vic =3D=3D 17 || vic =3D=3D 18) - inno_conn_state->colorimetry =3D HDMI_COLORIMETRY_ITU_601; - else - inno_conn_state->colorimetry =3D HDMI_COLORIMETRY_ITU_709; - - return 0; -} - -static const struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_func= s =3D { - .atomic_check =3D inno_hdmi_encoder_atomic_check, - .atomic_enable =3D inno_hdmi_encoder_enable, - .atomic_disable =3D inno_hdmi_encoder_disable, -}; - static enum drm_connector_status -inno_hdmi_connector_detect(struct drm_connector *connector, bool force) +inno_hdmi_bridge_detect(struct drm_bridge *bridge, struct drm_connector *c= onnector) { - struct inno_hdmi *hdmi =3D connector_to_inno_hdmi(connector); + struct inno_hdmi *hdmi =3D bridge_to_inno_hdmi(bridge); =20 return (hdmi_readb(hdmi, HDMI_STATUS) & m_HOTPLUG) ? connector_status_connected : connector_status_disconnected; } =20 -static int inno_hdmi_connector_get_modes(struct drm_connector *connector) +static const struct drm_edid * +inno_hdmi_bridge_edid_read(struct drm_bridge *bridge, struct drm_connector= *connector) { - struct inno_hdmi *hdmi =3D connector_to_inno_hdmi(connector); + struct inno_hdmi *hdmi =3D bridge_to_inno_hdmi(bridge); const struct drm_edid *drm_edid; - int ret =3D 0; - - if (!hdmi->ddc) - return 0; - - drm_edid =3D drm_edid_read_ddc(connector, hdmi->ddc); - drm_edid_connector_update(connector, drm_edid); - ret =3D drm_edid_connector_add_modes(connector); - drm_edid_free(drm_edid); - - return ret; -} - -static enum drm_mode_status -inno_hdmi_connector_mode_valid(struct drm_connector *connector, - const struct drm_display_mode *mode) -{ - struct inno_hdmi *hdmi =3D connector_to_inno_hdmi(connector); - - return inno_hdmi_display_mode_valid(hdmi, mode); -} =20 -static void -inno_hdmi_connector_destroy_state(struct drm_connector *connector, - struct drm_connector_state *state) -{ - struct inno_hdmi_connector_state *inno_conn_state =3D - to_inno_hdmi_conn_state(state); + drm_edid =3D drm_edid_read_ddc(connector, bridge->ddc); + if (!drm_edid) + dev_dbg(hdmi->dev, "failed to get edid\n"); =20 - __drm_atomic_helper_connector_destroy_state(&inno_conn_state->base); - kfree(inno_conn_state); + return drm_edid; } =20 -static void inno_hdmi_connector_reset(struct drm_connector *connector) +static void inno_hdmi_bridge_atomic_enable(struct drm_bridge *bridge, + struct drm_atomic_state *state) { - struct inno_hdmi_connector_state *inno_conn_state; - - if (connector->state) { - inno_hdmi_connector_destroy_state(connector, connector->state); - connector->state =3D NULL; - } - - inno_conn_state =3D kzalloc(sizeof(*inno_conn_state), GFP_KERNEL); - if (!inno_conn_state) - return; - - __drm_atomic_helper_connector_reset(connector, &inno_conn_state->base); - __drm_atomic_helper_connector_hdmi_reset(connector, connector->state); + struct inno_hdmi *hdmi =3D bridge_to_inno_hdmi(bridge); =20 - inno_conn_state->colorimetry =3D HDMI_COLORIMETRY_ITU_709; + inno_hdmi_setup(hdmi, state); } =20 -static struct drm_connector_state * -inno_hdmi_connector_duplicate_state(struct drm_connector *connector) +static void inno_hdmi_bridge_atomic_disable(struct drm_bridge *bridge, + struct drm_atomic_state *state) { - struct inno_hdmi_connector_state *inno_conn_state; - - if (WARN_ON(!connector->state)) - return NULL; - - inno_conn_state =3D kmemdup(to_inno_hdmi_conn_state(connector->state), - sizeof(*inno_conn_state), GFP_KERNEL); - - if (!inno_conn_state) - return NULL; + struct inno_hdmi *hdmi =3D bridge_to_inno_hdmi(bridge); =20 - __drm_atomic_helper_connector_duplicate_state(connector, - &inno_conn_state->base); - - return &inno_conn_state->base; + inno_hdmi_standby(hdmi); } =20 -static const struct drm_connector_funcs inno_hdmi_connector_funcs =3D { - .fill_modes =3D drm_helper_probe_single_connector_modes, - .detect =3D inno_hdmi_connector_detect, - .reset =3D inno_hdmi_connector_reset, - .atomic_duplicate_state =3D inno_hdmi_connector_duplicate_state, - .atomic_destroy_state =3D inno_hdmi_connector_destroy_state, -}; - -static struct drm_connector_helper_funcs inno_hdmi_connector_helper_funcs = =3D { - .atomic_check =3D drm_atomic_helper_connector_hdmi_check, - .get_modes =3D inno_hdmi_connector_get_modes, - .mode_valid =3D inno_hdmi_connector_mode_valid, +static const struct drm_bridge_funcs inno_hdmi_bridge_funcs =3D { + .atomic_duplicate_state =3D drm_atomic_helper_bridge_duplicate_state, + .atomic_destroy_state =3D drm_atomic_helper_bridge_destroy_state, + .atomic_reset =3D drm_atomic_helper_bridge_reset, + .atomic_enable =3D inno_hdmi_bridge_atomic_enable, + .atomic_disable =3D inno_hdmi_bridge_atomic_disable, + .detect =3D inno_hdmi_bridge_detect, + .edid_read =3D inno_hdmi_bridge_edid_read, + .hdmi_clear_infoframe =3D inno_hdmi_bridge_clear_infoframe, + .hdmi_write_infoframe =3D inno_hdmi_bridge_write_infoframe, + .mode_valid =3D inno_hdmi_bridge_mode_valid, }; =20 -static int inno_hdmi_register(struct drm_device *drm, struct inno_hdmi *hd= mi) -{ - struct drm_encoder *encoder =3D &hdmi->encoder.encoder; - struct device *dev =3D hdmi->dev; - - encoder->possible_crtcs =3D drm_of_find_possible_crtcs(drm, dev->of_node); - - /* - * If we failed to find the CRTC(s) which this encoder is - * supposed to be connected to, it's because the CRTC has - * not been registered yet. Defer probing, and hope that - * the required CRTC is added later. - */ - if (encoder->possible_crtcs =3D=3D 0) - return -EPROBE_DEFER; - - drm_encoder_helper_add(encoder, &inno_hdmi_encoder_helper_funcs); - drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_TMDS); - - hdmi->connector.polled =3D DRM_CONNECTOR_POLL_HPD; - - drm_connector_helper_add(&hdmi->connector, - &inno_hdmi_connector_helper_funcs); - drmm_connector_hdmi_init(drm, &hdmi->connector, - "Rockchip", "Inno HDMI", - &inno_hdmi_connector_funcs, - &inno_hdmi_hdmi_connector_funcs, - DRM_MODE_CONNECTOR_HDMIA, - hdmi->ddc, - BIT(HDMI_COLORSPACE_RGB), - 8); - - drm_connector_attach_encoder(&hdmi->connector, encoder); - - return 0; -} - static irqreturn_t inno_hdmi_i2c_irq(struct inno_hdmi *hdmi) { struct inno_hdmi_i2c *i2c =3D hdmi->i2c; @@ -1111,7 +927,7 @@ static irqreturn_t inno_hdmi_irq(int irq, void *dev_id) { struct inno_hdmi *hdmi =3D dev_id; =20 - drm_helper_hpd_irq_event(hdmi->connector.dev); + drm_helper_hpd_irq_event(hdmi->bridge.dev); =20 return IRQ_HANDLED; } @@ -1243,128 +1059,80 @@ static struct i2c_adapter *inno_hdmi_i2c_adapter(s= truct inno_hdmi *hdmi) return adap; } =20 -static int inno_hdmi_bind(struct device *dev, struct device *master, - void *data) +struct inno_hdmi *inno_hdmi_bind(struct device *dev, + struct drm_encoder *encoder, + const struct inno_hdmi_plat_data *plat_data) { struct platform_device *pdev =3D to_platform_device(dev); - struct drm_device *drm =3D data; struct inno_hdmi *hdmi; - const struct inno_hdmi_variant *variant; int irq; int ret; =20 - hdmi =3D devm_kzalloc(dev, sizeof(*hdmi), GFP_KERNEL); - if (!hdmi) - return -ENOMEM; - - hdmi->dev =3D dev; + if (!plat_data->phy_configs || !plat_data->default_phy_config) { + dev_err(dev, "Missing platform PHY ops\n"); + return ERR_PTR(-ENODEV); + } =20 - variant =3D of_device_get_match_data(hdmi->dev); - if (!variant) - return -EINVAL; + hdmi =3D devm_drm_bridge_alloc(dev, struct inno_hdmi, bridge, &inno_hdmi_= bridge_funcs); + if (IS_ERR(hdmi)) + return ERR_CAST(hdmi); =20 - hdmi->variant =3D variant; + hdmi->dev =3D dev; + hdmi->plat_data =3D plat_data; =20 hdmi->regs =3D devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(hdmi->regs)) - return PTR_ERR(hdmi->regs); + return ERR_CAST(hdmi->regs); =20 hdmi->pclk =3D devm_clk_get_enabled(hdmi->dev, "pclk"); - if (IS_ERR(hdmi->pclk)) - return dev_err_probe(dev, PTR_ERR(hdmi->pclk), "Unable to get HDMI pclk\= n"); + if (IS_ERR(hdmi->pclk)) { + dev_err_probe(dev, PTR_ERR(hdmi->pclk), "Unable to get HDMI pclk\n"); + return ERR_CAST(hdmi->pclk); + } =20 hdmi->refclk =3D devm_clk_get_optional_enabled(hdmi->dev, "ref"); - if (IS_ERR(hdmi->refclk)) - return dev_err_probe(dev, PTR_ERR(hdmi->refclk), "Unable to get HDMI ref= clk\n"); - - if (hdmi->variant->dev_type =3D=3D RK3036_HDMI) { - hdmi->grf =3D syscon_regmap_lookup_by_phandle(dev->of_node, "rockchip,gr= f"); - if (IS_ERR(hdmi->grf)) - return dev_err_probe(dev, - PTR_ERR(hdmi->grf), "Unable to get rockchip,grf\n"); + if (IS_ERR(hdmi->refclk)) { + dev_err_probe(dev, PTR_ERR(hdmi->refclk), "Unable to get HDMI refclk\n"); + return ERR_CAST(hdmi->refclk); } =20 - irq =3D platform_get_irq(pdev, 0); - if (irq < 0) - return irq; - inno_hdmi_init_hw(hdmi); =20 - hdmi->ddc =3D inno_hdmi_i2c_adapter(hdmi); - if (IS_ERR(hdmi->ddc)) - return PTR_ERR(hdmi->ddc); - - ret =3D inno_hdmi_register(drm, hdmi); - if (ret) - return ret; - - dev_set_drvdata(dev, hdmi); + irq =3D platform_get_irq(pdev, 0); + if (irq < 0) + return ERR_PTR(irq); =20 ret =3D devm_request_threaded_irq(dev, irq, inno_hdmi_hardirq, inno_hdmi_irq, IRQF_SHARED, dev_name(dev), hdmi); - if (ret < 0) - goto err_cleanup_hdmi; - - return 0; -err_cleanup_hdmi: - hdmi->connector.funcs->destroy(&hdmi->connector); - hdmi->encoder.encoder.funcs->destroy(&hdmi->encoder.encoder); - return ret; -} - -static void inno_hdmi_unbind(struct device *dev, struct device *master, - void *data) -{ - struct inno_hdmi *hdmi =3D dev_get_drvdata(dev); - - hdmi->connector.funcs->destroy(&hdmi->connector); - hdmi->encoder.encoder.funcs->destroy(&hdmi->encoder.encoder); -} + if (ret) + return ERR_PTR(ret); =20 -static const struct component_ops inno_hdmi_ops =3D { - .bind =3D inno_hdmi_bind, - .unbind =3D inno_hdmi_unbind, -}; + hdmi->bridge.driver_private =3D hdmi; + hdmi->bridge.ops =3D DRM_BRIDGE_OP_DETECT | + DRM_BRIDGE_OP_EDID | + DRM_BRIDGE_OP_HDMI | + DRM_BRIDGE_OP_HPD; + hdmi->bridge.of_node =3D pdev->dev.of_node; + hdmi->bridge.type =3D DRM_MODE_CONNECTOR_HDMIA; + hdmi->bridge.vendor =3D "Inno"; + hdmi->bridge.product =3D "Inno HDMI"; + + hdmi->bridge.ddc =3D inno_hdmi_i2c_adapter(hdmi); + if (IS_ERR(hdmi->bridge.ddc)) + return ERR_CAST(hdmi->bridge.ddc); + + ret =3D devm_drm_bridge_add(dev, &hdmi->bridge); + if (ret) + return ERR_PTR(ret); =20 -static int inno_hdmi_probe(struct platform_device *pdev) -{ - return component_add(&pdev->dev, &inno_hdmi_ops); -} + ret =3D drm_bridge_attach(encoder, &hdmi->bridge, NULL, DRM_BRIDGE_ATTACH= _NO_CONNECTOR); + if (ret) + return ERR_PTR(ret); =20 -static void inno_hdmi_remove(struct platform_device *pdev) -{ - component_del(&pdev->dev, &inno_hdmi_ops); + return hdmi; } - -static const struct inno_hdmi_variant rk3036_inno_hdmi_variant =3D { - .dev_type =3D RK3036_HDMI, - .phy_configs =3D rk3036_hdmi_phy_configs, - .default_phy_config =3D &rk3036_hdmi_phy_configs[1], -}; - -static const struct inno_hdmi_variant rk3128_inno_hdmi_variant =3D { - .dev_type =3D RK3128_HDMI, - .phy_configs =3D rk3128_hdmi_phy_configs, - .default_phy_config =3D &rk3128_hdmi_phy_configs[1], -}; - -static const struct of_device_id inno_hdmi_dt_ids[] =3D { - { .compatible =3D "rockchip,rk3036-inno-hdmi", - .data =3D &rk3036_inno_hdmi_variant, - }, - { .compatible =3D "rockchip,rk3128-inno-hdmi", - .data =3D &rk3128_inno_hdmi_variant, - }, - {}, -}; -MODULE_DEVICE_TABLE(of, inno_hdmi_dt_ids); - -struct platform_driver inno_hdmi_driver =3D { - .probe =3D inno_hdmi_probe, - .remove =3D inno_hdmi_remove, - .driver =3D { - .name =3D "innohdmi-rockchip", - .of_match_table =3D inno_hdmi_dt_ids, - }, -}; +EXPORT_SYMBOL_GPL(inno_hdmi_bind); +MODULE_AUTHOR("Andy Yan "); +MODULE_DESCRIPTION("INNOSILICON HDMI transmitter library"); +MODULE_LICENSE("GPL"); diff --git a/drivers/gpu/drm/rockchip/Kconfig b/drivers/gpu/drm/rockchip/Kc= onfig index 14ec0281d45a4..e2f355f87ae51 100644 --- a/drivers/gpu/drm/rockchip/Kconfig +++ b/drivers/gpu/drm/rockchip/Kconfig @@ -15,6 +15,7 @@ config DRM_ROCKCHIP select DRM_DW_HDMI_QP if ROCKCHIP_DW_HDMI_QP select DRM_DW_MIPI_DSI if ROCKCHIP_DW_MIPI_DSI select DRM_DW_MIPI_DSI2 if ROCKCHIP_DW_MIPI_DSI2 + select DRM_INNO_HDMI if ROCKCHIP_INNO_HDMI select GENERIC_PHY if ROCKCHIP_DW_MIPI_DSI select GENERIC_PHY_MIPI_DPHY if ROCKCHIP_DW_MIPI_DSI select SND_SOC_HDMI_CODEC if ROCKCHIP_CDN_DP && SND_SOC diff --git a/drivers/gpu/drm/rockchip/Makefile b/drivers/gpu/drm/rockchip/M= akefile index 097f062399c7a..948b0f906d3d8 100644 --- a/drivers/gpu/drm/rockchip/Makefile +++ b/drivers/gpu/drm/rockchip/Makefile @@ -15,7 +15,7 @@ rockchipdrm-$(CONFIG_ROCKCHIP_DW_HDMI_QP) +=3D dw_hdmi_qp= -rockchip.o rockchipdrm-$(CONFIG_ROCKCHIP_DW_MIPI_DSI) +=3D dw-mipi-dsi-rockchip.o rockchipdrm-$(CONFIG_ROCKCHIP_DW_MIPI_DSI2) +=3D dw-mipi-dsi2-rockchip.o rockchipdrm-$(CONFIG_ROCKCHIP_DW_DP) +=3D dw_dp-rockchip.o -rockchipdrm-$(CONFIG_ROCKCHIP_INNO_HDMI) +=3D inno_hdmi.o +rockchipdrm-$(CONFIG_ROCKCHIP_INNO_HDMI) +=3D inno_hdmi-rockchip.o rockchipdrm-$(CONFIG_ROCKCHIP_LVDS) +=3D rockchip_lvds.o rockchipdrm-$(CONFIG_ROCKCHIP_RGB) +=3D rockchip_rgb.o rockchipdrm-$(CONFIG_ROCKCHIP_RK3066_HDMI) +=3D rk3066_hdmi.o diff --git a/drivers/gpu/drm/rockchip/inno_hdmi-rockchip.c b/drivers/gpu/dr= m/rockchip/inno_hdmi-rockchip.c new file mode 100644 index 0000000000000..31cb2a90308c1 --- /dev/null +++ b/drivers/gpu/drm/rockchip/inno_hdmi-rockchip.c @@ -0,0 +1,188 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (C) Rockchip Electronics Co., Ltd. + * Zheng Yang + * Andy Yan + */ +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "rockchip_drm_drv.h" + +#define HIWORD_UPDATE(val, mask) ((val) | (mask) << 16) + +#define RK3036_GRF_SOC_CON2 0x148 +#define RK3036_HDMI_PHSYNC BIT(4) +#define RK3036_HDMI_PVSYNC BIT(5) + +enum inno_hdmi_dev_type { + RK3036_HDMI, + RK3128_HDMI, +}; + +struct inno_hdmi_connector_state { + struct drm_connector_state base; + unsigned int colorimetry; +}; + +struct rockchip_inno_hdmi { + struct inno_hdmi *base; + struct device *dev; + struct regmap *grf; + struct rockchip_encoder encoder; +}; + +static struct inno_hdmi_phy_config rk3036_hdmi_phy_configs[] =3D { + { 74250000, 0x3f, 0xbb }, + { 165000000, 0x6f, 0xbb }, + { ~0UL, 0x00, 0x00 } +}; + +static struct inno_hdmi_phy_config rk3128_hdmi_phy_configs[] =3D { + { 74250000, 0x3f, 0xaa }, + { 165000000, 0x5f, 0xaa }, + { ~0UL, 0x00, 0x00 } +}; + +static void inno_hdmi_rk3036_enable(struct device *dev, struct drm_display= _mode *mode) +{ + struct rockchip_inno_hdmi *hdmi =3D dev_get_drvdata(dev); + int value, psync; + + psync =3D mode->flags & DRM_MODE_FLAG_PHSYNC ? RK3036_HDMI_PHSYNC : 0; + value =3D HIWORD_UPDATE(psync, RK3036_HDMI_PHSYNC); + psync =3D mode->flags & DRM_MODE_FLAG_PVSYNC ? RK3036_HDMI_PVSYNC : 0; + value |=3D HIWORD_UPDATE(psync, RK3036_HDMI_PVSYNC); + regmap_write(hdmi->grf, RK3036_GRF_SOC_CON2, value); +} + +static int inno_hdmi_encoder_atomic_check(struct drm_encoder *encoder, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state) +{ + struct rockchip_crtc_state *s =3D to_rockchip_crtc_state(crtc_state); + + s->output_mode =3D ROCKCHIP_OUT_MODE_P888; + s->output_type =3D DRM_MODE_CONNECTOR_HDMIA; + + return 0; +} + +static const struct drm_encoder_helper_funcs inno_hdmi_rockchip_encoder_he= lper_funcs =3D { + .atomic_check =3D inno_hdmi_encoder_atomic_check, +}; + +static int inno_hdmi_rockchip_bind(struct device *dev, struct device *mast= er, void *data) +{ + struct drm_device *drm =3D data; + struct drm_connector *connector; + struct drm_encoder *encoder; + struct rockchip_inno_hdmi *hdmi; + const struct inno_hdmi_plat_data *plat_data; + int ret; + + hdmi =3D devm_kzalloc(dev, sizeof(*hdmi), GFP_KERNEL); + if (!hdmi) + return -ENOMEM; + + hdmi->dev =3D dev; + + plat_data =3D of_device_get_match_data(hdmi->dev); + if (!plat_data) + return -EINVAL; + + if (of_device_is_compatible(dev->of_node, "rockchip,rk3036-inno-hdmi")) { + hdmi->grf =3D syscon_regmap_lookup_by_phandle(dev->of_node, "rockchip,gr= f"); + if (IS_ERR(hdmi->grf)) + return dev_err_probe(dev, + PTR_ERR(hdmi->grf), "Unable to get rockchip,grf\n"); + } + + encoder =3D &hdmi->encoder.encoder; + encoder->possible_crtcs =3D drm_of_find_possible_crtcs(drm, dev->of_node); + + /* + * If we failed to find the CRTC(s) which this encoder is + * supposed to be connected to, it's because the CRTC has + * not been registered yet. Defer probing, and hope that + * the required CRTC is added later. + */ + if (encoder->possible_crtcs =3D=3D 0) + return -EPROBE_DEFER; + + ret =3D drmm_encoder_init(drm, encoder, NULL, DRM_MODE_ENCODER_TMDS, NULL= ); + if (ret) + return ret; + + drm_encoder_helper_add(encoder, &inno_hdmi_rockchip_encoder_helper_funcs); + + dev_set_drvdata(dev, hdmi); + + hdmi->base =3D inno_hdmi_bind(dev, encoder, plat_data); + + connector =3D drm_bridge_connector_init(drm, encoder); + if (IS_ERR(connector)) { + ret =3D PTR_ERR(connector); + dev_err(hdmi->dev, "failed to init bridge connector: %d\n", ret); + return ret; + } + + return drm_connector_attach_encoder(connector, encoder); +} + +static const struct component_ops inno_hdmi_rockchip_ops =3D { + .bind =3D inno_hdmi_rockchip_bind, +}; + +static int inno_hdmi_rockchip_probe(struct platform_device *pdev) +{ + return component_add(&pdev->dev, &inno_hdmi_rockchip_ops); +} + +static void inno_hdmi_rockchip_remove(struct platform_device *pdev) +{ + component_del(&pdev->dev, &inno_hdmi_rockchip_ops); +} + +static const struct inno_hdmi_plat_ops rk3036_inno_hdmi_plat_ops =3D { + .enable =3D inno_hdmi_rk3036_enable, +}; + +static const struct inno_hdmi_plat_data rk3036_inno_hdmi_plat_data =3D { + .ops =3D &rk3036_inno_hdmi_plat_ops, + .phy_configs =3D rk3036_hdmi_phy_configs, + .default_phy_config =3D &rk3036_hdmi_phy_configs[1], +}; + +static const struct inno_hdmi_plat_data rk3128_inno_hdmi_plat_data =3D { + .phy_configs =3D rk3128_hdmi_phy_configs, + .default_phy_config =3D &rk3128_hdmi_phy_configs[1], +}; + +static const struct of_device_id inno_hdmi_rockchip_dt_ids[] =3D { + { .compatible =3D "rockchip,rk3036-inno-hdmi", + .data =3D &rk3036_inno_hdmi_plat_data, + }, + { .compatible =3D "rockchip,rk3128-inno-hdmi", + .data =3D &rk3128_inno_hdmi_plat_data, + }, + {}, +}; +MODULE_DEVICE_TABLE(of, inno_hdmi_rockchip_dt_ids); + +struct platform_driver inno_hdmi_driver =3D { + .probe =3D inno_hdmi_rockchip_probe, + .remove =3D inno_hdmi_rockchip_remove, + .driver =3D { + .name =3D "innohdmi-rockchip", + .of_match_table =3D inno_hdmi_rockchip_dt_ids, + }, +}; diff --git a/include/drm/bridge/inno_hdmi.h b/include/drm/bridge/inno_hdmi.h new file mode 100644 index 0000000000000..8b39655212e24 --- /dev/null +++ b/include/drm/bridge/inno_hdmi.h @@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * Copyright (c) 2025 Rockchip Electronics Co., Ltd. + */ + +#ifndef __INNO_HDMI__ +#define __INNO_HDMI__ + +struct device; +struct drm_encoder; +struct drm_display_mode; +struct inno_hdmi; + +struct inno_hdmi_plat_ops { + void (*enable)(struct device *pdev, struct drm_display_mode *mode); +}; + +struct inno_hdmi_phy_config { + unsigned long pixelclock; + u8 pre_emphasis; + u8 voltage_level_control; +}; + +struct inno_hdmi_plat_data { + const struct inno_hdmi_plat_ops *ops; + struct inno_hdmi_phy_config *phy_configs; + struct inno_hdmi_phy_config *default_phy_config; +}; + +struct inno_hdmi *inno_hdmi_bind(struct device *pdev, + struct drm_encoder *encoder, + const struct inno_hdmi_plat_data *plat_data); +#endif /* __INNO_HDMI__ */ --=20 2.43.0 From nobody Fri Oct 3 08:51:14 2025 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.3]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E41D52F6180; Wed, 3 Sep 2025 11:09:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.3 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756897787; cv=none; b=Sp4Z6sXCfT4RVEWFfvpC/7m/W74D3Vonz4/GQc8R9S//fOqJfxBHkXcOMdQygXjC+BpQA/KHemB5CJRnm4R5iBoLRFajjOfYvFrBH0JGYa7EmICUxz4Ff5CP6MDjKtTQdLrnE1Hv0M2ZOIQuQwuuvPVxV9ml8EAjEhNNj4XIKu8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756897787; c=relaxed/simple; bh=5JuM+zVZonADMosGAewf0MPciwlPQvws9ZO+aeqWtgo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Oi3nw0dMGl0NGE4yUn3btwrLdLO3q9p46yfQJS72Z5yj74yZAUYZN0wd9338BmadMBGGduPSvhdNEp0aoRjVxhMviZFFspoTJGPhoWjQUgZ3EMdv42BUZ6yQgFEM5+7FnMnvD+SeqOrzER3difTjUyOKxNPSWZxRrzOmvcknZFs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=pzmGJUW5; arc=none smtp.client-ip=117.135.210.3 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="pzmGJUW5" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=c0 /SBiSXOOl6HFr+JmOjCWEmu3pstjSyRziH55Av6WA=; b=pzmGJUW5GsUD0zajgM 1dLJ5xfepWw+5r6dKHs8FqtSnbSrW6yE4YGJJgieet+W9uNB1cCZPLY2cMlHAziF CeAW/sq3nKyZtSTjyQ6nN4BdM4UVJOfciEZrD2to83lqxyMEtbXujEgp3CHn79sV nTWuDvNnkqHafHOXA5tRWUOXE= Received: from ProDesk.. (unknown []) by gzga-smtp-mtada-g1-4 (Coremail) with SMTP id _____wC3ZLuqIbhoXAZsFw--.3268S4; Wed, 03 Sep 2025 19:08:34 +0800 (CST) From: Andy Yan To: dmitry.baryshkov@oss.qualcomm.com, heiko@sntech.de Cc: mripard@kernel.org, neil.armstrong@linaro.org, andrzej.hajda@intel.com, jernej.skrabec@gmail.com, jonas@kwiboo.se, Laurent.pinchart@ideasonboard.com, maarten.lankhorst@linux.intel.com, rfoss@kernel.org, simona@ffwll.ch, tzimmermann@suse.de, knaerzche@gmail.com, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Andy Yan Subject: [PATCH v7 2/2] MAINTAINERS: Add entry for Innosilicon hdmi bridge library Date: Wed, 3 Sep 2025 19:07:39 +0800 Message-ID: <20250903110825.776807-3-andyshrk@163.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250903110825.776807-1-andyshrk@163.com> References: <20250903110825.776807-1-andyshrk@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: _____wC3ZLuqIbhoXAZsFw--.3268S4 X-Coremail-Antispam: 1Uf129KBjvdXoW7GFy8uFyxCFy5Kr17Zr48tFb_yoWfGrX_GF 18JrW8Zr4jkFWjy397Ca1fX3sIkw4xtF1fXFn5tws7Jwn8AryDJwn2gryIgr15CF1xGayq qayUXF9Ikr13WjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU0iqXJUUUUU== X-CM-SenderInfo: 5dqg52xkunqiywtou0bp/xtbBEAO9Xmi4H7lLfwAAsy Content-Type: text/plain; charset="utf-8" From: Andy Yan Add entry for Innosilicon hdmi bridge library Signed-off-by: Andy Yan --- (no changes since v1) MAINTAINERS | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 88851907b6725..d4b5eea84cb9f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -12085,6 +12085,14 @@ M: Samuel Holland S: Maintained F: drivers/power/supply/ip5xxx_power.c =20 +INNOSILICON HDMI BRIDGE DRIVER +M: Andy Yan +L: dri-devel@lists.freedesktop.org +S: Maintained +T: git https://gitlab.freedesktop.org/drm/misc/kernel.git +F: drivers/gpu/drm/bridge/inno-hdmi.c +F: include/drm/bridge/inno_hdmi.h + INOTIFY M: Jan Kara R: Amir Goldstein --=20 2.43.0