[PATCH v4 4/7] cpufreq: add clk-reg cpufreq driver

2011-12-21 Thread Richard Zhao
The driver get cpu operation point table from device tree cpu0 node,
and adjusts operating points using clk and regulator APIs.

It support single core and multi-core ARM SoCs. But currently it assume
all cores share the same frequency and voltage.

Signed-off-by: Richard Zhao 
---
 .../devicetree/bindings/cpufreq/clk-reg-cpufreq|7 +
 drivers/cpufreq/Kconfig|   10 +
 drivers/cpufreq/Makefile   |2 +
 drivers/cpufreq/clk-reg-cpufreq.c  |  289 
 4 files changed, 308 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/cpufreq/clk-reg-cpufreq
 create mode 100644 drivers/cpufreq/clk-reg-cpufreq.c

diff --git a/Documentation/devicetree/bindings/cpufreq/clk-reg-cpufreq 
b/Documentation/devicetree/bindings/cpufreq/clk-reg-cpufreq
new file mode 100644
index 000..bf07c1b
--- /dev/null
+++ b/Documentation/devicetree/bindings/cpufreq/clk-reg-cpufreq
@@ -0,0 +1,7 @@
+Generic cpufreq driver based on clk and regulator APIs
+
+Required properties in /cpus/cpu@0:
+- cpu-freqs : cpu frequency points it support, in unit of Hz.
+- cpu-volts : cpu voltages required by the frequency point at the same index,
+ in unit of uV.
+- trans-latency :  transition_latency, in unit of ns.
diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
index e24a2a1..95470f1 100644
--- a/drivers/cpufreq/Kconfig
+++ b/drivers/cpufreq/Kconfig
@@ -179,6 +179,16 @@ config CPU_FREQ_GOV_CONSERVATIVE
 
  If in doubt, say N.
 
+config CLK_REG_CPUFREQ_DRIVER
+   tristate "Generic cpufreq driver using clk and regulator APIs"
+   depends on HAVE_CLK && OF && REGULATOR
+   select CPU_FREQ_TABLE
+   help
+ This adds generic CPUFreq driver based on clk and regulator APIs.
+ It assumes all cores of the CPU share the same clock and voltage.
+
+ If in doubt, say N.
+
 menu "x86 CPU frequency scaling drivers"
 depends on X86
 source "drivers/cpufreq/Kconfig.x86"
diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile
index ce75fcb..2c4eb33 100644
--- a/drivers/cpufreq/Makefile
+++ b/drivers/cpufreq/Makefile
@@ -13,6 +13,8 @@ obj-$(CONFIG_CPU_FREQ_GOV_CONSERVATIVE)   += 
cpufreq_conservative.o
 # CPUfreq cross-arch helpers
 obj-$(CONFIG_CPU_FREQ_TABLE)   += freq_table.o
 
+obj-$(CONFIG_CLK_REG_CPUFREQ_DRIVER)   += clk-reg-cpufreq.o
+
 
##
 # x86 drivers.
 # Link order matters. K8 is preferred to ACPI because of firmware bugs in early
diff --git a/drivers/cpufreq/clk-reg-cpufreq.c 
b/drivers/cpufreq/clk-reg-cpufreq.c
new file mode 100644
index 000..c30d2c5
--- /dev/null
+++ b/drivers/cpufreq/clk-reg-cpufreq.c
@@ -0,0 +1,289 @@
+/*
+ * Copyright (C) 2011 Freescale Semiconductor, Inc.
+ */
+
+/*
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+#define pr_fmt(fmt)KBUILD_MODNAME ": " fmt
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static u32 *cpu_freqs; /* Hz */
+static u32 *cpu_volts; /* uV */
+static u32 trans_latency; /* ns */
+static int cpu_op_nr;
+static unsigned int cur_index;
+
+static struct clk *cpu_clk;
+static struct regulator *cpu_reg;
+static struct cpufreq_frequency_table *freq_table;
+
+static int set_cpu_freq(unsigned long freq, int index, int higher)
+{
+   int ret = 0;
+
+   if (higher && cpu_reg) {
+   ret = regulator_set_voltage(cpu_reg,
+   cpu_volts[index * 2], cpu_volts[index * 2 + 1]);
+   if (ret) {
+   pr_err("set cpu voltage failed!\n");
+   return ret;
+   }
+   }
+
+   ret = clk_set_rate(cpu_clk, freq);
+   if (ret) {
+   if (cpu_reg)
+   regulator_set_voltage(cpu_reg, cpu_volts[cur_index * 2],
+   cpu_volts[cur_index * 2 + 1]);
+   pr_err("cannot set CPU clock rate\n");
+   return ret;
+   }
+
+   if (!higher && cpu_reg) {
+   ret = regulator_set_voltage(cpu_reg,
+   cpu_volts[index * 2], cpu_volts[index * 2 + 1]);
+   if (ret)
+   pr_warn("set cpu voltage failed, might run on"
+   " higher voltage!\n");
+   ret = 0;
+   }
+
+   return ret;
+}
+
+static int clk_reg_verify_speed(struct cpufreq_policy *policy)
+{
+   return cpufreq_frequency_table_verify(policy, freq_table);
+}
+
+static unsigned int clk_reg_get_speed(unsigned int cpu)
+{
+   return clk_get_rate(cpu_clk) / 1000;
+}
+
+static int clk_r

[PATCH v4 6/7] arm/imx6q: register arm_clk as cpu to clkdev

2011-12-21 Thread Richard Zhao
cpufreq needs cpu clock to change frequency.

Signed-off-by: Richard Zhao 
---
 arch/arm/mach-imx/clock-imx6q.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-imx/clock-imx6q.c b/arch/arm/mach-imx/clock-imx6q.c
index 039a7ab..72acbc2 100644
--- a/arch/arm/mach-imx/clock-imx6q.c
+++ b/arch/arm/mach-imx/clock-imx6q.c
@@ -1911,6 +1911,7 @@ static struct clk_lookup lookups[] = {
_REGISTER_CLOCK(NULL, "gpmi_io_clk", gpmi_io_clk),
_REGISTER_CLOCK(NULL, "usboh3_clk", usboh3_clk),
_REGISTER_CLOCK(NULL, "sata_clk", sata_clk),
+   _REGISTER_CLOCK(NULL, "cpu", arm_clk),
 };
 
 int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode)
-- 
1.7.5.4



___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[PATCH v4 2/7] arm/imx: cpufreq: remove loops_per_jiffy recalculate for smp

2011-12-21 Thread Richard Zhao
arm registered cpufreq transition notifier to recalculate it.

Signed-off-by: Richard Zhao 
---
 arch/arm/plat-mxc/cpufreq.c |   10 --
 1 files changed, 0 insertions(+), 10 deletions(-)

diff --git a/arch/arm/plat-mxc/cpufreq.c b/arch/arm/plat-mxc/cpufreq.c
index c937e75..364793a 100644
--- a/arch/arm/plat-mxc/cpufreq.c
+++ b/arch/arm/plat-mxc/cpufreq.c
@@ -99,16 +99,6 @@ static int mxc_set_target(struct cpufreq_policy *policy,
 
ret = set_cpu_freq(freq_Hz);
 
-#ifdef CONFIG_SMP
-   /* loops_per_jiffy is not updated by the cpufreq core for SMP systems.
-* So update it for all CPUs.
-*/
-   for_each_possible_cpu(cpu)
-   per_cpu(cpu_data, cpu).loops_per_jiffy =
-   cpufreq_scale(per_cpu(cpu_data, cpu).loops_per_jiffy,
-   freqs.old, freqs.new);
-#endif
-
for_each_possible_cpu(cpu) {
freqs.cpu = cpu;
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
-- 
1.7.5.4



___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[PATCH v4 1/7] ARM: add cpufreq transiton notifier to adjust loops_per_jiffy for smp

2011-12-21 Thread Richard Zhao
If CONFIG_SMP, cpufreq skips loops_per_jiffy update, because different
arch has different per-cpu loops_per_jiffy definition.

Signed-off-by: Richard Zhao 
---
 arch/arm/kernel/smp.c |   54 +
 1 files changed, 54 insertions(+), 0 deletions(-)

diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index ef5640b..ac9cadc 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -631,3 +632,56 @@ int setup_profiling_timer(unsigned int multiplier)
 {
return -EINVAL;
 }
+
+#ifdef CONFIG_CPU_FREQ
+
+static DEFINE_PER_CPU(unsigned long, l_p_j_ref);
+static DEFINE_PER_CPU(unsigned long, l_p_j_ref_freq);
+static unsigned long global_l_p_j_ref;
+static unsigned long global_l_p_j_ref_freq;
+
+static int cpufreq_callback(struct notifier_block *nb,
+   unsigned long val, void *data)
+{
+   struct cpufreq_freqs *freq = data;
+   int cpu = freq->cpu;
+
+   if (freq->flags & CPUFREQ_CONST_LOOPS)
+   return NOTIFY_OK;
+
+   if (!per_cpu(l_p_j_ref, cpu)) {
+   per_cpu(l_p_j_ref, cpu) =
+   per_cpu(cpu_data, cpu).loops_per_jiffy;
+   per_cpu(l_p_j_ref_freq, cpu) = freq->old;
+   if (!global_l_p_j_ref) {
+   global_l_p_j_ref = loops_per_jiffy;
+   global_l_p_j_ref_freq = freq->old;
+   }
+   }
+
+   if ((val == CPUFREQ_PRECHANGE  && freq->old < freq->new) ||
+   (val == CPUFREQ_POSTCHANGE && freq->old > freq->new) ||
+   (val == CPUFREQ_RESUMECHANGE || val == CPUFREQ_SUSPENDCHANGE)) {
+   loops_per_jiffy = cpufreq_scale(global_l_p_j_ref,
+   global_l_p_j_ref_freq,
+   freq->new);
+   per_cpu(cpu_data, cpu).loops_per_jiffy =
+   cpufreq_scale(per_cpu(l_p_j_ref, cpu),
+   per_cpu(l_p_j_ref_freq, cpu),
+   freq->new);
+   }
+   return NOTIFY_OK;
+}
+
+static struct notifier_block cpufreq_notifier = {
+   .notifier_call  = cpufreq_callback,
+};
+
+static int __init register_cpufreq_notifier(void)
+{
+   return cpufreq_register_notifier(&cpufreq_notifier,
+   CPUFREQ_TRANSITION_NOTIFIER);
+}
+core_initcall(register_cpufreq_notifier);
+
+#endif
-- 
1.7.5.4



___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[PATCH v4 3/7] cpufreq: OMAP: remove loops_per_jiffy recalculate for smp

2011-12-21 Thread Richard Zhao
arm registered cpufreq transition notifier to recalculate it.

Signed-off-by: Richard Zhao 
---
 drivers/cpufreq/omap-cpufreq.c |   36 
 1 files changed, 0 insertions(+), 36 deletions(-)

diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c
index 5d04c57..17da4c4 100644
--- a/drivers/cpufreq/omap-cpufreq.c
+++ b/drivers/cpufreq/omap-cpufreq.c
@@ -37,16 +37,6 @@
 
 #include 
 
-#ifdef CONFIG_SMP
-struct lpj_info {
-   unsigned long   ref;
-   unsigned intfreq;
-};
-
-static DEFINE_PER_CPU(struct lpj_info, lpj_ref);
-static struct lpj_info global_lpj_ref;
-#endif
-
 static struct cpufreq_frequency_table *freq_table;
 static atomic_t freq_table_users = ATOMIC_INIT(0);
 static struct clk *mpu_clk;
@@ -118,32 +108,6 @@ static int omap_target(struct cpufreq_policy *policy,
ret = clk_set_rate(mpu_clk, freqs.new * 1000);
freqs.new = omap_getspeed(policy->cpu);
 
-#ifdef CONFIG_SMP
-   /*
-* Note that loops_per_jiffy is not updated on SMP systems in
-* cpufreq driver. So, update the per-CPU loops_per_jiffy value
-* on frequency transition. We need to update all dependent CPUs.
-*/
-   for_each_cpu(i, policy->cpus) {
-   struct lpj_info *lpj = &per_cpu(lpj_ref, i);
-   if (!lpj->freq) {
-   lpj->ref = per_cpu(cpu_data, i).loops_per_jiffy;
-   lpj->freq = freqs.old;
-   }
-
-   per_cpu(cpu_data, i).loops_per_jiffy =
-   cpufreq_scale(lpj->ref, lpj->freq, freqs.new);
-   }
-
-   /* And don't forget to adjust the global one */
-   if (!global_lpj_ref.freq) {
-   global_lpj_ref.ref = loops_per_jiffy;
-   global_lpj_ref.freq = freqs.old;
-   }
-   loops_per_jiffy = cpufreq_scale(global_lpj_ref.ref, global_lpj_ref.freq,
-   freqs.new);
-#endif
-
/* notifiers */
for_each_cpu(i, policy->cpus) {
freqs.cpu = i;
-- 
1.7.5.4



___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[PATCH v4 0/7] add a generic cpufreq driver

2011-12-21 Thread Richard Zhao
Thanks Arnd, Mark, Jamie, Rob, for your review.

Changes in v4:
 - add depends on HAVE_CLK && OF && REGULATOR
 - add set_cpu_freq fail check
 - regulator_put wehn module exit
 - add pr_fmt and convert all printk to pr_xxx
 - use voltage range
 - comment and doc fix
 - add cpu_volts value pre-check in module init
 - add helpfull module parameter max_freq
 - remove compatible string check on Arnd's comment.
 - remove generic-cpufreq to clk-reg-cpufreq

Changes in v3:
 - move adjusting smp loops_per_jiffy to arm common code,
   and also adjust global loops_per_jiffy.
 - remove adjusting loops_per_jiffy in imx and omap cpufreq drivers.
 - check compatible "generic-cpufreq" when module_init
 - change printk to pr_xxx
 - add generic-cpufreq DT binding doc

Changes in v2:
 - add volatage change support
 - change '_' in property name to '-'
 - use initial value to calculate loops_per_jiffy
 - fix reading cpu_volts property bug 
 - let cpufreq_frequency_table_cpuinfo routines handle cpu_freq_khz_max/min
 - don't change freq in arm_cpufreq_exit, because every core share the same 
freq.
 - use unsigned long describe frequency as much as possible. Because clk use
   unsigned long, but cpufreq use unsigned int.

[PATCH v4 1/7] ARM: add cpufreq transiton notifier to adjust
[PATCH v4 2/7] arm/imx: cpufreq: remove loops_per_jiffy recalculate
[PATCH v4 3/7] cpufreq: OMAP: remove loops_per_jiffy recalculate for
[PATCH v4 4/7] cpufreq: add clk-reg cpufreq driver
[PATCH v4 5/7] dts/imx6q: add cpufreq property
[PATCH v4 6/7] arm/imx6q: register arm_clk as cpu to clkdev
[PATCH v4 7/7] arm/imx6q: select ARCH_HAS_CPUFREQ


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[PATCH v4 5/7] dts/imx6q: add cpufreq property

2011-12-21 Thread Richard Zhao
Signed-off-by: Richard Zhao 
---
 arch/arm/boot/dts/imx6q.dtsi |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi
index 263e8f3..2087db7 100644
--- a/arch/arm/boot/dts/imx6q.dtsi
+++ b/arch/arm/boot/dts/imx6q.dtsi
@@ -29,6 +29,13 @@
compatible = "arm,cortex-a9";
reg = <0>;
next-level-cache = <&L2>;
+   cpu-freqs = <99600 79200 39600 19800>;
+   cpu-volts = <   /* min  max */
+   1225000 145 /* 996M */
+   110 145 /* 792M */
+   95  145 /* 396M */
+   85  145>; /* 198M */
+   trans-latency = <61036>; /* two CLK32 periods */
};
 
cpu@1 {
-- 
1.7.5.4



___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[PATCH v4 7/7] arm/imx6q: select ARCH_HAS_CPUFREQ

2011-12-21 Thread Richard Zhao
Signed-off-by: Richard Zhao 
---
 arch/arm/mach-imx/Kconfig |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index c44aa97..39cf00a 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -595,6 +595,7 @@ comment "i.MX6 family:"
 
 config SOC_IMX6Q
bool "i.MX6 Quad support"
+   select ARCH_HAS_CPUFREQ
select ARM_GIC
select CACHE_L2X0
select CPU_V7
-- 
1.7.5.4



___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: Announce: Panda ICS SGX 1.8 on tilt-android-tracking

2011-12-21 Thread Andy Green

On 12/22/2011 11:58 AM, Somebody in the thread at some point said:

Hi -


Thanks for all the effort you guys put in to get it working. I will try
to get a 4.0.1 accelerated build working.


Thanks for looking at it!


Build 4 is based on 4.0.3 in which the dss/dsscomp headers in userspace
have been updated to the latest aosp kernel.There are few patches from
Lajos molnar which are missing I guess.

Upgrading  SGX 1.8 driver to  v55175 version  we can get  4.0.3 running
again.

Here is the  kernel tip:
http://android.git.linaro.org/gitweb?p=kernel/omap.git;a=shortlog;h=refs/heads/linaro-android-omap-panda-3.0


Okay, I will pick the updated patch and test.  I guess this will be an 
ongoing thing to keep on top of.



I forgot to mention two things

3) HDMI Audio is broken atm, Jassi is working on fixing that.  Onboard 
audio should be fine.


4) One of the advantages of running off tracking basis is we inherit all 
the goodies from vanilla.  In this kernel for Android same as in vanilla 
you'll find working Panda onboard camera driver and Unified Memory 
Allocator series among other improvements.  In this way we can leverage 
the work we're doing on vanilla twice, by having it appear automatically 
at the Android kernel too.


-Andy

--
Andy Green | TI Landing Team Leader
Linaro.org │ Open source software for ARM SoCs | Follow Linaro
http://facebook.com/pages/Linaro/155974581091106  - 
http://twitter.com/#!/linaroorg - http://linaro.org/linaro-blog


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: Announce: Panda ICS SGX 1.8 on tilt-android-tracking

2011-12-21 Thread Vishal Bhoj
Andy & Jassi,

Thanks for all the effort you guys put in to get it working. I will try to
get a 4.0.1 accelerated build working.

On 22 December 2011 09:02, Andy Green  wrote:

> Hi -
>
> Mainly due to the extraordinary efforts of Jassi, I'm pleased to announce
> TI LT now has a mostly-workable initial build of tilt-android-tracking for
> ICS including SGX 1.8 driver, on 3.2-rc5 basis.
>
> It has two issues at the moment to be aware of:
>
> 1) We were only able to get it to work right now on Build #1 of the Panda
> ICS rootfs.  Build 4 is giving some problem with struct size matching in
> dsscomp.  Jassi had read something about it on linaro-android and expects
> it'll be solved soon.
>

Build 4 is based on 4.0.3 in which the dss/dsscomp headers in userspace
have been updated to the latest aosp kernel.There are few patches from
Lajos molnar which are missing I guess.

Upgrading  SGX 1.8 driver to  v55175 version  we can get  4.0.3 running
again.

Here is the  kernel tip:
http://android.git.linaro.org/gitweb?p=kernel/omap.git;a=shortlog;h=refs/heads/linaro-android-omap-panda-3.0



> 2) Display is from HDMI, is coming at 1080p, but we have a 640x480 box in
> the top left right now with the content.  I understand AOSP is only coming
> at 640x480 anyway from HDMI anyway.  We also hope to fix this shortly.
>
> It's important to note this is now stitched into its own topic
> (tracking-topic-sgx-1.8) and follows our normal flow of vanilla tracking +
> sgx-1.8 + androidization, ie, it's under control for ongoing tracking like
> the previous sgx topic was (which we successfully provided for 5 months or
> so for Gingerbread) and not just a bolt-on.
>
> Hopefully this will reduce the amount of Linaro effort wasted off-piste...
>
> -Andy
>
> --
> Andy Green | TI Landing Team Leader
> Linaro.org │ Open source software for ARM SoCs | Follow Linaro
> http://facebook.com/pages/**Linaro/155974581091106
>  -
> http://twitter.com/#!/**linaroorg  -
> http://linaro.org/linaro-blog
>
> __**_
> linaro-android mailing list
> linaro-android@lists.linaro.**org 
> http://lists.linaro.org/**mailman/listinfo/linaro-**android
>
___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Announce: Panda ICS SGX 1.8 on tilt-android-tracking

2011-12-21 Thread Andy Green

Hi -

Mainly due to the extraordinary efforts of Jassi, I'm pleased to 
announce TI LT now has a mostly-workable initial build of 
tilt-android-tracking for ICS including SGX 1.8 driver, on 3.2-rc5 basis.


It has two issues at the moment to be aware of:

1) We were only able to get it to work right now on Build #1 of the 
Panda ICS rootfs.  Build 4 is giving some problem with struct size 
matching in dsscomp.  Jassi had read something about it on 
linaro-android and expects it'll be solved soon.


2) Display is from HDMI, is coming at 1080p, but we have a 640x480 box 
in the top left right now with the content.  I understand AOSP is only 
coming at 640x480 anyway from HDMI anyway.  We also hope to fix this 
shortly.


It's important to note this is now stitched into its own topic 
(tracking-topic-sgx-1.8) and follows our normal flow of vanilla tracking 
+ sgx-1.8 + androidization, ie, it's under control for ongoing tracking 
like the previous sgx topic was (which we successfully provided for 5 
months or so for Gingerbread) and not just a bolt-on.


Hopefully this will reduce the amount of Linaro effort wasted off-piste...

-Andy

--
Andy Green | TI Landing Team Leader
Linaro.org │ Open source software for ARM SoCs | Follow Linaro
http://facebook.com/pages/Linaro/155974581091106  - 
http://twitter.com/#!/linaroorg - http://linaro.org/linaro-blog


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: audio support for pandboard on Linaro release 11.11/12

2011-12-21 Thread Andy Green

On 12/22/2011 09:42 AM, Somebody in the thread at some point said:

Hi Andy,
 Thanks for your answer.

On Wed, Dec 21, 2011 at 4:33 PM, "Andy Green (林安廸)"  wrote:

On 12/21/2011 03:46 PM, Somebody in the thread at some point said:

Hi -



I have one pandboard (4430), however, it's said the audio and
audiohw  not supported in the Linaro android release 11.11 or 11.12,



Well, the alsa driver side is working, the two main issues left are about
integration with pulse and fixing an issue with one channel of audio record.

So if you update to latest pulseaudio and run this script for example with a
48kHz stereo wav



audio should be coming from headphone jack on Panda OK.


   I am interested in the Linaro android release, not try the Linario
ubuntu version, and
Android doesn't use pulseAudio. as matter of fact, I have tried the ubuntu omap
image (from ubuntu site), the audio works just as what you said.


Oh.. I see.  The Linaro kernel for Android is just the vanilla one with 
some Androidization patches applied, so the kernel sound status is the same.


During gingerbread onboard sound in the rootfs was also working after 
Vishal Bhoj did the work to integrate it.


Now the Android side moved to ICS, I don't know the status of audio 
there, although I guess we can expect a few things to regress initially 
in userland due to the big changes.  But it's workable on kernel side.



so is there one way  to add the support manually ? if yes, where to
begin ?  I am also interested in enabling the video hw support for the
board, but no idea until now.



Do you mean just video output at all?  It should be working well from HDMI
jack.  If you mean accelerated video multimedia decode, this is very close
to being there but has a latency bug we didn't get a chance to look at yet

https://bugs.launchpad.net/bugs/880840

once that's solved it should be workable end-end.


I mean the latter, however, it seems that it's only concerned about
the ubuntu way.


Right... with TI there's no real relationship between vanilla / ubuntu 
effort for accelerated MM and Android effort, and despite trying to find 
a common basis so at least some of the kernelside stuff can be shared 
between the two ongoing, it doesn't look like that's going to happen.


Part of TI feeds Omapzoom kernel with Android pieces customized around 
the needs of Android pieces, and the part of TI we (the Landing Team) 
work with do their own thing differently for Vanilla, driven by needs of 
gstreamer and X pipeline.  Those two implementations conflict reflecting 
the conflicting drivers creating them.


Of the two, the vanilla side is almost always more closely aligned with 
upstream implementation, a lot of the stuff that enters and sticks 
around in Omapzoom does not care much about that it was just trying to 
get stuff working with whatever was at hand.


In addition, we keep the vanilla stuff up to date on tracking branches, 
currently 3.2-rc5.


Currently Linaro Android is building AOSP kernel (3.0 based) in addition 
to ours, which seems to have been fed with / based off omapzoom stuff, 
although that provides a quick fix for some pieces of the puzzle it has 
its own problems.  I don't know if it provides MM acceleration out of 
the box either.


And certainly work on AOSP with 3.0 basis does not feed either Linus 
upstream or synergize with other Linaro kernel work - in fact undermines 
it - so it will be interesting to see how that plays out.


Anyway currently -- and we did look at it -- there's no easy path for us 
to add accelerated video decode for Android on LT kernel.  After we 
finished ICS SGX support we might look at it again but it's not the 
biggest issue on our list.


-Andy

--
Andy Green | TI Landing Team Leader
Linaro.org │ Open source software for ARM SoCs | Follow Linaro
http://facebook.com/pages/Linaro/155974581091106  - 
http://twitter.com/#!/linaroorg - http://linaro.org/linaro-blog


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: audio support for pandboard on Linaro release 11.11/12

2011-12-21 Thread Zach Pfeffer
On 21 December 2011 19:42, Yuping Luo  wrote:
> Hi Andy,
>    Thanks for your answer.
>
> On Wed, Dec 21, 2011 at 4:33 PM, "Andy Green (林安廸)"  wrote:
>> On 12/21/2011 03:46 PM, Somebody in the thread at some point said:
>>
>> Hi -
>>
>>
>>>    I have one pandboard (4430), however, it's said the audio and
>>> audiohw  not supported in the Linaro android release 11.11 or 11.12,
>>
>>
>> Well, the alsa driver side is working, the two main issues left are about
>> integration with pulse and fixing an issue with one channel of audio record.
>>
>> So if you update to latest pulseaudio and run this script for example with a
>> 48kHz stereo wav
>
>> audio should be coming from headphone jack on Panda OK.
>>
>  I am interested in the Linaro android release, not try the Linario
> ubuntu version, and
> Android doesn't use pulseAudio. as matter of fact, I have tried the ubuntu 
> omap
> image (from ubuntu site), the audio works just as what you said.

We have a few Android Panda baselines depending on what you need. All
distro's run ICS.

tracking-panda (TI Landing Team kernel)
staging-panda (TI Landing Team kernel)
aosp-panda (AOSP kernel)
panda (only upstream)
landing-panda (AOSP kernel)

aosp-panda and landing-panda are based on AOSP's kernel the rest are
based on kernels from the TI landing team. The current release is
based on landing-panda. As you may have read AOSP doesn't support
audio yet (via tinyalsa) but we're working on that with the rest of
the Android community. Feel free to subscribe to

http://lists.linaro.org/mailman/listinfo/linaro-android

I've added the relevant groups.

>>> so is there one way  to add the support manually ? if yes, where to
>>> begin ?  I am also interested in enabling the video hw support for the
>>> board, but no idea until now.
>>
>>
>> Do you mean just video output at all?  It should be working well from HDMI
>> jack.  If you mean accelerated video multimedia decode, this is very close
>> to being there but has a latency bug we didn't get a chance to look at yet
>>
>> https://bugs.launchpad.net/bugs/880840
>>
>> once that's solved it should be workable end-end.
>>
> I mean the latter, however, it seems that it's only concerned about
> the ubuntu way.
>
>> -Andy
>
> Thanks
> Yuping Luo
>
> ___
> linaro-dev mailing list
> linaro-dev@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/linaro-dev



-- 
Zach Pfeffer
Android Platform Team Lead, Linaro Platform Teams
Linaro.org | Open source software for ARM SoCs
Follow Linaro: http://www.facebook.com/pages/Linaro
http://twitter.com/#!/linaroorg - http://www.linaro.org/linaro-blog

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: audio support for pandboard on Linaro release 11.11/12

2011-12-21 Thread Yuping Luo
Hi Andy,
Thanks for your answer.

On Wed, Dec 21, 2011 at 4:33 PM, "Andy Green (林安廸)"  wrote:
> On 12/21/2011 03:46 PM, Somebody in the thread at some point said:
>
> Hi -
>
>
>>    I have one pandboard (4430), however, it's said the audio and
>> audiohw  not supported in the Linaro android release 11.11 or 11.12,
>
>
> Well, the alsa driver side is working, the two main issues left are about
> integration with pulse and fixing an issue with one channel of audio record.
>
> So if you update to latest pulseaudio and run this script for example with a
> 48kHz stereo wav

> audio should be coming from headphone jack on Panda OK.
>
  I am interested in the Linaro android release, not try the Linario
ubuntu version, and
Android doesn't use pulseAudio. as matter of fact, I have tried the ubuntu omap
image (from ubuntu site), the audio works just as what you said.

>> so is there one way  to add the support manually ? if yes, where to
>> begin ?  I am also interested in enabling the video hw support for the
>> board, but no idea until now.
>
>
> Do you mean just video output at all?  It should be working well from HDMI
> jack.  If you mean accelerated video multimedia decode, this is very close
> to being there but has a latency bug we didn't get a chance to look at yet
>
> https://bugs.launchpad.net/bugs/880840
>
> once that's solved it should be workable end-end.
>
I mean the latter, however, it seems that it's only concerned about
the ubuntu way.

> -Andy

Thanks
Yuping Luo

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH V3 4/7] cpufreq: add generic cpufreq driver

2011-12-21 Thread Mark Brown
On Wed, Dec 21, 2011 at 10:19:11PM +0800, Richard Zhao wrote:

> Even cpu node is device, I still need to find a way to get it.  I think it's
> better have another patch to fix the regulator dt binding in cpu node. I'll
> not include it in this patch series.

I'd expect this to be easy if we can find any device tree data for the
CPU at all?  It's just another piece of data no different to the clock
rates or whatever.

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH] mmc: use usleep_range() in mmc_delay()

2011-12-21 Thread Sujit Reddy Thumma

On 12/21/2011 12:26 PM, Dmitry Antipov wrote:

 From f447d78db65c6675e69466e8ed08364ff065ac08 Mon Sep 17 00:00:00 2001
From: Dmitry Antipov 
Date: Wed, 21 Dec 2011 10:51:03 +0400
Subject: [PATCH] mmc: use usleep_range() in mmc_delay()

---
drivers/mmc/core/core.h | 8 ++--
1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h
index 14664f1..a77851e 100644
--- a/drivers/mmc/core/core.h
+++ b/drivers/mmc/core/core.h
@@ -47,12 +47,8 @@ void mmc_power_off(struct mmc_host *host);

static inline void mmc_delay(unsigned int ms)
{
- if (ms < 1000 / HZ) {
- cond_resched();
- mdelay(ms);
- } else {
- msleep(ms);
- }
+ unsigned long us = ms * USEC_PER_MSEC;
+ usleep_range(us, us + 1000);


I have posted similar patch some time back. 
http://comments.gmane.org/gmane.linux.ports.arm.msm/2119.


Would you like to comment on that?

Thanks,
Sujit


}

void mmc_rescan(struct work_struct *work);



___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH V3 4/7] cpufreq: add generic cpufreq driver

2011-12-21 Thread Kay Sievers
On Wed, Dec 21, 2011 at 13:12, Mark Brown
 wrote:
> On Wed, Dec 21, 2011 at 12:44:57PM +0100, Kay Sievers wrote:
>
>> We will convert all classes to buses over time time, and have a single
>> type of device and a single type of subsystem.
>
> Are there any conversions that have been done already that I can look at
> for reference?

The first step is the conversion from 'sys_device' to 'device', which is here:
  http://git.kernel.org/?p=linux/kernel/git/kay/patches.git;a=tree

That should hit the tree soon, if all works according to plan. All
sys_devices and sysdev classes will be gone for forever.

The 'class' to 'bus' work is simpler, because the logic in both of
them is very similar and both use the same 'struct device' already.

We'll need to add some convenience APIs to bus, and add code to make
sure the converted stuff has compat symlinks in /sys/class when
needed. Then we can convert-over one 'struct class' to 'struct
bus_type' after the other until 'struct class' can be deleted.

This work has not yet started, because we are busy with the sys_device
stuff at the moment.

No new stuff should use 'struct class' or 'struct sys_device', they
should all start right away with 'struct bus_type'.

Kay

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH V3 4/7] cpufreq: add generic cpufreq driver

2011-12-21 Thread Kay Sievers
On Wed, Dec 21, 2011 at 10:43, Arnd Bergmann  wrote:
> On Wednesday 21 December 2011, Richard Zhao wrote:
>> On Wed, Dec 21, 2011 at 09:20:46AM +0800, Richard Zhao wrote:
>
>> > > > > You also need to define how the core supplies get looked up.
>> > >
>> > > > It's pure software. platform uses this driver have to define "cpu" 
>> > > > consumer.
>> > >
>> > > You still need to define this in the binding.
>> > You mean regulator DT binding? already in ? I'll check it.
>> Mark, cpu node is not a struct device, sys_device instead. I can not find
>> regulator via device/dt node. Can I still use the string to get regulator
>> after converting to DT?
>
> I believe Kay and Greg have the plan to unify "class" and "bus" in sysfs, 
> which
> implies turning sys_device into a derived class of device instead of kobject.
> If that understanding is correct, we might as well do that now so we can
> attach a device_node to a sys_device.
>
> Kay, does this make sense?

Yes, it's all converted already:
  http://git.kernel.org/?p=linux/kernel/git/kay/patches.git;a=tree

The sysdev stuff will entirely go away, the devices are just 'struct
device' and the sysdev classes are all converted to buses.

We will convert all classes to buses over time time, and have a single
type of device and a single type of subsystem.

Kay

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH] ohci-hcd: ohci-hcd: use usleep_range() instead of mdelay()

2011-12-21 Thread Greg KH
On Wed, Dec 21, 2011 at 11:07:22AM +0400, Dmitry Antipov wrote:
> From ac60fe289eef3d81009f2b14a12acbac3e71878b Mon Sep 17 00:00:00 2001
> From: Dmitry Antipov 
> Date: Wed, 21 Dec 2011 11:05:27 +0400
> Subject: [PATCH] ohci-hcd: use usleep_range() instead of mdelay()
> 

You didn't sign off on this, and you failed to explain why this is
needed.

You also didn't use git-send-email, making it a pain to apply (why do I
need the duplicate headers in the email body?

So consider this patch totally ignored.

greg k-h



___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Call for testing: Updated OpenJDK 6.0 ARM port (for Ubuntu)

2011-12-21 Thread Christian Robottom Reis
Hi there,

Matthias has just landed in the Precise repositories an updated
version of OpenJDK that comes with a newly updated Zero-based ARM
optimized backend. Since many people have inquired about the general
state of Java on ARM, I'd like it if we could get some installation and
testing results using the packages published from the source at:

https://launchpad.net/ubuntu/precise/+source/openjdk-6/6b24~pre2-0ubuntu2

Installable packages are linked to from:


https://launchpad.net/ubuntu/+source/openjdk-6/6b24~pre2-0ubuntu2/+build/3015810

Reports of installation issues, and general results trying to run from
simple to complex applications would be appreciated.

Note there is no backport PPA for these packages at the moment. But it's
still time to give them a xmas spin and give me the great news that Java
on ARM is getting back on track -- thanks!
-- 
Christian Robottom Reis, Engineering VP
Brazil (GMT-3) | [+55] 16 9112 6430 | [+1] 612 216 4935
Linaro.org: Open Source Software for ARM SoCs

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH] drm: fix compilation warning with i386_defconfig

2011-12-21 Thread Francesco Sarasini

it makes "OMAP2+ Display Subsystem support" disappear in "make
menuconfig"

How can I solve this?

Thanks
Sarasini 



___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH V3 1/7] ARM: add cpufreq transiton notifier to adjust loops_per_jiffy for smp

2011-12-21 Thread Richard Zhao
Hi Russel,

Are the patch #1 #2 #3 ok for you?

Thanks
Richard

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH V3 4/7] cpufreq: add generic cpufreq driver

2011-12-21 Thread Richard Zhao
On Wed, Dec 21, 2011 at 01:49:07PM +0100, Kay Sievers wrote:
> On Wed, Dec 21, 2011 at 13:12, Mark Brown
>  wrote:
> > On Wed, Dec 21, 2011 at 12:44:57PM +0100, Kay Sievers wrote:
> >
> >> We will convert all classes to buses over time time, and have a single
> >> type of device and a single type of subsystem.
> >
> > Are there any conversions that have been done already that I can look at
> > for reference?
> 
> The first step is the conversion from 'sys_device' to 'device', which is here:
>   http://git.kernel.org/?p=linux/kernel/git/kay/patches.git;a=tree
> 
> That should hit the tree soon, if all works according to plan. All
> sys_devices and sysdev classes will be gone for forever.
Even cpu node is device, I still need to find a way to get it.  I think it's
better have another patch to fix the regulator dt binding in cpu node. I'll
not include it in this patch series.

Richard
> 
> The 'class' to 'bus' work is simpler, because the logic in both of
> them is very similar and both use the same 'struct device' already.
> 
> We'll need to add some convenience APIs to bus, and add code to make
> sure the converted stuff has compat symlinks in /sys/class when
> needed. Then we can convert-over one 'struct class' to 'struct
> bus_type' after the other until 'struct class' can be deleted.
> 
> This work has not yet started, because we are busy with the sys_device
> stuff at the moment.
> 
> No new stuff should use 'struct class' or 'struct sys_device', they
> should all start right away with 'struct bus_type'.
> 
> Kay

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH] mmc: use usleep_range() in mmc_delay()

2011-12-21 Thread Dmitry Antipov

On 12/21/2011 03:25 PM, Sujit Reddy Thumma wrote:


I have posted similar patch some time back.
http://comments.gmane.org/gmane.linux.ports.arm.msm/2119.

Would you like to comment on that?


- I believe we should forget about jiffies, HZ and other similar obsolete
  timekeeping stuff;

- I have no ideas where did you get 'most typical' 20 ms. MMC subsystem uses
  mmc_delay() with two compile-time fixed values 1 and 10 ms, with the only
  exception of card-dependent sleep/awake timeout. I was unable to find a table
  with typical values, but it's rounded up to >= 1 ms anyway.

Dmitry

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH V3 4/7] cpufreq: add generic cpufreq driver

2011-12-21 Thread Mark Brown
On Wed, Dec 21, 2011 at 12:44:57PM +0100, Kay Sievers wrote:

> We will convert all classes to buses over time time, and have a single
> type of device and a single type of subsystem.

Are there any conversions that have been done already that I can look at
for reference?

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH V3 4/7] cpufreq: add generic cpufreq driver

2011-12-21 Thread Mark Brown
On Wed, Dec 21, 2011 at 09:43:34AM +, Arnd Bergmann wrote:
> On Wednesday 21 December 2011, Richard Zhao wrote:

> > Mark, cpu node is not a struct device, sys_device instead. I can not find
> > regulator via device/dt node. Can I still use the string to get regulator
> > after converting to DT?

> I believe Kay and Greg have the plan to unify "class" and "bus" in sysfs, 
> which
> implies turning sys_device into a derived class of device instead of kobject.
> If that understanding is correct, we might as well do that now so we can
> attach a device_node to a sys_device.

> Kay, does this make sense?

I'm noy Kay but I think even if it's not what we end uo doing internally
it's a sensible design for the device tree representation.


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[RFC PATCH 1/3] thermal: exynos: Add thermal interface support for linux thermal layer

2011-12-21 Thread Amit Daniel Kachhap
This codes uses the generic linux thermal layer and creates a bridge
between temperature sensors, linux thermal framework and cooling devices
for samsung exynos platform. This layer recieves or monitor the
temperature from the sensor and informs the generic thermal layer to take
the necessary cooling action.

Signed-off-by: Amit Daniel Kachhap 
---
 drivers/thermal/Kconfig  |8 ++
 drivers/thermal/Makefile |1 +
 drivers/thermal/exynos_thermal.c |  255 ++
 include/linux/exynos_thermal.h   |   59 +
 4 files changed, 323 insertions(+), 0 deletions(-)
 create mode 100644 drivers/thermal/exynos_thermal.c
 create mode 100644 include/linux/exynos_thermal.h

diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig
index 298c1cd..4e8df56 100644
--- a/drivers/thermal/Kconfig
+++ b/drivers/thermal/Kconfig
@@ -29,3 +29,11 @@ config CPU_THERMAL
  This will be useful for platforms using the generic thermal interface
  and not the ACPI interface.
  If you want this support, you should say Y or M here.
+
+config SAMSUNG_THERMAL_INTERFACE
+   bool "Samsung Thermal interface support"
+   depends on THERMAL && CPU_THERMAL
+   help
+ This is a samsung thermal interface which will be used as
+ a link between sensors and cooling devices with linux thermal
+ framework.
diff --git a/drivers/thermal/Makefile b/drivers/thermal/Makefile
index 655cbc4..c67b6b2 100644
--- a/drivers/thermal/Makefile
+++ b/drivers/thermal/Makefile
@@ -4,3 +4,4 @@
 
 obj-$(CONFIG_THERMAL)  += thermal_sys.o
 obj-$(CONFIG_CPU_THERMAL)  += cpu_cooling.o
+obj-$(CONFIG_SAMSUNG_THERMAL_INTERFACE)+= exynos_thermal.o
diff --git a/drivers/thermal/exynos_thermal.c b/drivers/thermal/exynos_thermal.c
new file mode 100644
index 000..7c916db
--- /dev/null
+++ b/drivers/thermal/exynos_thermal.c
@@ -0,0 +1,255 @@
+/* linux/drivers/thermal/exynos_thermal.c
+ *
+ * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+struct exynos4_thermal_zone {
+   unsigned int idle_interval;
+   unsigned int active_interval;
+   struct thermal_zone_device *therm_dev;
+   struct thermal_cooling_device *cool_dev;
+   struct platform_device *exynos4_dev;
+   struct thermal_sensor_conf *sensor_conf;
+   struct exynos4_tmu_platform_data *sensor_data;
+};
+
+static struct exynos4_thermal_zone *th_zone;
+
+static int exynos4_get_mode(struct thermal_zone_device *thermal,
+   enum thermal_device_mode *mode)
+{
+   if (th_zone->sensor_conf) {
+   pr_info("Temperature sensor not initialised\n");
+   *mode = THERMAL_DEVICE_DISABLED;
+   } else
+   *mode = THERMAL_DEVICE_ENABLED;
+   return 0;
+}
+
+static int exynos4_set_mode(struct thermal_zone_device *thermal,
+   enum thermal_device_mode mode)
+{
+   if (!th_zone->therm_dev) {
+   pr_notice("thermal zone not registered\n");
+   return 0;
+   }
+   if (mode == THERMAL_DEVICE_ENABLED)
+   th_zone->therm_dev->polling_delay =
+   th_zone->active_interval*1000;
+   else
+   th_zone->therm_dev->polling_delay =
+   th_zone->idle_interval*1000;
+
+   thermal_zone_device_update(th_zone->therm_dev);
+   pr_info("thermal polling set for duration=%d sec\n",
+   th_zone->therm_dev->polling_delay/1000);
+   return 0;
+}
+
+/*This may be called from interrupt based temperature sensor*/
+void exynos4_report_trigger(void)
+{
+   unsigned int th_temp = th_zone->sensor_data->threshold;
+   unsigned int monitor_temp = th_temp +
+   th_zone->sensor_data->trigger_levels[1];
+
+   thermal_zone_device_update(th_zone->therm_dev);
+
+   if (th_zone->therm_dev->last_temperature > monitor_temp)
+   th_zone->therm_dev->polling_delay =
+   th_zone->active_interval*1000;
+   else
+   th_zone->therm_dev->polling_delay =
+   th_zone->idle_interval*1000;
+}
+
+static int exynos4_get_trip_type(struct thermal_zone_device *thermal, int trip,
+enum thermal_trip_type *type)
+{
+   if (trip == 0 || trip == 1)
+   *type = THERMAL_TRIP_STATE_ACTIVE;
+   else if (trip == 2)
+   *type = THERMAL_TRIP_CRITICAL;
+   else
+   return -EINVAL;
+
+   return 0;
+}
+
+static int exynos4_get_trip_temp(s

[RFC PATCH 0/3] thermal: exynos: Add kernel thermal support for exynos platform

2011-12-21 Thread Amit Daniel Kachhap
All the patchset based on Kernel version 3.2-rc6 and uses the cpufreq
cooling registration api's implemented in earlier patchset 
http://www.spinics.net/lists/linux-pm/msg26500.html

The code added in this patchset adds a thermal interface layer for samsung
exynos platforms. This layer is registered from the hwmon based temperature
sensor and recieves/monitor the temperature from the sensor and informs the
generic thermal layer to take the necessary cooling action. Currently this
layer can be used to create only one thermal zone and hence only one
temperature sensor can register.

Some modifications are done in the temperature sensor driver to export the
information needed for the thermal interface to register with the core linux
thermal framework and with the cpu frequency based cooling devices.

A simple data/control flow diagrams to illustrate this,

Core Linux thermal <--->  Exynos thermal  < Temperature Sensor
  | |
 \|/|
  Cpufreq cooling device <-

Amit Daniel Kachhap (3):
  thermal: exynos: Add thermal interface support for linux thermal
layer
  thermal: exynos4: Register the tmu sensor with the thermal interface
layer
  ARM: exynos4: Add thermal sensor driver platform device support

 arch/arm/mach-exynos/Kconfig  |   12 ++
 arch/arm/mach-exynos/Makefile |1 +
 arch/arm/mach-exynos/clock.c  |4 +
 arch/arm/mach-exynos/dev-tmu.c|   64 +++
 arch/arm/mach-exynos/include/mach/irqs.h  |2 +
 arch/arm/mach-exynos/include/mach/map.h   |1 +
 arch/arm/mach-exynos/mach-origen.c|1 +
 arch/arm/plat-samsung/include/plat/devs.h |1 +
 drivers/hwmon/exynos4_tmu.c   |   34 -
 drivers/thermal/Kconfig   |8 +
 drivers/thermal/Makefile  |1 +
 drivers/thermal/exynos_thermal.c  |  255 +
 include/linux/exynos_thermal.h|   59 +++
 include/linux/platform_data/exynos4_tmu.h |7 +
 14 files changed, 447 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/mach-exynos/dev-tmu.c
 create mode 100644 drivers/thermal/exynos_thermal.c
 create mode 100644 include/linux/exynos_thermal.h


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[RFC PATCH 3/3] ARM: exynos4: Add thermal sensor driver platform device support

2011-12-21 Thread Amit Daniel Kachhap
This patch adds necessary source definations needed for TMU driver and
the platform device support.

Signed-off-by: Amit Daniel Kachhap 
---
 arch/arm/mach-exynos/Kconfig  |   12 +
 arch/arm/mach-exynos/Makefile |1 +
 arch/arm/mach-exynos/clock.c  |4 ++
 arch/arm/mach-exynos/dev-tmu.c|   64 +
 arch/arm/mach-exynos/include/mach/irqs.h  |2 +
 arch/arm/mach-exynos/include/mach/map.h   |1 +
 arch/arm/mach-exynos/mach-origen.c|1 +
 arch/arm/plat-samsung/include/plat/devs.h |1 +
 8 files changed, 86 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-exynos/dev-tmu.c

diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 724ec0f..cfc6119 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -82,6 +82,17 @@ config EXYNOS4_DEV_DWMCI
help
  Compile in platform device definitions for DWMCI
 
+config EXYNOS4_DEV_TMU
+   bool "Exynos4 tmu device support"
+   default n
+   depends on ARCH_EXYNOS4
+   ---help---
+ Compile in platform device definitions for TMU. This macro also
+ enables compilation hwmon base TMU driver and also allows compilation
+ of the platform device files. The platform data in this case is trip
+ temperature and some tmu h/w configurations related parameter.
+
+
 config EXYNOS4_SETUP_I2C1
bool
help
@@ -288,6 +299,7 @@ config MACH_ORIGEN
select SAMSUNG_DEV_BACKLIGHT
select SAMSUNG_DEV_PWM
select EXYNOS4_DEV_PD
+   select EXYNOS4_DEV_TMU
select EXYNOS4_SETUP_FIMD0
select EXYNOS4_SETUP_SDHCI
select EXYNOS4_SETUP_USB_PHY
diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index 59069a3..d2493e8 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -44,6 +44,7 @@ obj-$(CONFIG_EXYNOS4_DEV_AHCI)+= dev-ahci.o
 obj-$(CONFIG_EXYNOS4_DEV_PD)   += dev-pd.o
 obj-$(CONFIG_EXYNOS4_DEV_SYSMMU)   += dev-sysmmu.o
 obj-$(CONFIG_EXYNOS4_DEV_DWMCI)+= dev-dwmci.o
+obj-$(CONFIG_EXYNOS4_DEV_TMU)   += dev-tmu.o
 
 obj-$(CONFIG_EXYNOS4_SETUP_FIMC)   += setup-fimc.o
 obj-$(CONFIG_EXYNOS4_SETUP_FIMD0)  += setup-fimd0.o
diff --git a/arch/arm/mach-exynos/clock.c b/arch/arm/mach-exynos/clock.c
index 2894f0a..edecc5e 100644
--- a/arch/arm/mach-exynos/clock.c
+++ b/arch/arm/mach-exynos/clock.c
@@ -567,6 +567,10 @@ static struct clk init_clocks_off[] = {
.enable = exynos4_clk_ip_peril_ctrl,
.ctrlbit= (1 << 15),
}, {
+   .name   = "tmu_apbif",
+   .enable = exynos4_clk_ip_perir_ctrl,
+   .ctrlbit= (1 << 17),
+   }, {
.name   = "keypad",
.enable = exynos4_clk_ip_perir_ctrl,
.ctrlbit= (1 << 16),
diff --git a/arch/arm/mach-exynos/dev-tmu.c b/arch/arm/mach-exynos/dev-tmu.c
new file mode 100644
index 000..2e98912
--- /dev/null
+++ b/arch/arm/mach-exynos/dev-tmu.c
@@ -0,0 +1,64 @@
+/* linux/arch/arm/mach-exynos4/dev-tmu.c
+ *
+ * Copyright 2011 by SAMSUNG
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+static struct resource exynos4_tmu_resource[] = {
+   [0] = {
+   .start  = EXYNOS4_PA_TMU,
+   .end= EXYNOS4_PA_TMU + 0x - 1,
+   .flags  = IORESOURCE_MEM,
+   },
+   [1] = {
+   .start  = IRQ_TMU_TRIG0,
+   .end= IRQ_TMU_TRIG0,
+   .flags  = IORESOURCE_IRQ,
+   },
+};
+
+static struct exynos4_tmu_platform_data default_tmu_data = {
+   .threshold = 80,
+   .trigger_levels[0] = 2,
+   .trigger_levels[1] = 5,
+   .trigger_levels[2] = 20,
+   .trigger_levels[3] = 30,
+   .trigger_level0_en = 1,
+   .trigger_level1_en = 1,
+   .trigger_level2_en = 1,
+   .trigger_level3_en = 1,
+   .gain = 15,
+   .reference_voltage = 7,
+   .cal_type = TYPE_ONE_POINT_TRIMMING,
+   .freq_tab[0] = {
+   .freq_clip_pctg[0] = 30,
+   },
+   .freq_tab[1] = {
+   .freq_clip_pctg[0] = 99,
+   },
+   .freq_tab_count = 2,
+};
+
+struct platform_device exynos4_device_tmu = {
+   .name   = "exynos4-tmu",
+   .id = -1,
+   .num_resources  = ARRAY_SIZE(exynos4_tmu_resource),
+   .resource   = exynos4_tmu_resource,
+   .dev= {
+   .platform_data  = &default_tmu_data,
+   },
+};
diff --git a/arch/arm/mach-exynos/include/mach/irqs.h 
b/arch/arm/mach-exy

[RFC PATCH 2/3] thermal: exynos4: Register the tmu sensor with the thermal interface layer

2011-12-21 Thread Amit Daniel Kachhap
Export and register information from the hwmon tmu sensor to the samsung
exynos kernel thermal framework where different cooling devices and thermal
zone are binded. The exported information is based according to the data
structure thermal_sensor_conf present in exynos_thermal.h. HWMON sysfs
functions are currently left although all of them are present in generic
linux thermal layer.
Also the platform data structure is modified to pass frequency cooling
in percentages for each thermal level.

Signed-off-by: Amit Daniel Kachhap 
---
 drivers/hwmon/exynos4_tmu.c   |   34 ++--
 include/linux/platform_data/exynos4_tmu.h |7 ++
 2 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/drivers/hwmon/exynos4_tmu.c b/drivers/hwmon/exynos4_tmu.c
index f2359a0..6912a7f 100644
--- a/drivers/hwmon/exynos4_tmu.c
+++ b/drivers/hwmon/exynos4_tmu.c
@@ -37,6 +37,9 @@
 #include 
 
 #include 
+#ifdef CONFIG_SAMSUNG_THERMAL_INTERFACE
+#include 
+#endif
 
 #define EXYNOS4_TMU_REG_TRIMINFO   0x0
 #define EXYNOS4_TMU_REG_CONTROL0x20
@@ -248,10 +251,13 @@ static void exynos4_tmu_work(struct work_struct *work)
 
kobject_uevent(&data->hwmon_dev->kobj, KOBJ_CHANGE);
 
-   enable_irq(data->irq);
 
clk_disable(data->clk);
mutex_unlock(&data->lock);
+#ifdef CONFIG_SAMSUNG_THERMAL_INTERFACE
+   exynos4_report_trigger();
+#endif
+   enable_irq(data->irq);
 }
 
 static irqreturn_t exynos4_tmu_irq(int irq, void *id)
@@ -345,6 +351,14 @@ static const struct attribute_group exynos4_tmu_attr_group 
= {
.attrs = exynos4_tmu_attributes,
 };
 
+#ifdef CONFIG_SAMSUNG_THERMAL_INTERFACE
+static struct thermal_sensor_conf exynos4_sensor_conf = {
+   .name   = "exynos4-therm",
+   .read_temperature   = (int (*)(void *))exynos4_tmu_read,
+};
+#endif
+/*CONFIG_SAMSUNG_THERMAL_INTERFACE*/
+
 static int __devinit exynos4_tmu_probe(struct platform_device *pdev)
 {
struct exynos4_tmu_data *data;
@@ -432,9 +446,20 @@ static int __devinit exynos4_tmu_probe(struct 
platform_device *pdev)
}
 
exynos4_tmu_control(pdev, true);
-
+#ifdef CONFIG_SAMSUNG_THERMAL_INTERFACE
+   (&exynos4_sensor_conf)->private_data = data;
+   (&exynos4_sensor_conf)->sensor_data = pdata;
+   ret = exynos4_register_thermal(&exynos4_sensor_conf);
+   if (ret) {
+   dev_err(&pdev->dev, "Failed to register thermal interface\n");
+   goto err_hwmon_device;
+   }
+#endif
return 0;
-
+#ifdef CONFIG_SAMSUNG_THERMAL_INTERFACE
+err_hwmon_device:
+   hwmon_device_unregister(data->hwmon_dev);
+#endif
 err_create_group:
sysfs_remove_group(&pdev->dev.kobj, &exynos4_tmu_attr_group);
 err_clk:
@@ -458,6 +483,9 @@ static int __devexit exynos4_tmu_remove(struct 
platform_device *pdev)
 
exynos4_tmu_control(pdev, false);
 
+#ifdef CONFIG_SAMSUNG_THERMAL_INTERFACE
+   exynos4_unregister_thermal();
+#endif
hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&pdev->dev.kobj, &exynos4_tmu_attr_group);
 
diff --git a/include/linux/platform_data/exynos4_tmu.h 
b/include/linux/platform_data/exynos4_tmu.h
index 39e038c..642c508 100644
--- a/include/linux/platform_data/exynos4_tmu.h
+++ b/include/linux/platform_data/exynos4_tmu.h
@@ -21,6 +21,7 @@
 
 #ifndef _LINUX_EXYNOS4_TMU_H
 #define _LINUX_EXYNOS4_TMU_H
+#include 
 
 enum calibration_type {
TYPE_ONE_POINT_TRIMMING,
@@ -64,6 +65,9 @@ enum calibration_type {
  * in the positive-TC generator block
  * 0 <= reference_voltage <= 31
  * @cal_type: calibration type for temperature
+ * @freq_pctg_table: Table representing frequency reduction percentage.
+ * @freq_tab_count: Count of the above table as frequency reduction may
+ * applicable to only some of the trigger levels.
  *
  * This structure is required for configuration of exynos4_tmu driver.
  */
@@ -79,5 +83,8 @@ struct exynos4_tmu_platform_data {
u8 reference_voltage;
 
enum calibration_type cal_type;
+
+   struct freq_pctg_table freq_tab[4];
+   unsigned int freq_tab_count;
 };
 #endif /* _LINUX_EXYNOS4_TMU_H */
-- 
1.7.1


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: audio support for pandboard on Linaro release 11.11/12

2011-12-21 Thread Andy Green (林安廸)

On 12/21/2011 03:46 PM, Somebody in the thread at some point said:

Hi -


I have one pandboard (4430), however, it's said the audio and
audiohw  not supported in the Linaro android release 11.11 or 11.12,


Well, the alsa driver side is working, the two main issues left are 
about integration with pulse and fixing an issue with one channel of 
audio record.


So if you update to latest pulseaudio and run this script for example 
with a 48kHz stereo wav


#!/bin/sh
amixer cset name='DL1 Mixer Multimedia' 1
amixer cset name='DL1 Media Playback Volume' 118
amixer cset name='Sidetone Mixer Playback' 1
amixer cset name='SDT DL Volume' 120
amixer cset name='DL1 PDM Switch' 1
amixer cset name='Headset Left Playback' 'HS DAC'
amixer cset name='Headset Right Playback' 'HS DAC'
amixer cset name='Headset Playback Volume' 13
aplay -Dhw:0,6 -M -f S16_LE -r 44100 -c 2 test48.wav

audio should be coming from headphone jack on Panda OK.


so is there one way  to add the support manually ? if yes, where to
begin ?  I am also interested in enabling the video hw support for the
board, but no idea until now.


Do you mean just video output at all?  It should be working well from 
HDMI jack.  If you mean accelerated video multimedia decode, this is 
very close to being there but has a latency bug we didn't get a chance 
to look at yet


https://bugs.launchpad.net/bugs/880840

once that's solved it should be workable end-end.

-Andy

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


RE: [PATCH] ARM: EXYNOS: Add USB OHCI support to ORIGEN board

2011-12-21 Thread Jingoo Han
Hi, Tushar.

Tushar Behera wrote:
> -Original Message-
> Subject: [PATCH] ARM: EXYNOS: Add USB OHCI support to ORIGEN board
> 
> Signed-off-by: Tushar Behera 
> Signed-off-by: Angus Ainslie 

Acked-by: Jingoo Han 

Thanks.

Best regards,
Jingoo Han
> ---
> 
> This patch are based Kukjin's for-next branch and OHCI related
> patches from Jingoo Han.
> [PATCH v2 0/3] Support Samsung Exynos OHCI device and driver
> 
>  arch/arm/mach-exynos/Kconfig   |1 +
>  arch/arm/mach-exynos/mach-origen.c |   13 +
>  2 files changed, 14 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
> index bd1bb9f1..0da2ced 100644
> --- a/arch/arm/mach-exynos/Kconfig
> +++ b/arch/arm/mach-exynos/Kconfig
> @@ -304,6 +304,7 @@ config MACH_ORIGEN
>   select SAMSUNG_DEV_PWM
>   select EXYNOS4_DEV_DMA
>   select EXYNOS4_DEV_PD
> + select EXYNOS4_DEV_USB_OHCI
>   select EXYNOS4_SETUP_FIMD0
>   select EXYNOS4_SETUP_SDHCI
>   select EXYNOS4_SETUP_USB_PHY
> diff --git a/arch/arm/mach-exynos/mach-origen.c 
> b/arch/arm/mach-exynos/mach-origen.c
> index f56d027..a0116036 100644
> --- a/arch/arm/mach-exynos/mach-origen.c
> +++ b/arch/arm/mach-exynos/mach-origen.c
> @@ -42,6 +42,7 @@
>  #include 
>  #include 
> 
> +#include 
>  #include 
> 
>  /* Following are default values for UCON, ULCON and UFCON UART registers */
> @@ -487,6 +488,16 @@ static void __init origen_ehci_init(void)
>   s5p_ehci_set_platdata(pdata);
>  }
> 
> +/* USB OHCI */
> +static struct exynos4_ohci_platdata origen_ohci_pdata;
> +
> +static void __init origen_ohci_init(void)
> +{
> + struct exynos4_ohci_platdata *pdata = &origen_ohci_pdata;
> +
> + exynos4_ohci_set_platdata(pdata);
> +}
> +
>  static struct gpio_keys_button origen_gpio_keys_table[] = {
>   {
>   .code   = KEY_MENU,
> @@ -627,6 +638,7 @@ static struct platform_device *origen_devices[] 
> __initdata = {
>   &s5p_device_mfc_l,
>   &s5p_device_mfc_r,
>   &s5p_device_mixer,
> + &exynos4_device_ohci,
>   &exynos4_device_pd[PD_LCD0],
>   &exynos4_device_pd[PD_TV],
>   &exynos4_device_pd[PD_G3D],
> @@ -702,6 +714,7 @@ static void __init origen_machine_init(void)
>   s3c_sdhci0_set_platdata(&origen_hsmmc0_pdata);
> 
>   origen_ehci_init();
> + origen_ohci_init();
>   clk_xusbxti.rate = 2400;
> 
>   s5p_tv_setup();
> --
> 1.7.4.1


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: Is Pandaboard cpuhotplug working stably?

2011-12-21 Thread Russell King - ARM Linux
On Wed, Dec 21, 2011 at 05:59:07PM +0800, Barry Song wrote:
> 2011/12/21 Russell King - ARM Linux :
> > cpu hotplug is basically totally buggered - the preconditions placed
> > upon the bringup code path are basically impossible to satisfy in any
> > shape or form at the moment.
> >
> > There's the requirement that the secondary CPU is marked online and
> > active before interrupts are enabled for the thread migration stuff
> > to behave correctly.  However, this is incompatible with smp_call_function()
> > which will wait for online CPUs to respond to an IPI - which this one
> > won't because interrupts are disabled.
> >
> > I think there was some discussion about how to fix this but I don't
> > recall the details.
> 
> thanks, Russell. then could i think this is an ARM-kernel-specific bug
> which exists on all ARM SMP chips for the moment?
> and that bug doesn't happen on x86:

I don't think so.  There's nothing ARM specific about it.

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: Is Pandaboard cpuhotplug working stably?

2011-12-21 Thread Barry Song
2011/12/21 Russell King - ARM Linux :
> On Wed, Dec 21, 2011 at 05:23:48PM +0800, Barry Song wrote:
>> Hi guys,
>> i tried cpuhotplug on pandaboard for both
>> Pandroid_Froyo_L27.8.2_release_pkg and Linaro 11.11. It has failed to
>> work stably.
>> On Pandroid_Froyo_L27.8.2_release_pkg, unplugging cpu1 works well:
>> # echo 0 > /sys/devices/system/cpu/cpu1/online
>> CPU1: shutdown
>>
>> if i enable the cpu1 again by "echo 1 >
>> /sys/devices/system/cpu/cpu1/online", the system will restore to 3
>> random status: hang, normal, panic.
>>
>> Using  Linaro 11.11 release, "echo 0 >
>> /sys/devices/system/cpu/cpu1/online" will make system hang and the
>> whole system will not be able to reset by pressing reset key, the only
>> way to reset system is pulling out AV power.
>>
>> i am sorry i can't get more time to debug and find more clues. just
>> want to ask people whether this is a version the cpuhotplug works
>> normal on?
>
> cpu hotplug is basically totally buggered - the preconditions placed
> upon the bringup code path are basically impossible to satisfy in any
> shape or form at the moment.
>
> There's the requirement that the secondary CPU is marked online and
> active before interrupts are enabled for the thread migration stuff
> to behave correctly.  However, this is incompatible with smp_call_function()
> which will wait for online CPUs to respond to an IPI - which this one
> won't because interrupts are disabled.
>
> I think there was some discussion about how to fix this but I don't
> recall the details.

thanks, Russell. then could i think this is an ARM-kernel-specific bug
which exists on all ARM SMP chips for the moment?
and that bug doesn't happen on x86:
root@ubuntu:~/simple-rootfs/initrd/bin# echo 0 >
/sys/devices/system/cpu/cpu3/online
root@ubuntu:~/simple-rootfs/initrd/bin# echo 1 >
/sys/devices/system/cpu/cpu3/online
root@ubuntu:~/simple-rootfs/initrd/bin# echo 0 >
/sys/devices/system/cpu/cpu2/online
root@ubuntu:~/simple-rootfs/initrd/bin# echo 1 >
/sys/devices/system/cpu/cpu2/online

-barry

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: Is Pandaboard cpuhotplug working stably?

2011-12-21 Thread Russell King - ARM Linux
On Wed, Dec 21, 2011 at 05:23:48PM +0800, Barry Song wrote:
> Hi guys,
> i tried cpuhotplug on pandaboard for both
> Pandroid_Froyo_L27.8.2_release_pkg and Linaro 11.11. It has failed to
> work stably.
> On Pandroid_Froyo_L27.8.2_release_pkg, unplugging cpu1 works well:
> # echo 0 > /sys/devices/system/cpu/cpu1/online
> CPU1: shutdown
> 
> if i enable the cpu1 again by "echo 1 >
> /sys/devices/system/cpu/cpu1/online", the system will restore to 3
> random status: hang, normal, panic.
> 
> Using  Linaro 11.11 release, "echo 0 >
> /sys/devices/system/cpu/cpu1/online" will make system hang and the
> whole system will not be able to reset by pressing reset key, the only
> way to reset system is pulling out AV power.
> 
> i am sorry i can't get more time to debug and find more clues. just
> want to ask people whether this is a version the cpuhotplug works
> normal on?

cpu hotplug is basically totally buggered - the preconditions placed
upon the bringup code path are basically impossible to satisfy in any
shape or form at the moment.

There's the requirement that the secondary CPU is marked online and
active before interrupts are enabled for the thread migration stuff
to behave correctly.  However, this is incompatible with smp_call_function()
which will wait for online CPUs to respond to an IPI - which this one
won't because interrupts are disabled.

I think there was some discussion about how to fix this but I don't
recall the details.

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH V3 4/7] cpufreq: add generic cpufreq driver

2011-12-21 Thread Arnd Bergmann
On Wednesday 21 December 2011, Richard Zhao wrote:
> On Wed, Dec 21, 2011 at 09:20:46AM +0800, Richard Zhao wrote:

> > > > > You also need to define how the core supplies get looked up.
> > > 
> > > > It's pure software. platform uses this driver have to define "cpu" 
> > > > consumer.
> > > 
> > > You still need to define this in the binding.
> > You mean regulator DT binding? already in ? I'll check it.
> Mark, cpu node is not a struct device, sys_device instead. I can not find
> regulator via device/dt node. Can I still use the string to get regulator
> after converting to DT?

I believe Kay and Greg have the plan to unify "class" and "bus" in sysfs, which
implies turning sys_device into a derived class of device instead of kobject.
If that understanding is correct, we might as well do that now so we can
attach a device_node to a sys_device.

Kay, does this make sense?

Arnd

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH V3 4/7] cpufreq: add generic cpufreq driver

2011-12-21 Thread Richard Zhao
On Wed, Dec 21, 2011 at 09:20:46AM +0800, Richard Zhao wrote:
> Hi Mark,
> 
> On Tue, Dec 20, 2011 at 11:48:45PM +, Mark Brown wrote:
> > On Wed, Dec 21, 2011 at 07:27:03AM +0800, Richard Zhao wrote:
> > > On Tue, Dec 20, 2011 at 02:59:04PM +, Mark Brown wrote:
> > 
> > > > My comments on the previous version of the patch still apply:
> > 
> > > >  - The voltage ranges being set need to be specified as ranges.
> > 
> > > cpu normally need strict voltages. and only proved operating opints
> > > are allowed to set in dts. If the voltage changes slightly especially
> > > for high frequency, it's easy to cause unstable.
> > 
> > Clearly there will be limits which get more and more restrictive as the
> > frequencies get higher but there will always be at least some play in
> > the numbers as one must at a minimum specify tolerance ranges, and at
> > lower frequencies the ranges specified will typically get compartively
> > large.
> hmm, reasonable. I'll add it in dts. Thanks.
> > 
> > Note also that not all hardware specifies things in terms of a fixed set
> > of operating points, sometimes only the minimum voltage specification is
> > varied with frequency or sometimes you see maximum and minimum stepping
> > independently.
> cpus that don't use freq table is out of scope of this driver.
> > 
> > Further note that if all hardware really does have as tight a set of
> > requirements as you suggest then the regulator support in the driver
> > needs to be non-optional otherwise a board without software regulator
> > control might drop the frequency without also dropping the voltage.
> It's ok to only adjuct freq without changes voltage. You can find many
> arm soc cpufreq drivers don't change voltage.
> If dts specify voltage but don't have such regulator. I'll assume it
> always runs on the initial volatage (highest for most cases).
> > 
> > > >  - Frequencies that can't be supported due to limitations of the
> > > >available supplies shouldn't be exposed to users.
> > 
> > > As I said, only proved operation points are allowed.
> > 
> > This statement appears to be unrelated to the comment you're replying
> > to.
> I meant the exact voltage can always successfull set. Anyway, I'll add
> regulator_set_voltage return value checking.
> > 
> > > > You also need to define how the core supplies get looked up.
> > 
> > > It's pure software. platform uses this driver have to define "cpu" 
> > > consumer.
> > 
> > You still need to define this in the binding.
> You mean regulator DT binding? already in ? I'll check it.
Mark, cpu node is not a struct device, sys_device instead. I can not find
regulator via device/dt node. Can I still use the string to get regulator
after converting to DT?

And regulator binding is not on cpufreq git tree.

Thanks
Richard
> > 
> > > > > + pr_info("Generic CPU frequency driver\n");
> > 
> > > > This seems noisy...
> > 
> > > Why? Do you think only errors and warnings can print out?
> > 
> > Yes.
> 
> Maybe I can remove it. But I'd probably add freq table dump. It's more 
> important.
> Agree?
> 
> I checked pr_fmt. Thanks very much. I'll use below and remove __func_.
> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> 
> 
> Thanks
> Richard
> > 
> > ___
> > linux-arm-kernel mailing list
> > linux-arm-ker...@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> > 
> 
> 
> ___
> linux-arm-kernel mailing list
> linux-arm-ker...@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Is Pandaboard cpuhotplug working stably?

2011-12-21 Thread Barry Song
Hi guys,
i tried cpuhotplug on pandaboard for both
Pandroid_Froyo_L27.8.2_release_pkg and Linaro 11.11. It has failed to
work stably.
On Pandroid_Froyo_L27.8.2_release_pkg, unplugging cpu1 works well:
# echo 0 > /sys/devices/system/cpu/cpu1/online
CPU1: shutdown

if i enable the cpu1 again by "echo 1 >
/sys/devices/system/cpu/cpu1/online", the system will restore to 3
random status: hang, normal, panic.

Using  Linaro 11.11 release, "echo 0 >
/sys/devices/system/cpu/cpu1/online" will make system hang and the
whole system will not be able to reset by pressing reset key, the only
way to reset system is pulling out AV power.

i am sorry i can't get more time to debug and find more clues. just
want to ask people whether this is a version the cpuhotplug works
normal on?

Thanks
barry

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[PATCHv2] Regulator: Add Anatop regulator driver

2011-12-21 Thread Ying-Chun Liu (PaulLiu)
From: "Ying-Chun Liu (PaulLiu)" 

Anatop regulator driver is used by i.MX6 SoC. The regulator provides
controlling the voltage of PU, CORE, SOC, and some devices. This patch
adds the Anatop regulator driver.

Signed-off-by: Nancy Chen 
Signed-off-by: Ying-Chun Liu (PaulLiu) 
Cc: Mark Brown 
Cc: Liam Girdwood 
---
 drivers/regulator/Kconfig  |7 +
 drivers/regulator/Makefile |1 +
 drivers/regulator/anatop-regulator.c   |  260 
 include/linux/regulator/anatop-regulator.h |   67 +++
 4 files changed, 335 insertions(+), 0 deletions(-)
 create mode 100644 drivers/regulator/anatop-regulator.c
 create mode 100644 include/linux/regulator/anatop-regulator.h

diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 9713b1b..6aebd6d 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -327,5 +327,12 @@ config REGULATOR_AAT2870
  If you have a AnalogicTech AAT2870 say Y to enable the
  regulator driver.
 
+config REGULATOR_ANATOP
+   tristate "ANATOP LDO regulators"
+   depends on SOC_IMX6
+   default y if SOC_IMX6
+   help
+ Say y here to support ANATOP LDOs regulators.
+
 endif
 
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
index 93a6318..990c332 100644
--- a/drivers/regulator/Makefile
+++ b/drivers/regulator/Makefile
@@ -46,5 +46,6 @@ obj-$(CONFIG_REGULATOR_AB8500)+= ab8500.o
 obj-$(CONFIG_REGULATOR_DB8500_PRCMU) += db8500-prcmu.o
 obj-$(CONFIG_REGULATOR_TPS65910) += tps65910-regulator.o
 obj-$(CONFIG_REGULATOR_AAT2870) += aat2870-regulator.o
+obj-$(CONFIG_REGULATOR_ANATOP) += anatop-regulator.o
 
 ccflags-$(CONFIG_REGULATOR_DEBUG) += -DDEBUG
diff --git a/drivers/regulator/anatop-regulator.c 
b/drivers/regulator/anatop-regulator.c
new file mode 100644
index 000..31156d5
--- /dev/null
+++ b/drivers/regulator/anatop-regulator.c
@@ -0,0 +1,260 @@
+/*
+ * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved.
+ */
+
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static int anatop_set_voltage(struct regulator_dev *reg, int min_uV,
+ int max_uV, unsigned *selector)
+{
+   struct anatop_regulator *anatop_reg = rdev_get_drvdata(reg);
+   u32 val, rega;
+   int uv;
+
+   uv = max_uV;
+   pr_debug("%s: uv %d, min %d, max %d\n", __func__,
+uv, reg->constraints->min_uV,
+reg->constraints->max_uV);
+
+   if (uv < reg->constraints->min_uV || uv > reg->constraints->max_uV)
+   return -EINVAL;
+
+   if (anatop_reg->rdata->control_reg) {
+   val = anatop_reg->rdata->min_bit_val +
+   (uv - reg->constraints->min_uV) / 25000;
+   rega = (__raw_readl(anatop_reg->rdata->control_reg) &
+  ~(anatop_reg->rdata->vol_bit_mask <<
+anatop_reg->rdata->vol_bit_shift));
+   pr_debug("%s: calculated val %d\n", __func__, val);
+   __raw_writel((val << anatop_reg->rdata->vol_bit_shift) | rega,
+anatop_reg->rdata->control_reg);
+   return 0;
+   } else {
+   pr_debug("Regulator not supported.\n");
+   return -ENOTSUPP;
+   }
+}
+
+static int anatop_get_voltage(struct regulator_dev *reg)
+{
+   struct anatop_regulator *anatop_reg = rdev_get_drvdata(reg);
+   int uv;
+   struct anatop_regulator_data *rdata = anatop_reg->rdata;
+
+   if (rdata->control_reg) {
+   u32 val = (__raw_readl(rdata->control_reg) <<
+  rdata->vol_bit_shift) & rdata->vol_bit_mask;
+   uv = reg->constraints->min_uV
+ + (val - rdata->min_bit_val) * 25000;
+   pr_debug("vddio = %d, val=%u\n", uv, val);
+   return uv;
+   } else {
+   pr_debug("Regulator not supported.\n");
+   return -ENOTSUPP;
+   }
+}
+
+static int anatop_enable(struct regulator_dev *reg)
+{
+   return 0;
+}
+
+static int anatop_disable(struct regulator_dev *reg)
+{
+   return 0;
+}
+
+static int anatop_is_enable

[PATCH] ARM: EXYNOS: Add USB OHCI support to ORIGEN board

2011-12-21 Thread Tushar Behera
Signed-off-by: Tushar Behera 
Signed-off-by: Angus Ainslie 
---

This patch are based Kukjin's for-next branch and OHCI related
patches from Jingoo Han.
[PATCH v2 0/3] Support Samsung Exynos OHCI device and driver

 arch/arm/mach-exynos/Kconfig   |1 +
 arch/arm/mach-exynos/mach-origen.c |   13 +
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index bd1bb9f1..0da2ced 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -304,6 +304,7 @@ config MACH_ORIGEN
select SAMSUNG_DEV_PWM
select EXYNOS4_DEV_DMA
select EXYNOS4_DEV_PD
+   select EXYNOS4_DEV_USB_OHCI
select EXYNOS4_SETUP_FIMD0
select EXYNOS4_SETUP_SDHCI
select EXYNOS4_SETUP_USB_PHY
diff --git a/arch/arm/mach-exynos/mach-origen.c 
b/arch/arm/mach-exynos/mach-origen.c
index f56d027..a0116036 100644
--- a/arch/arm/mach-exynos/mach-origen.c
+++ b/arch/arm/mach-exynos/mach-origen.c
@@ -42,6 +42,7 @@
 #include 
 #include 
 
+#include 
 #include 
 
 /* Following are default values for UCON, ULCON and UFCON UART registers */
@@ -487,6 +488,16 @@ static void __init origen_ehci_init(void)
s5p_ehci_set_platdata(pdata);
 }
 
+/* USB OHCI */
+static struct exynos4_ohci_platdata origen_ohci_pdata;
+
+static void __init origen_ohci_init(void)
+{
+   struct exynos4_ohci_platdata *pdata = &origen_ohci_pdata;
+
+   exynos4_ohci_set_platdata(pdata);
+}
+
 static struct gpio_keys_button origen_gpio_keys_table[] = {
{
.code   = KEY_MENU,
@@ -627,6 +638,7 @@ static struct platform_device *origen_devices[] __initdata 
= {
&s5p_device_mfc_l,
&s5p_device_mfc_r,
&s5p_device_mixer,
+   &exynos4_device_ohci,
&exynos4_device_pd[PD_LCD0],
&exynos4_device_pd[PD_TV],
&exynos4_device_pd[PD_G3D],
@@ -702,6 +714,7 @@ static void __init origen_machine_init(void)
s3c_sdhci0_set_platdata(&origen_hsmmc0_pdata);
 
origen_ehci_init();
+   origen_ohci_init();
clk_xusbxti.rate = 2400;
 
s5p_tv_setup();
-- 
1.7.4.1


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev