lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <38a949ea89ed322579d9cc1aa820c374c33adcfa.camel@mediatek.com>
Date: Mon, 10 Feb 2025 06:58:13 +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>,
	"dmitry.baryshkov@...aro.org" <dmitry.baryshkov@...aro.org>,
	"krzk+dt@...nel.org" <krzk+dt@...nel.org>,
	Lewis Liao (廖柏鈞) <Lewis.Liao@...iatek.com>,
	"p.zabel@...gutronix.de" <p.zabel@...gutronix.de>, "conor+dt@...nel.org"
	<conor+dt@...nel.org>, TommyYL Chen (陳彥良)
	<TommyYL.Chen@...iatek.com>, Ives Chenjh (陳俊弘)
	<Ives.Chenjh@...iatek.com>, "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>, Jason-JH Lin (林睿祥)
	<Jason-JH.Lin@...iatek.com>, "junzhi.zhao@...iatek.com"
	<junzhi.zhao@...iatek.com>
Subject: Re: [PATCH v5 09/34] drm/mediatek: mtk_cec: Switch to register as
 module_platform_driver

Hi, Angelo:

On Mon, 2025-01-13 at 15:52 +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 splitting out the common bits from the HDMI
> driver, change the mtk_cec driver from being registered from the
> HDMI driver itself to be a module_platform_driver of its own.

CEC is not the common part, so the reason is not related to splitting out the common bits.
I think the reason is HDMI v2 driver does not use CEC driver, so you want not to build CEC driver when HDMI v2.

> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
> ---
>  drivers/gpu/drm/mediatek/Makefile   | 4 ++--
>  drivers/gpu/drm/mediatek/mtk_cec.c  | 7 ++++++-
>  drivers/gpu/drm/mediatek/mtk_hdmi.c | 2 +-
>  drivers/gpu/drm/mediatek/mtk_hdmi.h | 1 -
>  4 files changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/Makefile b/drivers/gpu/drm/mediatek/Makefile
> index 32a2ed6c0cfe..bdd3a062f797 100644
> --- a/drivers/gpu/drm/mediatek/Makefile
> +++ b/drivers/gpu/drm/mediatek/Makefile
> @@ -21,10 +21,10 @@ mediatek-drm-y := mtk_crtc.o \
> 
>  obj-$(CONFIG_DRM_MEDIATEK) += mediatek-drm.o
> 
> -mediatek-drm-hdmi-objs := mtk_cec.o \
> -                         mtk_hdmi.o \
> +mediatek-drm-hdmi-objs := mtk_hdmi.o \
>                           mtk_hdmi_ddc.o

You don't need to separate mtk_cec to a independent module.
You could include it in v1 and exclude it in v2.

Regards,
CK

> 
> +obj-$(CONFIG_DRM_MEDIATEK_HDMI) += mtk_cec.o
>  obj-$(CONFIG_DRM_MEDIATEK_HDMI) += mediatek-drm-hdmi.o
> 
>  obj-$(CONFIG_DRM_MEDIATEK_DP) += mtk_dp.o
> diff --git a/drivers/gpu/drm/mediatek/mtk_cec.c b/drivers/gpu/drm/mediatek/mtk_cec.c
> index b42c0d87eba3..c7be530ca041 100644
> --- a/drivers/gpu/drm/mediatek/mtk_cec.c
> +++ b/drivers/gpu/drm/mediatek/mtk_cec.c
> @@ -12,7 +12,6 @@
>  #include <linux/platform_device.h>
> 
>  #include "mtk_cec.h"
> -#include "mtk_hdmi.h"
>  #include "mtk_drm_drv.h"
> 
>  #define TR_CONFIG              0x00
> @@ -102,6 +101,7 @@ void mtk_cec_set_hpd_event(struct device *dev,
>         cec->hpd_event = hpd_event;
>         spin_unlock_irqrestore(&cec->lock, flags);
>  }
> +EXPORT_SYMBOL_NS_GPL(mtk_cec_set_hpd_event, "DRM_MTK_HDMI_V1");
> 
>  bool mtk_cec_hpd_high(struct device *dev)
>  {
> @@ -112,6 +112,7 @@ bool mtk_cec_hpd_high(struct device *dev)
> 
>         return (status & (HDMI_PORD | HDMI_HTPLG)) == (HDMI_PORD | HDMI_HTPLG);
>  }
> +EXPORT_SYMBOL_NS_GPL(mtk_cec_hpd_high, "DRM_MTK_HDMI_V1");
> 
>  static void mtk_cec_htplg_irq_init(struct mtk_cec *cec)
>  {
> @@ -247,3 +248,7 @@ struct platform_driver mtk_cec_driver = {
>                 .of_match_table = mtk_cec_of_ids,
>         },
>  };
> +module_platform_driver(mtk_cec_driver);
> +
> +MODULE_DESCRIPTION("MediaTek HDMI CEC Driver");
> +MODULE_LICENSE("GPL");
> diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c
> index ca82bc829cb9..da725182f0db 100644
> --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c
> @@ -1805,7 +1805,6 @@ static struct platform_driver mtk_hdmi_driver = {
> 
>  static struct platform_driver * const mtk_hdmi_drivers[] = {
>         &mtk_hdmi_ddc_driver,
> -       &mtk_cec_driver,
>         &mtk_hdmi_driver,
>  };
> 
> @@ -1827,3 +1826,4 @@ module_exit(mtk_hdmitx_exit);
>  MODULE_AUTHOR("Jie Qiu <jie.qiu@...iatek.com>");
>  MODULE_DESCRIPTION("MediaTek HDMI Driver");
>  MODULE_LICENSE("GPL v2");
> +MODULE_IMPORT_NS("DRM_MTK_HDMI_V1");
> diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.h b/drivers/gpu/drm/mediatek/mtk_hdmi.h
> index 472bf141c92b..e40bc4651995 100644
> --- a/drivers/gpu/drm/mediatek/mtk_hdmi.h
> +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.h
> @@ -8,7 +8,6 @@
> 
>  struct platform_driver;
> 
> -extern struct platform_driver mtk_cec_driver;
>  extern struct platform_driver mtk_hdmi_ddc_driver;
> 
>  #endif /* _MTK_HDMI_CTRL_H */
> --
> 2.47.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ