[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ef02d09ce33ab249e877e779f75c3980f5a5939a.camel@mediatek.com>
Date: Mon, 16 Dec 2024 07:38:59 +0000
From: CK Hu (胡俊光) <ck.hu@...iatek.com>
To: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
"chunkuang.hu@...nel.org" <chunkuang.hu@...nel.org>
CC: "robh@...nel.org" <robh@...nel.org>, "jie.qiu@...iatek.com"
<jie.qiu@...iatek.com>, "tzimmermann@...e.de" <tzimmermann@...e.de>,
"simona@...ll.ch" <simona@...ll.ch>, "mripard@...nel.org"
<mripard@...nel.org>, Jitao Shi (石记涛)
<jitao.shi@...iatek.com>, "linux-mediatek@...ts.infradead.org"
<linux-mediatek@...ts.infradead.org>, "dri-devel@...ts.freedesktop.org"
<dri-devel@...ts.freedesktop.org>, "maarten.lankhorst@...ux.intel.com"
<maarten.lankhorst@...ux.intel.com>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "devicetree@...r.kernel.org"
<devicetree@...r.kernel.org>, "kernel@...labora.com" <kernel@...labora.com>,
"krzk+dt@...nel.org" <krzk+dt@...nel.org>, "p.zabel@...gutronix.de"
<p.zabel@...gutronix.de>, "conor+dt@...nel.org" <conor+dt@...nel.org>,
"airlied@...il.com" <airlied@...il.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, "matthias.bgg@...il.com"
<matthias.bgg@...il.com>, "junzhi.zhao@...iatek.com"
<junzhi.zhao@...iatek.com>
Subject: Re: [PATCH v2 12/15] drm/mediatek: mtk_hdmi: Split driver and add
common probe function
Hi, Angelo:
On Thu, 2024-12-05 at 12:45 +0100, AngeloGioacchino Del Regno wrote:
> External email : Please do not click links or open attachments until you have verified the sender or the content.
>
>
> In preparation for adding a new driver for the HDMI TX v2 IP,
> split out the functions that will be common between the already
> present mtk_hdmi (v1) driver and the new one.
>
> Since the probe flow for both drivers is 90% similar, add a common
> probe function that will be called from each driver's .probe()
> callback, avoiding lots of code duplication.
>
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
> ---
[snip]
> -struct mtk_hdmi {
> - struct drm_bridge bridge;
> - struct drm_bridge *next_bridge;
> - struct drm_connector *curr_conn;/* current connector (only valid when 'enabled') */
> - struct device *dev;
> - const struct mtk_hdmi_conf *conf;
> - struct phy *phy;
> - struct device *cec_dev;
> - struct i2c_adapter *ddc_adpt;
> - struct clk *clk[MTK_HDMI_CLK_COUNT];
> - struct drm_display_mode mode;
> - bool dvi_mode;
> - u32 min_clock;
> - u32 max_clock;
> - u32 max_hdisplay;
> - u32 max_vdisplay;
> - u32 ibias;
> - u32 ibias_up;
> - struct regmap *sys_regmap;
> - unsigned int sys_offset;
> - struct regmap *regs;
> - enum hdmi_colorspace csp;
> - struct hdmi_audio_param aud_param;
> - bool audio_enable;
> - bool powered;
> - bool enabled;
> - hdmi_codec_plugged_cb plugged_cb;
> - struct device *codec_dev;
> - struct mutex update_plugged_status_lock;
> };
>
> +struct mtk_hdmi {
> + struct drm_bridge bridge;
> + struct device *dev;
> + const struct mtk_hdmi_conf *conf;
> + struct phy *phy;
> + struct i2c_adapter *ddc_adpt;
> + struct clk **clk;
> + struct drm_display_mode mode;
> + bool dvi_mode;
> + struct regmap *sys_regmap;
> + unsigned int sys_offset;
> + struct regmap *regs;
> +
> + bool powered;
> + bool enabled;
> + unsigned int irq;
You add something which is used in v2 but not in v1.
Move these to the v2 patch, or separate them to a precondition patch of v2.
> + enum hdmi_hpd_state hpd;
> +
> + /* Audio */
> + struct platform_device *audio_pdev;
> + struct hdmi_audio_param aud_param;
> + bool audio_enable;
> +
> + struct drm_connector *curr_conn;/* current connector (only valid when 'enabled') */
> + struct mutex update_plugged_status_lock;
> + struct device *cec_dev;
> + struct device *codec_dev;
> + hdmi_codec_plugged_cb plugged_cb;
> + struct drm_bridge *next_bridge;
I don't know why you reorder these.
If it's necessary, separate these reorder to a refinement patch.
Regards,
CK
> +};
> +
Powered by blists - more mailing lists