Re: Updated Pulse Audio + alsa-lib for 11.12

2011-12-18 Thread Andy Green

On 12/19/2011 02:25 PM, Somebody in the thread at some point said:

On Sun, Dec 18, 2011 at 10:05 PM, Andy Green  wrote:

On 12/19/2011 12:17 AM, Somebody in the thread at some point said:


Hi Ricardo,

With working HDMI output on the original panda board, and Wei's new
release of patches to alsa-lib and pulseaudio, I've updated both
alsa-lib and pulseaudio for 11.12 in ppa:linaro-maintainers/overlay.
Sound on the panda over HDMI from my testing works out of the box.
It's not perfect but it works. I will repeat this same test with my
imx53 shortly.


For all on the dev list, be aware that audio is in a state of flux and
while we'd like to avoid defects they are likely. The Multimedia WG is
putting substantial effort into having a "just works" level of quality
for supported boards.

A very bit thank you is in order for Wei Feng for his hard work on
11.12! Good job! One small sound for an ARM board, but a big noise for
Linaro when we can say, "It just works."


That's cool, still want to test the support, but nice to know that
it's working at Panda.


That is indeed good news, thanks a lot guys.

About Panda UCM, last week I noticed though that there is different wiring
on input side between 4430 Panda (line in goes to analogue headset mic
inputs on twl6040) and 4460 Panda (line in goes to FM analogue inputs).  So
this week I plan to make changes to the onboard audio driver to change its
alsa card name based on what board it's on, with a view to elaborating out
the UCM directories so the recording case is handled correctly depending on
the board.

At the moment, the two recording cases in UCM for Panda anyway are broken so
hopefully there'll be fixes for that too.


Do you have any idea when you'll be pushing the new patches?


I'm planning to do the card dynamic naming and fix up the UCM side this 
week.


However there are two funnies left, one is L3 bus exception coming from 
ABE when pulse touches it, which Liam has reproduced IIRC and the other 
is one stereo channel records correctly while the other records white 
noise (on both 4430 and 4460).


-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: Updated Pulse Audio + alsa-lib for 11.12

2011-12-18 Thread Andy Green

On 12/19/2011 01:16 PM, Somebody in the thread at some point said:

About Panda UCM, last week I noticed though that there is different wiring
on input side between 4430 Panda (line in goes to analogue headset mic
inputs on twl6040) and 4460 Panda (line in goes to FM analogue inputs).  So
this week I plan to make changes to the onboard audio driver to change its
alsa card name based on what board it's on, with a view to elaborating out
the UCM directories so the recording case is handled correctly depending on
the board.

That's my concern too. The first thing is we need directories under
/usr/share/alsa/ucm with the same audio card names on both panda
boards. The second thing is to have correct configurations for both
boards. I don't have a 4460 board, Andy, can you help on giving the
ucm configurations for it?


Yes I'm hoping to sort it out.  I'll give you the patches on UCM when 
they're done.


-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: Updated Pulse Audio + alsa-lib for 11.12

2011-12-18 Thread Ricardo Salveti
On Sun, Dec 18, 2011 at 10:05 PM, Andy Green  wrote:
> On 12/19/2011 12:17 AM, Somebody in the thread at some point said:
>>
>> Hi Ricardo,
>>
>> With working HDMI output on the original panda board, and Wei's new
>> release of patches to alsa-lib and pulseaudio, I've updated both
>> alsa-lib and pulseaudio for 11.12 in ppa:linaro-maintainers/overlay.
>> Sound on the panda over HDMI from my testing works out of the box.
>> It's not perfect but it works. I will repeat this same test with my
>> imx53 shortly.
>>
>>
>> For all on the dev list, be aware that audio is in a state of flux and
>> while we'd like to avoid defects they are likely. The Multimedia WG is
>> putting substantial effort into having a "just works" level of quality
>> for supported boards.
>>
>> A very bit thank you is in order for Wei Feng for his hard work on
>> 11.12! Good job! One small sound for an ARM board, but a big noise for
>> Linaro when we can say, "It just works."

That's cool, still want to test the support, but nice to know that
it's working at Panda.

> That is indeed good news, thanks a lot guys.
>
> About Panda UCM, last week I noticed though that there is different wiring
> on input side between 4430 Panda (line in goes to analogue headset mic
> inputs on twl6040) and 4460 Panda (line in goes to FM analogue inputs).  So
> this week I plan to make changes to the onboard audio driver to change its
> alsa card name based on what board it's on, with a view to elaborating out
> the UCM directories so the recording case is handled correctly depending on
> the board.
>
> At the moment, the two recording cases in UCM for Panda anyway are broken so
> hopefully there'll be fixes for that too.

Do you have any idea when you'll be pushing the new patches?

Thanks,
-- 
Ricardo Salveti de Araujo

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


[PATCH 1/2] Exynos: PWM: Add TCMPB3 field in pwm structure

2011-12-18 Thread Chander Kashyap
Add TCMPB3 field in pwm structure, earliar this was res1.

Signed-off-by: Chander Kashyap 
---
 arch/arm/include/asm/arch-exynos/pwm.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/include/asm/arch-exynos/pwm.h 
b/arch/arm/include/asm/arch-exynos/pwm.h
index d0cf3cb..3e95160 100644
--- a/arch/arm/include/asm/arch-exynos/pwm.h
+++ b/arch/arm/include/asm/arch-exynos/pwm.h
@@ -57,7 +57,7 @@ struct s5p_timer {
unsigned inttcmpb2;
unsigned inttcnto2;
unsigned inttcntb3;
-   unsigned intres1;
+   unsigned inttcmpb3;
unsigned inttcnto3;
unsigned inttcntb4;
unsigned inttcnto4;
-- 
1.7.5.4


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


[PATCH 0/2] Exynos Related fixes

2011-12-18 Thread Chander Kashyap
Chander Kashyap (2):
  Exynos: PWM: Add TCMPB3 field in pwm structure
  Exynos: Fix ARM Clock frequency calculation

 arch/arm/cpu/armv7/exynos/clock.c  |9 ++---
 arch/arm/include/asm/arch-exynos/pwm.h |2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)

-- 
1.7.5.4


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


[PATCH] Origen: Select SCLKMPLL as FIMD0 parent clock

2011-12-18 Thread Chander Kashyap
Signed-off-by: Chander Kashyap 
---
 board/samsung/origen/lowlevel_init.S |5 +
 board/samsung/origen/origen_setup.h  |   12 
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/board/samsung/origen/lowlevel_init.S 
b/board/samsung/origen/lowlevel_init.S
index 0eebbfc..9283201 100644
--- a/board/samsung/origen/lowlevel_init.S
+++ b/board/samsung/origen/lowlevel_init.S
@@ -158,6 +158,11 @@ system_clock_init:
ldr r2, =CLK_SRC_PERIL0_OFFSET
str r1, [r0, r2]
 
+   /* FIMD0 */
+   ldr r1, =CLK_SRC_LCD0_VAL
+   ldr r2, =CLK_SRC_LCD0_OFFSET
+   str r1, [r0, r2]
+
/* wait ?us */
mov r1, #0x1
 3: subsr1, r1, #1
diff --git a/board/samsung/origen/origen_setup.h 
b/board/samsung/origen/origen_setup.h
index d949ad2..94a 100644
--- a/board/samsung/origen/origen_setup.h
+++ b/board/samsung/origen/origen_setup.h
@@ -56,6 +56,8 @@
 #define CLK_SRC_PERIL0_OFFSET  0xC250
 #define CLK_DIV_PERIL0_OFFSET  0xC550
 
+#define CLK_SRC_LCD0_OFFSET0xC234
+
 #define APLL_LOCK_OFFSET   0x14000
 #define MPLL_LOCK_OFFSET   0x14008
 #define APLL_CON0_OFFSET   0x14100
@@ -351,6 +353,16 @@
| (UART1_RATIO << 4) \
| (UART0_RATIO << 0))
 
+/* CLK_SRC_LCD0 */
+#define FIMD_SEL_SCLKMPLL  6
+#define MDNIE0_SEL_XUSBXTI 1
+#define MDNIE_PWM0_SEL_XUSBXTI 1
+#define MIPI0_SEL_XUSBXTI  1
+#define CLK_SRC_LCD0_VAL   ((MIPI0_SEL_XUSBXTI << 12) \
+   | (MDNIE_PWM0_SEL_XUSBXTI << 8) \
+   | (MDNIE0_SEL_XUSBXTI << 4) \
+   | (FIMD_SEL_SCLKMPLL << 0))
+
 /* Required period to generate a stable clock output */
 /* PLL_LOCK_TIME */
 #define PLL_LOCKTIME   0x1C20
-- 
1.7.5.4


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


[PATCH 2/2] Exynos: Fix ARM Clock frequency calculation

2011-12-18 Thread Chander Kashyap
Earliar ARM clock frequency was calculated by:
MOUTAPLL/(DIVAPLL + 1) which is actually returning SCLKAPLL.
It is fixed by calcuating it as follows:
ARMCLK=MOUTCORE/(DIVCORE + 1)/DIVCORE2 + 1)

Signed-off-by: Chander Kashyap 
---
 arch/arm/cpu/armv7/exynos/clock.c |9 ++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
b/arch/arm/cpu/armv7/exynos/clock.c
index 64de262..17ff012 100644
--- a/arch/arm/cpu/armv7/exynos/clock.c
+++ b/arch/arm/cpu/armv7/exynos/clock.c
@@ -103,14 +103,17 @@ static unsigned long exynos4_get_arm_clk(void)
(struct exynos4_clock *)samsung_get_base_clock();
unsigned long div;
unsigned long dout_apll;
-   unsigned int apll_ratio;
+   unsigned int core_ratio;
+   unsigned int core2_ratio;
 
div = readl(&clk->div_cpu0);
 
/* APLL_RATIO: [26:24] */
-   apll_ratio = (div >> 24) & 0x7;
+   core_ratio = (div >> 0) & 0x7;
+   core2_ratio = (div >> 28) & 0x7;
 
-   dout_apll = get_pll_clk(APLL) / (apll_ratio + 1);
+   dout_apll = get_pll_clk(APLL) / (core_ratio + 1);
+   dout_apll /= (core2_ratio + 1);
 
return dout_apll;
 }
-- 
1.7.5.4


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


Re: Updated Pulse Audio + alsa-lib for 11.12

2011-12-18 Thread Feng Wei
> About Panda UCM, last week I noticed though that there is different wiring
> on input side between 4430 Panda (line in goes to analogue headset mic
> inputs on twl6040) and 4460 Panda (line in goes to FM analogue inputs).  So
> this week I plan to make changes to the onboard audio driver to change its
> alsa card name based on what board it's on, with a view to elaborating out
> the UCM directories so the recording case is handled correctly depending on
> the board.
That's my concern too. The first thing is we need directories under
/usr/share/alsa/ucm with the same audio card names on both panda
boards. The second thing is to have correct configurations for both
boards. I don't have a 4460 board, Andy, can you help on giving the
ucm configurations for it?

-- 
Wei.Feng (irc wei_feng)
Linaro Multimedia Team
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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


Re: [PATCH] i2c-s3c2410: Fix return code of s3c24xx_i2c_parse_dt_gpio

2011-12-18 Thread Tushar Behera

Ping

On 12/09/2011 03:33 PM, Tushar Behera wrote:

s3c24xx_i2c_parse_dt_gpio is called when cfg_gpio is not defined
in the platform data of the i2c device. When DT is not enabled,
the above function always returns -EINVAL. Since there can be
some i2c devices which don't need to configure any gpio lines,
the probe of such devices would fail here. Changing the default
return value to success would fix this issue.

Signed-off-by: Tushar Behera
---
This patch is rebased on Kukjin's for-next branch.
d3d936c "Merge branch 'samsung-fixes-2' into for-next"

  drivers/i2c/busses/i2c-s3c2410.c |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c
index 2754cef..b5caa42 100644
--- a/drivers/i2c/busses/i2c-s3c2410.c
+++ b/drivers/i2c/busses/i2c-s3c2410.c
@@ -786,7 +786,7 @@ static void s3c24xx_i2c_dt_gpio_free(struct s3c24xx_i2c 
*i2c)
  #else
  static int s3c24xx_i2c_parse_dt_gpio(struct s3c24xx_i2c *i2c)
  {
-   return -EINVAL;
+   return 0;
  }

  static void s3c24xx_i2c_dt_gpio_free(struct s3c24xx_i2c *i2c)



--
Tushar Behera

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


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

2011-12-18 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 V3 1/7] ARM: add cpufreq transiton notifier to adjust loops_per_jiffy for smp

2011-12-18 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 V3 4/7] cpufreq: add generic cpufreq driver

2011-12-18 Thread Richard Zhao
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/generic-cpufreq|7 +
 drivers/cpufreq/Kconfig|8 +
 drivers/cpufreq/Makefile   |2 +
 drivers/cpufreq/generic-cpufreq.c  |  251 
 4 files changed, 268 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/cpufreq/generic-cpufreq
 create mode 100644 drivers/cpufreq/generic-cpufreq.c

diff --git a/Documentation/devicetree/bindings/cpufreq/generic-cpufreq 
b/Documentation/devicetree/bindings/cpufreq/generic-cpufreq
new file mode 100644
index 000..15dd780
--- /dev/null
+++ b/Documentation/devicetree/bindings/cpufreq/generic-cpufreq
@@ -0,0 +1,7 @@
+Generic cpufreq driver
+
+Required properties in /cpus/cpu@0:
+- compatible : "generic-cpufreq"
+- cpu-freqs : cpu frequency points it support
+- cpu-volts : cpu voltages required by the frequency point at the same index
+- trans-latency :  transition_latency
diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
index e24a2a1..216eecd 100644
--- a/drivers/cpufreq/Kconfig
+++ b/drivers/cpufreq/Kconfig
@@ -179,6 +179,14 @@ config CPU_FREQ_GOV_CONSERVATIVE
 
  If in doubt, say N.
 
+config GENERIC_CPUFREQ_DRIVER
+   bool "Generic cpufreq driver using clock/regulator/devicetree"
+   help
+ This adds generic CPUFreq driver. 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..2dbdab1 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_GENERIC_CPUFREQ_DRIVER)   += generic-cpufreq.o
+
 
##
 # x86 drivers.
 # Link order matters. K8 is preferred to ACPI because of firmware bugs in early
diff --git a/drivers/cpufreq/generic-cpufreq.c 
b/drivers/cpufreq/generic-cpufreq.c
new file mode 100644
index 000..781bb9b
--- /dev/null
+++ b/drivers/cpufreq/generic-cpufreq.c
@@ -0,0 +1,251 @@
+/*
+ * 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
+ */
+
+#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 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)
+   regulator_set_voltage(cpu_reg,
+   cpu_volts[index], cpu_volts[index]);
+
+   ret = clk_set_rate(cpu_clk, freq);
+   if (ret != 0) {
+   pr_err("generic-cpufreq: cannot set CPU clock rate\n");
+   return ret;
+   }
+
+   if (!higher && cpu_reg)
+   regulator_set_voltage(cpu_reg,
+   cpu_volts[index], cpu_volts[index]);
+
+   return ret;
+}
+
+static int generic_verify_speed(struct cpufreq_policy *policy)
+{
+   return cpufreq_frequency_table_verify(policy, freq_table);
+}
+
+static unsigned int generic_get_speed(unsigned int cpu)
+{
+   return clk_get_rate(cpu_clk) / 1000;
+}
+
+static int generic_set_target(struct cpufreq_policy *policy,
+ unsigned int target_freq, unsigned int relation)
+{
+   struct cpufreq_freqs freqs;
+   unsigned long freq_Hz;
+   int cpu;
+   int ret = 0;
+   unsigned int index;
+
+   cpufreq_frequency_table_target(policy, freq_table,
+   target_freq, relation, &index);
+   freq_Hz = clk_round_rate(cpu_clk, cpu_freqs[index]);
+   freq_Hz = freq_Hz ? freq_Hz : cpu_freqs[index];
+   freqs.old = clk_get_rate(cpu_clk) / 1000;
+   freqs.new = freq_Hz / 1000;
+   freqs.flags = 0;
+
+   if (freqs.old == freqs.new)
+   return 0;
+
+   for_each_possible_cpu(cpu) {
+   freqs.cpu = cpu;
+   cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
+   }
+
+   ret = set_cpu_freq(freq_Hz, index, (freqs.new > freqs.old));
+
+   for_each_possible_cpu(cpu) 

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

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

diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi
index 263e8f3..80e47b5 100644
--- a/arch/arm/boot/dts/imx6q.dtsi
+++ b/arch/arm/boot/dts/imx6q.dtsi
@@ -26,9 +26,12 @@
#size-cells = <0>;
 
cpu@0 {
-   compatible = "arm,cortex-a9";
+   compatible = "arm,cortex-a9", "generic-cpufreq";
reg = <0>;
next-level-cache = <&L2>;
+   cpu-freqs = <99600 79200 39600 19800>;
+   cpu-volts = <1225000 110 95 85>;
+   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 V3 2/7] arm/imx: cpufreq: remove loops_per_jiffy recalculate for smp

2011-12-18 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 V3 0/7] add a generic cpufreq driver

2011-12-18 Thread Richard Zhao
The driver support single core and multi core ARM SoCs. For multi core,
it assume all cores share the same clock and voltage.

TODO:
 - Add each core seperate freq/volt support (MSM).

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 V3 1/7] ARM: add cpufreq transiton notifier to adjust
[PATCH V3 2/7] arm/imx: cpufreq: remove loops_per_jiffy recalculate
[PATCH V3 3/7] cpufreq: OMAP: remove loops_per_jiffy recalculate for
[PATCH V3 4/7] cpufreq: add generic cpufreq driver
[PATCH V3 5/7] dts/imx6q: add cpufreq property
[PATCH V3 6/7] arm/imx6q: register arm_clk as cpu to clkdev
[PATCH V3 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 V3 3/7] cpufreq: OMAP: remove loops_per_jiffy recalculate for smp

2011-12-18 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 V3 7/7] arm/imx6q: select ARCH_HAS_CPUFREQ

2011-12-18 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: [PATCH V2 1/4] cpufreq: add arm soc generic cpufreq driver

2011-12-18 Thread Richard Zhao
Hi Bryan,

On Fri, Dec 16, 2011 at 11:59:02AM -0800, Bryan Huntsman wrote:
> On 12/16/2011 02:52 AM, Jamie Iles wrote:
> >
> >> +static DEFINE_PER_CPU(unsigned long, l_p_j_ref);
> >> +static unsigned long l_p_j_ref_freq;
> >> +
> >> +static struct clk *cpu_clk;
> > 
> > This assumes that all CPU's share the same clk and run at the same rate.  
> > Is that a fair/safe assumption?  I honestly don't know the answer to 
> > this so it's just a question!!!
> 
> On MSM, cpus independently scale both frequency and voltage.  Our clock
> driver isn't upstream yet.  David Brown has a preliminary version here:
> 
> https://www.codeaurora.org/gitweb/quic/kernel/?p=davidb/linux-msm.git;a=shortlog;h=refs/heads/msm-clock-rfc
> 
> Once we get our driver upstream, MSM will be an exception and not select
> ARM_GENERIC_CPUFREQ.  We'll probably have a separate msm-cpufreq.c
> driver under drivers/cpufreq/.
Do you have to patch to implement per-cpu udelay? In current code, udelay uses
global loops_per_jiffy.

Thanks
Richard
> 
> - Bryan
> 
> -- 
> Sent by an employee of the Qualcomm Innovation Center, Inc.
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
> 
> ___
> 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


Re: Updated Pulse Audio + alsa-lib for 11.12

2011-12-18 Thread Andy Green

On 12/19/2011 12:17 AM, Somebody in the thread at some point said:

Hi Ricardo,

With working HDMI output on the original panda board, and Wei's new
release of patches to alsa-lib and pulseaudio, I've updated both
alsa-lib and pulseaudio for 11.12 in ppa:linaro-maintainers/overlay.
Sound on the panda over HDMI from my testing works out of the box.
It's not perfect but it works. I will repeat this same test with my
imx53 shortly.


For all on the dev list, be aware that audio is in a state of flux and
while we'd like to avoid defects they are likely. The Multimedia WG is
putting substantial effort into having a "just works" level of quality
for supported boards.

A very bit thank you is in order for Wei Feng for his hard work on
11.12! Good job! One small sound for an ARM board, but a big noise for
Linaro when we can say, "It just works."


That is indeed good news, thanks a lot guys.

About Panda UCM, last week I noticed though that there is different 
wiring on input side between 4430 Panda (line in goes to analogue 
headset mic inputs on twl6040) and 4460 Panda (line in goes to FM 
analogue inputs).  So this week I plan to make changes to the onboard 
audio driver to change its alsa card name based on what board it's on, 
with a view to elaborating out the UCM directories so the recording case 
is handled correctly depending on the board.


At the moment, the two recording cases in UCM for Panda anyway are 
broken so hopefully there'll be fixes for that 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


Updated Pulse Audio + alsa-lib for 11.12

2011-12-18 Thread Tom Gall
Hi Ricardo,

With working HDMI output on the original panda board, and Wei's new
release of patches to alsa-lib and pulseaudio, I've updated both
alsa-lib and pulseaudio for 11.12 in ppa:linaro-maintainers/overlay.
Sound on the panda over HDMI from my testing works out of the box.
It's not perfect but it works. I will repeat this same test with my
imx53 shortly.


For all on the dev list, be aware that audio is in a state of flux and
while we'd like to avoid defects they are likely. The Multimedia WG is
putting substantial effort into having a "just works" level of quality
for supported boards.

A very bit thank you is in order for Wei Feng for his hard work on
11.12! Good job! One small sound for an ARM board, but a big noise for
Linaro when we can say, "It just works."

-- 
Regards,
Tom

"Where's the kaboom!? There was supposed to be an earth-shattering
kaboom!" Marvin Martian
Multimedia Tech Lead | Linaro.org │ Open source software for ARM SoCs
w) tom.gall att linaro.org
w) tom_gall att vnet.ibm.com
h) tom_gall att mac.com

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


Re: "struct user" conflicts on arm

2011-12-18 Thread peter green



ISO C99 says that WCHAR_MAX must be a constant expression and the
above definition is such an expression. Technically the program needs
fixing (see below though for the "standards matter but so do users"),
there is nothing wrong with a type cast and a constant value e.g.
signed -1 converted to unsigned int (ARM GNU/Linux value for wchar_t).

However, the real issue here is that it differs from x86, the most
common architecture, and differences from x86 cause porting problems.
The patch itself is insufficient because it doesn't take into account
wordsize. When we switch to the 64-bit ARM ABI it should just work.
Therefore you need to check for __WORDSIZE and *only* define a value
if we are *not* 64-bits. You don't want to define anything for the
64-bit case until the 64-bit ARM ABI is out and finalized.
  
Thanks for the info, I may look at this later. The ucontext namespace 
pollution

seems to be a bigger issue though.


Your patch to fix ucontext namespace pollution looks good, please post
that to libc-ports for review
should I send it immidiately or should I wait until I have test results 
to give them?

 and make sure to state what testing
you've done with the patch. At a minimum you should run the glibc
testsuite 
Afaict the debian packaging automatically runs the testsuite and 
compares it against
a list of expected failures (ideally that list would be empty but in 
real life).


Right now i'm running into unexpected testsuite failures (unfortunately 
the last
test build I didn't take a log of so i've got to run it again to find 
out details of the
failures) but I do not know if those failures are related to my patch, 
related to

changes in the build environment since the package was last built in debian
or related to my hardware. Further testing will be neeed to establish 
that (and

said testing takes a while, a beagleboard xm isn't exactly a speed demon).


and build gdb with those newly installed headers.
  
Will do once I get glibc built and installed, are there any specific 
tests you

want doing with gdb or is testing it still builds sufficient??


Cheers,
Carlos.
  

Thanks for the help and advice so-far.

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


Re: "struct user" conflicts on arm

2011-12-18 Thread Carlos O'Donell
On Sat, Dec 17, 2011 at 7:54 PM, peter green  wrote:
>> Your patch to fix ucontext namespace pollution looks good, please post
>> that to libc-ports for review
>
> should I send it immidiately or should I wait until I have test results to
> give them?

Wait until the test results are complete and you've built gdb, this
allows your patch to be accepted immediately if the maintainers agree
that it's a good thing.

>>  and make sure to state what testing
>> you've done with the patch. At a minimum you should run the glibc
>> testsuite
>
> Afaict the debian packaging automatically runs the testsuite and compares it
> against
> a list of expected failures (ideally that list would be empty but in real
> life).

Upstream wants to know that no new failures appeared with your patch.

>> and build gdb with those newly installed headers.
>
> Will do once I get glibc built and installed, are there any specific tests
> you want doing with gdb or is testing it still builds sufficient??

In this case I think building gdb is sufficient.

However, the strongest case would be made by showing no regressions in
the gdb testsuite with and without your glibc patch.

Cheers,
Carlos.

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


Re: [PATCH V2 1/4] cpufreq: add arm soc generic cpufreq driver

2011-12-18 Thread Richard Zhao
On Sat, Dec 17, 2011 at 10:29:29AM +0100, Arnd Bergmann wrote:
> On Saturday 17 December 2011 16:00:03 Richard Zhao wrote:
> > On Fri, Dec 16, 2011 at 08:32:35AM -0600, Rob Herring wrote:
> > > On 12/16/2011 04:30 AM, Richard Zhao wrote:
> > > > It support single core and multi-core ARM SoCs. But it assume
> > > > all cores share the same frequency and voltage.
> > > > 
> > > > Signed-off-by: Richard Zhao 
> > > > ---
> > > >  drivers/cpufreq/Kconfig.arm   |8 ++
> > > >  drivers/cpufreq/Makefile  |1 +
> > > >  drivers/cpufreq/arm-cpufreq.c |  269 
> > > > +
> > > >  3 files changed, 278 insertions(+), 0 deletions(-)
> > > >  create mode 100644 drivers/cpufreq/arm-cpufreq.c
> > > > 
> > > 
> > > What makes this specific to ARM and not a generic DT + clk api +
> > > regulator api driver?
> >
> > smp loops_per_jiffy update needs arm header .
> 
> I would suggest to instead change the definition of adjust_jiffies in the
> core so it can be overridden by the architecture, like this
> 
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 987a165..174584d 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -189,6 +189,7 @@ EXPORT_SYMBOL_GPL(cpufreq_cpu_put);
>   * systems as each CPU might be scaled differently. So, use the arch
>   * per-CPU loops_per_jiffy value wherever possible.
>   */
> +#ifndef adjust_jiffies
>  #ifndef CONFIG_SMP
>  static unsigned long l_p_j_ref;
>  static unsigned int  l_p_j_ref_freq;
> @@ -218,7 +219,8 @@ static inline void adjust_jiffies(unsigned long val, 
> struct cpufreq_freqs *ci)
>  {
> return;
>  }
> -#endif
> +#endif /* CONFIG_SMP */
> +#endif /* adjust_jiffies */
>  
>  
>  /**
> 
> 
> Then ARM (and any others that want the driver) can provide their own
> implementation and set 
> 
> #define adjust_jiffies(val, ci) adjust_jiffies((val), (ci))
> 
> to let the core use that instead of the generic UP version.
> 
> 
> While we're there, we should probably try to fix drivers that use 
> loops_per_jiffy,
> because that is not what they think it is on SMP.
Or let different arch register its different CPUFREQ_TRANSITION_NOTIFIER ?

Thanks
Richard
> 
>   Arnd
> 
> ___
> 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