2022-11-03 05:39:56

by Aakarsh Jain

[permalink] [raw]
Subject: [PATCH 2/3] media: s5p-mfc:Add variant data for MFC v7 hardware for Exynos 3250 SOC

commit "5441e9dafdfc6dc40fa" which adds mfc v7 support for
Exynos3250 and used the same compatible string as used by
Exynos5240 but both the IPs are a bit different in terms of
IP clock.
Lets add variant driver data based on the new compatible string
"samsung,exynos3250-mfc" for Exynos3250 SoC.

Suggested-by: Alim Akhtar <[email protected]>
Fixes: 5441e9dafdfc ("[media] s5p-mfc: Core support for MFC v7")
Signed-off-by: Aakarsh Jain <[email protected]>
---
.../media/platform/samsung/s5p-mfc/s5p_mfc.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c
index fca5c6405eec..007c7dbee037 100644
--- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c
@@ -1576,8 +1576,18 @@ static struct s5p_mfc_variant mfc_drvdata_v7 = {
.port_num = MFC_NUM_PORTS_V7,
.buf_size = &buf_size_v7,
.fw_name[0] = "s5p-mfc-v7.fw",
- .clk_names = {"mfc", "sclk_mfc"},
- .num_clocks = 2,
+ .clk_names = {"mfc"},
+ .num_clocks = 1,
+};
+
+static struct s5p_mfc_variant mfc_drvdata_v7_3250 = {
+ .version = MFC_VERSION_V7,
+ .version_bit = MFC_V7_BIT,
+ .port_num = MFC_NUM_PORTS_V7,
+ .buf_size = &buf_size_v7,
+ .fw_name[0] = "s5p-mfc-v7.fw",
+ .clk_names = {"mfc", "sclk_mfc"},
+ .num_clocks = 2,
};

static struct s5p_mfc_buf_size_v6 mfc_buf_size_v8 = {
@@ -1647,6 +1657,9 @@ static const struct of_device_id exynos_mfc_match[] = {
}, {
.compatible = "samsung,mfc-v7",
.data = &mfc_drvdata_v7,
+ }, {
+ .compatible = "samsung,exynos3250-mfc",
+ .data = &mfc_drvdata_v7_3250,
}, {
.compatible = "samsung,mfc-v8",
.data = &mfc_drvdata_v8,
--
2.17.1



2022-11-03 11:55:02

by Tommaso Merciai

[permalink] [raw]
Subject: Re: [PATCH 2/3] media: s5p-mfc:Add variant data for MFC v7 hardware for Exynos 3250 SOC

Hi Aakarsh,

On Wed, Nov 02, 2022 at 06:36:01PM +0530, Aakarsh Jain wrote:
> commit "5441e9dafdfc6dc40fa" which adds mfc v7 support for
> Exynos3250 and used the same compatible string as used by
> Exynos5240 but both the IPs are a bit different in terms of
> IP clock.
> Lets add variant driver data based on the new compatible string
> "samsung,exynos3250-mfc" for Exynos3250 SoC.
>
> Suggested-by: Alim Akhtar <[email protected]>
> Fixes: 5441e9dafdfc ("[media] s5p-mfc: Core support for MFC v7")
> Signed-off-by: Aakarsh Jain <[email protected]>
> ---
> .../media/platform/samsung/s5p-mfc/s5p_mfc.c | 17 +++++++++++++++--
> 1 file changed, 15 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c
> index fca5c6405eec..007c7dbee037 100644
> --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c
> +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c
> @@ -1576,8 +1576,18 @@ static struct s5p_mfc_variant mfc_drvdata_v7 = {
> .port_num = MFC_NUM_PORTS_V7,
> .buf_size = &buf_size_v7,
> .fw_name[0] = "s5p-mfc-v7.fw",
> - .clk_names = {"mfc", "sclk_mfc"},
> - .num_clocks = 2,
> + .clk_names = {"mfc"},
> + .num_clocks = 1,
> +};
> +
> +static struct s5p_mfc_variant mfc_drvdata_v7_3250 = {
> + .version = MFC_VERSION_V7,
> + .version_bit = MFC_V7_BIT,
> + .port_num = MFC_NUM_PORTS_V7,
> + .buf_size = &buf_size_v7,
> + .fw_name[0] = "s5p-mfc-v7.fw",
> + .clk_names = {"mfc", "sclk_mfc"},
> + .num_clocks = 2,
> };
>
> static struct s5p_mfc_buf_size_v6 mfc_buf_size_v8 = {
> @@ -1647,6 +1657,9 @@ static const struct of_device_id exynos_mfc_match[] = {
> }, {
> .compatible = "samsung,mfc-v7",
> .data = &mfc_drvdata_v7,
> + }, {
> + .compatible = "samsung,exynos3250-mfc",
> + .data = &mfc_drvdata_v7_3250,
> }, {
> .compatible = "samsung,mfc-v8",
> .data = &mfc_drvdata_v8,
> --
> 2.17.1
>

Patch looks good to me, only one fix in commit body:

"... Exynos3250 and used the same compatible string..."

with:

"... Exynos3250 and use the same compatible string...

But this is a nitpicking :)

Regards,
Tommaso


--
Tommaso Merciai
Embedded Linux Engineer
[email protected]
__________________________________

Amarula Solutions SRL
Via Le Canevare 30, 31100 Treviso, Veneto, IT
T. +39 042 243 5310
[email protected]
http://www.amarulasolutions.com

2022-11-03 13:03:28

by Marek Szyprowski

[permalink] [raw]
Subject: Re: [PATCH 2/3] media: s5p-mfc:Add variant data for MFC v7 hardware for Exynos 3250 SOC

On 03.11.2022 13:35, Krzysztof Kozlowski wrote:
> On 02/11/2022 09:06, Aakarsh Jain wrote:
>> commit "5441e9dafdfc6dc40fa" which adds mfc v7 support for
> Please run scripts/checkpatch.pl and fix reported warnings.
>
>> Exynos3250 and used the same compatible string as used by
>> Exynos5240 but both the IPs are a bit different in terms of
>> IP clock.
>> Lets add variant driver data based on the new compatible string
>> "samsung,exynos3250-mfc" for Exynos3250 SoC.
> Aren't you just missing the clock on Exynos3250?

Nope, the Exynos3250 variant indeed has only one clock and the driver
code simply ignored the -ENOENT error while getting the clocks, see the
code in drivers/media/platform/samsung/s5p-mfc/s5p_mfc_pm.c, so it
worked fine even without it.

IMHO it is a good idea to clean this up.

Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland


2022-11-03 13:04:06

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 2/3] media: s5p-mfc:Add variant data for MFC v7 hardware for Exynos 3250 SOC

On 03/11/2022 08:44, Marek Szyprowski wrote:
> On 03.11.2022 13:35, Krzysztof Kozlowski wrote:
>> On 02/11/2022 09:06, Aakarsh Jain wrote:
>>> commit "5441e9dafdfc6dc40fa" which adds mfc v7 support for
>> Please run scripts/checkpatch.pl and fix reported warnings.
>>
>>> Exynos3250 and used the same compatible string as used by
>>> Exynos5240 but both the IPs are a bit different in terms of
>>> IP clock.
>>> Lets add variant driver data based on the new compatible string
>>> "samsung,exynos3250-mfc" for Exynos3250 SoC.
>> Aren't you just missing the clock on Exynos3250?
>
> Nope, the Exynos3250 variant indeed has only one clock and the driver
> code simply ignored the -ENOENT error while getting the clocks, see the
> code in drivers/media/platform/samsung/s5p-mfc/s5p_mfc_pm.c, so it
> worked fine even without it.
>
> IMHO it is a good idea to clean this up.

OK, then please make the new compatible followed by old.

Best regards,
Krzysztof


2022-11-03 13:22:57

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 2/3] media: s5p-mfc:Add variant data for MFC v7 hardware for Exynos 3250 SOC

On 02/11/2022 09:06, Aakarsh Jain wrote:
> commit "5441e9dafdfc6dc40fa" which adds mfc v7 support for

Please run scripts/checkpatch.pl and fix reported warnings.

> Exynos3250 and used the same compatible string as used by
> Exynos5240 but both the IPs are a bit different in terms of
> IP clock.
> Lets add variant driver data based on the new compatible string
> "samsung,exynos3250-mfc" for Exynos3250 SoC.

Aren't you just missing the clock on Exynos3250?

Best regards,
Krzysztof


2022-11-09 05:09:56

by Aakarsh Jain

[permalink] [raw]
Subject: RE: [PATCH 2/3] media: s5p-mfc:Add variant data for MFC v7 hardware for Exynos 3250 SOC



> -----Original Message-----
> From: Krzysztof Kozlowski [mailto:[email protected]]
> Sent: 03 November 2022 18:16
> To: Marek Szyprowski <[email protected]>; Aakarsh Jain
> <[email protected]>; [email protected]; linux-
> [email protected]; [email protected];
> [email protected]
> Cc: [email protected]; [email protected]; [email protected];
> [email protected]; [email protected];
> [email protected]; [email protected];
> [email protected]; [email protected];
> [email protected]; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]; [email protected];
> [email protected]; [email protected]
> Subject: Re: [PATCH 2/3] media: s5p-mfc:Add variant data for MFC v7
> hardware for Exynos 3250 SOC
>
> On 03/11/2022 08:44, Marek Szyprowski wrote:
> > On 03.11.2022 13:35, Krzysztof Kozlowski wrote:
> >> On 02/11/2022 09:06, Aakarsh Jain wrote:
> >>> commit "5441e9dafdfc6dc40fa" which adds mfc v7 support for
> >> Please run scripts/checkpatch.pl and fix reported warnings.
> >>
As I didn't see any checkpatch warnings from the above commit message.
Anyway I fixed all checkpatch warnings from drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c and posted 3 patches for the same.
https://patchwork.kernel.org/project/linux-media/patch/[email protected]/

> >>> Exynos3250 and used the same compatible string as used by
> >>> Exynos5240 but both the IPs are a bit different in terms of IP
> >>> clock.
> >>> Lets add variant driver data based on the new compatible string
> >>> "samsung,exynos3250-mfc" for Exynos3250 SoC.
> >> Aren't you just missing the clock on Exynos3250?
> >
> > Nope, the Exynos3250 variant indeed has only one clock and the driver
> > code simply ignored the -ENOENT error while getting the clocks, see
> > the code in drivers/media/platform/samsung/s5p-mfc/s5p_mfc_pm.c, so it
> > worked fine even without it.
> >
> > IMHO it is a good idea to clean this up.
>
> OK, then please make the new compatible followed by old.
>
> Best regards,
> Krzysztof


Thanks for the review.