Re: [PATCH 05/10] USB: EHCI: make ehci-atmel a separate driver
Hi Manjunath Goudar, I test this patch based on linux master branch, the commit id is: 6bacaa9ddacb71c691d32c678d37bc59ffc71fac. (I am not sure this is the right place for testing). First, it has an compile error as following. After fix it, and tested, the EHCI doesn't work. ---<8--- drivers/usb/host/ehci-atmel.c: In function 'ehci_atmel_drv_remove': drivers/usb/host/ehci-atmel.c:167: error: implicit declaration of function 'ehci_shutdown' --->8--- And a little code style comments as following. On 2/8/2013 1:34, manjunath.gou...@linaro.org wrote: From: Manjunath Goudar Separate the Atmel host controller driver from ehci-hcd host code into its own driver module. Signed-off-by: Manjunath Goudar Cc: Alan Stern Cc: Greg KH Cc: Grant Likely Cc: Rob Herring Cc: Andrew Victor Cc: Nicolas Ferre Cc: Jean-Christophe Plagniol-Villard Cc: linux-...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/usb/host/Kconfig |7 drivers/usb/host/Makefile |1 + drivers/usb/host/ehci-atmel.c | 78 ++--- drivers/usb/host/ehci-hcd.c |6 +--- 4 files changed, 51 insertions(+), 41 deletions(-) diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 3689b7b..5a13f9d 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -176,6 +176,13 @@ config USB_EHCI_HCD_ORION ---help--- Enables support for the on-chip EHCI controller on Morvell Orion chips. Need blank line here. +config USB_EHCI_HCD_AT91 +tristate "Support for Atmel on-chip EHCI USB controller" +depends on USB_EHCI_HCD && ARCH_AT91 +default y +---help--- + Enables support for the on-chip EHCI controller on + Atmel chips. config USB_EHCI_MSM bool "Support for MSM on-chip EHCI USB controller" [snip] +static void __exit ehci_atmel_cleanup(void) +{ + platform_driver_unregister(&ehci_atmel_driver); +} +module_exit(ehci_atmel_cleanup); + +MODULE_DESCRIPTION(DRIVER_DESC); + +MODULE_ALIAS("platform:ehci-atmel"); +MODULE_AUTHOR("Nicolas Ferre"); +MODULE_LICENSE("GPL"); + Remove the blank line here. As to it is the EOF. Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] net/cadence/macb: fix kernel Oops if no PHY were discovered during probe
Hi Boris, On 08/25/2013 03:21 AM, Boris BREZILLON wrote: Test the presence of a PHY device before printing attached PHY informations. Signed-off-by: Boris BREZILLON --- drivers/net/ethernet/cadence/macb.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c index e866608..fd3b67f 100644 --- a/drivers/net/ethernet/cadence/macb.c +++ b/drivers/net/ethernet/cadence/macb.c @@ -1868,8 +1868,10 @@ static int __init macb_probe(struct platform_device *pdev) dev->irq, dev->dev_addr); phydev = bp->phy_dev; - netdev_info(dev, "attached PHY driver [%s] (mii_bus:phy_addr=%s, irq=%d)\n", - phydev->drv->name, dev_name(&phydev->dev), phydev->irq); + if (phydev) + netdev_info(dev, "attached PHY driver [%s] (mii_bus:phy_addr=%s, irq=%d)\n", + phydev->drv->name, dev_name(&phydev->dev), + phydev->irq); Actually no need this check, if PHY is attached failed, the macb driver probe will fail, then it won't show this message. return 0; Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: mmotm 2013-08-27-16-51 uploaded
Hi Stephen Boyd, On 08/28/2013 08:50 AM, Stephen Boyd wrote: On 08/27/13 16:52, a...@linux-foundation.org wrote: * kernel-time-sched_clockc-correct-the-comparison-parameter-of-mhz.patch I believe Russell nacked this change[1]? This should probably be dropped Yes, this is RFC patch, and NACKed by Russell, so we can drop it. unless there's been more discussion. Or maybe reworked into a comment in the code that doesn't lead to the same change again. [1] https://lkml.org/lkml/2013/8/7/95 Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [GIT PULL] at91: soc update for 3.12 #1
Hi Olof, On 08/29/2013 07:58 AM, Olof Johansson wrote: On Mon, Aug 26, 2013 at 05:55:43PM +0200, Nicolas Ferre wrote: Arnd, Olof, Kevin, Here is AT91 SoC updates for 3.12 kernel. It is the first pull-request for this topic and it is based on 3.11-rc5 like your next/soc branch. Thanks, best regards, The following changes since commit d4e4ab86bcba5a72779c43dc1459f71fea3d89c8: Linux 3.11-rc5 (2013-08-11 18:04:20 -0700) are available in the git repository at: git://github.com/at91linux/linux-at91.git tags/at91-soc for you to fetch changes up to 99eb3b40ec42e7fce1fc58429bf9b26c17973c12: ARM: at91: at91_dt_defconfig: enable rm9200 support (2013-08-26 09:58:29 +0200) AT91 SoC update for 3.12 take 1 - enable kernel uncompress information output for SoC where it was missing: at91sam9n12 and sama5d3 - addition of at91rm9200 to the generic at91_dt_defconfig Jean-Christophe PLAGNIOL-VILLARD (1): ARM: at91: at91_dt_defconfig: enable rm9200 support voice (4): ARM: at91: sama5d3: add definition for usart base address ARM: at91: include sama5d3.h into hardware.h ARM: at91: sama5: enable kernel uncompress info output ARM: at91: sam9n12: enable kernel uncompress info output That doesn't look right. Author should probably be "Bo Shen " instead. Can you fixup and respin, please? I don't know why on the patchwork it show my name as voice. So, if get patch from patchwork and apply it will show my name as voice. So, would it be possible to show the name as Bo Shen on patchwork? -Olof Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2 1/5] sound: sam9x5_wm8731: machine driver for at91sam9x5 wm8731 boards
Hi Richard, On 7/9/2013 16:19, Richard Genoud wrote: 2013/7/8 Mark Brown : On Mon, Jul 08, 2013 at 03:29:49PM +0200, Richard Genoud wrote: + * Nicolas Ferre + * + * Based on sam9g20_wm8731.c by: + * Sedji Gaouaou The obvious question here is of course if we can use the same driver for both of them. I haven't got a g20 to test that, but that's the goal. For now, g20 is still non-DT, so I think it's best to have a DT-only driver like this one for the 9x5 family (9g15, 9g25, 9x25, 9g35, 9x25). When the g20 will move to DT completely, we can drop sam9g20_wm8731.c and adjust sam9x5_wm8731.c (mainly master clock and widgets it seems) The at91sam9g20ek board can work in DT mode, and the sound has support in DT mode already. Sure, the mainly thing we need deal with is the master clock and widgets. If put them together will make code ugly or need many many #ifdef, I suggest to keep them separately. By the way, maybe g45 could use that also (and SAMA5 ?) For g45ek board, it use AC97 interface, not the case. + codec_dai->driver->playback.rates &= SNDRV_PCM_RATE_8000 | + SNDRV_PCM_RATE_32000 | + SNDRV_PCM_RATE_48000 | + SNDRV_PCM_RATE_96000; + codec_dai->driver->capture.rates &= SNDRV_PCM_RATE_8000 | + SNDRV_PCM_RATE_32000 | + SNDRV_PCM_RATE_48000 | + SNDRV_PCM_RATE_96000; You definitely shouldn't be fiddling with a driver's constant static data. You want to be using snd_pcm_hw_constraint() APIs to set additional constraints intead. Ok, I'll change that. Thanks ! Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v4 1/7] sound: sam9x5_wm8731: machine driver for at91sam9x5 wm8731 boards
Hi Richard, On 7/9/2013 22:25, Richard Genoud wrote: [snip] +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include "../codecs/wm8731.h" +#include "atmel-pcm.h" +#include "atmel_ssc_dai.h" I think some of the header file include is not needed. I keep them as simple as following: ---8>--- #include #include #include #include #include #include #include "../codecs/wm8731.h" #include "atmel_ssc_dai.h" ---<8--- +#define MCLK_RATE 12288000 + +#define DRV_NAME "sam9x5-snd-wm8731" + +/* + * Authorized rates are: + * Rate = MCLK_RATE / (n * 2) + * Where n is in [1..4095] + * (cf register SSC_CMR) + */ +static unsigned int rates[] = { + 8000, + 16000, + 32000, + 48000, + 64000, + 96000, +}; This is decided by the codec, while not ssc when ssc in slave mode. +static struct snd_pcm_hw_constraint_list hw_rates = { + .count = ARRAY_SIZE(rates), + .list = rates, +}; + [snip] + + at91sam9x5ek_dai.dai_fmt = snd_soc_of_parse_daifmt(np, "atmel,"); We can put this into at91sam9x5ek_dai directly, not need to parse it then. example as following: ---8>--- .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBM_CFM, ---<8--- Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 0/3] arm: atmel: at91sam9n12: add i2c pinctrl and qt1070 support
this patch is based on linux master branch, implementation as following: - add the i2c pinctrl which needed for using at91sam9n12 TWI - enable qt1070 - trivial fix for the gpio-key pin number Bo Shen (3): arm: atmel: at91sam9n12: add pinctrl of TWI arm: atmel: at91sam9n12: add qt1070 support arm: atmel: at91sam9n12: correct pin number of gpio-key arch/arm/boot/dts/at91sam9n12.dtsi | 20 arch/arm/boot/dts/at91sam9n12ek.dts | 18 +- 2 files changed, 37 insertions(+), 1 deletion(-) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 3/3] arm: atmel: at91sam9n12: correct pin number of gpio-key
correct pin number of gpio-key for at91sam9n12ek board the pioB4 is connect to LED, the pioB3 use as gpio-key Signed-off-by: Bo Shen --- arch/arm/boot/dts/at91sam9n12ek.dts |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/at91sam9n12ek.dts b/arch/arm/boot/dts/at91sam9n12ek.dts index 3acac62..9f4c601 100644 --- a/arch/arm/boot/dts/at91sam9n12ek.dts +++ b/arch/arm/boot/dts/at91sam9n12ek.dts @@ -137,7 +137,7 @@ enter { label = "Enter"; - gpios = <&pioB 4 GPIO_ACTIVE_LOW>; + gpios = <&pioB 3 GPIO_ACTIVE_LOW>; linux,code = <28>; gpio-key,wakeup; }; -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/3] arm: atmel: at91sam9n12: add qt1070 support
add qt1070 support on at91sam9n12ek board Signed-off-by: Bo Shen --- arch/arm/boot/dts/at91sam9n12ek.dts | 16 1 file changed, 16 insertions(+) diff --git a/arch/arm/boot/dts/at91sam9n12ek.dts b/arch/arm/boot/dts/at91sam9n12ek.dts index d59b70c..3acac62 100644 --- a/arch/arm/boot/dts/at91sam9n12ek.dts +++ b/arch/arm/boot/dts/at91sam9n12ek.dts @@ -40,6 +40,15 @@ i2c0: i2c@f801 { status = "okay"; + + qt1070: keyboard@1b { + compatible = "qt1070"; + reg = <0x1b>; + interrupt-parent = <&pioA>; + interrupts = <2 0x0>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_qt1070_irq>; + }; }; i2c1: i2c@f8014000 { @@ -66,6 +75,13 @@ ; /* PA7 gpio CD pin pull up and deglitch */ }; }; + + qt1070 { + pinctrl_qt1070_irq: qt1070_irq { + atmel,pins = + ; /* PA2 GPIO with pull up deglith */ + }; + }; }; spi0: spi@f000 { -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/3] arm: atmel: at91sam9n12: add pinctrl of TWI
add pinctrl of TWI for at91sam9n12 SoC Signed-off-by: Bo Shen --- arch/arm/boot/dts/at91sam9n12.dtsi | 20 1 file changed, 20 insertions(+) diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi index bb7f564..3db62f6 100644 --- a/arch/arm/boot/dts/at91sam9n12.dtsi +++ b/arch/arm/boot/dts/at91sam9n12.dtsi @@ -291,6 +291,22 @@ }; }; + i2c0 { + pinctrl_i2c0: i2c0-0 { + atmel,pins = + ; /* PA31 periph A I2C0 clock */ + }; + }; + + i2c1 { + pinctrl_i2c1: i2c1-0 { + atmel,pins = + ; /* PC1 periph C I2C1 clock */ + }; + }; + tcb0 { pinctrl_tcb0_tclk0: tcb0_tclk0-0 { atmel,pins = ; @@ -471,6 +487,8 @@ dma-names = "tx", "rx"; #address-cells = <1>; #size-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c0>; status = "disabled"; }; @@ -483,6 +501,8 @@ dma-names = "tx", "rx"; #address-cells = <1>; #size-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c1>; status = "disabled"; }; -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/3] arm: atmel: at91sam9n12: add pinctrl of TWI
Hi J, On 7/10/2013 22:39, Jean-Christophe PLAGNIOL-VILLARD wrote: On 17:51 Wed 10 Jul , Bo Shen wrote: add pinctrl of TWI for at91sam9n12 SoC Signed-off-by: Bo Shen --- arch/arm/boot/dts/at91sam9n12.dtsi | 20 1 file changed, 20 insertions(+) diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi index bb7f564..3db62f6 100644 --- a/arch/arm/boot/dts/at91sam9n12.dtsi +++ b/arch/arm/boot/dts/at91sam9n12.dtsi @@ -291,6 +291,22 @@ }; }; + i2c0 { + pinctrl_i2c0: i2c0-0 { + atmel,pins = + ; /* PA31 periph A I2C0 clock */ + }; + }; + + i2c1 { + pinctrl_i2c1: i2c1-0 { + atmel,pins = + ; /* PC1 periph C I2C1 clock */ drop the comment as we use macro Thanks, I will drop the comment. + }; + }; + tcb0 { pinctrl_tcb0_tclk0: tcb0_tclk0-0 { atmel,pins = ; @@ -471,6 +487,8 @@ dma-names = "tx", "rx"; #address-cells = <1>; #size-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c0>; status = "disabled"; }; @@ -483,6 +501,8 @@ dma-names = "tx", "rx"; #address-cells = <1>; #size-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c1>; status = "disabled"; }; -- 1.7.9.5 Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/3] arm: atmel: at91sam9n12: add qt1070 support
Hi J, On 7/10/2013 22:38, Jean-Christophe PLAGNIOL-VILLARD wrote: On 17:51 Wed 10 Jul , Bo Shen wrote: add qt1070 support on at91sam9n12ek board Signed-off-by: Bo Shen --- arch/arm/boot/dts/at91sam9n12ek.dts | 16 1 file changed, 16 insertions(+) diff --git a/arch/arm/boot/dts/at91sam9n12ek.dts b/arch/arm/boot/dts/at91sam9n12ek.dts index d59b70c..3acac62 100644 --- a/arch/arm/boot/dts/at91sam9n12ek.dts +++ b/arch/arm/boot/dts/at91sam9n12ek.dts @@ -40,6 +40,15 @@ i2c0: i2c@f801 { status = "okay"; + + qt1070: keyboard@1b { + compatible = "qt1070"; + reg = <0x1b>; + interrupt-parent = <&pioA>; + interrupts = <2 0x0>; use the macro Thanks, I will use macro here. + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_qt1070_irq>; + }; }; i2c1: i2c@f8014000 { @@ -66,6 +75,13 @@ ; /* PA7 gpio CD pin pull up and deglitch */ }; }; + + qt1070 { + pinctrl_qt1070_irq: qt1070_irq { + atmel,pins = + ; /* PA2 GPIO with pull up deglith */ drop the comment as we use macro OK, I will drop the comment + }; + }; }; spi0: spi@f000 { -- Best Regards, J. Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 3/3] arm: atmel: at91sam9n12: correct pin number of gpio-key
correct pin number of gpio-key for at91sam9n12ek board the pioB4 is connect to LED, the pioB3 use as gpio-key Signed-off-by: Bo Shen --- Changes in v2: None arch/arm/boot/dts/at91sam9n12ek.dts |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/at91sam9n12ek.dts b/arch/arm/boot/dts/at91sam9n12ek.dts index 7a95a28..3e86b05 100644 --- a/arch/arm/boot/dts/at91sam9n12ek.dts +++ b/arch/arm/boot/dts/at91sam9n12ek.dts @@ -137,7 +137,7 @@ enter { label = "Enter"; - gpios = <&pioB 4 GPIO_ACTIVE_LOW>; + gpios = <&pioB 3 GPIO_ACTIVE_LOW>; linux,code = <28>; gpio-key,wakeup; }; -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 0/3] arm: atmel: at91sam9n12: add i2c pinctrl and qt1070 support
this patch is based on linux master branch, implementation as following: - add the i2c pinctrl which needed for using at91sam9n12 TWI - enable qt1070 - trival fix for the gpio-key pin number Changes in v2: - remove comments as use micro - using micro for interrupt trigger mode Bo Shen (3): arm: atmel: at91sam9n12: add pinctrl of TWI arm: atmel: at91sam9n12: add qt1070 support arm: atmel: at91sam9n12: correct pin number of gpio-key arch/arm/boot/dts/at91sam9n12.dtsi | 20 arch/arm/boot/dts/at91sam9n12ek.dts | 18 +- 2 files changed, 37 insertions(+), 1 deletion(-) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 1/3] arm: atmel: at91sam9n12: add pinctrl of TWI
add pinctrl of TWI for at91sam9n12 SoC Signed-off-by: Bo Shen --- Changes in v2: - remove comments as use micro arch/arm/boot/dts/at91sam9n12.dtsi | 20 1 file changed, 20 insertions(+) diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi index bb7f564..9fb7ffd 100644 --- a/arch/arm/boot/dts/at91sam9n12.dtsi +++ b/arch/arm/boot/dts/at91sam9n12.dtsi @@ -291,6 +291,22 @@ }; }; + i2c0 { + pinctrl_i2c0: i2c0-0 { + atmel,pins = + ; + }; + }; + + i2c1 { + pinctrl_i2c1: i2c1-0 { + atmel,pins = + ; + }; + }; + tcb0 { pinctrl_tcb0_tclk0: tcb0_tclk0-0 { atmel,pins = ; @@ -471,6 +487,8 @@ dma-names = "tx", "rx"; #address-cells = <1>; #size-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c0>; status = "disabled"; }; @@ -483,6 +501,8 @@ dma-names = "tx", "rx"; #address-cells = <1>; #size-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c1>; status = "disabled"; }; -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 2/3] arm: atmel: at91sam9n12: add qt1070 support
add qt1070 support on at91sam9n12ek board Signed-off-by: Bo Shen --- Changes in v2: - using micro for interrupt trigger mode arch/arm/boot/dts/at91sam9n12ek.dts | 16 1 file changed, 16 insertions(+) diff --git a/arch/arm/boot/dts/at91sam9n12ek.dts b/arch/arm/boot/dts/at91sam9n12ek.dts index d59b70c..7a95a28 100644 --- a/arch/arm/boot/dts/at91sam9n12ek.dts +++ b/arch/arm/boot/dts/at91sam9n12ek.dts @@ -40,6 +40,15 @@ i2c0: i2c@f801 { status = "okay"; + + qt1070: keyboard@1b { + compatible = "qt1070"; + reg = <0x1b>; + interrupt-parent = <&pioA>; + interrupts = <2 IRQ_TYPE_EDGE_FALLING>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_qt1070_irq>; + }; }; i2c1: i2c@f8014000 { @@ -66,6 +75,13 @@ ; /* PA7 gpio CD pin pull up and deglitch */ }; }; + + qt1070 { + pinctrl_qt1070_irq: qt1070_irq { + atmel,pins = + ; + }; + }; }; spi0: spi@f000 { -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v4] PWM: atmel-pwm: add PWM controller driver
Hi Alexandre, On 9/28/2013 00:52, Alexandre Belloni wrote: [snip] +static int atmel_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) +{ + struct atmel_pwm_chip *atmel_pwm = to_atmel_pwm_chip(chip); + int ret; + + ret = clk_enable(atmel_pwm->clk); + if (ret) { + pr_err("failed to enable pwm clock\n"); + return ret; + } + This will increment clk->enable_count each time it is called. Yes, that's true. + atmel_pwm_writel(atmel_pwm, PWM_ENA, 1 << pwm->hwpwm); + + return 0; +} + +static void atmel_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm) +{ + struct atmel_pwm_chip *atmel_pwm = to_atmel_pwm_chip(chip); + u32 val; + + atmel_pwm_writel(atmel_pwm, PWM_DIS, 1 << pwm->hwpwm); + + val = atmel_pwm_readl(atmel_pwm, PWM_SR); + if ((val & PWM_SR_ALL_CH_ON) == 0) + clk_disable(atmel_pwm->clk); +} This will decrement clk->enable_count only once there are no pwm enabled anymore. So in you enable more than one channel, you will never disable the clock. The simple fix is to always call clk_diasble, regardless of the state of the other channels. Thank for point out this. I see you have sent out a patch to fix it (however the other contents of your patch doesn't work). So, do you prefer I send out v5 patch to fix this? or you fix your patch at same time fix this issue? Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] PWM: atmel-pwm: use request/free instead of enable/disable
Hi Alexandre, On 9/28/2013 04:10, Alexandre Belloni wrote: I found that disabling a pwm while it is at a low level will actually put it back at a high level. The main symptom is that leds-pwm is calling pwm_disable() after setting the duty cycle to 0. Hence, instead of getting a switched off LED, you get an LED lit up at full brightness. Solve that by using the request and free callbacks to enable and disable the pwm channels and the clock. Signed-off-by: Alexandre Belloni --- This patch applies after: [PATCH v4] PWM: atmel-pwm: add PWM controller driver drivers/pwm/pwm-atmel.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/pwm/pwm-atmel.c b/drivers/pwm/pwm-atmel.c index 6af7a50..4526e71 100644 --- a/drivers/pwm/pwm-atmel.c +++ b/drivers/pwm/pwm-atmel.c @@ -209,7 +209,7 @@ static int atmel_pwm_set_polarity(struct pwm_chip *chip, struct pwm_device *pwm, return 0; } -static int atmel_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) +static int atmel_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) { struct atmel_pwm_chip *atmel_pwm = to_atmel_pwm_chip(chip); int ret; @@ -225,23 +225,19 @@ static int atmel_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) return 0; } -static void atmel_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm) +static void atmel_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm) { struct atmel_pwm_chip *atmel_pwm = to_atmel_pwm_chip(chip); - u32 val; atmel_pwm_writel(atmel_pwm, PWM_DIS, 1 << pwm->hwpwm); - - val = atmel_pwm_readl(atmel_pwm, PWM_SR); - if ((val & PWM_SR_ALL_CH_ON) == 0) - clk_disable(atmel_pwm->clk); + clk_disable(atmel_pwm->clk); } static const struct pwm_ops atmel_pwm_ops = { .config = atmel_pwm_config, .set_polarity = atmel_pwm_set_polarity, - .enable = atmel_pwm_enable, - .disable = atmel_pwm_disable, + .request = atmel_pwm_request, + .free = atmel_pwm_free, This will cause pwmadd_chip failure. Code from , in function: pwmadd_chip() ---8>--- if (!chip || !chip->dev || !chip->ops || !chip->ops->config || !chip->ops->enable || !chip->ops->disable) return -EINVAL; ---<8--- .owner = THIS_MODULE, }; Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v5] PWM: atmel-pwm: add PWM controller driver
Add Atmel PWM controller driver based on PWM framework. This is the basic function implementation of Atmel PWM controller. It can work with PWM based led and backlight. Signed-off-by: Bo Shen --- Changes in v5: - call clk_disable directly, if so, it won't cause more than one channel enabled, the clock can not be disabled. Changes in v4: - check the return value of clk_prepare() - change channel register size as constant Changes in v3: - change compatible string from "atmel,sama5-pwm" to "atmel,sama5d3-pwm" - Add PWM led example in binding documentation - Using micro replace hard code Changes in v2: - Address the comments from Thierry Reding .../devicetree/bindings/pwm/atmel-pwm.txt | 41 +++ drivers/pwm/Kconfig|9 + drivers/pwm/Makefile |1 + drivers/pwm/pwm-atmel.c| 344 4 files changed, 395 insertions(+) create mode 100644 Documentation/devicetree/bindings/pwm/atmel-pwm.txt create mode 100644 drivers/pwm/pwm-atmel.c diff --git a/Documentation/devicetree/bindings/pwm/atmel-pwm.txt b/Documentation/devicetree/bindings/pwm/atmel-pwm.txt new file mode 100644 index 000..1c1a5fa --- /dev/null +++ b/Documentation/devicetree/bindings/pwm/atmel-pwm.txt @@ -0,0 +1,41 @@ +Atmel PWM controller + +Required properties: + - compatible: should be one of: +- "atmel,at91sam9rl-pwm" +- "atmel,sama5d3-pwm" + - reg: physical base address and length of the controller's registers + - #pwm-cells: Should be 3. See pwm.txt in this directory for a +description of the cells format + +Example: + + pwm0: pwm@f8034000 { + compatible = "atmel,at91sam9rl-pwm"; + reg = <0xf8034000 0x400>; + #pwm-cells = <3>; + }; + +The following the pwm led based example: + + pwm0: pwm@f8034000 { + compatible = "atmel,at91sam9rl-pwm"; + reg = <0xf8034000 0x400>; + #pwm-cells = <3>; + }; + + pwdleds { + compatible = "pwm-leds"; + + d1 { + label = "d1"; + pwms = <&pwm0 3 5000 0> + max-brightness = <255>; + }; + + d2 { + label = "d2"; + pwms = <&pwm0 1 5000 1> + max-brightness = <255>; + }; + }; diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig index 75840b5..54237b9 100644 --- a/drivers/pwm/Kconfig +++ b/drivers/pwm/Kconfig @@ -41,6 +41,15 @@ config PWM_AB8500 To compile this driver as a module, choose M here: the module will be called pwm-ab8500. +config PWM_ATMEL + tristate "Atmel PWM support" + depends on ARCH_AT91 + help + Generic PWM framework driver for Atmel SoC. + + To compile this driver as a module, choose M here: the module + will be called pwm-atmel. + config PWM_ATMEL_TCB tristate "Atmel TC Block PWM support" depends on ATMEL_TCLIB && OF diff --git a/drivers/pwm/Makefile b/drivers/pwm/Makefile index 77a8c18..5b193f8 100644 --- a/drivers/pwm/Makefile +++ b/drivers/pwm/Makefile @@ -1,6 +1,7 @@ obj-$(CONFIG_PWM) += core.o obj-$(CONFIG_PWM_SYSFS)+= sysfs.o obj-$(CONFIG_PWM_AB8500) += pwm-ab8500.o +obj-$(CONFIG_PWM_ATMEL)+= pwm-atmel.o obj-$(CONFIG_PWM_ATMEL_TCB)+= pwm-atmel-tcb.o obj-$(CONFIG_PWM_BFIN) += pwm-bfin.o obj-$(CONFIG_PWM_IMX) += pwm-imx.o diff --git a/drivers/pwm/pwm-atmel.c b/drivers/pwm/pwm-atmel.c new file mode 100644 index 000..b4df36c --- /dev/null +++ b/drivers/pwm/pwm-atmel.c @@ -0,0 +1,344 @@ +/* + * Driver for Atmel Pulse Width Modulation Controller + * + * Copyright (C) 2013 Atmel Corporation + * Bo Shen + * + * Licensed under GPLv2. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* The following is global registers for PWM controller */ +#define PWM_ENA0x04 +#define PWM_DIS0x08 +#define PWM_SR 0x0C +/* bit field in SR */ +#define PWM_SR_ALL_CH_ON 0x0F + +/* The following register is PWM channel related registers */ +#define PWM_CH_REG_OFFSET 0x200 +#define PWM_CH_REG_SIZE0x20 + +#define PWM_CMR0x0 +/* bit field in CMR */ +#define PWM_CMR_CPOL (1 << 9) +#define PWM_CMR_UPD_CDTY (1 << 10) + +/* The following registers for PWM v1 */ +#define PWMv1_CDTY 0x04 +#define PWMv1_CPRD 0x08 +#define PWMv1_CUPD 0x10 + +/* The following registers f
[PATCH v3] PWM: at91: add Atmel PWM controller driver
Add Atmel PWM controller driver based on PWM framework. This is the basic function implementation of Atmel PWM controller. It can work with PWM based led and backlight. Signed-off-by: Bo Shen --- Changes in v3: - change compatible string from "atmel,sama5-pwm" to "atmel,sama5d3-pwm" - Add PWM led example in binding documentation - Using micro replace hard code Changes in v2: - Address the comments from Thierry Reding .../devicetree/bindings/pwm/atmel-pwm.txt | 41 +++ drivers/pwm/Kconfig|9 + drivers/pwm/Makefile |1 + drivers/pwm/pwm-atmel.c| 335 4 files changed, 386 insertions(+) create mode 100644 Documentation/devicetree/bindings/pwm/atmel-pwm.txt create mode 100644 drivers/pwm/pwm-atmel.c diff --git a/Documentation/devicetree/bindings/pwm/atmel-pwm.txt b/Documentation/devicetree/bindings/pwm/atmel-pwm.txt new file mode 100644 index 000..1c1a5fa --- /dev/null +++ b/Documentation/devicetree/bindings/pwm/atmel-pwm.txt @@ -0,0 +1,41 @@ +Atmel PWM controller + +Required properties: + - compatible: should be one of: +- "atmel,at91sam9rl-pwm" +- "atmel,sama5d3-pwm" + - reg: physical base address and length of the controller's registers + - #pwm-cells: Should be 3. See pwm.txt in this directory for a +description of the cells format + +Example: + + pwm0: pwm@f8034000 { + compatible = "atmel,at91sam9rl-pwm"; + reg = <0xf8034000 0x400>; + #pwm-cells = <3>; + }; + +The following the pwm led based example: + + pwm0: pwm@f8034000 { + compatible = "atmel,at91sam9rl-pwm"; + reg = <0xf8034000 0x400>; + #pwm-cells = <3>; + }; + + pwdleds { + compatible = "pwm-leds"; + + d1 { + label = "d1"; + pwms = <&pwm0 3 5000 0> + max-brightness = <255>; + }; + + d2 { + label = "d2"; + pwms = <&pwm0 1 5000 1> + max-brightness = <255>; + }; + }; diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig index 75840b5..54237b9 100644 --- a/drivers/pwm/Kconfig +++ b/drivers/pwm/Kconfig @@ -41,6 +41,15 @@ config PWM_AB8500 To compile this driver as a module, choose M here: the module will be called pwm-ab8500. +config PWM_ATMEL + tristate "Atmel PWM support" + depends on ARCH_AT91 + help + Generic PWM framework driver for Atmel SoC. + + To compile this driver as a module, choose M here: the module + will be called pwm-atmel. + config PWM_ATMEL_TCB tristate "Atmel TC Block PWM support" depends on ATMEL_TCLIB && OF diff --git a/drivers/pwm/Makefile b/drivers/pwm/Makefile index 77a8c18..5b193f8 100644 --- a/drivers/pwm/Makefile +++ b/drivers/pwm/Makefile @@ -1,6 +1,7 @@ obj-$(CONFIG_PWM) += core.o obj-$(CONFIG_PWM_SYSFS)+= sysfs.o obj-$(CONFIG_PWM_AB8500) += pwm-ab8500.o +obj-$(CONFIG_PWM_ATMEL)+= pwm-atmel.o obj-$(CONFIG_PWM_ATMEL_TCB)+= pwm-atmel-tcb.o obj-$(CONFIG_PWM_BFIN) += pwm-bfin.o obj-$(CONFIG_PWM_IMX) += pwm-imx.o diff --git a/drivers/pwm/pwm-atmel.c b/drivers/pwm/pwm-atmel.c new file mode 100644 index 000..9c86dfe --- /dev/null +++ b/drivers/pwm/pwm-atmel.c @@ -0,0 +1,335 @@ +/* + * Driver for Atmel Pulse Width Modulation Controller + * + * Copyright (C) 2013 Atmel Corporation + * Bo Shen + * + * Licensed under GPLv2. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* The following is global registers for PWM controller */ +#define PWM_ENA0x04 +#define PWM_DIS0x08 +#define PWM_SR 0x0C +/* bit field in SR */ +#define PWM_SR_ALL_CH_ON 0x0F + +/* The following register is PWM channel related registers */ +#define PWM_CH_REG_OFFSET 0x200 + +#define PWM_CMR0x0 +/* bit field in CMR */ +#define PWM_CMR_CPOL (1 << 9) +#define PWM_CMR_UPD_CDTY (1 << 10) + +/* The following registers for PWM v1 */ +#define PWMv1_CDTY 0x04 +#define PWMv1_CPRD 0x08 +#define PWMv1_CUPD 0x10 + +/* The following registers for PWM v2 */ +#define PWMv2_CDTY 0x04 +#define PWMv2_CDTYUPD 0x08 +#define PWMv2_CPRD 0x0C +#define PWMv2_CPRDUPD 0x10 + +/* max value for duty and period */ +/* + * Although the duty and period register is 32 bit, + * however only the LSB 16 bits
[PATCH v4] PWM: atmel-pwm: add PWM controller driver
Add Atmel PWM controller driver based on PWM framework. This is the basic function implementation of Atmel PWM controller. It can work with PWM based led and backlight. Signed-off-by: Bo Shen --- Changes in v4: - check the return value of clk_prepare() - change channel register size as constant Changes in v3: - change compatible string from "atmel,sama5-pwm" to "atmel,sama5d3-pwm" - Add PWM led example in binding documentation - Using micro replace hard code Changes in v2: - Address the comments from Thierry Reding .../devicetree/bindings/pwm/atmel-pwm.txt | 41 +++ drivers/pwm/Kconfig|9 + drivers/pwm/Makefile |1 + drivers/pwm/pwm-atmel.c| 350 4 files changed, 401 insertions(+) create mode 100644 Documentation/devicetree/bindings/pwm/atmel-pwm.txt create mode 100644 drivers/pwm/pwm-atmel.c diff --git a/Documentation/devicetree/bindings/pwm/atmel-pwm.txt b/Documentation/devicetree/bindings/pwm/atmel-pwm.txt new file mode 100644 index 000..1c1a5fa --- /dev/null +++ b/Documentation/devicetree/bindings/pwm/atmel-pwm.txt @@ -0,0 +1,41 @@ +Atmel PWM controller + +Required properties: + - compatible: should be one of: +- "atmel,at91sam9rl-pwm" +- "atmel,sama5d3-pwm" + - reg: physical base address and length of the controller's registers + - #pwm-cells: Should be 3. See pwm.txt in this directory for a +description of the cells format + +Example: + + pwm0: pwm@f8034000 { + compatible = "atmel,at91sam9rl-pwm"; + reg = <0xf8034000 0x400>; + #pwm-cells = <3>; + }; + +The following the pwm led based example: + + pwm0: pwm@f8034000 { + compatible = "atmel,at91sam9rl-pwm"; + reg = <0xf8034000 0x400>; + #pwm-cells = <3>; + }; + + pwdleds { + compatible = "pwm-leds"; + + d1 { + label = "d1"; + pwms = <&pwm0 3 5000 0> + max-brightness = <255>; + }; + + d2 { + label = "d2"; + pwms = <&pwm0 1 5000 1> + max-brightness = <255>; + }; + }; diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig index 75840b5..54237b9 100644 --- a/drivers/pwm/Kconfig +++ b/drivers/pwm/Kconfig @@ -41,6 +41,15 @@ config PWM_AB8500 To compile this driver as a module, choose M here: the module will be called pwm-ab8500. +config PWM_ATMEL + tristate "Atmel PWM support" + depends on ARCH_AT91 + help + Generic PWM framework driver for Atmel SoC. + + To compile this driver as a module, choose M here: the module + will be called pwm-atmel. + config PWM_ATMEL_TCB tristate "Atmel TC Block PWM support" depends on ATMEL_TCLIB && OF diff --git a/drivers/pwm/Makefile b/drivers/pwm/Makefile index 77a8c18..5b193f8 100644 --- a/drivers/pwm/Makefile +++ b/drivers/pwm/Makefile @@ -1,6 +1,7 @@ obj-$(CONFIG_PWM) += core.o obj-$(CONFIG_PWM_SYSFS)+= sysfs.o obj-$(CONFIG_PWM_AB8500) += pwm-ab8500.o +obj-$(CONFIG_PWM_ATMEL)+= pwm-atmel.o obj-$(CONFIG_PWM_ATMEL_TCB)+= pwm-atmel-tcb.o obj-$(CONFIG_PWM_BFIN) += pwm-bfin.o obj-$(CONFIG_PWM_IMX) += pwm-imx.o diff --git a/drivers/pwm/pwm-atmel.c b/drivers/pwm/pwm-atmel.c new file mode 100644 index 000..6af7a50 --- /dev/null +++ b/drivers/pwm/pwm-atmel.c @@ -0,0 +1,350 @@ +/* + * Driver for Atmel Pulse Width Modulation Controller + * + * Copyright (C) 2013 Atmel Corporation + * Bo Shen + * + * Licensed under GPLv2. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* The following is global registers for PWM controller */ +#define PWM_ENA0x04 +#define PWM_DIS0x08 +#define PWM_SR 0x0C +/* bit field in SR */ +#define PWM_SR_ALL_CH_ON 0x0F + +/* The following register is PWM channel related registers */ +#define PWM_CH_REG_OFFSET 0x200 +#define PWM_CH_REG_SIZE0x20 + +#define PWM_CMR0x0 +/* bit field in CMR */ +#define PWM_CMR_CPOL (1 << 9) +#define PWM_CMR_UPD_CDTY (1 << 10) + +/* The following registers for PWM v1 */ +#define PWMv1_CDTY 0x04 +#define PWMv1_CPRD 0x08 +#define PWMv1_CUPD 0x10 + +/* The following registers for PWM v2 */ +#define PWMv2_CDTY 0x04 +#define PWMv2_CDTYUPD 0x08 +#define PWMv2_CPRD 0x0C +#define PWMv2_CP
Re: [PATCH 3/3] ARM: at91/PMC: at91sam9n12 family has USB HS feature
Hi Nicolas, On 06/24/2013 05:08 PM, Nicolas Ferre wrote: Signed-off-by: Nicolas Ferre --- arch/arm/mach-at91/clock.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c index 978de42..1b9bbba 100644 --- a/arch/arm/mach-at91/clock.c +++ b/arch/arm/mach-at91/clock.c @@ -88,6 +88,7 @@ EXPORT_SYMBOL_GPL(at91_pmc_base); #define cpu_has_udpfs() (!(cpu_is_at91sam9rl() \ || cpu_is_at91sam9g45() \ || cpu_is_at91sam9x5() \ + || cpu_is_at91sam9n12() \ || cpu_is_sama5d3())) The at91sam9n12 don't have USB HS device port feature. It only has USB FS device port feature. #define cpu_has_plladiv2()(cpu_is_at91sam9g45() \ Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/3] ARM: at91/PMC: at91sam9n12 family have a PLLB
On 06/24/2013 05:08 PM, Nicolas Ferre wrote: Signed-off-by: Nicolas Ferre Acked-by: Bo Shen --- arch/arm/mach-at91/clock.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c index 085a79d..978de42 100644 --- a/arch/arm/mach-at91/clock.c +++ b/arch/arm/mach-at91/clock.c @@ -75,7 +75,6 @@ EXPORT_SYMBOL_GPL(at91_pmc_base); #define cpu_has_pllb()(!(cpu_is_at91sam9rl() \ || cpu_is_at91sam9g45() \ || cpu_is_at91sam9x5() \ - || cpu_is_at91sam9n12() \ || cpu_is_sama5d3())) #define cpu_has_upll()(cpu_is_at91sam9g45() \ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/2] ARM: at91/PMC: fix at91sam9n12 USB FS init
Hi Nicolas, On 06/25/2013 12:37 AM, Nicolas Ferre wrote: at91sam9n12 has Full-speed only USB. So we should add it to the list in at91_pllb_usbfs_clock_init() function. Moreover, at91sam9n12 has an unusual PMC in the sense that it has a PLLB but also has a USB clock register. Signed-off-by: Nicolas Ferre --- arch/arm/mach-at91/clock.c | 25 + arch/arm/mach-at91/include/mach/at91_pmc.h | 3 +++ 2 files changed, 24 insertions(+), 4 deletions(-) For this series, test on at91sam9n12ek board, all are OK. Tested-by: Bo Shen Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] ARM: at91/PMC: fix at91sam9n12 USB FS init
Hi Nicolas, On 06/24/2013 06:57 PM, Nicolas Ferre wrote: at91sam9n12 has Full-speed only USB. So we should add it to the list in at91_pllb_usbfs_clock_init() function. Signed-off-by: Nicolas Ferre --- arch/arm/mach-at91/clock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c index 978de42..2f732d9 100644 --- a/arch/arm/mach-at91/clock.c +++ b/arch/arm/mach-at91/clock.c @@ -699,7 +699,7 @@ static void __init at91_pllb_usbfs_clock_init(unsigned long main_clock) at91_pmc_write(AT91_PMC_SCER, AT91RM9200_PMC_MCKUDP); } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() || cpu_is_at91sam9263() || cpu_is_at91sam9g20() || - cpu_is_at91sam9g10()) { + cpu_is_at91sam9g10() || cpu_is_at91sam9n12()) { uhpck.pmc_mask = AT91SAM926x_PMC_UHP; udpck.pmc_mask = AT91SAM926x_PMC_UDP; } As you post the following patches: ARM: at91/PMC: fix at91sam9n12 USB FS init (https://patchwork.kernel.org/patch/2772301/) This patch no need anymore. Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFC PATCH 01/13] misc: atmel_ssc: add device tree DMA support
Hi Richard, On 7/1/2013 16:39, Richard Genoud wrote: The ssc device has to fill the at_dma_slave structure with the device tree informations. Doing a of_dma_request_slave_channel()+dma_release_channel() for that seems wrong (or at least not very clean). Please hold on of this, as to the ASoC dmaengine will deal with this. So, we not need do it manually. Now, I am working on it. And will send out the patch soon after testing OK. Signed-off-by: Richard Genoud --- drivers/misc/atmel-ssc.c| 56 +++ include/linux/atmel-ssc.h |2 ++ include/linux/platform_data/dma-atmel.h |2 ++ 3 files changed, 60 insertions(+) Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFC PATCH 03/13] ARM: at91: DTS: sam9x5: add clock for SSC DT entry
Hi Richard, On 7/1/2013 16:39, Richard Genoud wrote: Signed-off-by: Richard Genoud --- arch/arm/mach-at91/at91sam9x5.c |1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-at91/at91sam9x5.c b/arch/arm/mach-at91/at91sam9x5.c index 2abee66..191eb4b 100644 --- a/arch/arm/mach-at91/at91sam9x5.c +++ b/arch/arm/mach-at91/at91sam9x5.c @@ -233,6 +233,7 @@ static struct clk_lookup periph_clocks_lookups[] = { CLKDEV_CON_DEV_ID("mci_clk", "f000c000.mmc", &mmc1_clk), CLKDEV_CON_DEV_ID("dma_clk", "ec00.dma-controller", &dma0_clk), CLKDEV_CON_DEV_ID("dma_clk", "ee00.dma-controller", &dma1_clk), + CLKDEV_CON_DEV_ID("pclk", "at91sam9g45_ssc.0", &ssc_clk), Actually, we don't use this anymore. Am I right? CLKDEV_CON_DEV_ID("pclk", "f001.ssc", &ssc_clk), CLKDEV_CON_DEV_ID(NULL, "f801.i2c", &twi0_clk), CLKDEV_CON_DEV_ID(NULL, "f8014000.i2c", &twi1_clk), Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFC PATCH 02/13] misc: atmel_ssc: keep the count of pdev->id
Hi Richard, On 7/1/2013 16:39, Richard Genoud wrote: With device tree, pdev->id is always -1, so we introduce a local counter. Signed-off-by: Richard Genoud --- drivers/misc/atmel-ssc.c |7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c index 3afbd82..d1ec5ab 100644 --- a/drivers/misc/atmel-ssc.c +++ b/drivers/misc/atmel-ssc.c @@ -173,6 +173,12 @@ out: return err; } +/* counter of ssc devive instances. + * With device tree pdev->id is always -1, so we have to keep the + * count ourselves + */ +static int ssc_device_id; Do we really need this? If Yes, would it better to get from device through of_alias_get_id? + static int ssc_probe(struct platform_device *pdev) { struct resource *regs; @@ -235,6 +241,7 @@ static int ssc_probe(struct platform_device *pdev) } spin_lock(&user_lock); + pdev->id = ssc_device_id++; list_add_tail(&ssc->list, &ssc_list); spin_unlock(&user_lock); Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFC PATCH 08/13] sound: sam9x5_wm8731: machine driver for at91sam9x5 wm8731 boards
SNDRV_PCM_RATE_32000 | + SNDRV_PCM_RATE_48000 | + SNDRV_PCM_RATE_96000; + break; + case 1200: + /* all wm8731 rates supported */ + break; + default: + dev_err(dev, "ASoC: Codec Master clock rate not defined\n"); + return -EINVAL; + } Here, I think we not need to use switch ... case, as the MCLK_RATE is hard code as 12288000. --- + /* set not connected pins */ + snd_soc_dapm_nc_pin(dapm, "Mic Bias"); + snd_soc_dapm_nc_pin(dapm, "MICIN"); + snd_soc_dapm_nc_pin(dapm, "LOUT"); + snd_soc_dapm_nc_pin(dapm, "ROUT"); + + /* always connected */ + snd_soc_dapm_enable_pin(dapm, "Headphone Jack"); + snd_soc_dapm_enable_pin(dapm, "Line In Jack"); This part, not needed, as to the ASoC framework will deal with it. + /* set the codec system clock for DAC and ADC */ + ret = snd_soc_dai_set_sysclk(codec_dai, WM8731_SYSCLK_XTAL, +MCLK_RATE, SND_SOC_CLOCK_IN); + if (ret < 0) { + dev_err(dev, "ASoC: Failed to set WM8731 SYSCLK: %d\n", ret); + return ret; + } + + /* signal a DAPM event */ + snd_soc_dapm_sync(dapm); + return 0; +} + +static int sam9x5_wm8731_driver_probe(struct platform_device *pdev) +{ + struct device_node *np = pdev->dev.of_node; + struct device_node *codec_np, *cpu_np; + struct snd_soc_card *card; + struct snd_soc_dai_link *dai; + int ret; + + if (!np) { + dev_err(&pdev->dev, "No device node supplied\n"); + return -EINVAL; + } + + ret = atmel_ssc_set_audio(0); + if (ret != 0) { + dev_err(&pdev->dev, + "ASoC: Failed to set SSC 0 for audio: %d\n", ret); + return ret; + } + + card = devm_kzalloc(&pdev->dev, sizeof(*card), GFP_KERNEL); + dai = devm_kzalloc(&pdev->dev, sizeof(*dai), GFP_KERNEL); + if (!dai || !card) { + ret = -ENOMEM; + goto out; + } + + card->dev = &pdev->dev; + card->owner = THIS_MODULE; + card->dai_link = dai; + card->num_links = 1; + dai->name = "WM8731"; + dai->stream_name = "WM8731 PCM"; + dai->codec_dai_name = "wm8731-hifi"; + dai->init = at91sam9x5ek_wm8731_init; + card->dapm_widgets = at91sam9x5ek_dapm_widgets; + card->num_dapm_widgets = ARRAY_SIZE(at91sam9x5ek_dapm_widgets); Will keep these as snd_soc_card and snd_soc_dai_link structure separately? + ret = snd_soc_of_parse_card_name(card, "atmel,model"); + if (ret) + goto out; + + ret = snd_soc_of_parse_audio_routing(card, "atmel,audio-routing"); + if (ret) + goto out; + + codec_np = of_parse_phandle(np, "atmel,audio-codec", 0); + if (!codec_np) { + dev_err(&pdev->dev, "codec info missing\n"); + ret = -EINVAL; + goto out; + } + + dai->codec_of_node = codec_np; + + cpu_np = of_parse_phandle(np, "atmel,ssc-controller", 0); + if (!cpu_np) { + dev_err(&pdev->dev, "ssc controller node missing\n"); + ret = -EINVAL; + goto out; + } + dai->cpu_of_node = cpu_np; + dai->platform_of_node = cpu_np; + + of_node_put(codec_np); + of_node_put(cpu_np); + + dai->dai_fmt = snd_soc_of_parse_daifmt(np, "atmel,"); + + ret = snd_soc_register_card(card); + if (ret) { + dev_err(&pdev->dev, + "ASoC: Platform device allocation failed\n"); + goto out; + } + + platform_set_drvdata(pdev, card); + + dev_info(&pdev->dev, "ASoC: at91sam9x5ek_init ok\n"); + + return ret; + +out: + atmel_ssc_put_audio(0); + return ret; +} + +static int sam9x5_wm8731_driver_remove(struct platform_device *pdev) +{ + struct snd_soc_card *card = platform_get_drvdata(pdev); + + snd_soc_unregister_card(card); + atmel_ssc_put_audio(0); + + return 0; +} + +static const struct of_device_id sam9x5_wm8731_of_match[] = { + { .compatible = "atmel,sam9x5-audio-wm8731", }, + {}, +}; +MODULE_DEVICE_TABLE(of, sam9x5_wm8731_of_match); + +static struct platform_driver sam9x5_wm8731_driver = { + .driver = { +
[PATCH 1/2] ASoC: atmel_ssc_dai: move set dma data to startup callback
move set dma data to startup callback function, if the set dma data exist in hw_params callback, so the dma data only usable when call hw_params, if want use it before hw_params callback, it will cause NULL pointer access oops Signed-off-by: Bo Shen --- sound/soc/atmel/atmel_ssc_dai.c | 33 - 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index f3fdfa0..6cf9cf1 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c @@ -196,15 +196,27 @@ static int atmel_ssc_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct atmel_ssc_info *ssc_p = &ssc_info[dai->id]; - int dir_mask; + struct atmel_pcm_dma_params *dma_params; + int dir, dir_mask; pr_debug("atmel_ssc_startup: SSC_SR=0x%u\n", ssc_readl(ssc_p->ssc->regs, SR)); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + dir = 0; dir_mask = SSC_DIR_MASK_PLAYBACK; - else + } else { + dir = 1; dir_mask = SSC_DIR_MASK_CAPTURE; + } + + dma_params = &ssc_dma_params[dai->id][dir]; + dma_params->ssc = ssc_p->ssc; + dma_params->substream = substream; + + ssc_p->dma_params[dir] = dma_params; + + snd_soc_dai_set_dma_data(dai, substream, dma_params); spin_lock_irq(&ssc_p->lock); if (ssc_p->dir_mask & dir_mask) { @@ -325,7 +337,6 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { - struct snd_soc_pcm_runtime *rtd = snd_pcm_substream_chip(substream); int id = dai->id; struct atmel_ssc_info *ssc_p = &ssc_info[id]; struct atmel_pcm_dma_params *dma_params; @@ -344,19 +355,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, else dir = 1; - dma_params = &ssc_dma_params[id][dir]; - dma_params->ssc = ssc_p->ssc; - dma_params->substream = substream; - - ssc_p->dma_params[dir] = dma_params; - - /* -* The snd_soc_pcm_stream->dma_data field is only used to communicate -* the appropriate DMA parameters to the pcm driver hw_params() -* function. It should not be used for other purposes -* as it is common to all substreams. -*/ - snd_soc_dai_set_dma_data(rtd->cpu_dai, substream, dma_params); + dma_params = ssc_p->dma_params[dir]; channels = params_channels(params); -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/2] ASoC: atmel-pcm: use generic dmaengine framework
Align atmel pcm to use ASoC generic dmaengine framework Signed-off-by: Bo Shen --- sound/soc/atmel/atmel-pcm-dma.c | 118 ++- 1 file changed, 16 insertions(+), 102 deletions(-) diff --git a/sound/soc/atmel/atmel-pcm-dma.c b/sound/soc/atmel/atmel-pcm-dma.c index 1d38fd0..0f6c701 100644 --- a/sound/soc/atmel/atmel-pcm-dma.c +++ b/sound/soc/atmel/atmel-pcm-dma.c @@ -89,138 +89,52 @@ static void atmel_pcm_dma_irq(u32 ssc_sr, } } -/*--*\ - * DMAENGINE operations -\*--*/ -static bool filter(struct dma_chan *chan, void *slave) -{ - struct at_dma_slave *sl = slave; - - if (sl->dma_dev == chan->device->dev) { - chan->private = sl; - return true; - } else { - return false; - } -} - static int atmel_pcm_configure_dma(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *params, struct atmel_pcm_dma_params *prtd) + struct snd_pcm_hw_params *params, struct dma_slave_config *slave_config) { + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct atmel_pcm_dma_params *prtd; struct ssc_device *ssc; - struct dma_chan *dma_chan; - struct dma_slave_config slave_config; int ret; + prtd = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); ssc = prtd->ssc; - ret = snd_hwparams_to_dma_slave_config(substream, params, - &slave_config); + ret = snd_hwparams_to_dma_slave_config(substream, params, slave_config); if (ret) { pr_err("atmel-pcm: hwparams to dma slave configure failed\n"); return ret; } if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { - slave_config.dst_addr = (dma_addr_t)ssc->phybase + SSC_THR; - slave_config.dst_maxburst = 1; + slave_config->dst_addr = (dma_addr_t)ssc->phybase + SSC_THR; + slave_config->dst_maxburst = 1; } else { - slave_config.src_addr = (dma_addr_t)ssc->phybase + SSC_RHR; - slave_config.src_maxburst = 1; - } - - dma_chan = snd_dmaengine_pcm_get_chan(substream); - if (dmaengine_slave_config(dma_chan, &slave_config)) { - pr_err("atmel-pcm: failed to configure dma channel\n"); - ret = -EBUSY; - return ret; - } - - return 0; -} - -static int atmel_pcm_hw_params(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *params) -{ - struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct atmel_pcm_dma_params *prtd; - struct ssc_device *ssc; - struct at_dma_slave *sdata = NULL; - int ret; - - snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer); - - prtd = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); - ssc = prtd->ssc; - if (ssc->pdev) - sdata = ssc->pdev->dev.platform_data; - - ret = snd_dmaengine_pcm_open_request_chan(substream, filter, sdata); - if (ret) { - pr_err("atmel-pcm: dmaengine pcm open failed\n"); - return -EINVAL; - } - - ret = atmel_pcm_configure_dma(substream, params, prtd); - if (ret) { - pr_err("atmel-pcm: failed to configure dmai\n"); - goto err; + slave_config->src_addr = (dma_addr_t)ssc->phybase + SSC_RHR; + slave_config->src_maxburst = 1; } prtd->dma_intr_handler = atmel_pcm_dma_irq; return 0; -err: - snd_dmaengine_pcm_close_release_chan(substream); - return ret; } -static int atmel_pcm_dma_prepare(struct snd_pcm_substream *substream) -{ - struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct atmel_pcm_dma_params *prtd; - - prtd = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); - - ssc_writex(prtd->ssc->regs, SSC_IER, prtd->mask->ssc_error); - ssc_writex(prtd->ssc->regs, SSC_CR, prtd->mask->ssc_enable); - - return 0; -} - -static int atmel_pcm_open(struct snd_pcm_substream *substream) -{ - snd_soc_set_runtime_hwparams(substream, &atmel_pcm_dma_hardware); - - return 0; -} - -static struct snd_pcm_ops atmel_pcm_ops = { - .open = atmel_pcm_open, - .close = snd_dmaengine_pcm_close_release_chan, - .ioctl = snd_pcm_lib_ioctl, - .hw_params = atmel_pcm_hw_params, - .prepare= atmel_pcm_dma_prepare, - .trigger= snd_dmaengine_pcm_trigger, - .pointer= snd_dmaengine_pcm_pointer_no_residue, - .m
[PATCH 0/2] ASoC: atmel-pcm: use generic dmaengine framework
this patch series is based on next-20130701 Bo Shen (2): ASoC: atmel_ssc_dai: move set dma data to startup callback ASoC: atmel-pcm: use generic dmaengine framework sound/soc/atmel/atmel-pcm-dma.c | 118 ++- sound/soc/atmel/atmel_ssc_dai.c | 33 ++- 2 files changed, 32 insertions(+), 119 deletions(-) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFC PATCH 01/13] misc: atmel_ssc: add device tree DMA support
Hi Richard, On 7/2/2013 16:13, Richard Genoud wrote: Please hold on of this, as to the ASoC dmaengine will deal with this. So, we >not need do it manually. > >Now, I am working on it. And will send out the patch soon after testing OK. Ok, I stay tuned ! I think you can go on working with the two patches I send just now. [1]: ASoC: atmel_ssc_dai: move set dma data to startup callback https://patchwork.kernel.org/patch/2811241/ [2]: ASoC: atmel-pcm: use generic dmaengine framework https://patchwork.kernel.org/patch/2811261/ I use your patches 4 ~ 8 do a quick testing, it works. Please note the name of asound.state under /etc in your rootfs should the same with atmel,model in patch 6. Thanks ! Best regards, Richard Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [alsa-devel] [PATCH 1/2] ASoC: atmel_ssc_dai: move set dma data to startup callback
Hi Lars-Peter, On 7/2/2013 23:25, Lars-Peter Clausen wrote: On 07/02/2013 11:04 AM, Bo Shen wrote: [...] + dma_params->substream = substream; Unrelated to this patch, but having a substream field in the dma_params seems to be redundant, since you need to know the substream to get the dma_params in the first place. Looking at the code it also seems to be unused other than this assignment. Maybe you can send a follow up patch to remove it. [...] Yes, this is redundant. I will remove it in next version patches. Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [alsa-devel] [PATCH 2/2] ASoC: atmel-pcm: use generic dmaengine framework
Hi Lars-Peter, On 7/2/2013 23:34, Lars-Peter Clausen wrote: On 07/02/2013 11:04 AM, Bo Shen wrote: [...] -/*--*\ - * DMAENGINE operations -\*--*/ -static bool filter(struct dma_chan *chan, void *slave) -{ - struct at_dma_slave *sl = slave; - - if (sl->dma_dev == chan->device->dev) { - chan->private = sl; - return true; - } else { - return false; - } -} I'm wondering why is filtering no longer required? Now this is handled by at_dma_filter in at_hdmac driver. More information, you can reference: file [...] + slave_config->dst_addr = (dma_addr_t)ssc->phybase + SSC_THR; [...] + slave_config->src_addr = (dma_addr_t)ssc->phybase + SSC_RHR; Change the type of phybase to dma_addr_t It should be: slave_config->dst_addr = (dma_addr_t)(ssc->phybase + SSC_THR); slave_config->src_addr = (dma_addr_t)(ssc->phybase + SSC_RHR); [...] } -static int atmel_pcm_dma_prepare(struct snd_pcm_substream *substream) -{ - struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct atmel_pcm_dma_params *prtd; - - prtd = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); - - ssc_writex(prtd->ssc->regs, SSC_IER, prtd->mask->ssc_error); - ssc_writex(prtd->ssc->regs, SSC_CR, prtd->mask->ssc_enable); These writes are also completely lost This will be moved to DAI driver startup callback function. - - return 0; -} I think it would also be good to get rid of any references to the ssc struct from the DMA driver and move them over to the DAI driver. I will try to implement this in next version patch. Thanks. - Lars Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [alsa-devel] [PATCH 1/2] ASoC: atmel_ssc_dai: move set dma data to startup callback
Hi Lars, On 7/3/2013 09:20, Bo Shen wrote: Hi Lars-Peter, On 7/2/2013 23:25, Lars-Peter Clausen wrote: On 07/02/2013 11:04 AM, Bo Shen wrote: [...] +dma_params->substream = substream; Unrelated to this patch, but having a substream field in the dma_params seems to be redundant, since you need to know the substream to get the dma_params in the first place. Looking at the code it also seems to be unused other than this assignment. Maybe you can send a follow up patch to remove it. [...] Yes, this is redundant. I will remove it in next version patches. Sorry for mistake, this substream parameter need by the interrupt for PDC transfer, so, I will keep it. Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [alsa-devel] [PATCH 2/2] ASoC: atmel-pcm: use generic dmaengine framework
Hi Lars, On 7/3/2013 15:36, Lars-Peter Clausen wrote: +slave_config->dst_addr = (dma_addr_t)ssc->phybase + SSC_THR; >>[...] >>>+slave_config->src_addr = (dma_addr_t)ssc->phybase + SSC_RHR; >> >>Change the type of phybase to dma_addr_t > >It should be: >slave_config->dst_addr = (dma_addr_t)(ssc->phybase + SSC_THR); >slave_config->src_addr = (dma_addr_t)(ssc->phybase + SSC_RHR); The type of phybase in the ssc_device struct should be changed from resource_size_t to dma_addr_t. Actually, the phybase in ssc_device structure is resource_size_t which used to access the ssc device register. Here, we use ssc register as dma source address or destination address, so we convert it to dma_addr_t type. So, not need to change, am I right? Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [alsa-devel] [PATCH 2/2] ASoC: atmel-pcm: use generic dmaengine framework
Hi Lars, On 7/3/2013 16:08, Lars-Peter Clausen wrote: On 07/03/2013 09:57 AM, Bo Shen wrote: Hi Lars, On 7/3/2013 15:36, Lars-Peter Clausen wrote: +slave_config->dst_addr = (dma_addr_t)ssc->phybase + SSC_THR; [...] +slave_config->src_addr = (dma_addr_t)ssc->phybase + SSC_RHR; Change the type of phybase to dma_addr_t It should be: slave_config->dst_addr = (dma_addr_t)(ssc->phybase + SSC_THR); slave_config->src_addr = (dma_addr_t)(ssc->phybase + SSC_RHR); The type of phybase in the ssc_device struct should be changed from resource_size_t to dma_addr_t. Actually, the phybase in ssc_device structure is resource_size_t which used to access the ssc device register. Here, we use ssc register as dma source address or destination address, so we convert it to dma_addr_t type. So, not need to change, am I right? Isn't 'regs' used to access the registers? As far as I can see phybase is only used in the audio DMA driver. Thanks for point out this. I will change the phybase type from resource_size_t to dma_addr_t. - Lars Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFC PATCH 01/13] misc: atmel_ssc: add device tree DMA support
Hi Richard, On 7/3/2013 23:51, Richard Genoud wrote: >but there's a violent hang (kernel stops, no trace) when I try the record : >arecord -v -V stereo -Dplug:default -f cd -t wav -c 2 /tmp/toto.wav >last thing I see is : >dma dma0chan3: atc_control (3) I don't meet this issue. Playback and recording works well on my side on at91sam9g35ek board. >I'll try to trace that. I think it's DMA related. the last thing done by the kernel is: i2c i2c-0: i2c_outb: 0x34 A i2c i2c-0: i2c_outb: 0x0c A i2c i2c-0: i2c_outb: 0x5a A meaning: enable power on, LINE IN, ADC, OSC, on the WM8731 so, after that, data is comming from the codec to the SSC and then is handled by the DMA. there must be something nasty on the DMA bus to hang everything like that... Will you try i2c without DMA support to test this issue? Richard. Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 4/4] arm: atmel: sam9n12: enable kernel uncompress info output
the sam9n12 use the same array usart as sam9x5, add it which will enable output kernel uncompress info: ---8>--- Uncompressing Linux... done, booting the kernel. ---<8--- Signed-off-by: Bo Shen --- arch/arm/mach-at91/include/mach/uncompress.h |1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-at91/include/mach/uncompress.h b/arch/arm/mach-at91/include/mach/uncompress.h index fe097e6..4bb644f 100644 --- a/arch/arm/mach-at91/include/mach/uncompress.h +++ b/arch/arm/mach-at91/include/mach/uncompress.h @@ -130,6 +130,7 @@ static inline const u32* decomp_soc_detect(void __iomem *dbgu_base) case ARCH_ID_AT91SAM9RL64: return uarts_sam9rl; + case ARCH_ID_AT91SAM9N12: case ARCH_ID_AT91SAM9X5: return uarts_sam9x5; -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/4] arm: atmel: include sama5d3.h into hardware.h
include sama5d3.h into hardware.h Signed-off-by: Bo Shen --- arch/arm/mach-at91/include/mach/hardware.h |1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-at91/include/mach/hardware.h b/arch/arm/mach-at91/include/mach/hardware.h index a832e07..f17aa31 100644 --- a/arch/arm/mach-at91/include/mach/hardware.h +++ b/arch/arm/mach-at91/include/mach/hardware.h @@ -33,6 +33,7 @@ #include #include #include +#include /* * On all at91 except rm9200 and x40 have the System Controller starts -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 0/4] arm: atmel: enable kernel uncompress info output
this patch set enable kernel uncompress info output - sama5d3 - at91sam9n12 without this patch set, it won't show following information ---8>--- Uncompressing Linux... done, booting the kernel. ---<8--- Bo Shen (4): arm: atmel: sama5: add definition for usart base address arm: atmel: include sama5d3.h into hardware.h arm: atmel: sama5: enable kernel uncompress info output arm: atmel: sam9n12: enable kernel uncompress info output arch/arm/mach-at91/include/mach/hardware.h |1 + arch/arm/mach-at91/include/mach/sama5d3.h|8 arch/arm/mach-at91/include/mach/uncompress.h | 13 + 3 files changed, 22 insertions(+) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 3/4] arm: atmel: sama5: enable kernel uncompress info output
enable kernel uncompress info output, which will show as following: ---8>--- Uncompressing Linux... done, booting the kernel. ---<8--- Signed-off-by: Bo Shen --- arch/arm/mach-at91/include/mach/uncompress.h | 12 1 file changed, 12 insertions(+) diff --git a/arch/arm/mach-at91/include/mach/uncompress.h b/arch/arm/mach-at91/include/mach/uncompress.h index 5659f7c..fe097e6 100644 --- a/arch/arm/mach-at91/include/mach/uncompress.h +++ b/arch/arm/mach-at91/include/mach/uncompress.h @@ -94,6 +94,15 @@ static const u32 uarts_sam9x5[] = { 0, }; +static const u32 uarts_sama5[] = { + AT91_BASE_DBGU1, + SAMA5D3_BASE_USART0, + SAMA5D3_BASE_USART1, + SAMA5D3_BASE_USART2, + SAMA5D3_BASE_USART3, + 0, +}; + static inline const u32* decomp_soc_detect(void __iomem *dbgu_base) { u32 cidr, socid; @@ -123,6 +132,9 @@ static inline const u32* decomp_soc_detect(void __iomem *dbgu_base) case ARCH_ID_AT91SAM9X5: return uarts_sam9x5; + + case ARCH_ID_SAMA5D3: + return uarts_sama5; } /* at91sam9g10 */ -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/4] arm: atmel: sama5: add definition for usart base address
add definition for usart base address Signed-off-by: Bo Shen --- arch/arm/mach-at91/include/mach/sama5d3.h |8 1 file changed, 8 insertions(+) diff --git a/arch/arm/mach-at91/include/mach/sama5d3.h b/arch/arm/mach-at91/include/mach/sama5d3.h index 6dc81ee..31096a8 100644 --- a/arch/arm/mach-at91/include/mach/sama5d3.h +++ b/arch/arm/mach-at91/include/mach/sama5d3.h @@ -65,6 +65,14 @@ #define SAMA5D3_ID_IRQ047 /* Advanced Interrupt Controller (IRQ0) */ /* + * User Peripheral physical base addresses. + */ +#define SAMA5D3_BASE_USART00xf001c000 +#define SAMA5D3_BASE_USART10xf002 +#define SAMA5D3_BASE_USART20xf802 +#define SAMA5D3_BASE_USART30xf8024000 + +/* * Internal Memory */ #define SAMA5D3_SRAM_BASE 0x0030 /* Internal SRAM base address */ -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFC PATCH 01/13] misc: atmel_ssc: add device tree DMA support
Hi Richard, On 7/4/2013 21:44, Richard Genoud wrote: 2013/7/4 Bo Shen : Hi Richard, On 7/3/2013 23:51, Richard Genoud wrote: but there's a violent hang (kernel stops, no trace) when I try the record : arecord -v -V stereo -Dplug:default -f cd -t wav -c 2 /tmp/toto.wav last thing I see is : dma dma0chan3: atc_control (3) I don't meet this issue. Playback and recording works well on my side on at91sam9g35ek board. I'll try to trace that. I think it's DMA related. the last thing done by the kernel is: i2c i2c-0: i2c_outb: 0x34 A i2c i2c-0: i2c_outb: 0x0c A i2c i2c-0: i2c_outb: 0x5a A meaning: enable power on, LINE IN, ADC, OSC, on the WM8731 so, after that, data is comming from the codec to the SSC and then is handled by the DMA. there must be something nasty on the DMA bus to hang everything like that... Will you try i2c without DMA support to test this issue? Ok, I nailed it ! To be sure we are on the same base, here is what I have done: onto next-20130704: - your 5 patches: ASoC: atmel_ssc_dai: move set dma data to startup callback ASoC: atmel_ssc_dai: add error mask define ASoC: atmel-pcm-dma: move prepare for dma to dai prepare ARM: atmel-ssc: change phybase type to dma_addr_t ASoC: atmel-pcm: use generic dmaengine framework - my patches 4-8: ARM: at91: DTS: sam9x5: add SSC DMA parameters ARM: AT91: DTS: sam9x5ek: add WM8731 codec ARM: AT91: DTS: sam9x5ek: add sound configuration ARM: AT91: DTS: sam9x5ek: enable SSC sound: sam9x5_wm8731: machine driver for at91sam9x5 wm8731 boards To be sure that dma-I2c doesn't disturb something, I use i2c gpio bitbang: diff --git a/arch/arm/boot/dts/at91sam9x5ek.dtsi b/arch/arm/boot/dts/at91sam9x5ek.dtsi index 6684d4b..53a991e 100644 --- a/arch/arm/boot/dts/at91sam9x5ek.dtsi +++ b/arch/arm/boot/dts/at91sam9x5ek.dtsi @@ -57,15 +57,6 @@ status = "okay"; }; - i2c0: i2c@f801 { - status = "okay"; - - wm8731: wm8731@1a { - compatible = "wm8731"; - reg = <0x1a>; - }; - }; - pinctrl@f400 { mmc0 { pinctrl_board_mmc0: mmc0-board { @@ -114,6 +105,15 @@ }; }; + i2c@0 { + status = "okay"; + + wm8731: wm8731@1a { + compatible = "wm8731"; + reg = <0x1a>; + }; + }; + sound { compatible = "atmel,sam9x5-audio-wm8731"; with that configuration, it hangs when I do a: arecord -v -V stereo -Dplug:default -f cd -t wav -c 2 /tmp/toto.wav Now, if I remove the overrun error on ssc in rx_mask: diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index 0ecf356..c04e825 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c @@ -83,7 +83,6 @@ static struct atmel_ssc_mask ssc_rx_mask = { .ssc_disable= SSC_BIT(CR_RXDIS), .ssc_endx = SSC_BIT(SR_ENDRX), .ssc_endbuf = SSC_BIT(SR_RXBUFF), - .ssc_error = SSC_BIT(SR_OVRUN), .pdc_enable = ATMEL_PDC_RXTEN, .pdc_disable= ATMEL_PDC_RXTDIS, }; It doesn't hang any more doing a simple record. BUT it still hangs if we do record and play at the same time. Removing the overrun on tx_mask prevent the hang: diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index 0ecf356..41e15c2 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c @@ -73,7 +73,6 @@ static struct atmel_ssc_mask ssc_tx_mask = { .ssc_disable= SSC_BIT(CR_TXDIS), .ssc_endx = SSC_BIT(SR_ENDTX), .ssc_endbuf = SSC_BIT(SR_TXBUFE), - .ssc_error = SSC_BIT(SR_OVRUN), .pdc_enable = ATMEL_PDC_TXTEN, .pdc_disable= ATMEL_PDC_TXTDIS, }; i.e. when I revert "ASoC: atmel_ssc_dai: add error mask define", I don't see any hang. Could you test and confirm that behaviour please ? Yes, I aware this issue. Actually the system not hang, the resource all are occupied by the interrupt. This because, we enable the interrupt, when once interrupt occur, I try many methods to clear it, however we can not clear it. So, it generates the interrupt all the time. It seems the system hang. Temp solution: not enable the interrupt. use the following patch to disable the interrupt. ---8>--- diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index 0ecf356..bb53dea 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c @@ -649,7 +649,7 @@ static int atmel_s
Re: [RFC PATCH 08/13] sound: sam9x5_wm8731: machine driver for at91sam9x5 wm8731 boards
Hi Richard, On 7/5/2013 23:15, Richard Genoud wrote: + card->dev = &pdev->dev; >>+ card->owner = THIS_MODULE; >>+ card->dai_link = dai; >>+ card->num_links = 1; >>+ dai->name = "WM8731"; >>+ dai->stream_name = "WM8731 PCM"; >>+ dai->codec_dai_name = "wm8731-hifi"; >>+ dai->init = at91sam9x5ek_wm8731_init; >>+ card->dapm_widgets = at91sam9x5ek_dapm_widgets; >>+ card->num_dapm_widgets = ARRAY_SIZE(at91sam9x5ek_dapm_widgets); > > >Will keep these as snd_soc_card and snd_soc_dai_link structure separately? I don't really understand what you mean here. do you mean that something like that will more explicit ? : + card->dai_link[0].name = "WM8731"; + card->dai_link[0].stream_name = "WM8731 PCM"; + card->dai_link[0].codec_dai_name = "wm8731-hifi"; + card->dai_link[0].init = at91sam9x5ek_wm8731_init; I mean using structure to define snd_soc_card and snd_soc_dai_link, look like: struct snd_soc_dai_link dai_link_name = { .name = xxx, .stream_name = xxx, ... }; struct snd_soc_card card_name = { .name = .ower = THIS_MODULE, .dai_link = &dai_link_name, ... }; In this way, I think it will be more clear than put them in code. Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[RFC PATCH] pwm: atmel-pwm: add pwm controller driver
add atmel pwm controller driver based on PWM framework this is basic function implementation of pwm controller it can work with pwm based led and backlight Signed-off-by: Bo Shen --- This patch is based on Linux v3.11 rc6 Tested on sama5d31ek and at91sam9m10g45ek board --- .../devicetree/bindings/pwm/atmel-pwm.txt | 19 ++ drivers/pwm/Kconfig|9 + drivers/pwm/Makefile |1 + drivers/pwm/pwm-atmel.c| 327 4 files changed, 356 insertions(+) create mode 100644 Documentation/devicetree/bindings/pwm/atmel-pwm.txt create mode 100644 drivers/pwm/pwm-atmel.c diff --git a/Documentation/devicetree/bindings/pwm/atmel-pwm.txt b/Documentation/devicetree/bindings/pwm/atmel-pwm.txt new file mode 100644 index 000..127fcdb --- /dev/null +++ b/Documentation/devicetree/bindings/pwm/atmel-pwm.txt @@ -0,0 +1,19 @@ +Atmel PWM controller + +Required properties: + - compatible: should be one of: +- "atmel,at91sam9rl-pwm" +- "atmel,sama5-pwm" + - reg: physical base address and length of the controller's registers + - #pwm-cells: Should be 3. +- The first cell specifies the per-chip index of the PWM to use +- The second cell is the period in nanoseconds +- The third cell is used to encode the polarity of PWM output + +Example: + + pwm0: pwm@f8034000 { + compatible = "atmel,at91sam9rl-pwm"; + reg = <0xf8034000 0x400>; + #pwm-cells = <3>; + }; diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig index 75840b5..54237b9 100644 --- a/drivers/pwm/Kconfig +++ b/drivers/pwm/Kconfig @@ -41,6 +41,15 @@ config PWM_AB8500 To compile this driver as a module, choose M here: the module will be called pwm-ab8500. +config PWM_ATMEL + tristate "Atmel PWM support" + depends on ARCH_AT91 + help + Generic PWM framework driver for Atmel SoC. + + To compile this driver as a module, choose M here: the module + will be called pwm-atmel. + config PWM_ATMEL_TCB tristate "Atmel TC Block PWM support" depends on ATMEL_TCLIB && OF diff --git a/drivers/pwm/Makefile b/drivers/pwm/Makefile index 77a8c18..5b193f8 100644 --- a/drivers/pwm/Makefile +++ b/drivers/pwm/Makefile @@ -1,6 +1,7 @@ obj-$(CONFIG_PWM) += core.o obj-$(CONFIG_PWM_SYSFS)+= sysfs.o obj-$(CONFIG_PWM_AB8500) += pwm-ab8500.o +obj-$(CONFIG_PWM_ATMEL)+= pwm-atmel.o obj-$(CONFIG_PWM_ATMEL_TCB)+= pwm-atmel-tcb.o obj-$(CONFIG_PWM_BFIN) += pwm-bfin.o obj-$(CONFIG_PWM_IMX) += pwm-imx.o diff --git a/drivers/pwm/pwm-atmel.c b/drivers/pwm/pwm-atmel.c new file mode 100644 index 000..b83d68e --- /dev/null +++ b/drivers/pwm/pwm-atmel.c @@ -0,0 +1,327 @@ +/* + * Driver for Atmel Pulse Width Modulation Controller + * + * Copyright (C) 2013 Atmel Semiconductor Technology Ltd. + * Bo Shen + * + * GPL v2 or later + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define PWM_MR 0x00 +#define PWM_ENA0x04 +#define PWM_DIS0x08 +#define PWM_SR 0x0C + +#define PWM_CMR0x00 + +/* The following register for PWM v1 */ +#define PWMv1_CDTY 0x04 +#define PWMv1_CPRD 0x08 +#define PWMv1_CUPD 0x10 + +/* The following register for PWM v2 */ +#define PWMv2_CDTY 0x04 +#define PWMv2_CDTYUPD 0x08 +#define PWMv2_CPRD 0x0C +#define PWMv2_CPRDUPD 0x10 + +#define PWM_NUM4 + +struct atmel_pwm_chip { + struct pwm_chip chip; + struct clk *clk; + void __iomem *base; + + void (*config)(struct atmel_pwm_chip *chip, struct pwm_device *pwm, + unsigned int dty, unsigned int prd); +}; + +#define to_atmel_pwm_chip(chip) container_of(chip, struct atmel_pwm_chip, chip) + +static inline u32 atmel_pwm_readl(struct atmel_pwm_chip *chip, int offset) +{ + return readl(chip->base + offset); +} + +static inline void atmel_pwm_writel(struct atmel_pwm_chip *chip, int offset, + u32 val) +{ + writel(val, chip->base + offset); +} + +static inline u32 atmel_pwm_ch_readl(struct atmel_pwm_chip *chip, int ch, + int offset) +{ + return readl(chip->base + 0x200 + ch * 0x20 + offset); +} + +static inline void atmel_pwm_ch_writel(struct atmel_pwm_chip *chip, int ch, + int offset, u32 val) +{ + writel(val, chip->base + 0x200 + ch * 0x20 + offset); +} + +static int atmel_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, + int duty_ns, int period_ns) +{ + struct atmel_pwm_chip *atmel_pwm = to_atmel_pwm_chip(chip); + unsigned long long val, prd, dty; + unsigned long long div
Re: [RFC PATCH] pwm: atmel-pwm: add pwm controller driver
Hi Thierry, On 8/20/2013 05:20, Thierry Reding wrote: On Mon, Aug 19, 2013 at 11:11:06AM +0800, Bo Shen wrote: add atmel pwm controller driver based on PWM framework this is basic function implementation of pwm controller it can work with pwm based led and backlight Please use the proper spelling "PWM" in prose. Variable names and such should be "pwm", though. Also sentences should start with a capital letter and end with a full stop ('.'). I will do in next version. Signed-off-by: Bo Shen --- This patch is based on Linux v3.11 rc6 It's usually safer to work on top of the latest subsystem branch because it may contain patches that influence your patch as well. For most subsystems that branch is merged into linux-next, so that usually works well as the basis when writing patches. For next version, I will base on for-next branch on Linux PWM tree diff --git a/Documentation/devicetree/bindings/pwm/atmel-pwm.txt b/Documentation/devicetree/bindings/pwm/atmel-pwm.txt [...] + - #pwm-cells: Should be 3. +- The first cell specifies the per-chip index of the PWM to use +- The second cell is the period in nanoseconds +- The third cell is used to encode the polarity of PWM output For instance, patches were recently added to make the description of this property more consistent across the bindings documentation of PWM drivers. The more canonical form now is: - #pwm-cells: Should be 3. See pwm.txt in this directory for a description of the cells format. Thanks, I will use this in next version. diff --git a/drivers/pwm/pwm-atmel.c b/drivers/pwm/pwm-atmel.c [...] +#define PWM_MR 0x00 This doesn't seem to be used. I will remove it in next version, If will it for new feature, I will add it. +#define PWM_ENA0x04 +#define PWM_DIS0x08 +#define PWM_SR 0x0C Perhaps it'd be useful to add a comment that the above are global registers and the ones below are per-channel. I will add the comments in next version. +#define PWM_CMR0x00 + +/* The following register for PWM v1 */ +#define PWMv1_CDTY 0x04 +#define PWMv1_CPRD 0x08 +#define PWMv1_CUPD 0x10 + +/* The following register for PWM v2 */ +#define PWMv2_CDTY 0x04 +#define PWMv2_CDTYUPD 0x08 +#define PWMv2_CPRD 0x0C +#define PWMv2_CPRDUPD 0x10 + +#define PWM_NUM4 The only place where this is used is in the .probe() function, so you can just as well drop it. OK, I will hard code it in probe function. +struct atmel_pwm_chip { + struct pwm_chip chip; + struct clk *clk; + void __iomem *base; + + void (*config)(struct atmel_pwm_chip *chip, struct pwm_device *pwm, + unsigned int dty, unsigned int prd); Please use the same parameter names as the PWM core for consistency. OK, I will use the same parameter names as the PWM core for consistency. +}; + +#define to_atmel_pwm_chip(chip) container_of(chip, struct atmel_pwm_chip, chip) This should be a static inline function so that types are properly checked OK, I will change it as a static inline function. + +static inline u32 atmel_pwm_readl(struct atmel_pwm_chip *chip, int offset) "offset" is usually unsigned long. OK, I will use unsigned long to define it. And change all related definition. +{ + return readl(chip->base + offset); +} + +static inline void atmel_pwm_writel(struct atmel_pwm_chip *chip, int offset, + u32 val) And "value" is usually also unsigned long. +{ + writel(val, chip->base + offset); +} + +static inline u32 atmel_pwm_ch_readl(struct atmel_pwm_chip *chip, int ch, + int offset) "channel" can be unsigned int, and "offset" unsigned long again. Also the alignment is wrong here. The arguments continued on a new line should be aligned with the arguments on the previous line. I will fix the alignment in next version. +static int atmel_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, + int duty_ns, int period_ns) +{ + struct atmel_pwm_chip *atmel_pwm = to_atmel_pwm_chip(chip); + unsigned long long val, prd, dty; + unsigned long long div, clk_rate; All of these unsigned long long can be declared on one line. I will fix in next version. + int ret, pres = 0; + + clk_rate = clk_get_rate(atmel_pwm->clk); + + while (1) { + div = 10; + div *= 1 << pres; + val = clk_rate * period_ns; + prd = div_u64(val, div); + val = clk_rate * duty_ns; + dty = div_u64(val, div); + + if (prd < 0x0001 || dty < 0x0) + return -EINVAL; I find the usage of hexadecimal literals a bit strange here. Perhaps just change this to: if (prd < 1 || dty < 0) +
[v2 PATCH] PWM: atmel-pwm: add PWM controller driver
Add Atmel PWM controller driver based on PWM framework. This is the basic function implementation of Atmel PWM controller. It can work with PWM based led and backlight. Signed-off-by: Bo Shen --- This patch is based on the for-next branch on Linux pwm tree Test on at91sam9m10g45ek board with pwm led Test on sama5d31ek board with pwm backlight Changes in v2: - Address the comments from Thierry Reding .../devicetree/bindings/pwm/atmel-pwm.txt | 17 + drivers/pwm/Kconfig|9 + drivers/pwm/Makefile |1 + drivers/pwm/pwm-atmel.c| 328 4 files changed, 355 insertions(+) create mode 100644 Documentation/devicetree/bindings/pwm/atmel-pwm.txt create mode 100644 drivers/pwm/pwm-atmel.c diff --git a/Documentation/devicetree/bindings/pwm/atmel-pwm.txt b/Documentation/devicetree/bindings/pwm/atmel-pwm.txt new file mode 100644 index 000..f7b04f7 --- /dev/null +++ b/Documentation/devicetree/bindings/pwm/atmel-pwm.txt @@ -0,0 +1,17 @@ +Atmel PWM controller + +Required properties: + - compatible: should be one of: +- "atmel,at91sam9rl-pwm" +- "atmel,sama5-pwm" + - reg: physical base address and length of the controller's registers + - #pwm-cells: Should be 3. See pwm.txt in this directory for a +description of the cells format + +Example: + + pwm0: pwm@f8034000 { + compatible = "atmel,at91sam9rl-pwm"; + reg = <0xf8034000 0x400>; + #pwm-cells = <3>; + }; diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig index 75840b5..54237b9 100644 --- a/drivers/pwm/Kconfig +++ b/drivers/pwm/Kconfig @@ -41,6 +41,15 @@ config PWM_AB8500 To compile this driver as a module, choose M here: the module will be called pwm-ab8500. +config PWM_ATMEL + tristate "Atmel PWM support" + depends on ARCH_AT91 + help + Generic PWM framework driver for Atmel SoC. + + To compile this driver as a module, choose M here: the module + will be called pwm-atmel. + config PWM_ATMEL_TCB tristate "Atmel TC Block PWM support" depends on ATMEL_TCLIB && OF diff --git a/drivers/pwm/Makefile b/drivers/pwm/Makefile index 77a8c18..5b193f8 100644 --- a/drivers/pwm/Makefile +++ b/drivers/pwm/Makefile @@ -1,6 +1,7 @@ obj-$(CONFIG_PWM) += core.o obj-$(CONFIG_PWM_SYSFS)+= sysfs.o obj-$(CONFIG_PWM_AB8500) += pwm-ab8500.o +obj-$(CONFIG_PWM_ATMEL)+= pwm-atmel.o obj-$(CONFIG_PWM_ATMEL_TCB)+= pwm-atmel-tcb.o obj-$(CONFIG_PWM_BFIN) += pwm-bfin.o obj-$(CONFIG_PWM_IMX) += pwm-imx.o diff --git a/drivers/pwm/pwm-atmel.c b/drivers/pwm/pwm-atmel.c new file mode 100644 index 000..a9af974 --- /dev/null +++ b/drivers/pwm/pwm-atmel.c @@ -0,0 +1,328 @@ +/* + * Driver for Atmel Pulse Width Modulation Controller + * + * Copyright (C) 2013 Atmel Semiconductor Technology Ltd. + * Bo Shen + * + * GPL v2 + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* The following is global registers for PWM controller */ +#define PWM_ENA0x04 +#define PWM_DIS0x08 +#define PWM_SR 0x0C +/* bit field in SR */ +#define PWM_SR_ALL_CH_ON 0x0F + +/* The following register is PWM channel related registers */ +#define PWM_CMR0x00 +/* bit field in CMR */ +#define PWM_CMR_CPOL (1 << 9) +#define PWM_CMR_UPD_CDTY (1 << 10) + +/* The following registers for PWM v1 */ +#define PWMv1_CDTY 0x04 +#define PWMv1_CPRD 0x08 +#define PWMv1_CUPD 0x10 + +/* The following registers for PWM v2 */ +#define PWMv2_CDTY 0x04 +#define PWMv2_CDTYUPD 0x08 +#define PWMv2_CPRD 0x0C +#define PWMv2_CPRDUPD 0x10 + +struct atmel_pwm_chip { + struct pwm_chip chip; + struct clk *clk; + void __iomem *base; + + void (*config)(struct pwm_chip *chip, struct pwm_device *pwm, + int dty, int prd); +}; + +static inline struct atmel_pwm_chip *to_atmel_pwm_chip(struct pwm_chip *chip) +{ + return container_of(chip, struct atmel_pwm_chip, chip); +} + +static inline u32 atmel_pwm_readl(struct atmel_pwm_chip *chip, + unsigned long offset) +{ + return readl(chip->base + offset); +} + +static inline void atmel_pwm_writel(struct atmel_pwm_chip *chip, + unsigned long offset, unsigned long val) +{ + writel(val, chip->base + offset); +} + +static inline u32 atmel_pwm_ch_readl(struct atmel_pwm_chip *chip, +unsigned int ch, unsigned long offset) +{ + return readl(chip->base + 0x200 + ch * 0x20 + offset); +} + +static inline void atmel_pwm_ch_writel(struct at
Re: [RFC PATCH] pwm: atmel-pwm: add pwm controller driver
Hi Nicolas, On 8/20/2013 16:33, Nicolas Ferre wrote: On 19/08/2013 05:11, Bo Shen : add atmel pwm controller driver based on PWM framework this is basic function implementation of pwm controller it can work with pwm based led and backlight Signed-off-by: Bo Shen --- This patch is based on Linux v3.11 rc6 Tested on sama5d31ek and at91sam9m10g45ek board --- .../devicetree/bindings/pwm/atmel-pwm.txt | 19 ++ drivers/pwm/Kconfig|9 + drivers/pwm/Makefile |1 + drivers/pwm/pwm-atmel.c| 327 4 files changed, 356 insertions(+) create mode 100644 Documentation/devicetree/bindings/pwm/atmel-pwm.txt create mode 100644 drivers/pwm/pwm-atmel.c diff --git a/Documentation/devicetree/bindings/pwm/atmel-pwm.txt b/Documentation/devicetree/bindings/pwm/atmel-pwm.txt new file mode 100644 index 000..127fcdb --- /dev/null +++ b/Documentation/devicetree/bindings/pwm/atmel-pwm.txt @@ -0,0 +1,19 @@ +Atmel PWM controller + +Required properties: + - compatible: should be one of: +- "atmel,at91sam9rl-pwm" +- "atmel,sama5-pwm" No, the compatibility string should be: "atmel,sama5d3-pwm" OK, I will change it in next version. + - reg: physical base address and length of the controller's registers + - #pwm-cells: Should be 3. +- The first cell specifies the per-chip index of the PWM to use +- The second cell is the period in nanoseconds +- The third cell is used to encode the polarity of PWM output + +Example: + +pwm0: pwm@f8034000 { +compatible = "atmel,at91sam9rl-pwm"; +reg = <0xf8034000 0x400>; +#pwm-cells = <3>; +}; Can you add an example of consumer: it would make the example much more understandable. I will add an example of consumer. [...] diff --git a/drivers/pwm/pwm-atmel.c b/drivers/pwm/pwm-atmel.c new file mode 100644 index 000..b83d68e --- /dev/null +++ b/drivers/pwm/pwm-atmel.c @@ -0,0 +1,327 @@ +/* + * Driver for Atmel Pulse Width Modulation Controller + * + * Copyright (C) 2013 Atmel Semiconductor Technology Ltd. use "Atmel Corporation" in copyright. + * Bo Shen + * + * GPL v2 or later + */ A general remark also pointed out by Thierry: please use more defined constants in your code: it makes the code more readable and avoid this black magic feeling when we read it. Please help review v2. +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define PWM_MR0x00 +#define PWM_ENA0x04 +#define PWM_DIS0x08 +#define PWM_SR0x0C + +#define PWM_CMR0x00 + +/* The following register for PWM v1 */ +#define PWMv1_CDTY0x04 +#define PWMv1_CPRD0x08 +#define PWMv1_CUPD0x10 + +/* The following register for PWM v2 */ +#define PWMv2_CDTY0x04 +#define PWMv2_CDTYUPD0x08 +#define PWMv2_CPRD0x0C +#define PWMv2_CPRDUPD0x10 + +#define PWM_NUM4 + +struct atmel_pwm_chip { +struct pwm_chip chip; +struct clk *clk; +void __iomem *base; + +void (*config)(struct atmel_pwm_chip *chip, struct pwm_device *pwm, +unsigned int dty, unsigned int prd); +}; + +#define to_atmel_pwm_chip(chip) container_of(chip, struct atmel_pwm_chip, chip) + +static inline u32 atmel_pwm_readl(struct atmel_pwm_chip *chip, int offset) +{ +return readl(chip->base + offset); +} + +static inline void atmel_pwm_writel(struct atmel_pwm_chip *chip, int offset, +u32 val) +{ +writel(val, chip->base + offset); +} + +static inline u32 atmel_pwm_ch_readl(struct atmel_pwm_chip *chip, int ch, +int offset) +{ +return readl(chip->base + 0x200 + ch * 0x20 + offset); Maybe a constant for this 0x200 value... OK. I will fix it in net version. +} + +static inline void atmel_pwm_ch_writel(struct atmel_pwm_chip *chip, int ch, +int offset, u32 val) +{ +writel(val, chip->base + 0x200 + ch * 0x20 + offset); +} + +static int atmel_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, +int duty_ns, int period_ns) +{ +struct atmel_pwm_chip *atmel_pwm = to_atmel_pwm_chip(chip); +unsigned long long val, prd, dty; +unsigned long long div, clk_rate; +int ret, pres = 0; + +clk_rate = clk_get_rate(atmel_pwm->clk); + +while (1) { Why not use a proper loop condition here instead of a frightening while (true) loop? Is it really making the code less readable? OK, I will try to use the proper loop condition here. +div = 10; use a constant or at least a comment for this initialization. I will add comment in next version. +div *= 1 << pres; +val = clk_rate * period_ns; +prd = div_u64(val, div); +val = clk_rate * duty_ns; +dty = div_u64(val, div); + +if (prd < 0x0001 || dty <
[RFC PATCH] clock: correct the comparison parameter of MHz
correct the comparison parameter of MHz from 4,000,000 to 1,000,000 Signed-off-by: Bo Shen --- kernel/time/sched_clock.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/time/sched_clock.c b/kernel/time/sched_clock.c index a326f27..62885f7 100644 --- a/kernel/time/sched_clock.c +++ b/kernel/time/sched_clock.c @@ -128,7 +128,7 @@ void __init setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate) clocks_calc_mult_shift(&cd.mult, &cd.shift, rate, NSEC_PER_SEC, 0); r = rate; - if (r >= 400) { + if (r >= 100) { r /= 100; r_unit = 'M'; } else if (r >= 1000) { -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFC PATCH] clock: correct the comparison parameter of MHz
Hi Russell King, On 8/7/2013 16:02, Russell King - ARM Linux wrote: On Wed, Aug 07, 2013 at 03:47:40PM +0800, Bo Shen wrote: correct the comparison parameter of MHz from 4,000,000 to 1,000,000 You're assuming this wasn't intentional. As the division by 100 ends up losing the fractional rate, I decided to leave 1-4MHz as kHz, so something like 1.832MHz would be displayed as 1832kHz and not 1MHz. Thanks for clarification of this. Now, it is better for me to understand this piece of code. Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [V2 2/8] USB: EHCI: make ehci-atmel a separate driver
On 02/15/2013 06:24 PM, Manjunath Goudar wrote: Separate the Atmel host controller driver from ehci-hcd host code into its own driver module. In V2: Resolved below compiler error. drivers/usb/host/ehci-atmel.c: In function 'ehci_atmel_drv_remove': drivers/usb/host/ehci-atmel.c:167: error: implicit declaration of function 'ehci_shutdown' Signed-off-by: Manjunath Goudar Cc: Alan Stern Cc: Greg KH Cc: Grant Likely Cc: Rob Herring Cc: Andrew Victor Cc: Nicolas Ferre Cc: Jean-Christophe Plagniol-Villard Cc: linux-...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/usb/host/Kconfig |8 + drivers/usb/host/Makefile |1 + drivers/usb/host/ehci-atmel.c | 76 ++--- drivers/usb/host/ehci-hcd.c | 10 ++ drivers/usb/host/ehci.h |2 +- 5 files changed, 53 insertions(+), 44 deletions(-) diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 15e8032..1ef37d7 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -170,6 +170,14 @@ config USB_EHCI_HCD_SPEAR Enables support for the on-chip EHCI controller on ST SPEAr chips. +config USB_EHCI_HCD_AT91 +tristate "Support for Atmel on-chip EHCI USB controller" +depends on USB_EHCI_HCD&& ARCH_AT91 +default y +---help--- + Enables support for the on-chip EHCI controller on + Atmel chips. + config USB_EHCI_MSM bool "Support for MSM on-chip EHCI USB controller" depends on USB_EHCI_HCD&& ARCH_MSM diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile index c8fcde9..b301243 100644 --- a/drivers/usb/host/Makefile +++ b/drivers/usb/host/Makefile @@ -29,6 +29,7 @@ obj-$(CONFIG_USB_EHCI_HCD_PLATFORM) += ehci-platform.o obj-$(CONFIG_USB_EHCI_MXC)+= ehci-mxc.o obj-$(CONFIG_USB_EHCI_HCD_SPEAR)+= ehci-spear.o obj-$(CONFIG_USB_OXU210HP_HCD)+= oxu210hp-hcd.o +obj-$(CONFIG_USB_EHCI_HCD_AT91) += ehci-atmel.o obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o obj-$(CONFIG_USB_ISP1362_HCD) += isp1362-hcd.o obj-$(CONFIG_USB_OHCI_HCD)+= ohci-hcd.o diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c index 27639487..3cd0dd4 100644 --- a/drivers/usb/host/ehci-atmel.c +++ b/drivers/usb/host/ehci-atmel.c @@ -15,6 +15,19 @@ #include #include #include +#include +#include +#include +#include +#include +#include + +#include "ehci.h" + +#define DRIVER_DESC "EHCI atmel driver" + +static const char hcd_name[] = "ehci-atmel"; +static struct hc_driver __read_mostly ehci_atmel_hc_driver; /* interface and function clocks */ static struct clk *iclk, *fclk; @@ -60,41 +73,6 @@ static int ehci_atmel_setup(struct usb_hcd *hcd) return ehci_setup(hcd); } -static const struct hc_driver ehci_atmel_hc_driver = { - .description= hcd_name, - .product_desc = "Atmel EHCI UHP HS", - .hcd_priv_size = sizeof(struct ehci_hcd), - - /* generic hardware linkage */ - .irq= ehci_irq, - .flags = HCD_MEMORY | HCD_USB2, - - /* basic lifecycle operations */ - .reset = ehci_atmel_setup, - .start = ehci_run, - .stop = ehci_stop, - .shutdown = ehci_shutdown, - - /* managing i/o requests and associated device resources */ - .urb_enqueue= ehci_urb_enqueue, - .urb_dequeue= ehci_urb_dequeue, - .endpoint_disable = ehci_endpoint_disable, - .endpoint_reset = ehci_endpoint_reset, - - /* scheduling support */ - .get_frame_number = ehci_get_frame, - - /* root hub support */ - .hub_status_data= ehci_hub_status_data, - .hub_control= ehci_hub_control, - .bus_suspend= ehci_bus_suspend, - .bus_resume = ehci_bus_resume, - .relinquish_port= ehci_relinquish_port, - .port_handed_over = ehci_port_handed_over, - - .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, -}; - static u64 at91_ehci_dma_mask = DMA_BIT_MASK(32); static int ehci_atmel_drv_probe(struct platform_device *pdev) @@ -210,7 +188,33 @@ static struct platform_driver ehci_atmel_driver = { .remove = ehci_atmel_drv_remove, .shutdown = usb_hcd_platform_shutdown, .driver = { - .name = "atmel-ehci", + .name = hcd_name, This change will cause atmel ehci won't work with the none device tree kernel. it can be fixed with replace other places using "atmel-ehci" with , that means replace "atmel-ehci" with "ehci-atmel" at other places. Best Regards, Bo Shen -- To unsubscrib
[PATCH] ARM: at91/dt: sama5d4: fix the timer reg length
The second property of reg is the length, so correct it for timer. Signed-off-by: Bo Shen --- arch/arm/boot/dts/sama5d4.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/sama5d4.dtsi b/arch/arm/boot/dts/sama5d4.dtsi index 2cc3cfe..0901706 100644 --- a/arch/arm/boot/dts/sama5d4.dtsi +++ b/arch/arm/boot/dts/sama5d4.dtsi @@ -940,7 +940,7 @@ pit: timer@fc068630 { compatible = "atmel,at91sam9260-pit"; - reg = <0xfc068630 0xf>; + reg = <0xfc068630 0x10>; interrupts = <3 IRQ_TYPE_LEVEL_HIGH 5>; clocks = <&h32ck>; }; -- 2.1.0.24.g4109c28 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/3] ASoC: codecs: wm8904: add dt ids table
From: Alexander Morozov Signed-off-by: Alexander Morozov Signed-off-by: Bo Shen --- sound/soc/codecs/wm8904.c | 9 + 1 file changed, 9 insertions(+) diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c index 4d2d2b1..23831a5 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c @@ -2255,10 +2255,19 @@ static const struct i2c_device_id wm8904_i2c_id[] = { }; MODULE_DEVICE_TABLE(i2c, wm8904_i2c_id); +static const struct of_device_id wm8904_of_match[] = { + { .compatible = "wlf,wm8904", }, + { .compatible = "wlf,wm8912", }, + { .compatible = "wlf,wm8918", }, + { } +}; +MODULE_DEVICE_TABLE(of, wm8904_of_match); + static struct i2c_driver wm8904_i2c_driver = { .driver = { .name = "wm8904", .owner = THIS_MODULE, + .of_match_table = wm8904_of_match, }, .probe =wm8904_i2c_probe, .remove = wm8904_i2c_remove, -- 2.1.0.24.g4109c28 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 3/3] ARM: at91: at91sam9n12ek/dt: use dt ids for wm8904
Using the device tree ids for wm8904 codec. Signed-off-by: Bo Shen --- arch/arm/boot/dts/at91sam9n12ek.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/at91sam9n12ek.dts b/arch/arm/boot/dts/at91sam9n12ek.dts index 13bb24e..9575c0d 100644 --- a/arch/arm/boot/dts/at91sam9n12ek.dts +++ b/arch/arm/boot/dts/at91sam9n12ek.dts @@ -54,7 +54,7 @@ status = "okay"; wm8904: codec@1a { - compatible = "wm8904"; + compatible = "wlf,wm8904"; reg = <0x1a>; clocks = <&pck0>; clock-names = "mclk"; -- 2.1.0.24.g4109c28 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/3] ARM: at91: sama5d3xek/dt: use dt ids for wm8904
From: Alexander Morozov Using the wm8904 device tree compatible string. Signed-off-by: Alexander Morozov Signed-off-by: Bo Shen --- arch/arm/boot/dts/sama5d3xmb.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/sama5d3xmb.dtsi b/arch/arm/boot/dts/sama5d3xmb.dtsi index 49c10d3..2a1aa58 100644 --- a/arch/arm/boot/dts/sama5d3xmb.dtsi +++ b/arch/arm/boot/dts/sama5d3xmb.dtsi @@ -45,7 +45,7 @@ */ i2c0: i2c@f0014000 { wm8904: wm8904@1a { - compatible = "wm8904"; + compatible = "wlf,wm8904"; reg = <0x1a>; clocks = <&pck0>; clock-names = "mclk"; -- 2.1.0.24.g4109c28 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] sound: soc: atmel sam9g20_wm8731: remove useless include
Hi Alexandre Belloni, On 01/06/2015 05:21 PM, Alexandre Belloni wrote: A mach/ header is included but never used. Simply remove it. Signed-off-by: Alexandre Belloni Thanks for your patch. Acked-by: Bo Shen --- sound/soc/atmel/sam9g20_wm8731.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sound/soc/atmel/sam9g20_wm8731.c b/sound/soc/atmel/sam9g20_wm8731.c index 66b66d0e7514..531728975bbb 100644 --- a/sound/soc/atmel/sam9g20_wm8731.c +++ b/sound/soc/atmel/sam9g20_wm8731.c @@ -47,7 +47,6 @@ #include #include Btw, do you consider to remove this also? -#include #include "../codecs/wm8731.h" #include "atmel-pcm.h" Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Asoc: sam9x5_wm8731: depend on ARCH_AT91 instead of SOC_AT91SAM9X5
Hi Alexandre Belloni, On 01/13/2015 08:27 PM, Alexandre Belloni wrote: The SOC_AT91SAM9X5 option is going to be removed, only depend on ARCH_AT91 like for the other drivers. Signed-off-by: Alexandre Belloni Acked-by: Bo Shen --- sound/soc/atmel/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/atmel/Kconfig b/sound/soc/atmel/Kconfig index fb3878312bf8..1579e994acf8 100644 --- a/sound/soc/atmel/Kconfig +++ b/sound/soc/atmel/Kconfig @@ -45,7 +45,7 @@ config SND_ATMEL_SOC_WM8904 config SND_AT91_SOC_SAM9X5_WM8731 tristate "SoC Audio support for WM8731-based at91sam9x5 board" - depends on ATMEL_SSC && SND_ATMEL_SOC && SOC_AT91SAM9X5 + depends on ARCH_AT91 && ATMEL_SSC && SND_ATMEL_SOC select SND_ATMEL_SOC_SSC select SND_ATMEL_SOC_DMA select SND_SOC_WM8731 Best Regards Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2 1/3] ASoC: codecs: wm8904: add dt ids table
Hi Mark, On 01/15/2015 07:54 PM, Mark Brown wrote: On Mon, Dec 15, 2014 at 11:31:11AM +0800, Bo Shen wrote: +#ifdef CONFIG_OF +static enum wm8904_type wm8904_data = WM8904; +static enum wm8904_type wm8912_data = WM8912; + +static const struct of_device_id wm8904_of_match[] = { + { + .compatible = "wlf,wm8904", + .data = &wm8904_data, Does this end up in the i2c_driver_id driver data or do we need some extra code when devtype is assigned to check for an of_node and look at the DT data instead? That certainly used to be the case... At the beginning I think as the same as you, and also add the code to get the data as I do in . However, as I remember, I2C seems only use the compatible string after the comma, that means only for "wlf,wm8904", it uses "wm8904" to match. So, I remove all the code I added, and just keep these, and it can get the device type correctly. So, when I submit the patch and keep the code as simple as possible. Thanks. Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] ASoC: wm8904: fix runtime warning
As the commit 5fe5b76 (ASoC: dapm: Do not pretend to support controls for non mixer/mux widgets) remove the fake control. Then, the wm8904 throw out the following warning at runtime. --->8--- wm8904 1-001a: Control not supported for path ADCL -> [Left] -> AIFOUTL wm8904 1-001a: ASoC: no dapm match for ADCL --> Left --> AIFOUTL wm8904 1-001a: ASoC: Failed to add route ADCL -> Left -> AIFOUTL wm8904 1-001a: Control not supported for path ADCR -> [Right] -> AIFOUTL wm8904 1-001a: ASoC: no dapm match for ADCR --> Right --> AIFOUTL wm8904 1-001a: ASoC: Failed to add route ADCR -> Right -> AIFOUTL wm8904 1-001a: Control not supported for path ADCL -> [Left] -> AIFOUTR wm8904 1-001a: ASoC: no dapm match for ADCL --> Left --> AIFOUTR wm8904 1-001a: ASoC: Failed to add route ADCL -> Left -> AIFOUTR wm8904 1-001a: Control not supported for path ADCR -> [Right] -> AIFOUTR wm8904 1-001a: ASoC: no dapm match for ADCR --> Right --> AIFOUTR wm8904 1-001a: ASoC: Failed to add route ADCR -> Right -> AIFOUTR wm8904 1-001a: Control not supported for path AIFINR -> [Right] -> DACL wm8904 1-001a: ASoC: no dapm match for AIFINR --> Right --> DACL wm8904 1-001a: ASoC: Failed to add route AIFINR -> Right -> DACL wm8904 1-001a: Control not supported for path AIFINL -> [Left] -> DACL wm8904 1-001a: ASoC: no dapm match for AIFINL --> Left --> DACL wm8904 1-001a: ASoC: Failed to add route AIFINL -> Left -> DACL wm8904 1-001a: Control not supported for path AIFINR -> [Right] -> DACR wm8904 1-001a: ASoC: no dapm match for AIFINR --> Right --> DACR wm8904 1-001a: ASoC: Failed to add route AIFINR -> Right -> DACR wm8904 1-001a: Control not supported for path AIFINL -> [Left] -> DACR wm8904 1-001a: ASoC: no dapm match for AIFINL --> Left --> DACR wm8904 1-001a: ASoC: Failed to add route AIFINL -> Left -> DACR ---8<--- This patch is used to remove these warning. Signed-off-by: Bo Shen --- sound/soc/codecs/wm8904.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c index 4d2d2b1..38582d7 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c @@ -1076,10 +1076,10 @@ static const struct snd_soc_dapm_route adc_intercon[] = { { "Right Capture PGA", NULL, "Right Capture Mux" }, { "Right Capture PGA", NULL, "Right Capture Inverting Mux" }, - { "AIFOUTL", "Left", "ADCL" }, - { "AIFOUTL", "Right", "ADCR" }, - { "AIFOUTR", "Left", "ADCL" }, - { "AIFOUTR", "Right", "ADCR" }, + { "AIFOUTL", NULL, "ADCL" }, + { "AIFOUTL", NULL, "ADCR" }, + { "AIFOUTR", NULL, "ADCL" }, + { "AIFOUTR", NULL, "ADCR" }, { "ADCL", NULL, "CLK_DSP" }, { "ADCL", NULL, "Left Capture PGA" }, @@ -1089,12 +1089,12 @@ static const struct snd_soc_dapm_route adc_intercon[] = { }; static const struct snd_soc_dapm_route dac_intercon[] = { - { "DACL", "Right", "AIFINR" }, - { "DACL", "Left", "AIFINL" }, + { "DACL", NULL, "AIFINR" }, + { "DACL", NULL, "AIFINL" }, { "DACL", NULL, "CLK_DSP" }, - { "DACR", "Right", "AIFINR" }, - { "DACR", "Left", "AIFINL" }, + { "DACR", NULL, "AIFINR" }, + { "DACR", NULL, "AIFINL" }, { "DACR", NULL, "CLK_DSP" }, { "Charge pump", NULL, "SYSCLK" }, -- 2.1.0.24.g4109c28 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] ARM: at91: sama5d3: dt: correct the sound route
The MICBIAS is a supply, should route to MIC while not IN1L. Signed-off-by: Bo Shen --- arch/arm/boot/dts/sama5d3xmb.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/sama5d3xmb.dtsi b/arch/arm/boot/dts/sama5d3xmb.dtsi index 0399be6..83d0598 100644 --- a/arch/arm/boot/dts/sama5d3xmb.dtsi +++ b/arch/arm/boot/dts/sama5d3xmb.dtsi @@ -176,7 +176,7 @@ "Headphone Jack", "HPOUTR", "IN2L", "Line In Jack", "IN2R", "Line In Jack", - "MICBIAS", "IN1L", + "Mic", "MICBIAS", "IN1L", "Mic"; atmel,ssc-controller = <&ssc0>; -- 2.1.0.24.g4109c28 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [alsa-devel] [PATCH] ASoC: wm8904: fix runtime warning
Hi Charles, On 01/09/2015 07:16 PM, Charles Keepax wrote: On Fri, Jan 09, 2015 at 04:53:40PM +0800, Bo Shen wrote: As the commit 5fe5b76 (ASoC: dapm: Do not pretend to support controls for non mixer/mux widgets) remove the fake control. Then, the wm8904 throw out the following warning at runtime. --->8--- wm8904 1-001a: Control not supported for path ADCL -> [Left] -> AIFOUTL wm8904 1-001a: ASoC: no dapm match for ADCL --> Left --> AIFOUTL wm8904 1-001a: ASoC: Failed to add route ADCL -> Left -> AIFOUTL wm8904 1-001a: Control not supported for path ADCR -> [Right] -> AIFOUTL wm8904 1-001a: ASoC: no dapm match for ADCR --> Right --> AIFOUTL wm8904 1-001a: ASoC: Failed to add route ADCR -> Right -> AIFOUTL wm8904 1-001a: Control not supported for path ADCL -> [Left] -> AIFOUTR wm8904 1-001a: ASoC: no dapm match for ADCL --> Left --> AIFOUTR wm8904 1-001a: ASoC: Failed to add route ADCL -> Left -> AIFOUTR wm8904 1-001a: Control not supported for path ADCR -> [Right] -> AIFOUTR wm8904 1-001a: ASoC: no dapm match for ADCR --> Right --> AIFOUTR wm8904 1-001a: ASoC: Failed to add route ADCR -> Right -> AIFOUTR wm8904 1-001a: Control not supported for path AIFINR -> [Right] -> DACL wm8904 1-001a: ASoC: no dapm match for AIFINR --> Right --> DACL wm8904 1-001a: ASoC: Failed to add route AIFINR -> Right -> DACL wm8904 1-001a: Control not supported for path AIFINL -> [Left] -> DACL wm8904 1-001a: ASoC: no dapm match for AIFINL --> Left --> DACL wm8904 1-001a: ASoC: Failed to add route AIFINL -> Left -> DACL wm8904 1-001a: Control not supported for path AIFINR -> [Right] -> DACR wm8904 1-001a: ASoC: no dapm match for AIFINR --> Right --> DACR wm8904 1-001a: ASoC: Failed to add route AIFINR -> Right -> DACR wm8904 1-001a: Control not supported for path AIFINL -> [Left] -> DACR wm8904 1-001a: ASoC: no dapm match for AIFINL --> Left --> DACR wm8904 1-001a: ASoC: Failed to add route AIFINL -> Left -> DACR ---8<--- This patch is used to remove these warning. Signed-off-by: Bo Shen --- sound/soc/codecs/wm8904.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c index 4d2d2b1..38582d7 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c @@ -1076,10 +1076,10 @@ static const struct snd_soc_dapm_route adc_intercon[] = { { "Right Capture PGA", NULL, "Right Capture Mux" }, { "Right Capture PGA", NULL, "Right Capture Inverting Mux" }, - { "AIFOUTL", "Left", "ADCL" }, - { "AIFOUTL", "Right", "ADCR" }, - { "AIFOUTR", "Left", "ADCL" }, - { "AIFOUTR", "Right", "ADCR" }, + { "AIFOUTL", NULL, "ADCL" }, + { "AIFOUTL", NULL, "ADCR" }, + { "AIFOUTR", NULL, "ADCL" }, + { "AIFOUTR", NULL, "ADCR" }, Is this the right fix here? I am not super familiar with the driver but it appears to contain an "AIFOUTL Mux" control which is not connected to anything. Looks like maybe this is a mistake the mux is indeded to be included in the path? Feels like we should either remove the control as well or hook it into the path. Thank for your information. I think here it should correct the path name as --->8--- { "AIFOUTL Mux", "Left", "ADCL" }, { "AIFOUTL Mux", "Right", "ADCR" }, { "AIFOUTR Mux", "Left", "ADCL" }, { "AIFOUTR Mux", "Right", "ADCR" }, ---8<--- Thanks again. I will send out the new version. Thanks, Charles Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 6/7] ARM: at91: remove useless at91rm9200_dt_initialize()
Hi Alexandre, On 01/13/2015 02:42 AM, Alexandre Belloni wrote: at91rm9200_dt_initialize() is doing the same as at91_dit_initialize(), use that s/at91_dit_initialize/at91_dt_initialize one instead. Signed-off-by: Alexandre Belloni --- arch/arm/mach-at91/board-dt-rm9200.c | 2 +- arch/arm/mach-at91/generic.h | 1 - arch/arm/mach-at91/setup.c | 7 --- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/arch/arm/mach-at91/board-dt-rm9200.c b/arch/arm/mach-at91/board-dt-rm9200.c index 76dfe8f9af50..a15ab6f8de00 100644 --- a/arch/arm/mach-at91/board-dt-rm9200.c +++ b/arch/arm/mach-at91/board-dt-rm9200.c @@ -38,6 +38,6 @@ static const char *at91rm9200_dt_board_compat[] __initdata = { DT_MACHINE_START(at91rm9200_dt, "Atmel AT91RM9200 (Device Tree)") .init_time = at91rm9200_dt_timer_init, .map_io = at91_map_io, - .init_early = at91rm9200_dt_initialize, + .init_early = at91_dt_initialize, .dt_compat = at91rm9200_dt_board_compat, MACHINE_END diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h index e0368aa06390..c10c2ddaae6d 100644 --- a/arch/arm/mach-at91/generic.h +++ b/arch/arm/mach-at91/generic.h @@ -22,7 +22,6 @@ extern void __init at91_init_sram(int bank, unsigned long base, /* Processors */ extern void __init at91rm9200_set_type(int type); -extern void __init at91rm9200_dt_initialize(void); extern void __init at91_dt_initialize(void); /* Timer */ diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c index ce25e85720fb..acb8d7724609 100644 --- a/arch/arm/mach-at91/setup.c +++ b/arch/arm/mach-at91/setup.c @@ -429,13 +429,6 @@ static void at91_dt_ramc(void) at91_pm_set_standby(standby); } -void __init at91rm9200_dt_initialize(void) -{ - at91_dt_ramc(); - - at91_boot_soc.init(); -} - void __init at91_dt_initialize(void) { at91_dt_ramc(); Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 4/6] ARM: at91/dt: add SRAM nodes
; reg = <0x0080 0x10>; interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>; - //TODO clocks = <&usb>, <&uhphs_clk>, <&uhphs_clk>, <&uhpck>; clock-names = "usb_clk", "ehci_clk", "hclk", "uhpck"; status = "disabled"; diff --git a/arch/arm/boot/dts/at91sam9n12.dtsi b/arch/arm/boot/dts/at91sam9n12.dtsi index a7218bcc6a25..6ea7ee3b8ff8 100644 --- a/arch/arm/boot/dts/at91sam9n12.dtsi +++ b/arch/arm/boot/dts/at91sam9n12.dtsi @@ -64,6 +64,11 @@ }; }; + sram: sram@0030 { + compatible = "mmio-sram"; + reg = <0x0030 0x8000>; + }; + ahb { compatible = "simple-bus"; #address-cells = <1>; diff --git a/arch/arm/boot/dts/at91sam9rl.dtsi b/arch/arm/boot/dts/at91sam9rl.dtsi index 72424371413e..c055da2f151f 100644 --- a/arch/arm/boot/dts/at91sam9rl.dtsi +++ b/arch/arm/boot/dts/at91sam9rl.dtsi @@ -70,6 +70,11 @@ }; }; + sram: sram@0030 { + compatible = "mmio-sram"; + reg = <0x0030 0x4000>; + }; + ahb { compatible = "simple-bus"; #address-cells = <1>; diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi index bbb3ba65165f..818dabdd8c0e 100644 --- a/arch/arm/boot/dts/at91sam9x5.dtsi +++ b/arch/arm/boot/dts/at91sam9x5.dtsi @@ -72,6 +72,11 @@ }; }; + sram: sram@0030 { + compatible = "mmio-sram"; + reg = <0x0030 0x8000>; + }; + ahb { compatible = "simple-bus"; #address-cells = <1>; diff --git a/arch/arm/boot/dts/sama5d3.dtsi b/arch/arm/boot/dts/sama5d3.dtsi index d701ddda0e00..e17614fe58a9 100644 --- a/arch/arm/boot/dts/sama5d3.dtsi +++ b/arch/arm/boot/dts/sama5d3.dtsi @@ -78,6 +78,11 @@ }; }; + sram: sram@0030 { + compatible = "mmio-sram"; + reg = <0x0030 0x2>; + }; + ahb { compatible = "simple-bus"; #address-cells = <1>; diff --git a/arch/arm/boot/dts/sama5d4.dtsi b/arch/arm/boot/dts/sama5d4.dtsi index 0a2477fe5525..1b4fe4e19721 100644 --- a/arch/arm/boot/dts/sama5d4.dtsi +++ b/arch/arm/boot/dts/sama5d4.dtsi @@ -103,6 +103,11 @@ }; }; + ns_sram: sram@0021 { + compatible = "mmio-sram"; + reg = <0x0021 0x1>; + }; + ahb { compatible = "simple-bus"; #address-cells = <1>; Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v3 0/5] usb: atmel_usba_udc: Rework errata handling
Hi Boris, On 01/12/2015 06:57 PM, Boris Brezillon wrote: Hello, Here is a set of patches porting existing at91sam9rl erratum handling to DT and adding new code to handle at91sam9g45/9x5 erratum. It also adds several compatible strings to differentiate those errata. These patches should be backported to 3.17 and 3.18 stable releases but they do not apply cleanly on those stable branches. I'll send a backport of this series once it is merged in mainline. Regards, Boris Changes since v2: - remove UTF8 character in commit message of patch 2 Changes since v1: - cache INT_ENB value to speedup INT_ENB read operations For the whole series, test OK on at91sam9m10g45ek board with mass storage gadget, test OK on sama5d36ek with serial gadget. Tested-by: Bo Shen Boris Brezillon (5): usb: atmel_usba_udc: Rework at91sam9rl errata handling usb: atmel_usba_udc: Add at91sam9g45 and at91sam9x5 errata handling ARM: at91/dt: update udc compatible strings usb: atmel_usba_udc: Mask status with enabled irqs usb: gadget: atmel_usba: Cache INT_ENB register value .../devicetree/bindings/usb/atmel-usb.txt | 5 +- arch/arm/boot/dts/at91sam9g45.dtsi | 2 +- arch/arm/boot/dts/at91sam9x5.dtsi | 2 +- arch/arm/boot/dts/sama5d3.dtsi | 2 +- arch/arm/boot/dts/sama5d4.dtsi | 2 +- drivers/usb/gadget/udc/atmel_usba_udc.c| 146 + drivers/usb/gadget/udc/atmel_usba_udc.h| 9 ++ 7 files changed, 111 insertions(+), 57 deletions(-) Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [alsa-devel] [PATCH] ASoC: wm8904: fix runtime warning
Hi Lars-Perter Clausen, On 01/12/2015 05:30 PM, Lars-Peter Clausen wrote: On 01/12/2015 04:32 AM, Bo Shen wrote: [...] diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c index 4d2d2b1..38582d7 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c @@ -1076,10 +1076,10 @@ static const struct snd_soc_dapm_route adc_intercon[] = { { "Right Capture PGA", NULL, "Right Capture Mux" }, { "Right Capture PGA", NULL, "Right Capture Inverting Mux" }, -{ "AIFOUTL", "Left", "ADCL" }, -{ "AIFOUTL", "Right", "ADCR" }, -{ "AIFOUTR", "Left", "ADCL" }, -{ "AIFOUTR", "Right", "ADCR" }, +{ "AIFOUTL", NULL, "ADCL" }, +{ "AIFOUTL", NULL, "ADCR" }, +{ "AIFOUTR", NULL, "ADCL" }, +{ "AIFOUTR", NULL, "ADCR" }, Is this the right fix here? I am not super familiar with the driver but it appears to contain an "AIFOUTL Mux" control which is not connected to anything. Looks like maybe this is a mistake the mux is indeded to be included in the path? Feels like we should either remove the control as well or hook it into the path. Thank for your information. I think here it should correct the path name as --->8--- { "AIFOUTL Mux", "Left", "ADCL" }, { "AIFOUTL Mux", "Right", "ADCR" }, { "AIFOUTR Mux", "Left", "ADCL" }, { "AIFOUTR Mux", "Right", "ADCR" }, ---8<--- Thanks again. I will send out the new version. Your probably also need to connect the mux to the output pins. Thanks for you information, after check the datasheet, I still don't know which the mux should connect to which output pins. Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2] ASoC: wm8904: fix runtime warning
Correct the path name for mux to get rid of the following warning: --->8--- wm8904 1-001a: Control not supported for path ADCL -> [Left] -> AIFOUTL wm8904 1-001a: ASoC: no dapm match for ADCL --> Left --> AIFOUTL wm8904 1-001a: ASoC: Failed to add route ADCL -> Left -> AIFOUTL wm8904 1-001a: Control not supported for path ADCR -> [Right] -> AIFOUTL wm8904 1-001a: ASoC: no dapm match for ADCR --> Right --> AIFOUTL wm8904 1-001a: ASoC: Failed to add route ADCR -> Right -> AIFOUTL wm8904 1-001a: Control not supported for path ADCL -> [Left] -> AIFOUTR wm8904 1-001a: ASoC: no dapm match for ADCL --> Left --> AIFOUTR wm8904 1-001a: ASoC: Failed to add route ADCL -> Left -> AIFOUTR wm8904 1-001a: Control not supported for path ADCR -> [Right] -> AIFOUTR wm8904 1-001a: ASoC: no dapm match for ADCR --> Right --> AIFOUTR wm8904 1-001a: ASoC: Failed to add route ADCR -> Right -> AIFOUTR wm8904 1-001a: Control not supported for path AIFINR -> [Right] -> DACL wm8904 1-001a: ASoC: no dapm match for AIFINR --> Right --> DACL wm8904 1-001a: ASoC: Failed to add route AIFINR -> Right -> DACL wm8904 1-001a: Control not supported for path AIFINL -> [Left] -> DACL wm8904 1-001a: ASoC: no dapm match for AIFINL --> Left --> DACL wm8904 1-001a: ASoC: Failed to add route AIFINL -> Left -> DACL wm8904 1-001a: Control not supported for path AIFINR -> [Right] -> DACR wm8904 1-001a: ASoC: no dapm match for AIFINR --> Right --> DACR wm8904 1-001a: ASoC: Failed to add route AIFINR -> Right -> DACR wm8904 1-001a: Control not supported for path AIFINL -> [Left] -> DACR wm8904 1-001a: ASoC: no dapm match for AIFINL --> Left --> DACR wm8904 1-001a: ASoC: Failed to add route AIFINL -> Left -> DACR ---8<--- Signed-off-by: Bo Shen --- Changes in v2: - Correct the mux path name. - Route the mux to the pins. sound/soc/codecs/wm8904.c | 25 + 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c index 4d2d2b1..110d0e6 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c @@ -1076,10 +1076,13 @@ static const struct snd_soc_dapm_route adc_intercon[] = { { "Right Capture PGA", NULL, "Right Capture Mux" }, { "Right Capture PGA", NULL, "Right Capture Inverting Mux" }, - { "AIFOUTL", "Left", "ADCL" }, - { "AIFOUTL", "Right", "ADCR" }, - { "AIFOUTR", "Left", "ADCL" }, - { "AIFOUTR", "Right", "ADCR" }, + { "AIFOUTL Mux", "Left", "ADCL" }, + { "AIFOUTL Mux", "Right", "ADCR" }, + { "AIFOUTR Mux", "Left", "ADCL" }, + { "AIFOUTR Mux", "Right", "ADCR" }, + + { "AIFOUTL", NULL, "AIFOUTL Mux" }, + { "AIFOUTR", NULL, "AIFOUTR Mux" }, { "ADCL", NULL, "CLK_DSP" }, { "ADCL", NULL, "Left Capture PGA" }, @@ -1089,14 +1092,20 @@ static const struct snd_soc_dapm_route adc_intercon[] = { }; static const struct snd_soc_dapm_route dac_intercon[] = { - { "DACL", "Right", "AIFINR" }, - { "DACL", "Left", "AIFINL" }, + { "DACL", NULL, "AIFINL" }, + { "DACL", NULL, "AIFINR" }, { "DACL", NULL, "CLK_DSP" }, - { "DACR", "Right", "AIFINR" }, - { "DACR", "Left", "AIFINL" }, + { "DACR", NULL, "AIFINL" }, + { "DACR", NULL, "AIFINR" }, { "DACR", NULL, "CLK_DSP" }, + { "DACL Mux", "Left", "DACL" }, + { "DACL Mux", "Right", "DACR" }, + + { "DACR Mux", "Left", "DACL" }, + { "DACR Mux", "Right", "DACR" }, + { "Charge pump", NULL, "SYSCLK" }, { "Headphone Output", NULL, "HPL PGA" }, -- 2.1.0.24.g4109c28 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [alsa-devel] [PATCH] ASoC: wm8904: fix runtime warning
Hi Lars-Peter Clausen, On 01/13/2015 04:56 PM, Lars-Peter Clausen wrote: On 01/13/2015 06:36 AM, Bo Shen wrote: Hi Lars-Perter Clausen, On 01/12/2015 05:30 PM, Lars-Peter Clausen wrote: On 01/12/2015 04:32 AM, Bo Shen wrote: [...] diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c index 4d2d2b1..38582d7 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c @@ -1076,10 +1076,10 @@ static const struct snd_soc_dapm_route adc_intercon[] = { { "Right Capture PGA", NULL, "Right Capture Mux" }, { "Right Capture PGA", NULL, "Right Capture Inverting Mux" }, -{ "AIFOUTL", "Left", "ADCL" }, -{ "AIFOUTL", "Right", "ADCR" }, -{ "AIFOUTR", "Left", "ADCL" }, -{ "AIFOUTR", "Right", "ADCR" }, +{ "AIFOUTL", NULL, "ADCL" }, +{ "AIFOUTL", NULL, "ADCR" }, +{ "AIFOUTR", NULL, "ADCL" }, +{ "AIFOUTR", NULL, "ADCR" }, Is this the right fix here? I am not super familiar with the driver but it appears to contain an "AIFOUTL Mux" control which is not connected to anything. Looks like maybe this is a mistake the mux is indeded to be included in the path? Feels like we should either remove the control as well or hook it into the path. Thank for your information. I think here it should correct the path name as --->8--- { "AIFOUTL Mux", "Left", "ADCL" }, { "AIFOUTL Mux", "Right", "ADCR" }, { "AIFOUTR Mux", "Left", "ADCL" }, { "AIFOUTR Mux", "Right", "ADCR" }, ---8<--- Thanks again. I will send out the new version. Your probably also need to connect the mux to the output pins. Thanks for you information, after check the datasheet, I still don't know which the mux should connect to which output pins. AIFOUTL Mux to AIFOUTL AIFOUTR Mux to AIFOUTR Thanks. I will send new version patch for review. Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3] ASoC: wm8904: fix runtime warning
Correct the path name for mux to get rid of the following warning: --->8--- wm8904 1-001a: Control not supported for path ADCL -> [Left] -> AIFOUTL wm8904 1-001a: ASoC: no dapm match for ADCL --> Left --> AIFOUTL wm8904 1-001a: ASoC: Failed to add route ADCL -> Left -> AIFOUTL wm8904 1-001a: Control not supported for path ADCR -> [Right] -> AIFOUTL wm8904 1-001a: ASoC: no dapm match for ADCR --> Right --> AIFOUTL wm8904 1-001a: ASoC: Failed to add route ADCR -> Right -> AIFOUTL wm8904 1-001a: Control not supported for path ADCL -> [Left] -> AIFOUTR wm8904 1-001a: ASoC: no dapm match for ADCL --> Left --> AIFOUTR wm8904 1-001a: ASoC: Failed to add route ADCL -> Left -> AIFOUTR wm8904 1-001a: Control not supported for path ADCR -> [Right] -> AIFOUTR wm8904 1-001a: ASoC: no dapm match for ADCR --> Right --> AIFOUTR wm8904 1-001a: ASoC: Failed to add route ADCR -> Right -> AIFOUTR wm8904 1-001a: Control not supported for path AIFINR -> [Right] -> DACL wm8904 1-001a: ASoC: no dapm match for AIFINR --> Right --> DACL wm8904 1-001a: ASoC: Failed to add route AIFINR -> Right -> DACL wm8904 1-001a: Control not supported for path AIFINL -> [Left] -> DACL wm8904 1-001a: ASoC: no dapm match for AIFINL --> Left --> DACL wm8904 1-001a: ASoC: Failed to add route AIFINL -> Left -> DACL wm8904 1-001a: Control not supported for path AIFINR -> [Right] -> DACR wm8904 1-001a: ASoC: no dapm match for AIFINR --> Right --> DACR wm8904 1-001a: ASoC: Failed to add route AIFINR -> Right -> DACR wm8904 1-001a: Control not supported for path AIFINL -> [Left] -> DACR wm8904 1-001a: ASoC: no dapm match for AIFINL --> Left --> DACR wm8904 1-001a: ASoC: Failed to add route AIFINL -> Left -> DACR ---8<--- Signed-off-by: Bo Shen --- Changes in v3: - Correct the DAC related route path Changes in v2: - Correct the mux path name. - Route the mux to the pins. sound/soc/codecs/wm8904.c | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c index 4d2d2b1..75b87c5 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c @@ -1076,10 +1076,13 @@ static const struct snd_soc_dapm_route adc_intercon[] = { { "Right Capture PGA", NULL, "Right Capture Mux" }, { "Right Capture PGA", NULL, "Right Capture Inverting Mux" }, - { "AIFOUTL", "Left", "ADCL" }, - { "AIFOUTL", "Right", "ADCR" }, - { "AIFOUTR", "Left", "ADCL" }, - { "AIFOUTR", "Right", "ADCR" }, + { "AIFOUTL Mux", "Left", "ADCL" }, + { "AIFOUTL Mux", "Right", "ADCR" }, + { "AIFOUTR Mux", "Left", "ADCL" }, + { "AIFOUTR Mux", "Right", "ADCR" }, + + { "AIFOUTL", NULL, "AIFOUTL Mux" }, + { "AIFOUTR", NULL, "AIFOUTR Mux" }, { "ADCL", NULL, "CLK_DSP" }, { "ADCL", NULL, "Left Capture PGA" }, @@ -1089,12 +1092,16 @@ static const struct snd_soc_dapm_route adc_intercon[] = { }; static const struct snd_soc_dapm_route dac_intercon[] = { - { "DACL", "Right", "AIFINR" }, - { "DACL", "Left", "AIFINL" }, + { "DACL Mux", "Left", "AIFINL" }, + { "DACL Mux", "Right", "AIFINR" }, + + { "DACR Mux", "Left", "AIFINL" }, + { "DACR Mux", "Right", "AIFINR" }, + + { "DACL", NULL, "DACL Mux" }, { "DACL", NULL, "CLK_DSP" }, - { "DACR", "Right", "AIFINR" }, - { "DACR", "Left", "AIFINL" }, + { "DACR", NULL, "DACR Mux" }, { "DACR", NULL, "CLK_DSP" }, { "Charge pump", NULL, "SYSCLK" }, -- 2.1.0.24.g4109c28 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/2] ASoC: atmel_ssc_dai: fix start event for I2S mode
According to the I2S specification information as following: - WS = 0, channel 1 (left) - WS = 1, channel 2 (right) So, the start event should be TF/RF falling edge. Reported-by: Songjun Wu Signed-off-by: Bo Shen --- sound/soc/atmel/atmel_ssc_dai.c | 18 -- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index 99ff35e..e691aab 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c @@ -348,7 +348,6 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, struct atmel_pcm_dma_params *dma_params; int dir, channels, bits; u32 tfmr, rfmr, tcmr, rcmr; - int start_event; int ret; int fslen, fslen_ext; @@ -457,19 +456,10 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, * The SSC transmit clock is obtained from the BCLK signal on * on the TK line, and the SSC receive clock is * generated from the transmit clock. -* -* For single channel data, one sample is transferred -* on the falling edge of the LRC clock. -* For two channel data, one sample is -* transferred on both edges of the LRC clock. */ - start_event = ((channels == 1) - ? SSC_START_FALLING_RF - : SSC_START_EDGE_RF); - rcmr =SSC_BF(RCMR_PERIOD, 0) | SSC_BF(RCMR_STTDLY, START_DELAY) - | SSC_BF(RCMR_START, start_event) + | SSC_BF(RCMR_START, SSC_START_FALLING_RF) | SSC_BF(RCMR_CKI, SSC_CKI_RISING) | SSC_BF(RCMR_CKO, SSC_CKO_NONE) | SSC_BF(RCMR_CKS, ssc->clk_from_rk_pin ? @@ -478,14 +468,14 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, rfmr =SSC_BF(RFMR_FSEDGE, SSC_FSEDGE_POSITIVE) | SSC_BF(RFMR_FSOS, SSC_FSOS_NONE) | SSC_BF(RFMR_FSLEN, 0) - | SSC_BF(RFMR_DATNB, 0) + | SSC_BF(RFMR_DATNB, (channels - 1)) | SSC_BIT(RFMR_MSBF) | SSC_BF(RFMR_LOOP, 0) | SSC_BF(RFMR_DATLEN, (bits - 1)); tcmr =SSC_BF(TCMR_PERIOD, 0) | SSC_BF(TCMR_STTDLY, START_DELAY) - | SSC_BF(TCMR_START, start_event) + | SSC_BF(TCMR_START, SSC_START_FALLING_RF) | SSC_BF(TCMR_CKI, SSC_CKI_FALLING) | SSC_BF(TCMR_CKO, SSC_CKO_NONE) | SSC_BF(TCMR_CKS, ssc->clk_from_rk_pin ? @@ -495,7 +485,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, | SSC_BF(TFMR_FSDEN, 0) | SSC_BF(TFMR_FSOS, SSC_FSOS_NONE) | SSC_BF(TFMR_FSLEN, 0) - | SSC_BF(TFMR_DATNB, 0) + | SSC_BF(TFMR_DATNB, (channels - 1)) | SSC_BIT(TFMR_MSBF) | SSC_BF(TFMR_DATDEF, 0) | SSC_BF(TFMR_DATLEN, (bits - 1)); -- 2.3.0.rc0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/2] ASoC: atmel_ssc_dai: remove clock pin comments
As the clock can be get from TK/RK pin, so remove the comments. Signed-off-by: Bo Shen --- sound/soc/atmel/atmel_ssc_dai.c | 4 1 file changed, 4 deletions(-) diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index e691aab..198661b 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c @@ -452,10 +452,6 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, case SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBM_CFM: /* * I2S format, CODEC supplies BCLK and LRC clocks. -* -* The SSC transmit clock is obtained from the BCLK signal on -* on the TK line, and the SSC receive clock is -* generated from the transmit clock. */ rcmr =SSC_BF(RCMR_PERIOD, 0) | SSC_BF(RCMR_STTDLY, START_DELAY) -- 2.3.0.rc0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/2] ASoC: atmel_ssc_dai: remove clock pin comments
Hi Peter, On 01/19/2015 09:54 PM, Peter Rosin wrote: As the clock can be get from TK/RK pin, so remove the comments. Signed-off-by: Bo Shen --- sound/soc/atmel/atmel_ssc_dai.c | 4 1 file changed, 4 deletions(-) diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index e691aab..198661b 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c @@ -452,10 +452,6 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, case SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBM_CFM: /* * I2S format, CODEC supplies BCLK and LRC clocks. -* -* The SSC transmit clock is obtained from the BCLK signal on -* on the TK line, and the SSC receive clock is -* generated from the transmit clock. */ rcmr =SSC_BF(RCMR_PERIOD, 0) | SSC_BF(RCMR_STTDLY, START_DELAY) -- 2.3.0.rc0 Hi! You should probably remove that comment from the case with SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_CBM_CFM as well... Thanks, I will remove it in next version. Cheers, Peter Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 2/2] ASoC: atmel_ssc_dai: remove clock pin comments
As the clock can be get from TK/RK pin, so remove the comments. Signed-off-by: Bo Shen --- Changes in v2: - remove the comments for DSP mode A, codec as master sound/soc/atmel/atmel_ssc_dai.c | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index e691aab..3cd7059 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c @@ -450,13 +450,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, break; case SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBM_CFM: - /* -* I2S format, CODEC supplies BCLK and LRC clocks. -* -* The SSC transmit clock is obtained from the BCLK signal on -* on the TK line, and the SSC receive clock is -* generated from the transmit clock. -*/ + /* I2S format, CODEC supplies BCLK and LRC clocks. */ rcmr =SSC_BF(RCMR_PERIOD, 0) | SSC_BF(RCMR_STTDLY, START_DELAY) | SSC_BF(RCMR_START, SSC_START_FALLING_RF) @@ -535,10 +529,6 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, /* * DSP/PCM Mode A format, CODEC supplies BCLK and LRC clocks. * -* The SSC transmit clock is obtained from the BCLK signal on -* on the TK line, and the SSC receive clock is -* generated from the transmit clock. -* * Data is transferred on first BCLK after LRC pulse rising * edge.If stereo, the right channel data is contiguous with * the left channel data. -- 2.3.0.rc0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 1/2] ASoC: atmel_ssc_dai: fix start event for I2S mode
According to the I2S specification information as following: - WS = 0, channel 1 (left) - WS = 1, channel 2 (right) So, the start event should be TF/RF falling edge. Reported-by: Songjun Wu Signed-off-by: Bo Shen --- Changes in v2: None sound/soc/atmel/atmel_ssc_dai.c | 18 -- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index 99ff35e..e691aab 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c @@ -348,7 +348,6 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, struct atmel_pcm_dma_params *dma_params; int dir, channels, bits; u32 tfmr, rfmr, tcmr, rcmr; - int start_event; int ret; int fslen, fslen_ext; @@ -457,19 +456,10 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, * The SSC transmit clock is obtained from the BCLK signal on * on the TK line, and the SSC receive clock is * generated from the transmit clock. -* -* For single channel data, one sample is transferred -* on the falling edge of the LRC clock. -* For two channel data, one sample is -* transferred on both edges of the LRC clock. */ - start_event = ((channels == 1) - ? SSC_START_FALLING_RF - : SSC_START_EDGE_RF); - rcmr =SSC_BF(RCMR_PERIOD, 0) | SSC_BF(RCMR_STTDLY, START_DELAY) - | SSC_BF(RCMR_START, start_event) + | SSC_BF(RCMR_START, SSC_START_FALLING_RF) | SSC_BF(RCMR_CKI, SSC_CKI_RISING) | SSC_BF(RCMR_CKO, SSC_CKO_NONE) | SSC_BF(RCMR_CKS, ssc->clk_from_rk_pin ? @@ -478,14 +468,14 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, rfmr =SSC_BF(RFMR_FSEDGE, SSC_FSEDGE_POSITIVE) | SSC_BF(RFMR_FSOS, SSC_FSOS_NONE) | SSC_BF(RFMR_FSLEN, 0) - | SSC_BF(RFMR_DATNB, 0) + | SSC_BF(RFMR_DATNB, (channels - 1)) | SSC_BIT(RFMR_MSBF) | SSC_BF(RFMR_LOOP, 0) | SSC_BF(RFMR_DATLEN, (bits - 1)); tcmr =SSC_BF(TCMR_PERIOD, 0) | SSC_BF(TCMR_STTDLY, START_DELAY) - | SSC_BF(TCMR_START, start_event) + | SSC_BF(TCMR_START, SSC_START_FALLING_RF) | SSC_BF(TCMR_CKI, SSC_CKI_FALLING) | SSC_BF(TCMR_CKO, SSC_CKO_NONE) | SSC_BF(TCMR_CKS, ssc->clk_from_rk_pin ? @@ -495,7 +485,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, | SSC_BF(TFMR_FSDEN, 0) | SSC_BF(TFMR_FSOS, SSC_FSOS_NONE) | SSC_BF(TFMR_FSLEN, 0) - | SSC_BF(TFMR_DATNB, 0) + | SSC_BF(TFMR_DATNB, (channels - 1)) | SSC_BIT(TFMR_MSBF) | SSC_BF(TFMR_DATDEF, 0) | SSC_BF(TFMR_DATLEN, (bits - 1)); -- 2.3.0.rc0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [alsa-devel] [PATCH v2 1/3] ASoC: codecs: wm8904: add dt ids table
Hi Mark, Lars-Perter, On 01/27/2015 12:49 AM, Lars-Peter Clausen wrote: On 01/26/2015 05:42 PM, Mark Brown wrote: On Mon, Jan 26, 2015 at 04:24:38PM +0100, Nicolas Ferre wrote: Le 16/01/2015 02:17, Bo Shen a écrit : Does this end up in the i2c_driver_id driver data or do we need some extra code when devtype is assigned to check for an of_node and look at the DT data instead? That certainly used to be the case... At the beginning I think as the same as you, and also add the code to get the data as I do in . However, as I remember, I2C seems only use the compatible string after the comma, that means only for "wlf,wm8904", it uses "wm8904" to match. So, I remove all the code I added, and just keep these, and it can get the device type correctly. So, when I submit the patch and keep the code as simple as possible. I don't understand what's keeping this patch from being applied. Voice, do you mind re-sending? I need to convince myself that the above actually works and is doing the right thing; the above explanation sounds like if it works it might be relying on a bug. I'd call it a undocumented feature. But I wouldn't rely on it being around for ever. In my opinion to be future proof the driver should explicitly handle the OF case in the probe function. I will add this into probe function in next version. Thanks. Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 1/2] ASoC: codecs: wm8904: add dt ids table
From: Alexander Morozov The WM8904 and WM8918 has the same data type, while the WM8912 has different data type. So, use the data in dt ids table to distinguish them. Signed-off-by: Alexander Morozov [voice.s...@atmel.com: add code to distinguish device type] Signed-off-by: Bo Shen --- Changes in v3: - Get the device type from match data in probe function. Changes in v2: - Add driver data for distinguish the device capability. sound/soc/codecs/wm8904.c | 31 ++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c index 4d2d2b1..a80bc52 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c @@ -2098,6 +2098,24 @@ static const struct regmap_config wm8904_regmap = { .num_reg_defaults = ARRAY_SIZE(wm8904_reg_defaults), }; +#ifdef CONFIG_OF +static enum wm8904_type wm8904_data = WM8904; +static enum wm8904_type wm8912_data = WM8912; + +static const struct of_device_id wm8904_of_match[] = { + { + .compatible = "wlf,wm8904", + .data = &wm8904_data, + }, { + .compatible = "wlf,wm8912", + .data = &wm8912_data, + }, { + /* sentinel */ + } +}; +MODULE_DEVICE_TABLE(of, wm8904_of_match); +#endif + static int wm8904_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { @@ -2125,7 +2143,17 @@ static int wm8904_i2c_probe(struct i2c_client *i2c, return ret; } - wm8904->devtype = id->driver_data; + if (i2c->dev.of_node) { + const struct of_device_id *match; + + match = of_match_node(wm8904_of_match, i2c->dev.of_node); + if (match == NULL) + return -EINVAL; + wm8904->devtype = *((enum wm8904_type *)match->data); + } else { + wm8904->devtype = id->driver_data; + } + i2c_set_clientdata(i2c, wm8904); wm8904->pdata = i2c->dev.platform_data; @@ -2259,6 +2287,7 @@ static struct i2c_driver wm8904_i2c_driver = { .driver = { .name = "wm8904", .owner = THIS_MODULE, + .of_match_table = of_match_ptr(wm8904_of_match), }, .probe =wm8904_i2c_probe, .remove = wm8904_i2c_remove, -- 2.3.0.rc0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 2/2] binding: wm8904: add new compatible string
The "wlf,wm8912" compatible string is used for wm8912, which share driver with wm8904, however, the data type is different. Signed-off-by: Bo Shen --- Changes in v3: None Changes in v2: None Documentation/devicetree/bindings/sound/wm8904.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/sound/wm8904.txt b/Documentation/devicetree/bindings/sound/wm8904.txt index e99f409..66bf261 100644 --- a/Documentation/devicetree/bindings/sound/wm8904.txt +++ b/Documentation/devicetree/bindings/sound/wm8904.txt @@ -3,7 +3,7 @@ WM8904 audio CODEC This device supports I2C only. Required properties: - - compatible: "wlf,wm8904" + - compatible: "wlf,wm8904" or "wlf,wm8912" - reg: the I2C address of the device. - clock-names: "mclk" - clocks: reference to -- 2.3.0.rc0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v5 1/2] Input: touchscreen-iproc: Add Broadcom iProc touchscreen driver
Hi Jonathan Richardson, On 03/21/2015 08:57 AM, Jonathan Richardson wrote: +static struct platform_driver iproc_ts_driver = { + .probe = iproc_ts_probe, Just a little curious, is the .remove function missing or it doesn't need it. Thanks. + .driver = { + .name = IPROC_TS_NAME, + .of_match_table = of_match_ptr(iproc_ts_of_match), + }, +}; + +module_platform_driver(iproc_ts_driver); + +MODULE_DESCRIPTION("IPROC Touchscreen driver"); +MODULE_AUTHOR("Broadcom"); +MODULE_LICENSE("GPL v2"); Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 6/8] ASoC: atmel: support CCF based clks
From: Boris BREZILLON Provide dev to clk_get function if we're using CCF based clks. CCF based prog clks support automatic parent selection when asking for a specific rate: remove the clk32k clk retrieval if we're using these clks. Signed-off-by: Boris BREZILLON [voice.s...@atmel.com: switch to devm manage function] Signed-off-by: Bo Shen Signed-off-by: Bo Shen --- sound/soc/atmel/atmel_wm8904.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/sound/soc/atmel/atmel_wm8904.c b/sound/soc/atmel/atmel_wm8904.c index b4e3690..a797d33 100644 --- a/sound/soc/atmel/atmel_wm8904.c +++ b/sound/soc/atmel/atmel_wm8904.c @@ -170,25 +170,26 @@ static int atmel_asoc_wm8904_probe(struct platform_device *pdev) return ret; } - mclk = clk_get(NULL, "pck0"); + mclk = devm_clk_get(&pdev->dev, "pck0"); if (IS_ERR(mclk)) { dev_err(&pdev->dev, "failed to get pck0\n"); ret = PTR_ERR(mclk); goto err_set_audio; } - clk_src = clk_get(NULL, "clk32k"); - if (IS_ERR(clk_src)) { - dev_err(&pdev->dev, "failed to get clk32k\n"); - ret = PTR_ERR(clk_src); - goto err_set_audio; - } + if (!IS_ENABLED(CONFIG_COMMON_CLK)) { + clk_src = devm_clk_get(&pdev->dev, "clk32k"); + if (IS_ERR(clk_src)) { + dev_err(&pdev->dev, "failed to get clk32k\n"); + ret = PTR_ERR(clk_src); + goto err_set_audio; + } - ret = clk_set_parent(mclk, clk_src); - clk_put(clk_src); - if (ret != 0) { - dev_err(&pdev->dev, "failed to set MCLK parent\n"); - goto err_set_audio; + ret = clk_set_parent(mclk, clk_src); + if (ret != 0) { + dev_err(&pdev->dev, "failed to set MCLK parent\n"); + goto err_set_audio; + } } dev_info(&pdev->dev, "setting pck0 to %dHz\n", MCLK_RATE); -- 1.8.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 7/8] ASoC: atmel: document clock properties of the wm8904 driver
On 03/17/2014 05:45 PM, Bo Shen wrote: From: Boris BREZILLON Signed-off-by: Boris BREZILLON Signed-off-by: Bo Shen Oh, sorry for my SOB. Please remove it when apply. --- Documentation/devicetree/bindings/sound/atmel-wm8904.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/atmel-wm8904.txt b/Documentation/devicetree/bindings/sound/atmel-wm8904.txt index 8bbe50c..aca341c 100644 --- a/Documentation/devicetree/bindings/sound/atmel-wm8904.txt +++ b/Documentation/devicetree/bindings/sound/atmel-wm8904.txt @@ -3,6 +3,8 @@ Atmel ASoC driver with wm8904 audio codec complex Required properties: - compatible: "atmel,asoc-wm8904" - atmel,model: The user-visible name of this sound complex. + - clocks: A list of clocks needed by the wm8904 chip. + - clock-output-names: Driver related clock names. Shall contain "pck0". - atmel,audio-routing: A list of the connections between audio components. Each entry is a pair of strings, the first being the connection's sink, the second being the connection's source. Valid names for sources and Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 6/8] ASoC: atmel: support CCF based clks
On 03/17/2014 05:45 PM, Bo Shen wrote: From: Boris BREZILLON Provide dev to clk_get function if we're using CCF based clks. CCF based prog clks support automatic parent selection when asking for a specific rate: remove the clk32k clk retrieval if we're using these clks. Signed-off-by: Boris BREZILLON [voice.s...@atmel.com: switch to devm manage function] Signed-off-by: Bo Shen Signed-off-by: Bo Shen Oh, sorry for multi SOBs. Please remove it when apply. --- sound/soc/atmel/atmel_wm8904.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/sound/soc/atmel/atmel_wm8904.c b/sound/soc/atmel/atmel_wm8904.c index b4e3690..a797d33 100644 --- a/sound/soc/atmel/atmel_wm8904.c +++ b/sound/soc/atmel/atmel_wm8904.c @@ -170,25 +170,26 @@ static int atmel_asoc_wm8904_probe(struct platform_device *pdev) return ret; } - mclk = clk_get(NULL, "pck0"); + mclk = devm_clk_get(&pdev->dev, "pck0"); if (IS_ERR(mclk)) { dev_err(&pdev->dev, "failed to get pck0\n"); ret = PTR_ERR(mclk); goto err_set_audio; } - clk_src = clk_get(NULL, "clk32k"); - if (IS_ERR(clk_src)) { - dev_err(&pdev->dev, "failed to get clk32k\n"); - ret = PTR_ERR(clk_src); - goto err_set_audio; - } + if (!IS_ENABLED(CONFIG_COMMON_CLK)) { + clk_src = devm_clk_get(&pdev->dev, "clk32k"); + if (IS_ERR(clk_src)) { + dev_err(&pdev->dev, "failed to get clk32k\n"); + ret = PTR_ERR(clk_src); + goto err_set_audio; + } - ret = clk_set_parent(mclk, clk_src); - clk_put(clk_src); - if (ret != 0) { - dev_err(&pdev->dev, "failed to set MCLK parent\n"); - goto err_set_audio; + ret = clk_set_parent(mclk, clk_src); + if (ret != 0) { + dev_err(&pdev->dev, "failed to set MCLK parent\n"); + goto err_set_audio; + } } dev_info(&pdev->dev, "setting pck0 to %dHz\n", MCLK_RATE); Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 8/8] ARM: at91/dt: add clock properties to the wm8904 codec node
On 03/17/2014 05:45 PM, Bo Shen wrote: From: Boris BREZILLON Signed-off-by: Boris BREZILLON Signed-off-by: Bo Shen Oh, sorry for my SOB. Please remove it when apply. --- arch/arm/boot/dts/sama5d3xmb.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/boot/dts/sama5d3xmb.dtsi b/arch/arm/boot/dts/sama5d3xmb.dtsi index 306eef0..d9bb413 100644 --- a/arch/arm/boot/dts/sama5d3xmb.dtsi +++ b/arch/arm/boot/dts/sama5d3xmb.dtsi @@ -163,6 +163,8 @@ compatible = "atmel,asoc-wm8904"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pck0_as_audio_mck>; + clocks = <&pck0>; + clock-names = "pck0"; atmel,model = "wm8904 @ SAMA5D3EK"; atmel,audio-routing = Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 8/8] ARM: at91/dt: add clock properties to the wm8904 codec node
From: Boris BREZILLON Signed-off-by: Boris BREZILLON Signed-off-by: Bo Shen --- arch/arm/boot/dts/sama5d3xmb.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/boot/dts/sama5d3xmb.dtsi b/arch/arm/boot/dts/sama5d3xmb.dtsi index 306eef0..d9bb413 100644 --- a/arch/arm/boot/dts/sama5d3xmb.dtsi +++ b/arch/arm/boot/dts/sama5d3xmb.dtsi @@ -163,6 +163,8 @@ compatible = "atmel,asoc-wm8904"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pck0_as_audio_mck>; + clocks = <&pck0>; + clock-names = "pck0"; atmel,model = "wm8904 @ SAMA5D3EK"; atmel,audio-routing = -- 1.8.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 4/8] ARM: at91: sama5d3: add the missing property
If without the MICBIAS routing, the record don't work. Add the missing MICBIAS routing to let record from mic working. Signed-off-by: Bo Shen --- arch/arm/boot/dts/sama5d3xmb.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/boot/dts/sama5d3xmb.dtsi b/arch/arm/boot/dts/sama5d3xmb.dtsi index e1bd5767..0600153 100644 --- a/arch/arm/boot/dts/sama5d3xmb.dtsi +++ b/arch/arm/boot/dts/sama5d3xmb.dtsi @@ -166,6 +166,7 @@ "Headphone Jack", "HPOUTR", "IN2L", "Line In Jack", "IN2R", "Line In Jack", + "MICBIAS", "IN1L", "IN1L", "Mic"; atmel,ssc-controller = <&ssc0>; -- 1.8.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 5/8] ARM: at91: sama5d3: clock for ssc from rk pin
According to hardware design the clock for SSC device is from rk pin. Signed-off-by: Bo Shen --- arch/arm/boot/dts/sama5d3xmb.dtsi | 4 1 file changed, 4 insertions(+) diff --git a/arch/arm/boot/dts/sama5d3xmb.dtsi b/arch/arm/boot/dts/sama5d3xmb.dtsi index 0600153..306eef0 100644 --- a/arch/arm/boot/dts/sama5d3xmb.dtsi +++ b/arch/arm/boot/dts/sama5d3xmb.dtsi @@ -32,6 +32,10 @@ }; }; + ssc0: ssc@f0008000 { + atmel,clk-from-rk-pin; + }; + /* * i2c0 conflicts with ISI: * disable it to allow the use of ISI -- 1.8.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/8] ARM: at91: sama5d3: disable sound by default
Make the sound device in disabled status by default Signed-off-by: Bo Shen --- arch/arm/boot/dts/sama5d3xmb.dtsi | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/boot/dts/sama5d3xmb.dtsi b/arch/arm/boot/dts/sama5d3xmb.dtsi index dba739b..2938605 100644 --- a/arch/arm/boot/dts/sama5d3xmb.dtsi +++ b/arch/arm/boot/dts/sama5d3xmb.dtsi @@ -170,5 +170,7 @@ atmel,ssc-controller = <&ssc0>; atmel,audio-codec = <&wm8904>; + + status = "disabled"; }; }; -- 1.8.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 0/8] ARM: at91: sama5d3: enable sound support
This patch add sound support on sama5d3xek board. This patch series based on the following patch set: clk: at91: better support for the PCKs http://comments.gmane.org/gmane.linux.kernel/1664477 Bo Shen (5): ARM: at91: sama5d3: add DMA property for SSC devices ARM: at91: sama5d3: disable sound by default ARM: at91: sama5d3: correct the sound compatible string ARM: at91: sama5d3: add the missing property ARM: at91: sama5d3: clock for ssc from rk pin Boris BREZILLON (3): ASoC: atmel: support CCF based clks ASoC: atmel: document clock properties of the wm8904 driver ARM: at91/dt: add clock properties to the wm8904 codec node .../devicetree/bindings/sound/atmel-wm8904.txt | 2 ++ arch/arm/boot/dts/sama5d3.dtsi | 6 ++ arch/arm/boot/dts/sama5d3xmb.dtsi | 11 +- sound/soc/atmel/atmel_wm8904.c | 25 +++--- 4 files changed, 31 insertions(+), 13 deletions(-) -- 1.8.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 7/8] ASoC: atmel: document clock properties of the wm8904 driver
From: Boris BREZILLON Signed-off-by: Boris BREZILLON Signed-off-by: Bo Shen --- Documentation/devicetree/bindings/sound/atmel-wm8904.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/atmel-wm8904.txt b/Documentation/devicetree/bindings/sound/atmel-wm8904.txt index 8bbe50c..aca341c 100644 --- a/Documentation/devicetree/bindings/sound/atmel-wm8904.txt +++ b/Documentation/devicetree/bindings/sound/atmel-wm8904.txt @@ -3,6 +3,8 @@ Atmel ASoC driver with wm8904 audio codec complex Required properties: - compatible: "atmel,asoc-wm8904" - atmel,model: The user-visible name of this sound complex. + - clocks: A list of clocks needed by the wm8904 chip. + - clock-output-names: Driver related clock names. Shall contain "pck0". - atmel,audio-routing: A list of the connections between audio components. Each entry is a pair of strings, the first being the connection's sink, the second being the connection's source. Valid names for sources and -- 1.8.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/8] ARM: at91: sama5d3: add DMA property for SSC devices
Add DMA property for SSC devices on SAMA5D3 SoC. Signed-off-by: Bo Shen --- arch/arm/boot/dts/sama5d3.dtsi | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/boot/dts/sama5d3.dtsi b/arch/arm/boot/dts/sama5d3.dtsi index 3d5faf8..3e753e1 100644 --- a/arch/arm/boot/dts/sama5d3.dtsi +++ b/arch/arm/boot/dts/sama5d3.dtsi @@ -113,6 +113,9 @@ compatible = "atmel,at91sam9g45-ssc"; reg = <0xf0008000 0x4000>; interrupts = <38 IRQ_TYPE_LEVEL_HIGH 4>; + dmas = <&dma0 2 AT91_DMA_CFG_PER_ID(13)>, + <&dma0 2 AT91_DMA_CFG_PER_ID(14)>; + dma-names = "tx", "rx"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>; clocks = <&ssc0_clk>; @@ -231,6 +234,9 @@ compatible = "atmel,at91sam9g45-ssc"; reg = <0xf800c000 0x4000>; interrupts = <39 IRQ_TYPE_LEVEL_HIGH 4>; + dmas = <&dma1 2 AT91_DMA_CFG_PER_ID(3)>, + <&dma1 2 AT91_DMA_CFG_PER_ID(4)>; + dma-names = "tx", "rx"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ssc1_tx &pinctrl_ssc1_rx>; clocks = <&ssc1_clk>; -- 1.8.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 3/8] ARM: at91: sama5d3: correct the sound compatible string
As the sama5d3 dtsi file in go into mainline before sound driver, and, the sound compatible string is changed when go into mainline. Add this patch to correct the sound compatible string. Signed-off-by: Bo Shen --- arch/arm/boot/dts/sama5d3xmb.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/sama5d3xmb.dtsi b/arch/arm/boot/dts/sama5d3xmb.dtsi index 2938605..e1bd5767 100644 --- a/arch/arm/boot/dts/sama5d3xmb.dtsi +++ b/arch/arm/boot/dts/sama5d3xmb.dtsi @@ -156,7 +156,7 @@ }; sound { - compatible = "atmel,sama5d3ek-wm8904"; + compatible = "atmel,asoc-wm8904"; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pck0_as_audio_mck>; -- 1.8.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 7/8] ASoC: atmel: document clock properties of the wm8904 driver
Hi Mark, On 03/17/2014 07:55 PM, Mark Brown wrote: On Mon, Mar 17, 2014 at 05:45:40PM +0800, Bo Shen wrote: - compatible: "atmel,asoc-wm8904" - atmel,model: The user-visible name of this sound complex. + - clocks: A list of clocks needed by the wm8904 chip. + - clock-output-names: Driver related clock names. Shall contain "pck0". If this is a clock for the CODEC it should be documented as part of the binding for the CODEC and connected to the CODEC in the device tree rather than being part of a machine driver binding. This is a optional clock for CODEC which depends on hardware design. There are 3 options for this clock, wm8904 as an example. 1. Using internal FLL, so won't use this clock. 2. Using external oscillator, no need to retrieve this clock. 3. Using SoC provide this clock (we use this case). After considering these 3 options, if we put this into CODEC driver to do it, I think it will be more complicate to do logic judgement. Do you think so? And, in machine driver, it will depends on the clock option to decide whether to call snd_soc_dai_set_pll and snd_soc_dai_set_sysclk. And also the mentions the machine drivers responsibility (one is for clocking) as following: --->8--- The ASoC machine (or board) driver is the code that glues together all the component drivers (e.g. codecs, platforms and DAIs). It also describes the relationships between each componnent which include audio paths, GPIOs, interrupts, clocking, jacks and voltage regulators. ---8<--- So, I think put this into machine driver will be better. Do you have any other idea? Or if I misunderstand something, please point it out. Thanks. Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] Video: atmel: avoid the id of fix screen info is overwritten
Correct passing parameter sequence, which will avoid the id of fix screen info is overwritten. Signed-off-by: Bo Shen --- drivers/video/atmel_lcdfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index cd96162..695f28a 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c @@ -1190,12 +1190,12 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev) if (!sinfo->config) goto free_info; - strcpy(info->fix.id, sinfo->pdev->name); info->flags = ATMEL_LCDFB_FBINFO_DEFAULT; info->pseudo_palette = sinfo->pseudo_palette; info->fbops = &atmel_lcdfb_ops; info->fix = atmel_lcdfb_fix; + strcpy(info->fix.id, sinfo->pdev->name); /* Enable LCDC Clocks */ sinfo->bus_clk = clk_get(dev, "hclk"); -- 1.8.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 7/8] ASoC: atmel: document clock properties of the wm8904 driver
Hi Mark, On 03/19/2014 06:28 PM, Mark Brown wrote: On Wed, Mar 19, 2014 at 01:57:23PM +0800, Bo Shen wrote: On 03/17/2014 07:55 PM, Mark Brown wrote: If this is a clock for the CODEC it should be documented as part of the binding for the CODEC and connected to the CODEC in the device tree rather than being part of a machine driver binding. This is a optional clock for CODEC which depends on hardware design. There are 3 options for this clock, wm8904 as an example. 1. Using internal FLL, so won't use this clock. 2. Using external oscillator, no need to retrieve this clock. 3. Using SoC provide this clock (we use this case). After considering these 3 options, if we put this into CODEC driver to do it, I think it will be more complicate to do logic judgement. Do you think so? There shouldn't be any meaningful complexity from the above cases - cases 2 and 3 are the same and if the clock isn't used at all then it can be omitted. If the FLL is clocked from MCLK then the CODEC driver should be able to work out how to configure it easily, the device isn't like a digital hub CODEC with lots of clocking options. For this, in my mind, I think we need add following parameters in DT. 1. sysclk_src_from_fll --> we need do nothing. 2. sysclk_src_from_mclk 2.1 use_external_xtal --> we need clock_frequency 2.2 !use_external_xtal --> we need retrieve clock and clock_frequency. So, the dt may looks like: for case 1: wm8904: wm8904@1a { reg = <0x1a>; sysclk_src_from_fll; } for case 2.1: wm8904: wm8904@1a { reg = <0x1a>; sysclk_src_from_mclk; use_external_xtal; clock_frequency = 1200; } for case 2.2: wm8904: wm8904@1a { reg = <0x1a>; sysclk_src_from_mclk; clocks = <&pck0>; clock-names = "mclk"; clock_frequency = 32768; } Does this acceptable? Or any other better suggestion for this? Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 7/8] ASoC: atmel: document clock properties of the wm8904 driver
Hi Mark Brown, On 03/20/2014 09:47 PM, Mark Brown wrote: On Thu, Mar 20, 2014 at 10:37:53AM +0800, Bo Shen wrote: For this, in my mind, I think we need add following parameters in DT. 1. sysclk_src_from_fll --> we need do nothing. No, how would this work? If nothing else the FLL needs configuration. Only configure it in machine driver. Then no DT operation. 2. sysclk_src_from_mclk 2.1 use_external_xtal --> we need clock_frequency 2.2 !use_external_xtal --> we need retrieve clock and clock_frequency. No, this is all handled in the clock binding. If there's a fixed rate clock the device tree should have a fixed rate clock provided. Does this acceptable? Or any other better suggestion for this? Just have the device tree describe the hardware and provide a way of specifying an optional MCLK. I will implement an RFC patch, please help review it. Thanks. Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/2] USB: at91: using USBA_NR_DMAS for DMA channels
Hi Felipe Balbi, On 02/19/2014 12:19 AM, Felipe Balbi wrote: On Fri, Jan 17, 2014 at 10:59:25AM +0800, Bo Shen wrote: When the SoC is earlier than sama5d3 SoC, which have the same number endpoints and DMAs. However for sama5d3 SoC, it has different number for endpoints and DMAs. So, define USBA_NR_DMAs for DMA channels Signed-off-by: Bo Shen --- drivers/usb/gadget/atmel_usba_udc.c | 2 +- drivers/usb/gadget/atmel_usba_udc.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c index 7e67a81..5cded1c 100644 --- a/drivers/usb/gadget/atmel_usba_udc.c +++ b/drivers/usb/gadget/atmel_usba_udc.c @@ -1661,7 +1661,7 @@ static irqreturn_t usba_udc_irq(int irq, void *devid) if (dma_status) { int i; - for (i = 1; i < USBA_NR_ENDPOINTS; i++) + for (i = 1; i < USBA_NR_DMAS; i++) if (dma_status & (1 << i)) usba_dma_irq(udc, &udc->usba_ep[i]); } diff --git a/drivers/usb/gadget/atmel_usba_udc.h b/drivers/usb/gadget/atmel_usba_udc.h index 2922db5..a70706e 100644 --- a/drivers/usb/gadget/atmel_usba_udc.h +++ b/drivers/usb/gadget/atmel_usba_udc.h @@ -210,7 +210,7 @@ #define USBA_FIFO_BASE(x) ((x) << 16) /* Synth parameters */ -#define USBA_NR_ENDPOINTS 7 +#define USBA_NR_DMAS 7 what's the difference ? You just renamed this macro. Also, please clarify a bit your commit log. As commit message said, the SoC before sama5d3, the endpoint number is the same as DMA channel number, so use endpoints definition for DMA channel number, however after sama5d3, the endpoints is not the same as DMA channel, so use DMA micro for DMA channels. Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/2] USB: at91: using USBA_NR_DMAS for DMA channels
On 02/19/2014 09:22 AM, Felipe Balbi wrote: On Wed, Feb 19, 2014 at 09:14:58AM +0800, Bo Shen wrote: Hi Felipe Balbi, On 02/19/2014 12:19 AM, Felipe Balbi wrote: On Fri, Jan 17, 2014 at 10:59:25AM +0800, Bo Shen wrote: When the SoC is earlier than sama5d3 SoC, which have the same number endpoints and DMAs. However for sama5d3 SoC, it has different number for endpoints and DMAs. So, define USBA_NR_DMAs for DMA channels Signed-off-by: Bo Shen --- drivers/usb/gadget/atmel_usba_udc.c | 2 +- drivers/usb/gadget/atmel_usba_udc.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c index 7e67a81..5cded1c 100644 --- a/drivers/usb/gadget/atmel_usba_udc.c +++ b/drivers/usb/gadget/atmel_usba_udc.c @@ -1661,7 +1661,7 @@ static irqreturn_t usba_udc_irq(int irq, void *devid) if (dma_status) { int i; - for (i = 1; i < USBA_NR_ENDPOINTS; i++) + for (i = 1; i < USBA_NR_DMAS; i++) if (dma_status & (1 << i)) usba_dma_irq(udc, &udc->usba_ep[i]); } diff --git a/drivers/usb/gadget/atmel_usba_udc.h b/drivers/usb/gadget/atmel_usba_udc.h index 2922db5..a70706e 100644 --- a/drivers/usb/gadget/atmel_usba_udc.h +++ b/drivers/usb/gadget/atmel_usba_udc.h @@ -210,7 +210,7 @@ #define USBA_FIFO_BASE(x) ((x) << 16) /* Synth parameters */ -#define USBA_NR_ENDPOINTS 7 +#define USBA_NR_DMAS 7 what's the difference ? You just renamed this macro. Also, please clarify a bit your commit log. As commit message said, the SoC before sama5d3, the endpoint number is the same as DMA channel number, so use endpoints definition for DMA channel number, however after sama5d3, the endpoints is not the same as DMA channel, so use DMA micro for DMA channels. which means you're just renaming the macro for the sake of clarity. That's fine, just needs to be clearer in commit message. Thanks, I will send v2 to make the commit message more clearer. Best Regards, Bo Shen -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 2/2] USB: at91: using USBA_NR_DMAS for DMA channels
The SoCs earlier than sama5d3, they have the same number endpoints and DMA channels. In driver code, they use the same definition USBA_NR_ENDPOINTS for both endpoints and dma channels. However, in sama5d3, it has different number for endpoints and DMA channels. So, define a new micro USBA_NR_DMAs for DMA channels. And the USBA_NR_ENDPOINS is not used anymore, remove it at the same time. Signed-off-by: Bo Shen --- Changes in v2: - Make the commit message more clearer. drivers/usb/gadget/atmel_usba_udc.c | 2 +- drivers/usb/gadget/atmel_usba_udc.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c index 7e67a81..5cded1c 100644 --- a/drivers/usb/gadget/atmel_usba_udc.c +++ b/drivers/usb/gadget/atmel_usba_udc.c @@ -1661,7 +1661,7 @@ static irqreturn_t usba_udc_irq(int irq, void *devid) if (dma_status) { int i; - for (i = 1; i < USBA_NR_ENDPOINTS; i++) + for (i = 1; i < USBA_NR_DMAS; i++) if (dma_status & (1 << i)) usba_dma_irq(udc, &udc->usba_ep[i]); } diff --git a/drivers/usb/gadget/atmel_usba_udc.h b/drivers/usb/gadget/atmel_usba_udc.h index 2922db5..a70706e 100644 --- a/drivers/usb/gadget/atmel_usba_udc.h +++ b/drivers/usb/gadget/atmel_usba_udc.h @@ -210,7 +210,7 @@ #define USBA_FIFO_BASE(x) ((x) << 16) /* Synth parameters */ -#define USBA_NR_ENDPOINTS 7 +#define USBA_NR_DMAS 7 #define EP0_FIFO_SIZE 64 #define EP0_EPT_SIZE USBA_EPT_SIZE_64 -- 1.8.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 1/2] USB: at91: fix the number of endpoint parameter
In sama5d3 SoC, there are 16 endpoints, which is different with earlier SoCs (only have 7 endpoints). The USBA_NR_ENDPOINTS micro is not suitable for sama5d3. So, get the endpoints number through the udc->num_ep, which get from platform data for non-dt kernel, or parse from dt node. Signed-off-by: Bo Shen --- Changes in v2: - Make the commit message more clearer. drivers/usb/gadget/atmel_usba_udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c index 2cb52e0..7e67a81 100644 --- a/drivers/usb/gadget/atmel_usba_udc.c +++ b/drivers/usb/gadget/atmel_usba_udc.c @@ -1670,7 +1670,7 @@ static irqreturn_t usba_udc_irq(int irq, void *devid) if (ep_status) { int i; - for (i = 0; i < USBA_NR_ENDPOINTS; i++) + for (i = 0; i < udc->num_ep; i++) if (ep_status & (1 << i)) { if (ep_is_control(&udc->usba_ep[i])) usba_control_irq(udc, &udc->usba_ep[i]); -- 1.8.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 3/3] Binding: atmel-wm8904: add option to choose clock
Add the option to choose clock on which pin input to SSC (as slave). Default is on TK pin to SSC, add "atmel,clk-from-rk-pin" option to specify the clock is on RK pin to SSC. Signed-off-by: Bo Shen --- Changes in v2: - using "-" replace "_" in binding document Documentation/devicetree/bindings/sound/atmel-wm8904.txt | 6 ++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/atmel-wm8904.txt b/Documentation/devicetree/bindings/sound/atmel-wm8904.txt index 8bbe50c..2d86e2b 100644 --- a/Documentation/devicetree/bindings/sound/atmel-wm8904.txt +++ b/Documentation/devicetree/bindings/sound/atmel-wm8904.txt @@ -33,6 +33,12 @@ Required properties: Optional properties: - pinctrl-names, pinctrl-0: Please refer to pinctrl-bindings.txt + - atmel,clk-from-rk-pin: bool property. + - When SSC works in slave mode, according to the hardware design, the + clock can get from TK pin, and also can get from RK pin. So, add + this parameter to choose where the clock from. + - By default the clock is from TK pin, if the clock from RK pin, this + property is needed. Example: sound { -- 1.8.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/