Currently prototype of cpufreq_drivers target routines is:
int target(struct cpufreq_policy *policy, unsigned int target_freq,
unsigned int relation);
And most of the drivers call cpufreq_frequency_table_target() to get a valid
index of their frequency table which is closest to the target_freq. And they
don't use target_freq and relation after it.
So, it makes sense to just do this work in cpufreq core before calling
cpufreq_frequency_table_target() and simply pass index instead. But this can be
done only with drivers which expose their frequency table with cpufreq core. For
others we need to stick with the old prototype of target() until those drivers
are converted to expose frequency tables.
There are 7 drivers after this patchset which still use the heavy weight
version, i.e. target() and 44 drivers have adopted this new approach, i.e.
target_index().
Once those 7 drivers are also moved to use .target_index(), .target() will be
removed completely.
This is part 3 of my generic cpufreq cleanup stuff.. First two are posted here
and this one is rebased of them:
1: cpufreq: Introduce cpufreq_table_validate_and_show()
https://lkml.org/lkml/2013/8/8/263
2: cpufreq: define generic routines for cpufreq drivers
https://lkml.org/lkml/2013/8/10/48
All these are pushed here:
https://git.linaro.org/gitweb?p=people/vireshk/linux.git;a=shortlog;h=refs/…
V1->V2:
------
- Must be less ugly this time :)
- new interface is named as target_index() instead of target()
- old interface is kept as target() instead of target_old()
- few more drivers got converted to use this infrastructure (5)
- Documentation updates
- CONFIG_CPU_FREQ_TABLE removed completely as core depends on it now
Cc: Andrew Lunn <andrew(a)lunn.ch>
Cc: David S. Miller <davem(a)davemloft.net>
Cc: Dmitry Eremin-Solenikov <dbaryshkov(a)gmail.com>
Cc: Eric Miao <eric.y.miao(a)gmail.com>
Cc: Hans-Christian Egtvedt <egtvedt(a)samfundet.no>
Cc: Jesper Nilsson <jesper.nilsson(a)axis.com>
Cc: John Crispin <blogic(a)openwrt.org>
Cc: Kukjin Kim <kgene.kim(a)samsung.com>
Cc: Linus Walleij <linus.walleij(a)linaro.org>
Cc: linux-cris-kernel(a)axis.com
Cc: Mikael Starvik <starvik(a)axis.com>
Cc: Santosh Shilimkar <santosh.shilimkar(a)ti.com>
Cc: Sekhar Nori <nsekhar(a)ti.com>
Cc: Shawn Guo <shawn.guo(a)linaro.org>
Cc: sparclinux(a)vger.kernel.org
Cc: Stephen Warren <swarren(a)nvidia.com>
Cc: Steven Miao <realmz6(a)gmail.com>
Cc: Tony Luck <tony.luck(a)intel.com>
Viresh Kumar (35):
cpufreq: Implement light weight ->target_index() routine
cpufreq: remove CONFIG_CPU_FREQ_TABLE
cpufreq: acpi: Covert to light weight ->target_index() routine
cpufreq: arm_big_little: Covert to light weight ->target_index()
routine
cpufreq: at32ap: Covert to light weight ->target_index() routine
cpufreq: blackfin: Covert to light weight ->target_index() routine
cpufreq: cpu0: Covert to light weight ->target_index() routine
cpufreq: cris: Covert to light weight ->target_index() routine
cpufreq: davinci: Covert to light weight ->target_index() routine
cpufreq: dbx500: Covert to light weight ->target_index() routine
cpufreq: e_powersaver: Covert to light weight ->target_index()
routine
cpufreq: elanfreq: Covert to light weight ->target_index() routine
cpufreq: exynos: Covert to light weight ->target_index() routine
cpufreq: ia64: Covert to light weight ->target_index() routine
cpufreq: imx6q: Covert to light weight ->target_index() routine
cpufreq: kirkwood: Covert to light weight ->target_index() routine
cpufreq: longhaul: Covert to light weight ->target_index() routine
cpufreq: loongson2: Covert to light weight ->target_index() routine
cpufreq: maple: Covert to light weight ->target_index() routine
cpufreq: omap: Covert to light weight ->target_index() routine
cpufreq: p4: Covert to light weight ->target_index() routine
cpufreq: pasemi: Covert to light weight ->target_index() routine
cpufreq: pmac32: Covert to light weight ->target_index() routine
cpufreq: powernow: Covert to light weight ->target_index() routine
cpufreq: ppc: Covert to light weight ->target_index() routine
cpufreq: pxa: Covert to light weight ->target_index() routine
cpufreq: s3c2416: Covert to light weight ->target_index() routine
cpufreq: s3c64xx: Covert to light weight ->target_index() routine
cpufreq: s5pv210: Covert to light weight ->target_index() routine
cpufreq: sa11x0: Covert to light weight ->target_index() routine
cpufreq: sc520: Covert to light weight ->target_index() routine
cpufreq: sparc: Covert to light weight ->target_index() routine
cpufreq: SPEAr: Covert to light weight ->target_index() routine
cpufreq: speedstep: Covert to light weight ->target_index() routine
cpufreq: tegra: Covert to light weight ->target_index() routine
Documentation/cpu-freq/cpu-drivers.txt | 27 ++++++++++------
Documentation/cpu-freq/governors.txt | 4 +--
arch/arm/mach-davinci/Kconfig | 1 -
arch/arm/mach-pxa/Kconfig | 3 --
arch/arm/mach-sa1100/generic.c | 20 ------------
arch/arm/mach-sa1100/generic.h | 2 --
arch/arm/mach-ux500/Kconfig | 1 -
arch/blackfin/Kconfig | 1 -
arch/cris/Kconfig | 2 --
drivers/cpufreq/Kconfig | 11 -------
drivers/cpufreq/Kconfig.arm | 11 -------
drivers/cpufreq/Kconfig.powerpc | 6 ----
drivers/cpufreq/Kconfig.x86 | 13 --------
drivers/cpufreq/Makefile | 5 +--
drivers/cpufreq/acpi-cpufreq.c | 21 ++++---------
drivers/cpufreq/arm_big_little.c | 17 +++-------
drivers/cpufreq/at32ap-cpufreq.c | 23 +++-----------
drivers/cpufreq/blackfin-cpufreq.c | 17 +++-------
drivers/cpufreq/cpufreq-cpu0.c | 17 ++--------
drivers/cpufreq/cpufreq.c | 57 ++++++++++++++++++++++++++--------
drivers/cpufreq/cris-artpec3-cpufreq.c | 18 ++---------
drivers/cpufreq/cris-etraxfs-cpufreq.c | 17 ++--------
drivers/cpufreq/davinci-cpufreq.c | 16 ++--------
drivers/cpufreq/dbx500-cpufreq.c | 16 ++--------
drivers/cpufreq/e_powersaver.c | 17 ++--------
drivers/cpufreq/elanfreq.c | 34 ++------------------
drivers/cpufreq/exynos-cpufreq.c | 21 ++-----------
drivers/cpufreq/exynos5440-cpufreq.c | 13 ++------
drivers/cpufreq/ia64-acpi-cpufreq.c | 21 ++-----------
drivers/cpufreq/imx6q-cpufreq.c | 17 ++--------
drivers/cpufreq/kirkwood-cpufreq.c | 19 ++----------
drivers/cpufreq/longhaul.c | 13 ++------
drivers/cpufreq/loongson2_cpufreq.c | 21 +++----------
drivers/cpufreq/maple-cpufreq.c | 16 +++-------
drivers/cpufreq/omap-cpufreq.c | 31 ++----------------
drivers/cpufreq/p4-clockmod.c | 18 +++--------
drivers/cpufreq/pasemi-cpufreq.c | 12 ++-----
drivers/cpufreq/pmac32-cpufreq.c | 12 ++-----
drivers/cpufreq/pmac64-cpufreq.c | 17 +++-------
drivers/cpufreq/powernow-k6.c | 35 +++------------------
drivers/cpufreq/powernow-k7.c | 22 +++----------
drivers/cpufreq/powernow-k8.c | 24 +++++---------
drivers/cpufreq/ppc-corenet-cpufreq.c | 15 +++------
drivers/cpufreq/ppc_cbe_cpufreq.c | 12 ++-----
drivers/cpufreq/pxa2xx-cpufreq.c | 13 ++------
drivers/cpufreq/pxa3xx-cpufreq.c | 17 ++--------
drivers/cpufreq/s3c2416-cpufreq.c | 17 +++-------
drivers/cpufreq/s3c64xx-cpufreq.c | 18 +++--------
drivers/cpufreq/s5pv210-cpufreq.c | 54 +++++++++-----------------------
drivers/cpufreq/sa1100-cpufreq.c | 24 +++-----------
drivers/cpufreq/sa1110-cpufreq.c | 26 +++-------------
drivers/cpufreq/sc520_freq.c | 19 ++----------
drivers/cpufreq/sparc-us2e-cpufreq.c | 21 ++-----------
drivers/cpufreq/sparc-us3-cpufreq.c | 23 ++------------
drivers/cpufreq/spear-cpufreq.c | 12 +++----
drivers/cpufreq/speedstep-centrino.c | 26 +++++-----------
drivers/cpufreq/speedstep-ich.c | 24 ++++----------
drivers/cpufreq/speedstep-smi.c | 20 +++---------
drivers/cpufreq/tegra-cpufreq.c | 12 ++-----
drivers/thermal/Kconfig | 1 -
include/linux/cpufreq.h | 4 ++-
61 files changed, 238 insertions(+), 809 deletions(-)
--
1.7.12.rc2.18.g61b472e
From: Mark Brown <broonie(a)linaro.org>
Since the sht15 driver supports operation without an external vref
regulator the driver should use the new devm_regulator_get_optional() to
indicate that a stub regulator should not be provided.
Signed-off-by: Mark Brown <broonie(a)linaro.org>
---
Since devm_regulator_get_optional() is not yet merged either the branch
adding it would need be be merged into the hwmon tree or I'd need to
apply this to the regualtor tree.
drivers/hwmon/sht15.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c
index 883d291..97cd45a 100644
--- a/drivers/hwmon/sht15.c
+++ b/drivers/hwmon/sht15.c
@@ -957,7 +957,7 @@ static int sht15_probe(struct platform_device *pdev)
* If a regulator is available,
* query what the supply voltage actually is!
*/
- data->reg = devm_regulator_get(data->dev, "vcc");
+ data->reg = devm_regulator_get_optional(data->dev, "vcc");
if (!IS_ERR(data->reg)) {
int voltage;
--
1.8.4.rc2
Almost all drivers set policy->cur with current cpu frequency in their ->init()
part. This can be done for all of them at core level and so they wouldn't need
to do it.
This patchset adds supporting code in cpufreq core for calling get() after we have
called init() for a policy. Also fixes all drivers accordingly.
These drivers were still doing some stuff which isn't required and was done by
core already. And that is cleaned as well.
This is Fourth part of my cleanup work for CPUFreq, first three are (And
obviously its rebased over them):
1: cpufreq: Introduce cpufreq_table_validate_and_show()
https://lkml.org/lkml/2013/8/8/263
2: cpufreq: define generic routines for cpufreq drivers
https://lkml.org/lkml/2013/8/10/48
3. CPUFreq: Implement light weight ->target(): for 3.13
https://lkml.org/lkml/2013/8/13/349
All these are pushed here:
https://git.linaro.org/gitweb?p=people/vireshk/linux.git;a=shortlog;h=refs/…
--
viresh
Cc: Andrew Lunn <andrew(a)lunn.ch>
Cc: David S. Miller <davem(a)davemloft.net>
Cc: Dmitry Eremin-Solenikov <dbaryshkov(a)gmail.com>
Cc: Eric Miao <eric.y.miao(a)gmail.com>
Cc: Hans-Christian Egtvedt <egtvedt(a)samfundet.no>
Cc: Jesper Nilsson <jesper.nilsson(a)axis.com>
Cc: John Crispin <blogic(a)openwrt.org>
Cc: Kukjin Kim <kgene.kim(a)samsung.com>
Cc: Linus Walleij <linus.walleij(a)linaro.org>
Cc: linux-cris-kernel(a)axis.com
Cc: linux-sh(a)vger.kernel.org
Cc: Mikael Starvik <starvik(a)axis.com>
Cc: Paul Mundt <lethal(a)linux-sh.org>
Cc: Russell King <linux(a)arm.linux.org.uk>
Cc: Santosh Shilimkar <santosh.shilimkar(a)ti.com>
Cc: Sekhar Nori <nsekhar(a)ti.com>
Cc: Shawn Guo <shawn.guo(a)linaro.org>
Cc: spear-devel(a)list.st.com
Cc: Stephen Warren <swarren(a)nvidia.com>
Cc: Steven Miao <realmz6(a)gmail.com>
Cc: Tony Luck <tony.luck(a)intel.com>
Viresh Kumar (37):
cpufreq: call cpufreq_driver->get() after calling ->init()
cpufreq: acpi: don't initialize part of policy that is set by core
too
cpufreq: arm_big_little: don't initialize part of policy that is set
by core too
cpufreq: at32ap: don't initialize part of policy that is set by core
too
cpufreq: blackfin: don't initialize part of policy that is set by
core too
cpufreq: cpu0: don't initialize part of policy that is set by core
too
cpufreq: nforce2: don't initialize part of policy that is set by core
too
cpufreq: cris: don't initialize part of policy that is set by core
too
cpufreq: davinci: don't initialize part of policy that is set by core
too
cpufreq: dbx500: don't initialize part of policy that is set by core
too
cpufreq: e_powersaver: don't initialize part of policy that is set by
core too
cpufreq: elanfreq: don't initialize part of policy that is set by
core too
cpufreq: exynos: don't initialize part of policy that is set by core
too
cpufreq: gx: don't initialize part of policy that is set by core too
cpufreq: ia64-acpi: don't initialize part of policy that is set by
core too
cpufreq: imx6q: don't initialize part of policy that is set by core
too
cpufreq: integrator: don't initialize part of policy that is set by
core too
cpufreq: kirkwood: don't initialize part of policy that is set by
core too
cpufreq: longhaul: don't initialize part of policy that is set by
core too
cpufreq: loongson2: don't initialize part of policy that is set by
core too
cpufreq: maple: don't initialize part of policy that is set by core
too
cpufreq: omap: don't initialize part of policy that is set by core
too
cpufreq: p4: don't initialize part of policy that is set by core too
cpufreq: pcc: don't initialize part of policy that is set by core too
cpufreq: pmac: don't initialize part of policy that is set by core
too
cpufreq: powernow: don't initialize part of policy that is set by
core too
cpufreq: ppc: don't initialize part of policy that is set by core too
cpufreq: pxa: don't initialize part of policy that is set by core too
cpufreq: s3c: don't initialize part of policy that is set by core too
cpufreq: s5pv210: don't initialize part of policy that is set by core
too
cpufreq: sa11x0: don't initialize part of policy that is set by core
too
cpufreq: sc520_freq: don't initialize part of policy that is set by
core too
cpufreq: sh: don't initialize part of policy that is set by core too
cpufreq: spear: don't initialize part of policy that is set by core
too
cpufreq: speedstep: don't initialize part of policy that is set by
core too
cpufreq: tegra: don't initialize part of policy that is set by core
too
cpufreq: unicore2: don't initialize part of policy that is set by
core too
drivers/cpufreq/acpi-cpufreq.c | 1 -
drivers/cpufreq/arm_big_little.c | 2 --
drivers/cpufreq/at32ap-cpufreq.c | 12 ++++--------
drivers/cpufreq/blackfin-cpufreq.c | 1 -
drivers/cpufreq/cpufreq-cpu0.c | 1 -
drivers/cpufreq/cpufreq-nforce2.c | 1 -
drivers/cpufreq/cpufreq.c | 11 +++++++++++
drivers/cpufreq/cris-artpec3-cpufreq.c | 1 -
drivers/cpufreq/cris-etraxfs-cpufreq.c | 1 -
drivers/cpufreq/davinci-cpufreq.c | 2 --
drivers/cpufreq/dbx500-cpufreq.c | 5 -----
drivers/cpufreq/e_powersaver.c | 1 -
drivers/cpufreq/elanfreq.c | 1 -
drivers/cpufreq/exynos-cpufreq.c | 2 --
drivers/cpufreq/exynos5440-cpufreq.c | 1 -
drivers/cpufreq/gx-suspmod.c | 5 +----
drivers/cpufreq/ia64-acpi-cpufreq.c | 1 -
drivers/cpufreq/imx6q-cpufreq.c | 1 -
drivers/cpufreq/integrator-cpufreq.c | 5 ++---
drivers/cpufreq/kirkwood-cpufreq.c | 1 -
drivers/cpufreq/longhaul.c | 1 -
drivers/cpufreq/loongson2_cpufreq.c | 2 --
drivers/cpufreq/maple-cpufreq.c | 1 -
drivers/cpufreq/omap-cpufreq.c | 4 ----
drivers/cpufreq/p4-clockmod.c | 1 -
drivers/cpufreq/pcc-cpufreq.c | 7 -------
drivers/cpufreq/pmac32-cpufreq.c | 1 -
drivers/cpufreq/pmac64-cpufreq.c | 1 -
drivers/cpufreq/powernow-k6.c | 1 -
drivers/cpufreq/powernow-k7.c | 2 --
drivers/cpufreq/powernow-k8.c | 3 ---
drivers/cpufreq/ppc-corenet-cpufreq.c | 2 --
drivers/cpufreq/pxa2xx-cpufreq.c | 2 --
drivers/cpufreq/pxa3xx-cpufreq.c | 7 +++----
drivers/cpufreq/s3c2416-cpufreq.c | 2 --
drivers/cpufreq/s3c24xx-cpufreq.c | 5 -----
drivers/cpufreq/s3c64xx-cpufreq.c | 2 --
drivers/cpufreq/s5pv210-cpufreq.c | 2 --
drivers/cpufreq/sa1100-cpufreq.c | 1 -
drivers/cpufreq/sa1110-cpufreq.c | 1 -
drivers/cpufreq/sc520_freq.c | 1 -
drivers/cpufreq/sh-cpufreq.c | 2 --
drivers/cpufreq/spear-cpufreq.c | 2 --
drivers/cpufreq/speedstep-centrino.c | 5 -----
drivers/cpufreq/speedstep-ich.c | 15 +--------------
drivers/cpufreq/speedstep-smi.c | 13 -------------
drivers/cpufreq/tegra-cpufreq.c | 3 +--
drivers/cpufreq/unicore2-cpufreq.c | 1 -
48 files changed, 23 insertions(+), 123 deletions(-)
--
1.7.12.rc2.18.g61b472e
From: Mark Brown <broonie(a)linaro.org>
The Arndale has a SMSC USB3503 connected in hardware only mode like a PHY,
support it using the usb-nop-xceiv binding.
Note that due to a regrettable decision to use a regulator to represent
the reset signal this uses a fixed voltage regulator to do that, there
is a plan to use the reset controller binding once that is merged so it
does not seem worthwhile to fix the usb-nop-xceiv driver at this point.
Signed-off-by: Mark Brown <broonie(a)linaro.org>
Tested-by: Tushar Behera <tushar.behera(a)linaro.org>
---
arch/arm/boot/dts/exynos5250-arndale.dts | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/arch/arm/boot/dts/exynos5250-arndale.dts b/arch/arm/boot/dts/exynos5250-arndale.dts
index 96d528d..2428ffd 100644
--- a/arch/arm/boot/dts/exynos5250-arndale.dts
+++ b/arch/arm/boot/dts/exynos5250-arndale.dts
@@ -539,4 +539,18 @@
rtc {
status = "okay";
};
+
+ usb_hub_bus {
+ compatible = "simple-bus";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ // SMSC USB3503 connected in hardware only mode as a PHY
+ usb_hub: usb_hub {
+ compatible = "smsc,usb3503a";
+
+ reset-gpios = <&gpx3 5 1>;
+ connect-gpios = <&gpd1 7 1>;
+ };
+ };
};
--
1.8.4.rc2