Re: [PATCH 2/6] ARM: DTS: da850: Add node for edma0

2014-07-31 Thread Sekhar Nori
On Friday 01 August 2014 10:39 AM, Peter Ujfalusi wrote:
> On 07/31/2014 05:26 PM, Sergei Shtylyov wrote:
>> On 07/31/2014 02:18 PM, Peter Ujfalusi wrote:
>>
>>> Add DT node for edma0.
>>
>>> Signed-off-by: Peter Ujfalusi 
>>> ---
>>>   arch/arm/boot/dts/da850.dtsi | 6 ++
>>>   1 file changed, 6 insertions(+)
>>
>>> diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
>>> index b695548dbb4e..41ce4e8bf227 100644
>>> --- a/arch/arm/boot/dts/da850.dtsi
>>> +++ b/arch/arm/boot/dts/da850.dtsi
>>> @@ -150,6 +150,12 @@
>>>   };
>>>
>>>   };
>>> +edma0: edma@01c0 {
>>> +compatible = "ti,edma3";
>>> +reg =<0x0 0x1>;
>>
>>Why the mismatch between the unit-address part of the node name and the
>> "reg" property?
> 
> For some reason the whole da850 uses offset from 0x01c0 for the SoC IPs.
> The nodes are under 'soc' and that has the ranges attribute.
> I do not really like this either.

There is no reason I can remember for why we chose to go the offset +
ranges way. Probably based it on an early OMAP example. Right now lets
keep it that way unless there is a big disadvantage.

Thanks,
Sekhar
___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH v2 3/6] ARM: DTS: da850: Add node for McASP

2014-07-31 Thread Peter Ujfalusi
Node for mcasp0

Signed-off-by: Peter Ujfalusi 
---
 arch/arm/boot/dts/da850.dtsi | 13 +
 1 file changed, 13 insertions(+)

diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
index 41ce4e8bf227..0bd98cd00816 100644
--- a/arch/arm/boot/dts/da850.dtsi
+++ b/arch/arm/boot/dts/da850.dtsi
@@ -276,6 +276,19 @@
ti,davinci-gpio-unbanked = <0>;
status = "disabled";
};
+
+   mcasp0: mcasp@01d0 {
+   compatible = "ti,da830-mcasp-audio";
+   reg = <0x10 0x2000>,
+ <0x102000 0x40>;
+   reg-names = "mpu", "dat";
+   interrupts = <54>;
+   interrupt-names = "common";
+   status = "disabled";
+   dmas = <&edma0 1>,
+   <&edma0 0>;
+   dma-names = "tx", "rx";
+   };
};
nand_cs3@6200 {
compatible = "ti,davinci-nand";
-- 
2.0.2

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH v2 6/6] ARM: DTS: da850-evm: Enable audio via simple-card

2014-07-31 Thread Peter Ujfalusi
The audio on the board is using McASP <-> tlv320aic3106 codec and we have
LineIn and LineOut jacks.

Signed-off-by: Peter Ujfalusi 
---
 arch/arm/boot/dts/da850-evm.dts | 29 +
 1 file changed, 29 insertions(+)

diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts
index 41715b495861..4f935ad9f27b 100644
--- a/arch/arm/boot/dts/da850-evm.dts
+++ b/arch/arm/boot/dts/da850-evm.dts
@@ -52,6 +52,7 @@
reg = <0x48>;
};
tlv320aic3106: tlv320aic3106@18 {
+   #sound-dai-cells = <0>;
compatible = "ti,tlv320aic3106";
reg = <0x18>;
status = "okay";
@@ -142,6 +143,33 @@
regulator-max-microvolt = <500>;
regulator-boot-on;
};
+
+   sound {
+   compatible = "simple-audio-card";
+   simple-audio-card,name = "DA850/OMAP-L138 EVM";
+   simple-audio-card,widgets =
+   "Line", "Line In",
+   "Line", "Line Out";
+   simple-audio-card,routing =
+   "LINE1L", "Line In",
+   "LINE1R", "Line In",
+   "Line Out", "LLOUT",
+   "Line Out", "RLOUT";
+   simple-audio-card,format = "dsp_b";
+   simple-audio-card,bitclock-master = <&link0_codec>;
+   simple-audio-card,frame-master = <&link0_codec>;
+   simple-audio-card,bitclock-inversion;
+
+   simple-audio-card,cpu {
+   sound-dai = <&mcasp0>;
+   system-clock-frequency = <24576000>;
+   };
+
+   link0_codec: simple-audio-card,codec {
+   sound-dai = <&tlv320aic3106>;
+   system-clock-frequency = <24576000>;
+   };
+   };
 };
 
 /include/ "tps6507x.dtsi"
@@ -197,6 +225,7 @@
 };
 
 &mcasp0 {
+   #sound-dai-cells = <0>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&mcasp0_pins>;
-- 
2.0.2

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH v2 4/6] ARM: DTS: da850-evm: Enable McASP via DT boot

2014-07-31 Thread Peter Ujfalusi
Add pinctrl nodes for the McASP0 pins and configure McASP to the desired
mode for the board.

Signed-off-by: Peter Ujfalusi 
---
 arch/arm/boot/dts/da850-evm.dts | 30 ++
 1 file changed, 30 insertions(+)

diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts
index 1e11e5a5f723..1422c311af4c 100644
--- a/arch/arm/boot/dts/da850-evm.dts
+++ b/arch/arm/boot/dts/da850-evm.dts
@@ -17,6 +17,18 @@
soc {
pmx_core: pinmux@1c14120 {
status = "okay";
+
+   mcasp0_pins: pinmux_mcasp0_pins {
+   pinctrl-single,bits = <
+   /*
+* AHCLKX, ACLKX, AFSX, AHCLKR, ACLKR,
+* AFSR, AMUTE
+*/
+   0x00 0x 0x
+   /* AXR11, AXR12 */
+   0x04 0x00011000 0x000ff000
+   >;
+   };
};
serial0: serial@1c42000 {
status = "okay";
@@ -170,3 +182,21 @@
};
};
 };
+
+&mcasp0 {
+   status = "okay";
+   pinctrl-names = "default";
+   pinctrl-0 = <&mcasp0_pins>;
+
+   op-mode = <0>;  /* MCASP_IIS_MODE */
+   tdm-slots = <2>;
+   /* 4 serializer */
+   serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
+   0 0 0 0
+   0 0 0 0
+   0 0 0 1
+   2 0 0 0
+   >;
+   tx-num-evt = <32>;
+   rx-num-evt = <32>;
+};
-- 
2.0.2

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH v2 5/6] ARM: DTS: da850-evm: Add node for tlv320aic3106 codec

2014-07-31 Thread Peter Ujfalusi
The board uses aic3106 for audio.

Signed-off-by: Peter Ujfalusi 
---
 arch/arm/boot/dts/da850-evm.dts | 13 +
 1 file changed, 13 insertions(+)

diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts
index 1422c311af4c..41715b495861 100644
--- a/arch/arm/boot/dts/da850-evm.dts
+++ b/arch/arm/boot/dts/da850-evm.dts
@@ -51,6 +51,19 @@
tps: tps@48 {
reg = <0x48>;
};
+   tlv320aic3106: tlv320aic3106@18 {
+   compatible = "ti,tlv320aic3106";
+   reg = <0x18>;
+   status = "okay";
+
+   /* Regulators */
+   IOVDD-supply = <&vdcdc2_reg>;
+   /* Derived from VBAT: Baseboard 3.3V / 1.8V */
+   AVDD-supply = <&vbat>;
+   DRVDD-supply = <&vbat>;
+   DVDD-supply = <&vbat>;
+   };
+
};
wdt: wdt@1c21000 {
status = "okay";
-- 
2.0.2

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH v2 1/6] ARM: davinci: da8xx-dt: add OF_DEV_AUXDATA entry for mcasp0

2014-07-31 Thread Peter Ujfalusi
Add OF_DEV_AUXDATA for mcasp to be able to use clocks.

Signed-off-by: Peter Ujfalusi 
---
 arch/arm/mach-davinci/da8xx-dt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
index ed1928740b5f..f703d82f08a8 100644
--- a/arch/arm/mach-davinci/da8xx-dt.c
+++ b/arch/arm/mach-davinci/da8xx-dt.c
@@ -46,6 +46,7 @@ static struct of_dev_auxdata da850_auxdata_lookup[] 
__initdata = {
OF_DEV_AUXDATA("ti,davinci_mdio", 0x01e24000, "davinci_mdio.0", NULL),
OF_DEV_AUXDATA("ti,davinci-dm6467-emac", 0x01e2, "davinci_emac.1",
   NULL),
+   OF_DEV_AUXDATA("ti,da830-mcasp-audio", 0x01d0, "davinci-mcasp.0", 
NULL),
{}
 };
 
-- 
2.0.2

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH v2 2/6] ARM: DTS: da850: Add node for edma0

2014-07-31 Thread Peter Ujfalusi
Add DT node for edma0.

Signed-off-by: Peter Ujfalusi 
---
 arch/arm/boot/dts/da850.dtsi | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
index b695548dbb4e..41ce4e8bf227 100644
--- a/arch/arm/boot/dts/da850.dtsi
+++ b/arch/arm/boot/dts/da850.dtsi
@@ -150,6 +150,12 @@
};
 
};
+   edma0: edma@01c0 {
+   compatible = "ti,edma3";
+   reg =   <0x0 0x1>;
+   interrupts = <11 13 12>;
+   #dma-cells = <1>;
+   };
serial0: serial@1c42000 {
compatible = "ns16550a";
reg = <0x42000 0x100>;
-- 
2.0.2

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH v2 0/6] ARM: DT/davinci: Audio for da850-evm in DT boot

2014-07-31 Thread Peter Ujfalusi
Hi,

Changes since v1:
- fixed the address missmatch for tlv320aic3106 codec (@1b -> 18)
- The edma patches has been taken by Vinod, they should be in linux-next soon.

The following series will enable audio via simple card on the board when booted
with DT.

For edma one patch is needed to have working dma:
http://marc.info/?l=linux-omap&m=140680159327749&w=2

Regards,
Peter
---
Peter Ujfalusi (6):
  ARM: davinci: da8xx-dt: add OF_DEV_AUXDATA entry for mcasp0
  ARM: DTS: da850: Add node for edma0
  ARM: DTS: da850: Add node for McASP
  ARM: DTS: da850-evm: Enable McASP via DT boot
  ARM: DTS: da850-evm: Add node for tlv320aic3106 codec
  ARM: DTS: da850-evm: Enable audio via simple-card

 arch/arm/boot/dts/da850-evm.dts  | 72 
 arch/arm/boot/dts/da850.dtsi | 19 +++
 arch/arm/mach-davinci/da8xx-dt.c |  1 +
 3 files changed, 92 insertions(+)

-- 
2.0.2

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [PATCH 5/6] ARM: DTS: da850-evm: Add node for tlv320aic3106 codec

2014-07-31 Thread Peter Ujfalusi
On 07/31/2014 05:24 PM, Sergei Shtylyov wrote:
> Hello.
> 
> On 07/31/2014 02:18 PM, Peter Ujfalusi wrote:
> 
>> The board uses aic3106 for audio.
> 
>> Signed-off-by: Peter Ujfalusi 
>> ---
>>   arch/arm/boot/dts/da850-evm.dts | 14 ++
>>   1 file changed, 14 insertions(+)
> 
>> diff --git a/arch/arm/boot/dts/da850-evm.dts 
>> b/arch/arm/boot/dts/da850-evm.dts
>> index 09118c72e83f..b9ef2be0b145 100644
>> --- a/arch/arm/boot/dts/da850-evm.dts
>> +++ b/arch/arm/boot/dts/da850-evm.dts
>> @@ -51,6 +51,20 @@
>>   tps: tps@48 {
>>   reg = <0x48>;
>>   };
>> +tlv320aic3106: tlv320aic3106@1b {
> 
>The "reg" property is <0x18>, why the unit-address part of a name is
> different?

True, I have lifted the codec part from other dts file and overlooked the
unit-address.
I will resend the series with this fixed.


> Also, the ePAPR standard [1] says:
> 
> The name of a node should be somewhat generic, reflecting the function of the
> device and not its precise programming model.

True. This is why the node for the audio support is named as 'sound'. For the
components, like in this case I do not see issue to call the audio codec with
it's name.

> 
>> +#sound-dai-cells = <0>;
>> +compatible = "ti,tlv320aic3106";
>> +reg = <0x18>;
>> +status = "okay";
>> +
>> +/* Regulators */
>> +IOVDD-supply = <&vdcdc2_reg>;
>> +/* Derived from VBAT: Baseboard 3.3V / 1.8V */
>> +AVDD-supply = <&vbat>;
>> +DRVDD-supply = <&vbat>;
>> +DVDD-supply = <&vbat>;
>> +};
>> +
> 
> [1] http://www.power.org/resources/downloads/Power_ePAPR_APPROVED_v1.0.pdf

BTW: there's a newer version available:
https://www.power.org/wp-content/uploads/2012/06/Power_ePAPR_APPROVED_v1.1.pdf

> 
> WBR, Sergei
> 


-- 
Péter
___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [PATCH 2/6] ARM: DTS: da850: Add node for edma0

2014-07-31 Thread Peter Ujfalusi
On 07/31/2014 05:26 PM, Sergei Shtylyov wrote:
> On 07/31/2014 02:18 PM, Peter Ujfalusi wrote:
> 
>> Add DT node for edma0.
> 
>> Signed-off-by: Peter Ujfalusi 
>> ---
>>   arch/arm/boot/dts/da850.dtsi | 6 ++
>>   1 file changed, 6 insertions(+)
> 
>> diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
>> index b695548dbb4e..41ce4e8bf227 100644
>> --- a/arch/arm/boot/dts/da850.dtsi
>> +++ b/arch/arm/boot/dts/da850.dtsi
>> @@ -150,6 +150,12 @@
>>   };
>>
>>   };
>> +edma0: edma@01c0 {
>> +compatible = "ti,edma3";
>> +reg =<0x0 0x1>;
> 
>Why the mismatch between the unit-address part of the node name and the
> "reg" property?

For some reason the whole da850 uses offset from 0x01c0 for the SoC IPs.
The nodes are under 'soc' and that has the ranges attribute.
I do not really like this either.

> 
>> +interrupts = <11 13 12>;
>> +#dma-cells = <1>;
>> +};
> 
> WBR, Sergei
> 

-- 
Péter
___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [PATCH 2/6] ARM: DTS: da850: Add node for edma0

2014-07-31 Thread Sergei Shtylyov

On 07/31/2014 02:18 PM, Peter Ujfalusi wrote:


Add DT node for edma0.



Signed-off-by: Peter Ujfalusi 
---
  arch/arm/boot/dts/da850.dtsi | 6 ++
  1 file changed, 6 insertions(+)



diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
index b695548dbb4e..41ce4e8bf227 100644
--- a/arch/arm/boot/dts/da850.dtsi
+++ b/arch/arm/boot/dts/da850.dtsi
@@ -150,6 +150,12 @@
};

};
+   edma0: edma@01c0 {
+   compatible = "ti,edma3";
+   reg =   <0x0 0x1>;


   Why the mismatch between the unit-address part of the node name and the 
"reg" property?



+   interrupts = <11 13 12>;
+   #dma-cells = <1>;
+   };


WBR, Sergei

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [PATCH 5/6] ARM: DTS: da850-evm: Add node for tlv320aic3106 codec

2014-07-31 Thread Sergei Shtylyov

Hello.

On 07/31/2014 02:18 PM, Peter Ujfalusi wrote:


The board uses aic3106 for audio.



Signed-off-by: Peter Ujfalusi 
---
  arch/arm/boot/dts/da850-evm.dts | 14 ++
  1 file changed, 14 insertions(+)



diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts
index 09118c72e83f..b9ef2be0b145 100644
--- a/arch/arm/boot/dts/da850-evm.dts
+++ b/arch/arm/boot/dts/da850-evm.dts
@@ -51,6 +51,20 @@
tps: tps@48 {
reg = <0x48>;
};
+   tlv320aic3106: tlv320aic3106@1b {


   The "reg" property is <0x18>, why the unit-address part of a name is 
different? Also, the ePAPR standard [1] says:


The name of a node should be somewhat generic, reflecting the function of the 
device and not its precise programming model.



+   #sound-dai-cells = <0>;
+   compatible = "ti,tlv320aic3106";
+   reg = <0x18>;
+   status = "okay";
+
+   /* Regulators */
+   IOVDD-supply = <&vdcdc2_reg>;
+   /* Derived from VBAT: Baseboard 3.3V / 1.8V */
+   AVDD-supply = <&vbat>;
+   DRVDD-supply = <&vbat>;
+   DVDD-supply = <&vbat>;
+   };
+


[1] http://www.power.org/resources/downloads/Power_ePAPR_APPROVED_v1.0.pdf

WBR, Sergei

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [PATCH 00/16] i2c: drop class based instantiaion for selected drivers

2014-07-31 Thread Lothar Waßmann
Hi,

Wolfram Sang wrote:
> Some drivers were flagged to remove class based instantiation soon to improve
> boot-up time. Originally, I was planning for a longer deprecation time so 
> users
> could switch over to some other kind of instantiation. However, the demand for
> the speed up is high enough and class based instantiation is used rarely, so
> the removal takes place now. To make up for the deprecation time, another
> warning is added to the i2c core pointing out that the behaviour has now
> changed:
> 
> + /* Warn that the adapter lost class based instantiation */
> + if (adapter->class == I2C_CLASS_DEPRECATED) {
> + dev_dbg(&adapter->dev,
> + "This adapter dropped support for I2C classes and "
> + "won't auto-detect %s devices anymore. If you need it, 
> check "
> + "'Documentation/i2c/instantiating-devices' for 
> alternatives.\n",
>
It's usually a bad idea to split kernel messages across source lines
because it makes searching for the corresponding source line for a
message found in the log difficult.
You could at least do the split at the sentence boundary.


Lothar Waßmann
-- 
___

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | i...@karo-electronics.de
___
___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


RE: i2c-davinci.c: CPU FREQ causes lock up due to xfr_complete

2014-07-31 Thread Brian Niebuhr


> -Original Message-
> From: davinci-linux-open-source-boun...@linux.davincidsp.com
> [mailto:davinci-linux-open-source-boun...@linux.davincidsp.com] On
> Behalf Of Jon Cormier
> Sent: Tuesday, July 29, 2014 9:20 AM
> To: davinci-linux-open-source@linux.davincidsp.com
> Cc: Tim Iskander
> Subject: i2c-davinci.c: CPU FREQ causes lock up due to xfr_complete
>
> Reported issue:
>
> 1. Enable I2C1, flash the new kernel and reboot
> 2. Immediately after reboot, attempt to change the processor clock: "echo
> 456000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed"
> 3. Process blocks
>
> However, if we do the following:
> 1. Enable I2C1, flash the new kernel and reboot
> 2. Immediately after reboot, run: "i2cdetect -y 2 0x08 0x08" or just 
> "i2cdetect
> -y 2"
> 3. Then run: "echo 456000 >
> /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed"
> 4. Command succeeds

I found this problem as well, and I haven't had time to put together a proper 
patch.  Right now we're just working around it.  There are several problems 
with the use of a completion for this task:

1. If no I2C transfer has occurred, a cpufreq transition will block forever 
(which is the bug you found)
2. Once an I2C transfer has occurred the cpufreq transition will never block 
since the completion is never reinitialized.
3. Even if you do reinitialize the completion for every I2C transfer, (1) is 
not solved and there is still a race condition where the cpufreq transition 
could start just before an I2C transfer starts and the I2C transfer occurs 
during the cpufreq transition.

Personally I think the correct solution is to use a mutex instead of a 
completion.  The cpufreq code would take the mutex during the prechange 
callback and release it during the postchange callback.  Likewise the I2C 
transfer function would hold the mutex while an I2C transfer is ongoing.  That 
way an I2C transfer cannot occur during a cpufreq transition and vice-versa.  
As I mentioned, I have not had time to put together a proper patch, but I would 
be happy to see this issue addressed if someone else can do it.


> Here's the kernel hung task stack trace:
>
> INFO: task sh:1428 blocked for more than 120 seconds.
> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
> sh D c026dc74 0 1428 1426 0x
> [] (schedule+0x2a8/0x334) from []
> (schedule_timeout+0x1c/0x218)
> [] (schedule_timeout+0x1c/0x218) from []
> (wait_for_common+0xf0/0x1b8)
> [] (wait_for_common+0xf0/0x1b8) from []
> (i2c_davinci_cpufreq_transition+0x18/0x50)
> [] (i2c_davinci_cpufreq_transition+0x18/0x50) from []
> (notifier_call_chain+0x38/0x68)
> [] (notifier_call_chain+0x38/0x68) from []
> (__srcu_notifier_call_chain+0x40/0x58)
> [] (__srcu_notifier_call_chain+0x40/0x58) from []
> (srcu_notifier_call_chain+0x14/0x18)
> [] (srcu_notifier_call_chain+0x14/0x18) from []
> (cpufreq_notify_transition+0xc8/0xfc)
> [] (cpufreq_notify_transition+0xc8/0xfc) from []
> (davinci_target+0x144/0x154)
> [] (davinci_target+0x144/0x154) from []
> (__cpufreq_driver_target+0x28/0x38)
> [] (__cpufreq_driver_target+0x28/0x38) from []
> (cpufreq_set+0x54/0x70)
> [] (cpufreq_set+0x54/0x70) from []
> (store_scaling_setspeed+0x58/0x6c)
> [] (store_scaling_setspeed+0x58/0x6c) from []
> (store+0x58/0x74)
> [] (store+0x58/0x74) from []
> (sysfs_write_file+0x108/0x140)
> [] (sysfs_write_file+0x108/0x140) from []
> (vfs_write+0xb0/0x118)
> [] (vfs_write+0xb0/0x118) from []
> (sys_write+0x3c/0x68)
> [] (sys_write+0x3c/0x68) from []
> (ret_fast_syscall+0x0/0x28)
> Kernel panic - not syncing: hung_task: blocked tasks
> [] (unwind_backtrace+0x0/0xd0) from []
> (panic+0x44/0xc8)
> [] (panic+0x44/0xc8) from [] (watchdog+0x1d4/0x21c)
> [] (watchdog+0x1d4/0x21c) from []
> (kthread+0x78/0x80)
> [] (kthread+0x78/0x80) from []
> (kernel_thread_exit+0x0/0x8)
> According to the stack trace the kernel gets stuck in the
> "i2c_davinci_cpufreq_transition" function when it calls
> "wait_for_completion(&dev->xfr_complete);"  The two other places this
> xfr_complete variable is referenced is the init_completion in the probe and
> the complete at the end of the i2c_davinci_xfer function. My understanding
> as to what this was intended for was to ensure that a transfer in progress
> completed before changing the clock frequency.  But as its currently done
> the only thing it does is make sure there has been a completed i2c transfer
> on this device ever.  Is my understanding correct?
> Currently the workaround is to simply disable the wait_for_completion as
> seen below.  How would you fix this to ensure a transfer in progress
> completes before changing clocks without hanging if no transfer was ever
> attempted?
> diff --git a/drivers/i2c/busses/i2c-davinci.c 
> b/drivers/i2c/busses/i2c-davinci.c
> index a76d85f..564247f 100644
> --- a/drivers/i2c/busses/i2c-davinci.c
> +++ b/drivers/i2c/busses/i2c-davinci.c
> @@ -596,7 +596,7 @@ static int i2c_davinci_cpufreq_transition(struct
> notifier_block *nb,
>

Re: [PATCH 1/2] dmaengine: edma: Do not change the error code returned from edma_alloc_slot

2014-07-31 Thread Vinod Koul
On Thu, Jul 31, 2014 at 01:12:37PM +0300, Peter Ujfalusi wrote:
> In case of edma_alloc_slot() failure during probe we should return the error
> unchanged to make debugging easier.

Applied both

Thanks

-- 
~Vinod

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH 4/6] ARM: DTS: da850-evm: Enable McASP via DT boot

2014-07-31 Thread Peter Ujfalusi
Add pinctrl nodes for the McASP0 pins and configure McASP to the desired
mode for the board.

Signed-off-by: Peter Ujfalusi 
---
 arch/arm/boot/dts/da850-evm.dts | 31 +++
 1 file changed, 31 insertions(+)

diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts
index 1e11e5a5f723..09118c72e83f 100644
--- a/arch/arm/boot/dts/da850-evm.dts
+++ b/arch/arm/boot/dts/da850-evm.dts
@@ -17,6 +17,18 @@
soc {
pmx_core: pinmux@1c14120 {
status = "okay";
+
+   mcasp0_pins: pinmux_mcasp0_pins {
+   pinctrl-single,bits = <
+   /*
+* AHCLKX, ACLKX, AFSX, AHCLKR, ACLKR,
+* AFSR, AMUTE
+*/
+   0x00 0x 0x
+   /* AXR11, AXR12 */
+   0x04 0x00011000 0x000ff000
+   >;
+   };
};
serial0: serial@1c42000 {
status = "okay";
@@ -170,3 +182,22 @@
};
};
 };
+
+&mcasp0 {
+   #sound-dai-cells = <0>;
+   status = "okay";
+   pinctrl-names = "default";
+   pinctrl-0 = <&mcasp0_pins>;
+
+   op-mode = <0>;  /* MCASP_IIS_MODE */
+   tdm-slots = <2>;
+   /* 4 serializer */
+   serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
+   0 0 0 0
+   0 0 0 0
+   0 0 0 1
+   2 0 0 0
+   >;
+   tx-num-evt = <32>;
+   rx-num-evt = <32>;
+};
-- 
2.0.2

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH 3/6] ARM: DTS: da850: Add node for McASP

2014-07-31 Thread Peter Ujfalusi
Node for mcasp0

Signed-off-by: Peter Ujfalusi 
---
 arch/arm/boot/dts/da850.dtsi | 13 +
 1 file changed, 13 insertions(+)

diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
index 41ce4e8bf227..0bd98cd00816 100644
--- a/arch/arm/boot/dts/da850.dtsi
+++ b/arch/arm/boot/dts/da850.dtsi
@@ -276,6 +276,19 @@
ti,davinci-gpio-unbanked = <0>;
status = "disabled";
};
+
+   mcasp0: mcasp@01d0 {
+   compatible = "ti,da830-mcasp-audio";
+   reg = <0x10 0x2000>,
+ <0x102000 0x40>;
+   reg-names = "mpu", "dat";
+   interrupts = <54>;
+   interrupt-names = "common";
+   status = "disabled";
+   dmas = <&edma0 1>,
+   <&edma0 0>;
+   dma-names = "tx", "rx";
+   };
};
nand_cs3@6200 {
compatible = "ti,davinci-nand";
-- 
2.0.2

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH 2/6] ARM: DTS: da850: Add node for edma0

2014-07-31 Thread Peter Ujfalusi
Add DT node for edma0.

Signed-off-by: Peter Ujfalusi 
---
 arch/arm/boot/dts/da850.dtsi | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm/boot/dts/da850.dtsi b/arch/arm/boot/dts/da850.dtsi
index b695548dbb4e..41ce4e8bf227 100644
--- a/arch/arm/boot/dts/da850.dtsi
+++ b/arch/arm/boot/dts/da850.dtsi
@@ -150,6 +150,12 @@
};
 
};
+   edma0: edma@01c0 {
+   compatible = "ti,edma3";
+   reg =   <0x0 0x1>;
+   interrupts = <11 13 12>;
+   #dma-cells = <1>;
+   };
serial0: serial@1c42000 {
compatible = "ns16550a";
reg = <0x42000 0x100>;
-- 
2.0.2

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH 5/6] ARM: DTS: da850-evm: Add node for tlv320aic3106 codec

2014-07-31 Thread Peter Ujfalusi
The board uses aic3106 for audio.

Signed-off-by: Peter Ujfalusi 
---
 arch/arm/boot/dts/da850-evm.dts | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts
index 09118c72e83f..b9ef2be0b145 100644
--- a/arch/arm/boot/dts/da850-evm.dts
+++ b/arch/arm/boot/dts/da850-evm.dts
@@ -51,6 +51,20 @@
tps: tps@48 {
reg = <0x48>;
};
+   tlv320aic3106: tlv320aic3106@1b {
+   #sound-dai-cells = <0>;
+   compatible = "ti,tlv320aic3106";
+   reg = <0x18>;
+   status = "okay";
+
+   /* Regulators */
+   IOVDD-supply = <&vdcdc2_reg>;
+   /* Derived from VBAT: Baseboard 3.3V / 1.8V */
+   AVDD-supply = <&vbat>;
+   DRVDD-supply = <&vbat>;
+   DVDD-supply = <&vbat>;
+   };
+
};
wdt: wdt@1c21000 {
status = "okay";
-- 
2.0.2

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH 6/6] ARM: DTS: da850-evm: Enable audio via simple-card

2014-07-31 Thread Peter Ujfalusi
The audio on the board is using McASP <-> tlv320aic3106 codec and we have
LineIn and LineOut jacks.

Signed-off-by: Peter Ujfalusi 
---
 arch/arm/boot/dts/da850-evm.dts | 27 +++
 1 file changed, 27 insertions(+)

diff --git a/arch/arm/boot/dts/da850-evm.dts b/arch/arm/boot/dts/da850-evm.dts
index b9ef2be0b145..031117a4a797 100644
--- a/arch/arm/boot/dts/da850-evm.dts
+++ b/arch/arm/boot/dts/da850-evm.dts
@@ -143,6 +143,33 @@
regulator-max-microvolt = <500>;
regulator-boot-on;
};
+
+   sound {
+   compatible = "simple-audio-card";
+   simple-audio-card,name = "DA850/OMAP-L138 EVM";
+   simple-audio-card,widgets =
+   "Line", "Line In",
+   "Line", "Line Out";
+   simple-audio-card,routing =
+   "LINE1L", "Line In",
+   "LINE1R", "Line In",
+   "Line Out", "LLOUT",
+   "Line Out", "RLOUT";
+   simple-audio-card,format = "dsp_b";
+   simple-audio-card,bitclock-master = <&link0_codec>;
+   simple-audio-card,frame-master = <&link0_codec>;
+   simple-audio-card,bitclock-inversion;
+
+   simple-audio-card,cpu {
+   sound-dai = <&mcasp0>;
+   system-clock-frequency = <24576000>;
+   };
+
+   link0_codec: simple-audio-card,codec {
+   sound-dai = <&tlv320aic3106>;
+   system-clock-frequency = <24576000>;
+   };
+   };
 };
 
 /include/ "tps6507x.dtsi"
-- 
2.0.2

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH 0/6] ARM: DT/davinci: Audio for da850-evm in DT boot

2014-07-31 Thread Peter Ujfalusi
Hi,

The following series will enable audio via simple card on the board when booted
with DT.

For edma one patch is needed to have working dma:
http://marc.info/?l=linux-omap&m=140680159327749&w=2

Regards,
Peter
---
Peter Ujfalusi (6):
  ARM: davinci: da8xx-dt: add OF_DEV_AUXDATA entry for mcasp0
  ARM: DTS: da850: Add node for edma0
  ARM: DTS: da850: Add node for McASP
  ARM: DTS: da850-evm: Enable McASP via DT boot
  ARM: DTS: da850-evm: Add node for tlv320aic3106 codec
  ARM: DTS: da850-evm: Enable audio via simple-card

 arch/arm/boot/dts/da850-evm.dts  | 72 
 arch/arm/boot/dts/da850.dtsi | 19 +++
 arch/arm/mach-davinci/da8xx-dt.c |  1 +
 3 files changed, 92 insertions(+)

-- 
2.0.2

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH 1/6] ARM: davinci: da8xx-dt: add OF_DEV_AUXDATA entry for mcasp0

2014-07-31 Thread Peter Ujfalusi
Add OF_DEV_AUXDATA for mcasp to be able to use clocks.

Signed-off-by: Peter Ujfalusi 
---
 arch/arm/mach-davinci/da8xx-dt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c
index ed1928740b5f..f703d82f08a8 100644
--- a/arch/arm/mach-davinci/da8xx-dt.c
+++ b/arch/arm/mach-davinci/da8xx-dt.c
@@ -46,6 +46,7 @@ static struct of_dev_auxdata da850_auxdata_lookup[] 
__initdata = {
OF_DEV_AUXDATA("ti,davinci_mdio", 0x01e24000, "davinci_mdio.0", NULL),
OF_DEV_AUXDATA("ti,davinci-dm6467-emac", 0x01e2, "davinci_emac.1",
   NULL),
+   OF_DEV_AUXDATA("ti,da830-mcasp-audio", 0x01d0, "davinci-mcasp.0", 
NULL),
{}
 };
 
-- 
2.0.2

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH 2/2] dmaengine: edma: Do not register second device when booted with DT

2014-07-31 Thread Peter Ujfalusi
DT boot does not yet support more than one edma device. To avoid issues at
runtime we should not register the second device when the kernel is booted
with DT.

Signed-off-by: Peter Ujfalusi 
---
 drivers/dma/edma.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index 2953de0f53f3..d99351361fcb 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -1133,7 +1134,7 @@ static int edma_init(void)
}
}
 
-   if (EDMA_CTLRS == 2) {
+   if (!of_have_populated_dt() && EDMA_CTLRS == 2) {
pdev1 = platform_device_register_full(&edma_dev_info1);
if (IS_ERR(pdev1)) {
platform_driver_unregister(&edma_driver);
-- 
2.0.2

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


[PATCH 1/2] dmaengine: edma: Do not change the error code returned from edma_alloc_slot

2014-07-31 Thread Peter Ujfalusi
In case of edma_alloc_slot() failure during probe we should return the error
unchanged to make debugging easier.

Signed-off-by: Peter Ujfalusi 
---
 drivers/dma/edma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index 69f1f5250120..2953de0f53f3 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -1048,7 +1048,7 @@ static int edma_probe(struct platform_device *pdev)
ecc->dummy_slot = edma_alloc_slot(ecc->ctlr, EDMA_SLOT_ANY);
if (ecc->dummy_slot < 0) {
dev_err(&pdev->dev, "Can't allocate PaRAM dummy slot\n");
-   return -EIO;
+   return ecc->dummy_slot;
}
 
dma_cap_zero(ecc->dma_slave.cap_mask);
-- 
2.0.2

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source