diff mbox

[v4,1/3] cpufreq: mediatek: Add support of cpufreq to MT2701/MT7623 SoC

Message ID feabcfd53899954198c6620e9d9b68f4a3c55201.1499692967.git.sean.wang@mediatek.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sean Wang July 10, 2017, 2:23 p.m. UTC
From: Sean Wang <sean.wang@mediatek.com>

MT2701/MT7623 is a 32-bit ARMv7 based quad-core (4 * Cortex-A7) with
single cluster and this hardware is also compatible with the existing
driver through enabling CPU frequency feature with operating-points-v2
bindings. Also, this driver actually supports all MediaTek SoCs, the
Kconfig menu entry and file name itself should be updated with more
generic name to drop "MT8173"

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
---
 drivers/cpufreq/Kconfig.arm                              | 7 +++----
 drivers/cpufreq/Makefile                                 | 2 +-
 drivers/cpufreq/{mt8173-cpufreq.c => mediatek-cpufreq.c} | 2 ++
 3 files changed, 6 insertions(+), 5 deletions(-)
 rename drivers/cpufreq/{mt8173-cpufreq.c => mediatek-cpufreq.c} (99%)

Comments

Eddie Huang (黃智傑) July 11, 2017, 2:49 a.m. UTC | #1
Hi Sean,

On Mon, 2017-07-10 at 22:23 +0800, sean.wang@mediatek.com wrote:
> From: Sean Wang <sean.wang@mediatek.com>
> 
> MT2701/MT7623 is a 32-bit ARMv7 based quad-core (4 * Cortex-A7) with
> single cluster and this hardware is also compatible with the existing
> driver through enabling CPU frequency feature with operating-points-v2
> bindings. Also, this driver actually supports all MediaTek SoCs, the
> Kconfig menu entry and file name itself should be updated with more
> generic name to drop "MT8173"
> 
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> Reviewed-by: Jean Delvare <jdelvare@suse.de>
> ---
>  drivers/cpufreq/Kconfig.arm                              | 7 +++----
>  drivers/cpufreq/Makefile                                 | 2 +-
>  drivers/cpufreq/{mt8173-cpufreq.c => mediatek-cpufreq.c} | 2 ++
>  3 files changed, 6 insertions(+), 5 deletions(-)
>  rename drivers/cpufreq/{mt8173-cpufreq.c => mediatek-cpufreq.c} (99%)
> 

As Viresh mentioned, there are already many drivers use "mtk" as
filename prefix or postfix.To align with those files, I suggest use
mtk-cpufreq.c.I think there are not too many values to change all "mtk-"
to "mediatek-", but it is worth to have the same naming rule for
mediatek upstream driver.

Regards,
Eddie.
Matthias Brugger July 12, 2017, 2:50 p.m. UTC | #2
Hi Eddie,

On 07/11/2017 04:49 AM, Eddie Huang wrote:
> Hi Sean,
> 
> On Mon, 2017-07-10 at 22:23 +0800, sean.wang@mediatek.com wrote:
>> From: Sean Wang <sean.wang@mediatek.com>
>>
>> MT2701/MT7623 is a 32-bit ARMv7 based quad-core (4 * Cortex-A7) with
>> single cluster and this hardware is also compatible with the existing
>> driver through enabling CPU frequency feature with operating-points-v2
>> bindings. Also, this driver actually supports all MediaTek SoCs, the
>> Kconfig menu entry and file name itself should be updated with more
>> generic name to drop "MT8173"
>>
>> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
>> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
>> Reviewed-by: Jean Delvare <jdelvare@suse.de>
>> ---
>>   drivers/cpufreq/Kconfig.arm                              | 7 +++----
>>   drivers/cpufreq/Makefile                                 | 2 +-
>>   drivers/cpufreq/{mt8173-cpufreq.c => mediatek-cpufreq.c} | 2 ++
>>   3 files changed, 6 insertions(+), 5 deletions(-)
>>   rename drivers/cpufreq/{mt8173-cpufreq.c => mediatek-cpufreq.c} (99%)
>>
> 
> As Viresh mentioned, there are already many drivers use "mtk" as
> filename prefix or postfix.To align with those files, I suggest use
> mtk-cpufreq.c.I think there are not too many values to change all "mtk-"
> to "mediatek-", but it is worth to have the same naming rule for
> mediatek upstream driver.
> 

In the last submission Jean proposed to change all file names from 
mtk-*.[ch] to mediatek-*.[ch] as this will cause less confusion.

Viresh are you OK with that approach or do you prefer that we stay with 
mtk prefix? I think it makes sense to have a unique prefix and resolve 
the situation we now have with source files and Kconfig options.
But TBH I have no strong feeling for any of the two prefixes.

Regards,
Matthias
Viresh Kumar July 13, 2017, 3:16 a.m. UTC | #3
On 12-07-17, 16:50, Matthias Brugger wrote:
> Hi Eddie,
> 
> On 07/11/2017 04:49 AM, Eddie Huang wrote:
> >Hi Sean,
> >
> >On Mon, 2017-07-10 at 22:23 +0800, sean.wang@mediatek.com wrote:
> >>From: Sean Wang <sean.wang@mediatek.com>
> >>
> >>MT2701/MT7623 is a 32-bit ARMv7 based quad-core (4 * Cortex-A7) with
> >>single cluster and this hardware is also compatible with the existing
> >>driver through enabling CPU frequency feature with operating-points-v2
> >>bindings. Also, this driver actually supports all MediaTek SoCs, the
> >>Kconfig menu entry and file name itself should be updated with more
> >>generic name to drop "MT8173"
> >>
> >>Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> >>Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> >>Reviewed-by: Jean Delvare <jdelvare@suse.de>
> >>---
> >>  drivers/cpufreq/Kconfig.arm                              | 7 +++----
> >>  drivers/cpufreq/Makefile                                 | 2 +-
> >>  drivers/cpufreq/{mt8173-cpufreq.c => mediatek-cpufreq.c} | 2 ++
> >>  3 files changed, 6 insertions(+), 5 deletions(-)
> >>  rename drivers/cpufreq/{mt8173-cpufreq.c => mediatek-cpufreq.c} (99%)
> >>
> >
> >As Viresh mentioned, there are already many drivers use "mtk" as

Do you have a link to when I mentioned this?

/me suffering from Amnesia ? :)

> >filename prefix or postfix.To align with those files, I suggest use
> >mtk-cpufreq.c.I think there are not too many values to change all "mtk-"
> >to "mediatek-", but it is worth to have the same naming rule for
> >mediatek upstream driver.
> >
> 
> In the last submission Jean proposed to change all file names from
> mtk-*.[ch] to mediatek-*.[ch] as this will cause less confusion.
> 
> Viresh are you OK with that approach or do you prefer that we stay with mtk
> prefix? I think it makes sense to have a unique prefix and resolve the
> situation we now have with source files and Kconfig options.
> But TBH I have no strong feeling for any of the two prefixes.

I am fine with both. Maybe don't resend for just that, mediatek
doesn't sound any bad.
Eddie Huang (黃智傑) July 13, 2017, 3:54 a.m. UTC | #4
On Thu, 2017-07-13 at 08:46 +0530, Viresh Kumar wrote:
> On 12-07-17, 16:50, Matthias Brugger wrote:
> > Hi Eddie,
> > 
> > On 07/11/2017 04:49 AM, Eddie Huang wrote:
> > >Hi Sean,
> > >
> > >On Mon, 2017-07-10 at 22:23 +0800, sean.wang@mediatek.com wrote:
> > >>From: Sean Wang <sean.wang@mediatek.com>
> > >>
> > >>MT2701/MT7623 is a 32-bit ARMv7 based quad-core (4 * Cortex-A7) with
> > >>single cluster and this hardware is also compatible with the existing
> > >>driver through enabling CPU frequency feature with operating-points-v2
> > >>bindings. Also, this driver actually supports all MediaTek SoCs, the
> > >>Kconfig menu entry and file name itself should be updated with more
> > >>generic name to drop "MT8173"
> > >>
> > >>Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> > >>Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> > >>Reviewed-by: Jean Delvare <jdelvare@suse.de>
> > >>---
> > >>  drivers/cpufreq/Kconfig.arm                              | 7 +++----
> > >>  drivers/cpufreq/Makefile                                 | 2 +-
> > >>  drivers/cpufreq/{mt8173-cpufreq.c => mediatek-cpufreq.c} | 2 ++
> > >>  3 files changed, 6 insertions(+), 5 deletions(-)
> > >>  rename drivers/cpufreq/{mt8173-cpufreq.c => mediatek-cpufreq.c} (99%)
> > >>
> > >
> > >As Viresh mentioned, there are already many drivers use "mtk" as
> 
> Do you have a link to when I mentioned this?
> 
> /me suffering from Amnesia ? :)

Sorry, my fault. It's from Jean. The link is 
http://lists.infradead.org/pipermail/linux-arm-kernel/2017-July/517782.html

> 
> > >filename prefix or postfix.To align with those files, I suggest use
> > >mtk-cpufreq.c.I think there are not too many values to change all "mtk-"
> > >to "mediatek-", but it is worth to have the same naming rule for
> > >mediatek upstream driver.
> > >
> > 
> > In the last submission Jean proposed to change all file names from
> > mtk-*.[ch] to mediatek-*.[ch] as this will cause less confusion.
> > 
> > Viresh are you OK with that approach or do you prefer that we stay with mtk
> > prefix? I think it makes sense to have a unique prefix and resolve the
> > situation we now have with source files and Kconfig options.
> > But TBH I have no strong feeling for any of the two prefixes.
> 
> I am fine with both. Maybe don't resend for just that, mediatek
> doesn't sound any bad.

I am also fine with both. I think most people won't confuse about mtk
and mediatek. I don't like send patches to just only change filenames
and kconfig, especially kconfig modification will affect project
defconfigs. My point is we shouldn't spend much time on this topic, and
revisit filename when that driver need support new SoC, like this case.

Regards,
Eddie
Jean Delvare July 17, 2017, 8:05 a.m. UTC | #5
On Thu, 13 Jul 2017 11:54:38 +0800, Eddie Huang wrote:
> On Thu, 2017-07-13 at 08:46 +0530, Viresh Kumar wrote:
> > I am fine with both. Maybe don't resend for just that, mediatek
> > doesn't sound any bad.  
> 
> I am also fine with both. I think most people won't confuse about mtk
> and mediatek. I don't like send patches to just only change filenames
> and kconfig, especially kconfig modification will affect project
> defconfigs. My point is we shouldn't spend much time on this topic, and
> revisit filename when that driver need support new SoC, like this case.

I believe that being consistent is important, and I believe that
3-letter abbreviations are confusing. So in my ideal fantasy world, all
these drivers would be named *mediatek* and their config options would
be CONFIG_*MEDIATEK*. That being said, it's only my general opinion on
the topic. I'm not going to send any patch to rename any of these
drivers, as I have many tasks of higher priority on my own plate. And I
agree that renaming existing drivers does have a cost as well. So
whatever is decided is fine with me, really.
Jean Delvare July 17, 2017, 8:06 a.m. UTC | #6
On Mon, 10 Jul 2017 22:23:08 +0800, sean.wang@mediatek.com wrote:
> From: Sean Wang <sean.wang@mediatek.com>
> 
> MT2701/MT7623 is a 32-bit ARMv7 based quad-core (4 * Cortex-A7) with
> single cluster and this hardware is also compatible with the existing
> driver through enabling CPU frequency feature with operating-points-v2
> bindings. Also, this driver actually supports all MediaTek SoCs, the
> Kconfig menu entry and file name itself should be updated with more
> generic name to drop "MT8173"
> 
> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> Reviewed-by: Jean Delvare <jdelvare@suse.de>

Confirmed, looks good to me.

Thanks,
diff mbox

Patch

diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
index 74ed7e9..24ef446 100644
--- a/drivers/cpufreq/Kconfig.arm
+++ b/drivers/cpufreq/Kconfig.arm
@@ -87,14 +87,13 @@  config ARM_KIRKWOOD_CPUFREQ
 	  This adds the CPUFreq driver for Marvell Kirkwood
 	  SoCs.
 
-config ARM_MT8173_CPUFREQ
-	tristate "Mediatek MT8173 CPUFreq support"
+config ARM_MEDIATEK_CPUFREQ
+	tristate "CPU Frequency scaling support for MediaTek SoCs"
 	depends on ARCH_MEDIATEK && REGULATOR
-	depends on ARM64 || (ARM_CPU_TOPOLOGY && COMPILE_TEST)
 	depends on !CPU_THERMAL || THERMAL
 	select PM_OPP
 	help
-	  This adds the CPUFreq driver support for Mediatek MT8173 SoC.
+	  This adds the CPUFreq driver support for MediaTek SoCs.
 
 config ARM_OMAP2PLUS_CPUFREQ
 	bool "TI OMAP2+"
diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile
index b7e78f0..ea043aa 100644
--- a/drivers/cpufreq/Makefile
+++ b/drivers/cpufreq/Makefile
@@ -58,7 +58,7 @@  obj-$(CONFIG_ARM_EXYNOS5440_CPUFREQ)	+= exynos5440-cpufreq.o
 obj-$(CONFIG_ARM_HIGHBANK_CPUFREQ)	+= highbank-cpufreq.o
 obj-$(CONFIG_ARM_IMX6Q_CPUFREQ)		+= imx6q-cpufreq.o
 obj-$(CONFIG_ARM_KIRKWOOD_CPUFREQ)	+= kirkwood-cpufreq.o
-obj-$(CONFIG_ARM_MT8173_CPUFREQ)	+= mt8173-cpufreq.o
+obj-$(CONFIG_ARM_MEDIATEK_CPUFREQ)	+= mediatek-cpufreq.o
 obj-$(CONFIG_ARM_OMAP2PLUS_CPUFREQ)	+= omap-cpufreq.o
 obj-$(CONFIG_ARM_PXA2xx_CPUFREQ)	+= pxa2xx-cpufreq.o
 obj-$(CONFIG_PXA3xx)			+= pxa3xx-cpufreq.o
diff --git a/drivers/cpufreq/mt8173-cpufreq.c b/drivers/cpufreq/mediatek-cpufreq.c
similarity index 99%
rename from drivers/cpufreq/mt8173-cpufreq.c
rename to drivers/cpufreq/mediatek-cpufreq.c
index fd1886f..481ec77 100644
--- a/drivers/cpufreq/mt8173-cpufreq.c
+++ b/drivers/cpufreq/mediatek-cpufreq.c
@@ -575,6 +575,8 @@  static struct platform_driver mt8173_cpufreq_platdrv = {
 
 /* List of machines supported by this driver */
 static const struct of_device_id mt8173_cpufreq_machines[] __initconst = {
+	{ .compatible = "mediatek,mt2701", },
+	{ .compatible = "mediatek,mt7623", },
 	{ .compatible = "mediatek,mt817x", },
 	{ .compatible = "mediatek,mt8173", },
 	{ .compatible = "mediatek,mt8176", },