Re: [PATCH 04/12] ARM: pxa: stargate2: Constify the software node
Wolfram Sang writes: > On Mon, Mar 29, 2021 at 01:50:39PM +0300, Heikki Krogerus wrote: >> Additional device properties are always just a part of a >> software fwnode. If the device properties are constant, the >> software node can also be constant. >> >> Signed-off-by: Heikki Krogerus >> Cc: Jonathan Cameron >> Cc: Daniel Mack >> Cc: Haojian Zhuang >> Cc: Robert Jarzmik > > I like to apply it soon. Can we get an ack, please? Acked-by: Robert Jarzmik Cheers. -- Robert
Re: [PATCH] ARM: pxa: mainstone: avoid -Woverride-init warning
Arnd Bergmann writes: > From: Arnd Bergmann > > On Tue, 23 Mar 2021 14:08:27 +0100, Arnd Bergmann wrote: >> The default initializer at the start of the array causes a warning >> when building with W=1: >> >> In file included from arch/arm/mach-pxa/mainstone.c:47: >> arch/arm/mach-pxa/mainstone.h:124:33: error: initialized field overwritten >> [-Werror=override-init] >> 124 | #define MAINSTONE_IRQ(x)(MAINSTONE_NR_IRQS + (x)) >> | ^ >> arch/arm/mach-pxa/mainstone.h:133:33: note: in expansion of macro >> 'MAINSTONE_IRQ' >> 133 | #define MAINSTONE_S0_CD_IRQ MAINSTONE_IRQ(9) >> | ^ >> arch/arm/mach-pxa/mainstone.c:506:15: note: in expansion of macro >> 'MAINSTONE_S0_CD_IRQ' >> 506 | [5] = MAINSTONE_S0_CD_IRQ, >> | ^~~ >> >> [...] > > Applied to arm/fixes. Too late, but ... Acked-by: Robert Jarzmik Cheers. -- Robert
Re: [PATCH 06/32] usb: gadget: udc: pxa27x_udc: Fix a bunch of kerneldoc issues
Lee Jones writes: > Mostly bitrotted argument descriptions/names. Also the removal > of a blank line in the middle of a kerneldoc header, which is > not allowed. > > Fixes the following W=1 kernel build warning(s): > > drivers/usb/gadget/udc/pxa27x_udc.c:398: warning: Function parameter or > member 'ep' not described in 'ep_write_UDCCSR' > drivers/usb/gadget/udc/pxa27x_udc.c:398: warning: Excess function parameter > 'udc' description in 'ep_write_UDCCSR' > drivers/usb/gadget/udc/pxa27x_udc.c:479: warning: Function parameter or > member 'udc' not described in 'set_ep0state' > drivers/usb/gadget/udc/pxa27x_udc.c:479: warning: Excess function parameter > 'dev' description in 'set_ep0state' > drivers/usb/gadget/udc/pxa27x_udc.c:506: warning: Excess function parameter > 'req' description in 'inc_ep_stats_reqs' > drivers/usb/gadget/udc/pxa27x_udc.c:1476: warning: bad line: > drivers/usb/gadget/udc/pxa27x_udc.c:1697: warning: Function parameter or > member 'udc' not described in 'udc_enable' > drivers/usb/gadget/udc/pxa27x_udc.c:1697: warning: Excess function parameter > 'dev' description in 'udc_enable' > drivers/usb/gadget/udc/pxa27x_udc.c:1750: warning: Function parameter or > member 'g' not described in 'pxa27x_udc_start' > drivers/usb/gadget/udc/pxa27x_udc.c:1750: warning: Excess function parameter > 'bind' description in 'pxa27x_udc_start' > drivers/usb/gadget/udc/pxa27x_udc.c:1784: warning: Excess function parameter > 'driver' description in 'stop_activity' > drivers/usb/gadget/udc/pxa27x_udc.c:1800: warning: Function parameter or > member 'g' not described in 'pxa27x_udc_stop' > drivers/usb/gadget/udc/pxa27x_udc.c:1800: warning: Excess function parameter > 'driver' description in 'pxa27x_udc_stop' > drivers/usb/gadget/udc/pxa27x_udc.c:2358: warning: Function parameter or > member 'pdev' not described in 'pxa_udc_probe' > drivers/usb/gadget/udc/pxa27x_udc.c:2358: warning: Excess function parameter > '_dev' description in 'pxa_udc_probe' > > Cc: Daniel Mack > Cc: Haojian Zhuang > Cc: Robert Jarzmik > Cc: Felipe Balbi > Signed-off-by: Lee Jones Acked-by: Robert Jarzmik Cheers. -- Robert
Re: [PATCH] pinctrl: pxa: pxa2xx: Remove 'pxa2xx_pinctrl_exit()' which is unused and broken
Christophe JAILLET writes: > Commit 6d33ee7a0534 ("pinctrl: pxa: Use devm_pinctrl_register() for pinctrl > registration") > has turned a 'pinctrl_register()' into 'devm_pinctrl_register()' in > 'pxa2xx_pinctrl_init()'. > However, the corresponding 'pinctrl_unregister()' call in > 'pxa2xx_pinctrl_exit()' has not been removed. > > This is not an issue, because 'pxa2xx_pinctrl_exit()' is unused. > Remove it now to avoid some wondering in the future and save a few LoC. > > Signed-off-by: Christophe JAILLET Acked-by: Robert Jarzmik Would be even a better patch with a : Fixes: 6d33ee7a0534 ("pinctrl: pxa: Use devm_pinctrl_register() for pinctrl registration") Cheers. -- Robert
Re: [PATCH 2/3] gpio: pxa: Fix return value of pxa_gpio_probe()
Tiezhu Yang writes: > On 05/23/2020 03:07 AM, Robert Jarzmik wrote: >> Tiezhu Yang writes: >> >>> When call function devm_platform_ioremap_resource(), we should use IS_ERR() >>> to check the return value and return PTR_ERR() if failed. >>> >>> Fixes: 542c25b7a209 ("drivers: gpio: pxa: use >>> devm_platform_ioremap_resource()") >>> Signed-off-by: Tiezhu Yang >>> --- >>> drivers/gpio/gpio-pxa.c | 4 ++-- >>> 1 file changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c >>> index 1361270..0cb6600 100644 >>> --- a/drivers/gpio/gpio-pxa.c >>> +++ b/drivers/gpio/gpio-pxa.c >>> @@ -660,8 +660,8 @@ static int pxa_gpio_probe(struct platform_device *pdev) >>> pchip->irq1 = irq1; >>> gpio_reg_base = devm_platform_ioremap_resource(pdev, 0); >>> - if (!gpio_reg_base) >>> - return -EINVAL; >>> + if (IS_ERR(gpio_reg_base)) >>> + return PTR_ERR(gpio_reg_base); >> As far as I know, devm_platform_ioremap_resource() could return NULL which is >> not handled by this test (unless __devm_ioremap() semantics changed since I >> had >> a look). > > Hi Robert, > > In the function __devm_ioremap_resource(), if __devm_ioremap returns NULL, > it will return IOMEM_ERR_PTR(-ENOMEM). > > devm_platform_ioremap_resource() > devm_ioremap_resource() > __devm_ioremap_resource() >__devm_ioremap() > > static void __iomem * > __devm_ioremap_resource(struct device *dev, const struct resource *res, > enum devm_ioremap_type type) > { > ... > dest_ptr = __devm_ioremap(dev, res->start, size, type); > if (!dest_ptr) { > dev_err(dev, "ioremap failed for resource %pR\n", res); > devm_release_mem_region(dev, res->start, size); > dest_ptr = IOMEM_ERR_PTR(-ENOMEM); > } > > return dest_ptr; > } > > And also, we can see the comment of devm_ioremap_resource(): > > Usage example: > > res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > base = devm_ioremap_resource(&pdev->dev, res); > if (IS_ERR(base)) > return PTR_ERR(base); > >> >> Therefore, this patch is incorrect, or rather incomplete. > > So I think this patch is correct, do I miss something? You're right, my bad, didn't see the test in __devm_ioremap_resource(). Cheers. -- Robert
Re: [PATCH 2/3] gpio: pxa: Fix return value of pxa_gpio_probe()
Tiezhu Yang writes: > When call function devm_platform_ioremap_resource(), we should use IS_ERR() > to check the return value and return PTR_ERR() if failed. > > Fixes: 542c25b7a209 ("drivers: gpio: pxa: use > devm_platform_ioremap_resource()") > Signed-off-by: Tiezhu Yang > --- > drivers/gpio/gpio-pxa.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c > index 1361270..0cb6600 100644 > --- a/drivers/gpio/gpio-pxa.c > +++ b/drivers/gpio/gpio-pxa.c > @@ -660,8 +660,8 @@ static int pxa_gpio_probe(struct platform_device *pdev) > pchip->irq1 = irq1; > > gpio_reg_base = devm_platform_ioremap_resource(pdev, 0); > - if (!gpio_reg_base) > - return -EINVAL; > + if (IS_ERR(gpio_reg_base)) > + return PTR_ERR(gpio_reg_base); As far as I know, devm_platform_ioremap_resource() could return NULL which is not handled by this test (unless __devm_ioremap() semantics changed since I had a look). Therefore, this patch is incorrect, or rather incomplete. Cheers. -- Robert
[PATCH v3 2/3] MAINTAINERS: pxa: remove Compulab arm/pxa support
These boards support is removed from the kernel, so remove the MAINTAINERS entry for them. Signed-off-by: Robert Jarzmik Acked-by: Mike Rapoport Acked-by: Arnd Bergmann --- MAINTAINERS | 5 - 1 file changed, 5 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 091ec22c1a23..ad58388fa822 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1684,11 +1684,6 @@ S: Maintained T: git git://git.armlinux.org.uk/~rmk/linux-arm.git clkdev F: drivers/clk/clkdev.c -ARM/COMPULAB CM-X270/EM-X270 and CM-X300 MACHINE SUPPORT -M: Mike Rapoport -L: linux-arm-ker...@lists.infradead.org (moderated for non-subscribers) -S: Maintained - ARM/CONEXANT DIGICOLOR MACHINE SUPPORT M: Baruch Siach L: linux-arm-ker...@lists.infradead.org (moderated for non-subscribers) -- 2.26.2
[PATCH v3 3/3] ASoC: pxa: remove Compulab pxa2xx boards
As these boards have been removed from the pxa tree, amend accordingly the sound subsystem. Signed-off-by: Robert Jarzmik Acked-by: Mike Rapoport Acked-by: Arnd Bergmann --- sound/soc/pxa/Kconfig | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sound/soc/pxa/Kconfig b/sound/soc/pxa/Kconfig index d4c0f580a565..fb2d5ab02b0d 100644 --- a/sound/soc/pxa/Kconfig +++ b/sound/soc/pxa/Kconfig @@ -128,9 +128,8 @@ config SND_PXA2XX_SOC_E800 Toshiba e800 PDA config SND_PXA2XX_SOC_EM_X270 - tristate "SoC Audio support for CompuLab EM-x270, eXeda and CM-X300" - depends on SND_PXA2XX_SOC && (MACH_EM_X270 || MACH_EXEDA || \ - MACH_CM_X300) + tristate "SoC Audio support for CompuLab CM-X300" + depends on SND_PXA2XX_SOC && MACH_CM_X300 depends on AC97_BUS=n select REGMAP select AC97_BUS_NEW -- 2.26.2
[PATCH v3 1/3] ARM: pxa: remove Compulab pxa2xx boards
As these boards have no more users nor testers, and patching them has become a burden, be that because of the PCI part or the MTD NAND support, let's remove them. The cm-x300 will for now remain and represent Compulab boards at its best in the PXA department. Signed-off-by: Robert Jarzmik Acked-by: Mike Rapoport Acked-by: Arnd Bergmann --- Since v1: Arnd's comments Since v2: Acks --- arch/arm/configs/cm_x2xx_defconfig | 173 arch/arm/configs/em_x270_defconfig | 178 arch/arm/configs/pxa_defconfig |2 - arch/arm/mach-pxa/Kconfig | 17 - arch/arm/mach-pxa/Makefile |5 - arch/arm/mach-pxa/cm-x255.c | 240 - arch/arm/mach-pxa/cm-x270.c | 419 - arch/arm/mach-pxa/cm-x2xx-pci.c | 196 arch/arm/mach-pxa/cm-x2xx-pci.h | 14 - arch/arm/mach-pxa/cm-x2xx.c | 538 --- arch/arm/mach-pxa/em-x270.c | 1286 --- arch/arm/mach-pxa/include/mach/io.h | 18 - 12 files changed, 3086 deletions(-) delete mode 100644 arch/arm/configs/cm_x2xx_defconfig delete mode 100644 arch/arm/configs/em_x270_defconfig delete mode 100644 arch/arm/mach-pxa/cm-x255.c delete mode 100644 arch/arm/mach-pxa/cm-x270.c delete mode 100644 arch/arm/mach-pxa/cm-x2xx-pci.c delete mode 100644 arch/arm/mach-pxa/cm-x2xx-pci.h delete mode 100644 arch/arm/mach-pxa/cm-x2xx.c delete mode 100644 arch/arm/mach-pxa/em-x270.c delete mode 100644 arch/arm/mach-pxa/include/mach/io.h diff --git a/arch/arm/configs/cm_x2xx_defconfig b/arch/arm/configs/cm_x2xx_defconfig deleted file mode 100644 index fa997ae2673e.. --- a/arch/arm/configs/cm_x2xx_defconfig +++ /dev/null @@ -1,173 +0,0 @@ -# CONFIG_LOCALVERSION_AUTO is not set -CONFIG_SYSVIPC=y -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y -CONFIG_LOG_BUF_SHIFT=14 -CONFIG_SYSFS_DEPRECATED_V2=y -CONFIG_BLK_DEV_INITRD=y -CONFIG_EXPERT=y -# CONFIG_VM_EVENT_COUNTERS is not set -# CONFIG_SLUB_DEBUG is not set -# CONFIG_COMPAT_BRK is not set -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_BLK_DEV_BSG is not set -CONFIG_ARCH_PXA=y -CONFIG_MACH_ARMCORE=y -CONFIG_PCI=y -CONFIG_PCCARD=m -CONFIG_YENTA=m -# CONFIG_YENTA_O2 is not set -# CONFIG_YENTA_RICOH is not set -# CONFIG_YENTA_ENE_TUNE is not set -# CONFIG_YENTA_TOSHIBA is not set -CONFIG_PCMCIA_PXA2XX=m -CONFIG_NO_HZ=y -CONFIG_AEABI=y -CONFIG_ZBOOT_ROM_TEXT=0x0 -CONFIG_ZBOOT_ROM_BSS=0x0 -CONFIG_CMDLINE="root=1f03 mem=32M" -CONFIG_FPE_NWFPE=y -CONFIG_PM=y -CONFIG_APM_EMULATION=m -CONFIG_NET=y -CONFIG_PACKET=y -CONFIG_UNIX=y -CONFIG_INET=y -CONFIG_IP_MULTICAST=y -CONFIG_IP_PNP=y -CONFIG_IP_PNP_DHCP=y -CONFIG_IP_PNP_BOOTP=y -# CONFIG_INET_DIAG is not set -# CONFIG_IPV6 is not set -CONFIG_BT=m -CONFIG_BT_RFCOMM=m -CONFIG_BT_BNEP=m -CONFIG_BT_HIDP=m -CONFIG_LIB80211=m -CONFIG_FW_LOADER=m -CONFIG_MTD=y -CONFIG_MTD_CMDLINE_PARTS=y -CONFIG_MTD_BLOCK=y -CONFIG_MTD_CFI=y -CONFIG_MTD_JEDECPROBE=y -CONFIG_MTD_CFI_ADV_OPTIONS=y -CONFIG_MTD_CFI_INTELEXT=y -CONFIG_MTD_CFI_AMDSTD=y -CONFIG_MTD_CFI_STAA=y -CONFIG_MTD_PHYSMAP=y -CONFIG_MTD_PXA2XX=y -CONFIG_MTD_RAW_NAND=y -CONFIG_MTD_NAND_GPIO=m -CONFIG_MTD_NAND_CM_X270=y -CONFIG_MTD_NAND_PLATFORM=y -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_RAM=y -CONFIG_SCSI=y -CONFIG_BLK_DEV_SD=y -CONFIG_ATA=m -# CONFIG_SATA_PMP is not set -CONFIG_PATA_PCMCIA=m -CONFIG_NETDEVICES=y -CONFIG_NET_ETHERNET=y -CONFIG_DM9000=y -CONFIG_DM9000_DEBUGLEVEL=1 -CONFIG_NET_PCI=y -CONFIG_8139TOO=m -# CONFIG_8139TOO_PIO is not set -CONFIG_PPP=m -CONFIG_PPP_MULTILINK=y -CONFIG_PPP_FILTER=y -CONFIG_PPP_ASYNC=m -CONFIG_PPP_DEFLATE=m -CONFIG_PPP_BSDCOMP=m -CONFIG_INPUT_EVDEV=y -CONFIG_KEYBOARD_PXA27x=m -# CONFIG_INPUT_MOUSE is not set -CONFIG_INPUT_TOUCHSCREEN=y -CONFIG_TOUCHSCREEN_UCB1400=m -# CONFIG_SERIO_SERPORT is not set -CONFIG_SERIAL_PXA=y -CONFIG_SERIAL_PXA_CONSOLE=y -CONFIG_LEGACY_PTY_COUNT=16 -# CONFIG_HW_RANDOM is not set -CONFIG_I2C=y -CONFIG_I2C_CHARDEV=m -CONFIG_I2C_PXA=y -CONFIG_SPI=y -CONFIG_SPI_PXA2XX=m -# CONFIG_HWMON is not set -CONFIG_UCB1400_CORE=m -CONFIG_FB=y -CONFIG_FB_PXA=y -CONFIG_FB_PXA_PARAMETERS=y -CONFIG_FB_MBX=m -# CONFIG_LCD_CLASS_DEVICE is not set -# CONFIG_BACKLIGHT_CLASS_DEVICE is not set -# CONFIG_VGA_CONSOLE is not set -CONFIG_FRAMEBUFFER_CONSOLE=y -CONFIG_LOGO=y -CONFIG_SOUND=m -CONFIG_SND=m -CONFIG_SND_MIXER_OSS=m -CONFIG_SND_PCM_OSS=m -# CONFIG_SND_DRIVERS is not set -# CONFIG_SND_PCI is not set -CONFIG_SND_PXA2XX_AC97=m -# CONFIG_SND_SPI is not set -# CONFIG_SND_USB is not set -# CONFIG_SND_PCMCIA is not set -CONFIG_HID_A4TECH=y -CONFIG_HID_APPLE=y -CONFIG_HID_BELKIN=y -CONFIG_HID_CHERRY=y -CONFIG_HID_CHICONY=y -CONFIG_HID_CYPRESS=y -CONFIG_HID_EZKEY=y -CONFIG_HID_GYRATION=y -CONFIG_HID_LOGITECH=y -CONFIG_HID_MICROSOFT=y -CONFIG_HID_MONTEREY=y -CONFIG_HID_PANTHERLORD=y -CONFIG_HID_PETALYNX=y -CONFIG_HID_SAMSUNG=y -CONFIG_HID_SONY=y -CONFIG_HID_SUNPLUS=y -CONFIG_USB=y -CONFIG_USB_MON=y -CONFIG_USB_OHCI_HCD=y -CONFIG_USB_STORAGE=y -CONFIG_MMC
Re: [PATCH 00/46] ARM: pxa: towards multiplatform support
Arnd Bergmann writes: > On Fri, Oct 18, 2019 at 9:17 PM Arnd Bergmann wrote: >> On Fri, Oct 18, 2019 at 9:04 PM Robert Jarzmik >> wrote: >> > Arnd Bergmann writes: >> > >> > > Hi PXA maintainers, >> > > >> > > I'm in the process of getting the old ARM platforms to all build >> > > in a single kernel. The largest part of that work is changing all >> > > the device drivers to no longer require mach/*.h header files. >> > > >> > > This series does it for arch/pxa/. >> > > >> > > As with the omap1 and s3c24xx series I sent before, I don't >> > > expect this all to be correct in the first version, though >> > > a lot of the patches are fairly simple and I did exhaustive >> > > compile-time testing on them. >> > > >> > > Please test if you have the hardware, or review! >> > >> > Hi Arnd, >> > >> > Would you have a git tree I can pull from ? >> > That would make my life easier than applying manually 46 patches... >> >> I've now pushed it to >> >> git://git.kernel.org:/pub/scm/linux/kernel/git/arnd/playground.git >> pxa-multiplatform > > Sorry for the duplication, I had some problems with email configuration > so my reply got rejected, let's see if it goes through this time. I have it now, thanks, I'll test and review as soon as I can. Cheers. -- Robert
Re: [PATCH 00/46] ARM: pxa: towards multiplatform support
Arnd Bergmann writes: > Hi PXA maintainers, > > I'm in the process of getting the old ARM platforms to all build > in a single kernel. The largest part of that work is changing all > the device drivers to no longer require mach/*.h header files. > > This series does it for arch/pxa/. > > As with the omap1 and s3c24xx series I sent before, I don't > expect this all to be correct in the first version, though > a lot of the patches are fairly simple and I did exhaustive > compile-time testing on them. > > Please test if you have the hardware, or review! Hi Arnd, Would you have a git tree I can pull from ? That would make my life easier than applying manually 46 patches... Cheers. -- Robert
Re: [PATCH 4/6] dma: pxa_dma: no need to check return value of debugfs_create functions
Greg Kroah-Hartman writes: > On Sat, Aug 10, 2019 at 09:27:26PM +0200, Robert Jarzmik wrote: >> Greg Kroah-Hartman writes: >> >> This is not strictly equivalent. >> Imagine that the debugfs_create_dir() fails and returns NULL : > How can that happen? Well in v5.0-rc1 that could happen ... unfortunately that's also the code I checked ... >> - in the former case, neither "state", "descriptors" nor "requesters" would >> be >>created >> - in the new code, "state", "descriptors" nor "requesters" will be created >> in >>the debugfs root directory > > I agree, but debugfs_create_dir() does not return a NULL on an error > since many kernel releases. Neither can debugfs_create_file() so really > this test is not working at all as-is :) Ah yes, you're right, I wasn't aware of the debugfs changes ... But checking a bit further, your original mail is 2 monthes old, and this patch was already merged in v5.2. I probably fell in a time-space anomaly, as I received this mail only a couple of days ago. Have a nice day. -- Robert
Re: [PATCH 4/6] dma: pxa_dma: no need to check return value of debugfs_create functions
Greg Kroah-Hartman writes: Hi Greg, > When calling debugfs functions, there is no need to ever check the > return value. The function can work or not, but the code logic should > never do something different based on this. > > Also, because there is no need to save the file dentry, remove the > variable that was saving it as it was never even being used once set. > > Cc: Daniel Mack > Cc: Haojian Zhuang > Cc: Robert Jarzmik > Cc: Vinod Koul > Cc: Dan Williams > Cc: linux-arm-ker...@lists.infradead.org > Cc: dmaeng...@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Greg Kroah-Hartman > --- > drivers/dma/pxa_dma.c | 56 +-- > 1 file changed, 11 insertions(+), 45 deletions(-) > > diff --git a/drivers/dma/pxa_dma.c b/drivers/dma/pxa_dma.c > index b429642f3e7a..0f698f49ee26 100644 > --- a/drivers/dma/pxa_dma.c > +++ b/drivers/dma/pxa_dma.c > @@ -132,7 +132,6 @@ struct pxad_device { > spinlock_t phy_lock; /* Phy association */ > #ifdef CONFIG_DEBUG_FS > struct dentry *dbgfs_root; > - struct dentry *dbgfs_state; > struct dentry **dbgfs_chan; > #endif > }; > @@ -326,31 +325,18 @@ static struct dentry *pxad_dbg_alloc_chan(struct > pxad_device *pdev, >int ch, struct dentry *chandir) > { > char chan_name[11]; > - struct dentry *chan, *chan_state = NULL, *chan_descr = NULL; > - struct dentry *chan_reqs = NULL; > + struct dentry *chan; > void *dt; > > scnprintf(chan_name, sizeof(chan_name), "%d", ch); > chan = debugfs_create_dir(chan_name, chandir); > dt = (void *)&pdev->phys[ch]; > > - if (chan) > - chan_state = debugfs_create_file("state", 0400, chan, dt, > - &chan_state_fops); > - if (chan_state) > - chan_descr = debugfs_create_file("descriptors", 0400, chan, dt, > - &descriptors_fops); > - if (chan_descr) > - chan_reqs = debugfs_create_file("requesters", 0400, chan, dt, > - &requester_chan_fops); > - if (!chan_reqs) > - goto err_state; > + debugfs_create_file("state", 0400, chan, dt, &chan_state_fops); > + debugfs_create_file("descriptors", 0400, chan, dt, &descriptors_fops); > + debugfs_create_file("requesters", 0400, chan, dt, &requester_chan_fops); This is not strictly equivalent. Imagine that the debugfs_create_dir() fails and returns NULL : - in the former case, neither "state", "descriptors" nor "requesters" would be created - in the new code, "state", "descriptors" nor "requesters" will be created in the debugfs root directory Apart from that it looks fine. Cheers. -- Robert
Re: [PATCH] media: mt9m111: fix fw-node refactoring
Sakari Ailus writes: > On Thu, Jun 20, 2019 at 01:17:17PM +0300, Sakari Ailus wrote: >> diff --git a/drivers/media/i2c/mt9m111.c b/drivers/media/i2c/mt9m111.c >> index bd3a51c3b081..9761a6105407 100644 >> --- a/drivers/media/i2c/mt9m111.c >> +++ b/drivers/media/i2c/mt9m111.c >> @@ -1263,9 +1263,11 @@ static int mt9m111_probe(struct i2c_client *client, >> if (!mt9m111) >> return -ENOMEM; >> >> -ret = mt9m111_probe_fw(client, mt9m111); >> -if (ret) >> -return ret; >> +if (dev_fwnode(client->dev)) { > > &client->dev > >> +ret = mt9m111_probe_fw(client, mt9m111); >> +if (ret) >> +return ret; >> +} >> >> mt9m111->clk = v4l2_clk_get(&client->dev, "mclk"); >> if (IS_ERR(mt9m111->clk)) Sure, you can take the patch as yours, or sign off my modified patch, whatever pleases you. Cheers. -- Robert
Re: [PATCH 5/6] ARM: pxa: Switch to SPDX header
Lubomir Rintel writes: > The original license text had a typo ("publishhed") which would be > likely to confuse automated licensing auditing tools. Let's just switch > to SPDX instead of fixing the wording. > > Signed-off-by: Lubomir Rintel Acked-by: Robert Jarzmik Cheers. -- Robert
[PATCH] media: mt9m111: fix fw-node refactoring
In the patch refactoring the fw-node, the mt9m111 was broken for all platform_data based platforms, which were the first aim of this driver. Only the devicetree platform are still functional, probably because the testing was done on these. The result is that -EINVAL is systematically return for such platforms, what this patch fixes. Fixes: 98480d65c48c ("media: mt9m111: allow to setup pixclk polarity") Signed-off-by: Robert Jarzmik --- drivers/media/i2c/mt9m111.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/i2c/mt9m111.c b/drivers/media/i2c/mt9m111.c index 168a5c74f368..d65c23301498 100644 --- a/drivers/media/i2c/mt9m111.c +++ b/drivers/media/i2c/mt9m111.c @@ -1209,7 +1209,7 @@ static int mt9m111_probe(struct i2c_client *client, { struct mt9m111 *mt9m111; struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); - int ret; + int ret = 0; if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WORD_DATA)) { dev_warn(&adapter->dev, @@ -1221,7 +1221,8 @@ static int mt9m111_probe(struct i2c_client *client, if (!mt9m111) return -ENOMEM; - ret = mt9m111_probe_fw(client, mt9m111); + if (client->dev.of_node) + ret = mt9m111_probe_fw(client, mt9m111); if (ret) return ret; -- 2.20.1
Re: [PATCH] lib: scatterlist: Fix to support no mapped sg
Zhou Wang writes: > In function sg_split, the second sg_calculate_split will return -EINVAL > when in_mapped_nents is 0. > > Indeed there is no need to do second sg_calculate_split and sg_split_mapped > when in_mapped_nents is 0, as in_mapped_nents indicates no mapped entry in > original sgl. > > Signed-off-by: Zhou Wang That's right. May I know what is the usecase which led you to this fix ? Acked-by: Robert Jarzmik -- Robert
Re: Removing pcap? (EZX support in mainline linux)
Arnd Bergmann writes: > On Mon, Apr 8, 2019 at 8:58 AM Antonio Ospite wrote: >> On Sun, 7 Apr 2019 16:07:41 +0200 >> Alexandre Belloni wrote: >> adding Robert to CC as he is listed as the current maintainer of >> ARM/EZX SMARTPHONES in the MAINTAINERS file. >> >> > I've had a look at the PCAP RTC driver because I'm removing a few >> > deprecated APIs. While doing so, I've discovered that the driver has >> > never worked properly because PCAP_RTC_TOD_MASK and PCAP_RTC_DAY_MASK >> > are both missing a bit so every day would roll over at 18:12:15 and the >> > whole the date would roll over in 2014. >> > >> > I discussed with Arnd about 59ee93a528b9 ("ARM: pxa: remove irq_to_gpio >> > from ezx-pcap driver") and it seems the whole EZX support has been >> > broken for a while. >> > >> >> As Harald said in another message I tried taking over OpenEZX for a >> while, but eventually lost interest. >> >> JFTR some parts of the project has been backed up here: >> https://gitlab.com/openezx >> >> I should also have a git backup of the wiki somewhere. >> >> > Is it worth fixing the RTC driver or could I remove it? >> > >> >> I am not aware of any active user but I'd leave the final word to >> Robert, IIRC he received some EZX hardware "recently". >> >> FWIW I think EZX code can be removed if it is a maintenance burden for >> anyone. > > I would prefer if we could either keep or remove all of the ezx code, but not > just remove a particular driver. Removing it all now would let us skip that > discussion the next time someone has a problem with another device driver > for it. I'm on the same page here. I'm not strongly either for or against EZX removal (which would impact AFAIK 6 old Motorola smartphones). If I can find the wiki archives to cross-check the mask issue (especially PCAP_RTC_DAY_MASK), I wouldn't mind seeing a patch on that if it is kept. If I can make the EZX boot (the one I got from Antonia), I could even test it. As if it's worth it, I'm not personally an active user of this specific platform, so if no one is, one less would be less maintainance burden. Cheers. -- Robert
Re: [PATCH 1/7] thermal/drivers/core: Remove the module Kconfig's option
Daniel Lezcano writes: > The module support for the thermal subsystem makes little sense: > - some subsystems relying on it are not modules, thus forcing the >framework to be compiled in > - it is compiled in for almost every configs, the remaining ones >are a few platforms where I don't see why we can not switch the thermal >to 'y'. The drivers can stay in tristate. > - platforms need the thermal to be ready as soon as possible at boot time >in order to mitigate > > Usually the subsystems framework are compiled-in and the plugs are as module. > > Remove the module option. The removal of the module related dead code will > come after this patch gets in or is acked. > > Signed-off-by: Daniel Lezcano > Acked-by: Guenter Roeck > For mini2440: > Acked-by: Krzysztof Kozlowski For pxa: Acked-by: Robert Jarzmik Cheers. -- Robert
Re: [PATCH] cpufreq: pxa2xx: remove incorrect __init annotation
Arnd Bergmann writes: > pxa_cpufreq_init_voltages() is marked __init but usually inlined into > the non-__init pxa_cpufreq_init() function. When building with clang, > it can stay as a standalone function in a discarded section, and produce > this warning: > > WARNING: vmlinux.o(.text+0x616a00): Section mismatch in reference from the > function pxa_cpufreq_init() to the function > .init.text:pxa_cpufreq_init_voltages() > The function pxa_cpufreq_init() references > the function __init pxa_cpufreq_init_voltages(). > This is often because pxa_cpufreq_init lacks a __init > annotation or the annotation of pxa_cpufreq_init_voltages is wrong. > > Fixes: 50e77fcd790e ("ARM: pxa: remove __init from cpufreq_driver->init()") > Signed-off-by: Arnd Bergmann Acked-by: Robert Jarzmik Cheers. -- Robert
Re: [PATCH] mmc: pxamci: fix enum type confusion
Nathan Chancellor writes: > On Thu, Mar 07, 2019 at 11:09:19AM +0100, Arnd Bergmann wrote: >> clang points out several instances of mismatched types in this drivers, >> all coming from a single declaration: >> >> drivers/mmc/host/pxamci.c:193:15: error: implicit conversion from >> enumeration type 'enum dma_transfer_direction' to >> different enumeration type 'enum dma_data_direction' >> [-Werror,-Wenum-conversion] >> direction = DMA_DEV_TO_MEM; >> ~ ^~ >> drivers/mmc/host/pxamci.c:212:62: error: implicit conversion from >> enumeration type 'enum dma_data_direction' to >> different enumeration type 'enum dma_transfer_direction' >> [-Werror,-Wenum-conversion] >> tx = dmaengine_prep_slave_sg(chan, data->sg, host->dma_len, >> direction, >> >> The behavior is correct, so this must be a simply typo from >> dma_data_direction and dma_transfer_direction being similarly named >> types with a similar purpose. >> >> Fixes: 6464b7140951 ("mmc: pxamci: switch over to dmaengine use") >> Signed-off-by: Arnd Bergmann > > Reviewed-by: Nathan Chancellor Acked-by: Robert Jarzmik Cheers. -- Robert
Re: [PATCH] ARM: pxa: remove CONFIG_SND_PXA2XX_AC97 in pxa_defconfig
Arnd Bergmann writes: > The CONFIG_SND_PXA2XX_AC97 driver is for the old AC97 bus implementation, > and conflicts with all the new-style AC97 drivers after the conversion, > so the drivers we want all get turned off. > > Not disabling the symbol however does the right thing, and we get > the drivers that are selectively enabled here. > > Fixes: 25540f68c871 ("ASoC: pxa: change ac97 dependencies") > Signed-off-by: Arnd Bergmann Yes, most certainly. Acked-by: Robert Jarzmik Cheers. -- Robert
Re: [PATCH -next] ARM: pxa: ssp: Fix "WARNING: invalid free of devm_ allocated data"
YueHaibing writes: > Since commit 1c459de1e645 ("ARM: pxa: ssp: use devm_ functions") > kfree, iounmap, clk_put etc no need do any more in remove path. > > Fixes: 1c459de1e645 ("ARM: pxa: ssp: use devm_ functions") > Signed-off-by: YueHaibing Sorry for the late reply, I had forgotten to answer. Queued to pxa/for-next with a small spelling fix in the commit message, thanks. Cheers. -- Robert
Re: [PATCH v3 -next] mtd: docg3: Fix a possible memory leak of mtd->name
YueHaibing writes: > In case DOC_CHIPID_G3, mtd->name is not freed in err handling path, > which is alloced by kasprintf(). Fix this by using devm_kasprintf(). > > Fixes: ae9d4934b2d7 ("mtd: docg3: add multiple floor support") > Signed-off-by: YueHaibing > --- > v3: use devm_kasprintf > --- > drivers/mtd/devices/docg3.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Acked-by: Robert Jarzmik Cheers. -- Robert
Re: [PATCH -next] mtd: docg3: Fix passing zero to 'PTR_ERR' warning in doc_probe_device
Boris Brezillon writes: > On Wed, 23 Jan 2019 17:43:58 +0800 > YueHaibing wrote: > >> On 2019/1/23 17:12, Boris Brezillon wrote: >> > On Wed, 23 Jan 2019 14:58:27 +0800 >> > YueHaibing wrote: >> > >> >> Fix a static code checker warning: >> >> drivers/mtd/devices/docg3.c:1875 >> >> doc_probe_device() warn: passing zero to 'ERR_PTR' >> >> >> >> Fixes: ae9d4934b2d7 ("mtd: docg3: add multiple floor support") >> >> Signed-off-by: YueHaibing >> >> --- >> >> drivers/mtd/devices/docg3.c | 2 +- >> >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> >> >> diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c >> >> index 4c94fc0..60ddc38 100644 >> >> --- a/drivers/mtd/devices/docg3.c >> >> +++ b/drivers/mtd/devices/docg3.c >> >> @@ -1872,7 +1872,7 @@ doc_probe_device(struct docg3_cascade *cascade, int >> >> floor, struct device *dev) >> >> nomem2: >> >> kfree(docg3); >> >> nomem1: >> >> - return ERR_PTR(ret); >> >> + return ret ? ERR_PTR(ret) : NULL; >> >> } >> >> >> > >> > This is not the right fix, you should instead set ret to -EINVAL: >> >> Thanks , will fix it in v2. >> >> And seems doc_probe_device cannot return NULL. The NULL check of >> doc_probe_device >> in docg3_probe also can been removed, right? > > Hm, looks like the ret = 0 was intentional (to identify when ID is > invalid). Let's just keep your initial patch. Indeed, that's for the multiple floor configuration if I remember correctly. Acked-by: Robert Jarzmik Cheers. -- Robert
Re: [PATCH] pxa2xx: replace spi_master with spi_controller
Lubomir Rintel writes: > It's also a slave controller driver now, calling it "master" is slightly > misleading. I think the patch subject's prefix is not correct, should be : "spi: pxa2xx: replace spi_master with spi_controller". Apart from that, for the mach-pxa: Acked-by: Robert Jarzmik Cheers. -- Robert
Re: [PATCH 2/2] arm/plat-pxa/ssp : unneeded to free devm_ allocated data
Peng Hao writes: > devm_ allocated data will be automatically freed. The free > of devm_ allocated data is invalid. > > Signed-off-by: Peng Hao Hi Peng Hao, Thanks for the patch. I changed your title to fit my tree, ie. : "ARM: pxa: ssp: unneeded to free devm_ allocated data" If you have other patches please check what is the commit subject's prefix for the file(s) you're touching. Queued to pxa/fixes. Cheers. -- Robert
Re: [PATCH] dmaengine: remove DBGFS_FUNC_DECL()
Sinan Kaya writes: > On 11/30/2018 10:42 AM, Yangtao Li wrote: >> We already have the DEFINE_SHOW_ATTRIBUTE,There is no need to define >> such a macro,so remove DBGFS_FUNC_DECL.Also use macro to simplify some >> code. >> >> Signed-off-by: Yangtao Li >> --- >> drivers/dma/amba-pl08x.c | 14 ++ >> drivers/dma/mic_x100_dma.c | 22 +++--- >> drivers/dma/pxa_dma.c| 24 >> drivers/dma/qcom/hidma_dbg.c | 33 ++--- For pxa_dma: Acked-by: Robert Jarzmik Cheers. -- Robert
[PATCH] gpio: pxa: fix legacy non pinctrl aware builds again
As pointed out by Gregor, spitz keyboard matrix is broken, with or without CONFIG_PINCTRL set, quoting : "The gpio matrix keypard on the Zaurus C3x00 (see spitz.c) does not work properly. Noticeable are that rshift+c does nothing where as lshift+c creates C. Opposite it is for rshift+a vs lshift+a, here only rshift works. This affects a few other combinations using the rshift or lshift buttons." As a matter of fact, as for platform_data based builds CONFIG_PINCTRL=n is required for now (as opposed for devicetree builds where it should be set), this means gpio driver should change the direction, which is what was attempted by commit c4e5ffb6f224 ("gpio: pxa: fix legacy non pinctrl aware builds"). Unfortunately, the input case was inverted, and the direction change was never done. This wasn't seen up until now because the initial platform setup (MFP) was setting this direction. Yet in Gregory's case, the matrix-keypad driver changes back and forth the direction dynamically, and this is why he's the first to report it. Fixes: c4e5ffb6f224 ("gpio: pxa: fix legacy non pinctrl aware builds") Tested-by: Greg Signed-off-by: Robert Jarzmik --- drivers/gpio/gpio-pxa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c index 63536655f274..501147c5f3ca 100644 --- a/drivers/gpio/gpio-pxa.c +++ b/drivers/gpio/gpio-pxa.c @@ -268,8 +268,8 @@ static int pxa_gpio_direction_input(struct gpio_chip *chip, unsigned offset) if (pxa_gpio_has_pinctrl()) { ret = pinctrl_gpio_direction_input(chip->base + offset); - if (!ret) - return 0; + if (ret) + return ret; } spin_lock_irqsave(&gpio_lock, flags); -- 2.11.0
Re: [PATCH] spi: pxa2xx: Fix '"CONFIG_OF" is not defined' warning
Lubomir Rintel writes: > A careless oversight. Sorry. > > Fixes: 0a897143b7c9 ("spi: pxa2xx: Add slave mode support") > Signed-off-by: Lubomir Rintel > --- > drivers/spi/spi-pxa2xx.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c > index 29e6025f104c..7194070e4009 100644 > --- a/drivers/spi/spi-pxa2xx.c > +++ b/drivers/spi/spi-pxa2xx.c > @@ -1555,7 +1555,7 @@ pxa2xx_spi_init_pdata(struct platform_device *pdev) > } > #endif > > -#if CONFIG_OF > +#ifdef CONFIG_OF > if (of_id) { > pdata->is_slave = of_property_read_bool(pdev->dev.of_node, > "spi-slave"); While at it, why not simply remove the "#if CONFIG_OF", the if (of_id), and write simply this, without any ifs ? : pdata->is_slave = of_property_read_bool(pdev->dev.of_node, "spi-slave"); If CONFIG_OF=n, of_property_read_bool() is guaranteed to return false. If the device is not found through devicetree, of_node == NULL and a false will still be returned. And the last case is your bool read case (ie. when devicetree probed the device). Cheers. -- Robert
Re: [PATCH v3 17/18] USB: phy-mv-usb: use phy-pxa-usb
Lubomir Rintel writes: > Use a proper PHY driver, instead of hooks to a board support package. Hi Lubomir, This specific patch caught my attention, because of its title : I don't see what phy-pxa-usb stands for, is it a typo ? I don't think anybody implemented so far a proper phy support for pxa based boards (pxa27x actually), hence my question. Cheers. -- Robert
Re: [PATCH v4] ARM: dts: pxa: add mioa701 board description
Robert Jarzmik writes: > Add device-tree description of the Mitac MIO A701 board. > This is aimed at replacing mioa701.c board file, and once stabilized, > the leftover, such as the suspend resume mechanics will rely on a new > IPL, and not the legacy Windows CE one. > > Signed-off-by: Robert Jarzmik > --- > Since v1: fix lcd_supply and lcd_backlight > These were depending on my internal tree changes, fit it. > Since v2: take into account Rob's comments > Since v3: take into account Marcel's comments > > This patch deserves some special "love review". As it will probably > serve for a more broad pxa conversion to devicetree of the other boards, > and because it touches almost all domains for a pxa platform (camera, > video, audio, i2c, ...), it should be as clean as possible so that > mistakes are not carried on ... > > Therefore I expect the review of this one to be long (ie. it won't land > for v4.19), until it looks good enough. Rob, would you respin that in your tester now all the missing dependencies have hit Linus's master tree again please ? -- Robert
Re: [PATCH v4] ARM: dts: pxa: add mioa701 board description
Robert Jarzmik writes: > Add device-tree description of the Mitac MIO A701 board. > This is aimed at replacing mioa701.c board file, and once stabilized, > the leftover, such as the suspend resume mechanics will rely on a new > IPL, and not the legacy Windows CE one. > > Signed-off-by: Robert Jarzmik > --- > Since v1: fix lcd_supply and lcd_backlight > These were depending on my internal tree changes, fit it. > Since v2: take into account Rob's comments > Since v3: take into account Marcel's comments > > This patch deserves some special "love review". As it will probably > serve for a more broad pxa conversion to devicetree of the other boards, > and because it touches almost all domains for a pxa platform (camera, > video, audio, i2c, ...), it should be as clean as possible so that > mistakes are not carried on ... > > Therefore I expect the review of this one to be long (ie. it won't land > for v4.19), until it looks good enough. Rob, would you respin that in your tester now all the missing dependencies have hit Linus's master tree again please ? -- Robert
Re: linux-4.20-rc1/arch/arm/vfp/vfpmodule.c:576: possible cut'n'paste error
Russell King - ARM Linux writes: >> Interestingly, more of the same in file >> linux-4.20-rc1/arch/arm/mach-pxa/pxa3xx.c >> >> [linux-4.20-rc1/arch/arm/mach-pxa/pxa3xx.c:84]: (warning) Redundant >> assignment of 'ASCR' to itself. >> [linux-4.20-rc1/arch/arm/mach-pxa/pxa3xx.c:85]: (warning) Redundant >> assignment of 'ARSR' to itself. >> [linux-4.20-rc1/arch/arm/mach-pxa/pxa3xx.c:120]: (warning) Redundant >> assignment of 'ASCR' to itself. >> [linux-4.20-rc1/arch/arm/mach-pxa/pxa3xx.c:121]: (warning) Redundant >> assignment of 'ARSR' to itself. >> >> I don't know if these four are also worth fixing. > > There are cases where this can be false positives. In the case of a > status register with write-1-to-clear bits for example. These ones > look very much like that. And indeed they are, for bits 2,1,0 for ASCR and 3,2,1,0 for ARSR, and you guessed correctly they are partly status registers. If only your checker could filter out __iomem tagged pointers, you could have far less of these false positives ... Cheers. -- Robert
Re: [PATCH 3/5] spi: pxa2xx: use an enum for type
Lubomir Rintel writes: > That seems to be the correct type. Okay, but what happens here when adev_id->driver_data is a value out of enum range ? Does the following assignment make sense ? > + type = (enum pxa_ssp_type)adev_id->driver_data; As a side note, could you join for the next throw to the review : - Jarkko Nikula - Mika Westerberg Even if they are Intel, I think they have worked a lot on this driver for Intel platforms. Cheers. -- Robert
[PATCH v4] ARM: dts: pxa: add mioa701 board description
Add device-tree description of the Mitac MIO A701 board. This is aimed at replacing mioa701.c board file, and once stabilized, the leftover, such as the suspend resume mechanics will rely on a new IPL, and not the legacy Windows CE one. Signed-off-by: Robert Jarzmik --- Since v1: fix lcd_supply and lcd_backlight These were depending on my internal tree changes, fit it. Since v2: take into account Rob's comments Since v3: take into account Marcel's comments This patch deserves some special "love review". As it will probably serve for a more broad pxa conversion to devicetree of the other boards, and because it touches almost all domains for a pxa platform (camera, video, audio, i2c, ...), it should be as clean as possible so that mistakes are not carried on ... Therefore I expect the review of this one to be long (ie. it won't land for v4.19), until it looks good enough. --- arch/arm/boot/dts/Makefile| 2 + arch/arm/boot/dts/mioa701.dts | 570 ++ 2 files changed, 572 insertions(+) create mode 100644 arch/arm/boot/dts/mioa701.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index b5bd3de87c33..8809f4e2244d 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -775,6 +775,8 @@ dtb-$(CONFIG_ARCH_PRIMA2) += \ dtb-$(CONFIG_ARCH_OXNAS) += \ ox810se-wd-mbwe.dtb \ ox820-cloudengines-pogoplug-series-3.dtb +dtb-$(CONFIG_ARCH_PXA) += \ + mioa701.dtb dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8060-dragonboard.dtb \ qcom-apq8064-arrow-sd-600eval.dtb \ diff --git a/arch/arm/boot/dts/mioa701.dts b/arch/arm/boot/dts/mioa701.dts new file mode 100644 index ..9e368361d498 --- /dev/null +++ b/arch/arm/boot/dts/mioa701.dts @@ -0,0 +1,570 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2018 Robert Jarzmik + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * publishhed by the Free Software Foundation. + */ + +/dts-v1/; +#include "pxa27x.dtsi" +#include +#include +#include + +/ { + model = "Mitac Mio A701 Board"; + compatible = "mitac,mioa701", "marvell,pxa270"; + + chosen { + bootargs = "mtdparts=docg3.0:256k@3456k(barebox)ro,256k(barebox-logo),128k(barebox-env),4M(kernel),-(root) ubi.mtd=4 rootfstype=ubifs root=ubi0:linux_root ro"; + }; + + memory { + reg = <0xa000 0x0400>; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + + pstore_region:region@a200 { + compatible = "linux,contiguous-memory-region"; + reg = <0xa200 0x10>; + }; + }; + }; + + cpus { + cpu { + cpu-supply = <&vcc_core>; + }; + }; + + pxabus { + pinctrl: pinctrl@40e0 { + status = "okay"; + + pinctrl_ac97_default: ac97-default { + PMMUX(hpjack-detect, 12, gpio_in); + PMMUX(ac97-bitclk, 28, AC97_BITCLK); + PMMUX(ac97-sdata-in-0, 29, AC97_SDATA_IN_0); + PMMUX(ac97-sdata-out, 30, AC97_SDATA_OUT); + PMMUX(ac97-sync, 31, AC97_SYNC); + PMMUX(ac97-sysclk, 89, AC97_SYSCLK); + }; + + pinctrl_btuart_default: btuart-default { + PMMUX(btuart-nactivity, 14, gpio_in); + PMMUX(btuart-rxd, 42, BTRXD); + PMMUX(btuart-txd, 43, BTTXD); + PMMUX(btuart-cts, 44, BTCTS); + PMMUX(btuart-rts, 45, BTRTS); + PMMUX_LPM_LOW(bt-on, 83, gpio_out); + PMMUX_LPM_HIGH(bt-unknown, 77, gpio_out); + PMMUX_LPM_HIGH(bt-nreset, 86, gpio_out); + }; + + pinctrl_ffuart_default: ffuart-default { + PMMUX(ffuart-rxd, 34, FFRXD); + PMMUX(ffuart-cts, 35, FFCTS); + PMMUX(ffuart-dcd, 36, FFDCD); + PMMUX(ffuart-dsr, 37, FFDSR); + PMMUX(ffuart-txd, 39, FFTXD); + PMMUX(ffuart-dtr, 40, FFDTR); + PMMUX(ffuart-rts, 41, FFRTS); + PMMUX_LPM_LOW(gsm-reset, 24, gpio_out); +
Re: [PATCH v3] ARM: dts: pxa: add mioa701 board description
Marcel Ziswiler writes: > Hi Robert >> arch/arm/boot/dts/Makefile| 2 + >> arch/arm/boot/dts/mioa701.dts | 558 > > Isn't that one supposed to be prefixed by pxa270-? Good point, for v4. >> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile ... >> +dtb-$(CONFIG_ARCH_PXA) += \ > Wouldn't it rather make more sense to use CONFIG_MACH_PXA27X_DT > instead? No, I'll have all the devicetree files under one config, for the PXA architecture. >> +model = "Mitac Mio A701 Board"; >> +compatible = "marvell,pxa270"; > > Usually, there is also a compatible for the particular board e.g. > "mitac,mioa701", not? You might have to check on the vendor prefix > though. Ok. >> +pinctrl_usb_default: usb-default { >> +PMMUX(n-usb-detect, 13, gpio_in); >> +PMMUX_LPM_LOW(n-dplus-pullup, 22, >> gpio_out); >> +}; >> +pinctrl_power_default: power-default { >> +PMMUX_LPM_LOW(charge-enable, 9, >> gpio_out); >> +PMMUX(charge-vdrop, 80, gpio_out); >> +PMMUX(ac-detect, 96, gpio_in); >> +}; > > I guess usually, one would add newlines in front and between those > pinctrls but its kind of a matter of taste. Ok, for this and all the following newlines. >> +ffuart: serial@4010 { >> +pinctrl-names = "default"; >> +pinctrl-0 = <&pinctrl_ffuart_default>; >> +status = "okay"; >> +}; >> + >> +btuart: serial@4020 { >> +pinctrl-names = "default"; >> +pinctrl-0 = <&pinctrl_btuart_default>; >> +status = "okay"; >> +}; >> + >> +stuart: serial@4070 { >> +status = "okay"; >> +}; > > I believe pxa2xx.dtsi calls them uart rather than serial so unless you > plan to change this we will have to stick to using uart instead. There was a patch submitted for that earlier, at Rob's demand, to change these names. That's another dependency on the pxa/dt tree. > > I also don't think those serial port labels buy us anything, so I would > get rid of them. As there are already in the .dtsi files, they don't hurt do they ? >> +pwri2c: i2c@40f000180 { > > Uups, I guess that address is wrong, not? I will send a patch to fix it > in pxa27x.dtsi as well. Fixed here as well. > >> +status = "okay"; >> + >> +core_regulator@14 { >> +compatible = "maxim,max1586"; >> +reg = <0x14>; >> +v3-gain = <100>; >> + >> +regulators { >> +vcc_core: v3 { >> +regulator-name = >> "vcc_core"; >> +regulator-compatible >> = "Output_V3"; >> +regulator-min- >> microvolt = <100>; >> +regulator-max- >> microvolt = <1705000>; >> +regulator-always-on; >> +}; >> +}; >> +}; > > Haven't seen core_regulator before. Just regulator would do unless it > would be a more complex pmic. Ok. > > >> +port { >> +mt9m111_1: endpoint { >> +bus-width = <8>; >> +remote-endpoint = >> <&pxa_camera>; >> +}; >> +}; >> +}; >> +}; > > Same with pxai2c1 and mt9m111. Ok for mt9m111, same answer as before for pxai2c1. >> +gpio-keys { >> +compatible = "gpio-keys"; >> +#address-cells = <1>; >> +#size-cells = <0>; >> +autorepeat; >> +pinctrl-names = "default"; >> +pinctrl-0 = <&pinctrl_gpiokeys_default>; >> +status = "okay"; >> + >> +power-button { >> +label = "GPIO Key Power"; >> +linux,code = <174>; >> +gpios = <&gpio 0 0>; >> +gpio-key,wakeup; > > I believe that got deprecated in favour of just wakeup-source. Ok. >> +lcd-controller@4050 { >> +pinctrl-names = "default"; >> +pinctrl-0 = <&pinctrl_lcd_default>; >> +status = "okay"; > > Missing newline. > >> +port { >> +lcdc_out: endpoint { >> +
Re: [PATCH] Input: wm97xx: only unregister wm97xx_driver if it has been registered
Charles Keepax writes: > On Tue, Sep 04, 2018 at 07:35:05PM +0100, Colin King wrote: >> From: Colin Ian King >> >> In the case where IS_BUILTIN(CONFIG_AC97_BUS)) is not true, the >> wm97xx_driver driver is being unregistered even it has not been >> previously registered. Fix this by only unregistering it if >> IS_BUILTIN(CONFIG_AC97_BUS)) is true. This fixes the warning >> message: >> >> [ 834.111248] [ cut here ] >> [ 834.111248] Unexpected driver unregister! >> [ 834.111319] WARNING: CPU: 2 PID: 11749 at drivers/base/driver.c:193 >> driver_unregister+0x3b/0x40 >> [ 834.111319] Modules linked in: wm97xx_ts(-) >> >> ..and a stack trace. >> >> To easily reproduce this, load and unload the module on a system where >> the hardware is not supported. >> >> Fixes: ae9d1b5fbd7b ("Input: wm97xx: add new AC97 bus support") >> Signed-off-by: Colin Ian King >> --- > > Acked-by: Charles Keepax Acked-by: Robert Jarzmik Cheers. -- Robert
Re: [PATCH] ARM: dts: pxa: add pincontrol helpers
Robert Jarzmik writes: > Add 3 helpers so that pincontrol definitions for pxa25x and pxa27x are > easier, and can be easily converted from old mfp mach-pxa code to > devicetree. As this is exactly the same patch sent out for review July the 7th, queued to pxa/dt. -- Robert
Re: [PATCH] ARM: dts: pxa: fix power i2c base address
Marcel Ziswiler writes: > There is one too many zeroes in the Power I2C base address. Fix this. > > Signed-off-by: Marcel Ziswiler Queued to pxa/dt, thanks. Cheers. -- Robert
Re: [PATCH v3] ARM: dts: pxa: add mioa701 board description
kbuild test robot writes: > Hi Robert, > > I love your patch! Yet something to improve: This is because you are missing at least this patch submitted earlier : - [PATCH] ARM: dts: pxa: add pincontrol helpers You're also missing the previous patches in the pxa/dt tree, which are already on the trampoline for linux-next : - git fetch github.com:rjarzmik/linux.git pxa/dt Cheers. -- Robert
[PATCH v3] ARM: dts: pxa: add mioa701 board description
Add device-tree description of the Mitac MIO A701 board. This is aimed at replacing mioa701.c board file, and once stabilized, the leftover, such as the suspend resume mechanics will rely on a new IPL, and not the legacy Windows CE one. Signed-off-by: Robert Jarzmik --- Since v1: fix lcd_supply and lcd_backlight These were depending on my internal tree changes, fit it. Since v2: take into account Rob's comments This patch deserves some special "love review". As it will probably serve for a more broad pxa conversion to devicetree of the other boards, and because it touches almost all domains for a pxa platform (camera, video, audio, i2c, ...), it should be as clean as possible so that mistakes are not carried on ... Therefore I expect the review of this one to be long (ie. it won't land for v4.19), until it looks good enough. --- arch/arm/boot/dts/Makefile| 2 + arch/arm/boot/dts/mioa701.dts | 558 ++ 2 files changed, 560 insertions(+) create mode 100644 arch/arm/boot/dts/mioa701.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index b5bd3de87c33..8809f4e2244d 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -775,6 +775,8 @@ dtb-$(CONFIG_ARCH_PRIMA2) += \ dtb-$(CONFIG_ARCH_OXNAS) += \ ox810se-wd-mbwe.dtb \ ox820-cloudengines-pogoplug-series-3.dtb +dtb-$(CONFIG_ARCH_PXA) += \ + mioa701.dtb dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8060-dragonboard.dtb \ qcom-apq8064-arrow-sd-600eval.dtb \ diff --git a/arch/arm/boot/dts/mioa701.dts b/arch/arm/boot/dts/mioa701.dts new file mode 100644 index ..3791bc69e155 --- /dev/null +++ b/arch/arm/boot/dts/mioa701.dts @@ -0,0 +1,558 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2018 Robert Jarzmik + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * publishhed by the Free Software Foundation. + */ + +/dts-v1/; +#include "pxa27x.dtsi" +#include +#include + +/ { + model = "Mitac Mio A701 Board"; + compatible = "marvell,pxa270"; + + chosen { + bootargs = "mtdparts=docg3.0:256k@3456k(barebox)ro,256k(barebox-logo),128k(barebox-env),4M(kernel),-(root) ubi.mtd=4 rootfstype=ubifs root=ubi0:linux_root ro"; + }; + + memory { + reg = <0xa000 0x0400>; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + + pstore_region:region@a200 { + compatible = "linux,contiguous-memory-region"; + reg = <0xa200 0x10>; + }; + }; + }; + + cpus { + cpu { + cpu-supply = <&vcc_core>; + }; + }; + + pxabus { + pinctrl: pinctrl@40e0 { + status = "okay"; + pinctrl_ac97_default: ac97-default { + PMMUX(hpjack-detect, 12, gpio_in); + PMMUX(ac97-bitclk, 28, AC97_BITCLK); + PMMUX(ac97-sdata-in-0, 29, AC97_SDATA_IN_0); + PMMUX(ac97-sdata-out, 30, AC97_SDATA_OUT); + PMMUX(ac97-sync, 31, AC97_SYNC); + PMMUX(ac97-sysclk, 89, AC97_SYSCLK); + }; + pinctrl_btuart_default: btuart-default { + PMMUX(btuart-nactivity, 14, gpio_in); + PMMUX(btuart-rxd, 42, BTRXD); + PMMUX(btuart-txd, 43, BTTXD); + PMMUX(btuart-cts, 44, BTCTS); + PMMUX(btuart-rts, 45, BTRTS); + PMMUX_LPM_LOW(bt-on, 83, gpio_out); + PMMUX_LPM_HIGH(bt-unknown, 77, gpio_out); + PMMUX_LPM_HIGH(bt-nreset, 86, gpio_out); + }; + pinctrl_ffuart_default: ffuart-default { + PMMUX(ffuart-rxd, 34, FFRXD); + PMMUX(ffuart-cts, 35, FFCTS); + PMMUX(ffuart-dcd, 36, FFDCD); + PMMUX(ffuart-dsr, 37, FFDSR); + PMMUX(ffuart-txd, 39, FFTXD); + PMMUX(ffuart-dtr, 40, FFDTR); + PMMUX(ffuart-rts, 41, FFRTS); + PMMUX_LPM_LOW(gsm-reset, 24, gpio_out); + PMMUX(gsm-is-on, 25, gpio_in); + PM
[PATCH] ARM: dts: pxa: add pincontrol helpers
Add 3 helpers so that pincontrol definitions for pxa25x and pxa27x are easier, and can be easily converted from old mfp mach-pxa code to devicetree. An example of such conversion would be : static unsigned long mioa701_pin_config[] = { GPIO32_MMC_CLK, GPIO92_MMC_DAT_0, GPIO109_MMC_DAT_1, GPIO110_MMC_DAT_2, GPIO111_MMC_DAT_3, GPIO112_MMC_CMD, MIO_CFG_IN(GPIO78_SDIO_RO, AF0), MIO_CFG_IN(GPIO15_SDIO_INSERT, AF0), MIO_CFG_OUT(GPIO91_SDIO_EN, AF0, DRIVE_LOW), }; into: pinctrl_mmc_default: mmc-default { PMMUX(sd-insert, 15, gpio_in); PMMUX(mmclk, 32, MMCLK); PMMUX(sd-ro, 78, gpio_in); PMMUX_LPM_LOW(sd-enable, 91, gpio_out); PMMUX(mmdat0, 92, MMDAT<0>); PMMUX(mmdat1, 109, MMDAT<1>); PMMUX(mmdat2, 110, MMDAT<2>); PMMUX(mmdat3, 111, MMDAT<3>); PMMUX(mmcmd, 112, MMCMD); }; The third column of PMMUX*() helpers can be found in pincontrol muxing functions, either in pinctrl-pxa27x.c (or pinctrl-pxa25x.c), or by inspecting the pincontrol once booted in debugfs. Signed-off-by: Robert Jarzmik --- arch/arm/boot/dts/pxa2xx.dtsi | 19 +++ 1 file changed, 19 insertions(+) diff --git a/arch/arm/boot/dts/pxa2xx.dtsi b/arch/arm/boot/dts/pxa2xx.dtsi index a520b4c14ea9..81312a9813f6 100644 --- a/arch/arm/boot/dts/pxa2xx.dtsi +++ b/arch/arm/boot/dts/pxa2xx.dtsi @@ -9,6 +9,25 @@ #include "skeleton.dtsi" #include "dt-bindings/clock/pxa-clock.h" +#define PMGROUP(pin) #pin +#define PMMUX(func, pin, af) \ + mux- ## func { \ + groups = PMGROUP(P ## pin); \ + function = #af; \ + } +#define PMMUX_LPM_LOW(func, pin, af) \ + mux- ## func { \ + groups = PMGROUP(P ## pin); \ + function = #af; \ + low-power-disable; \ + } +#define PMMUX_LPM_HIGH(func, pin, af) \ + mux- ## func { \ + groups = PMGROUP(P ## pin); \ + function = #af; \ + low-power-enable; \ + } + / { model = "Marvell PXA2xx family SoC"; compatible = "marvell,pxa2xx"; -- 2.11.0
Re: [PATCH] ARM: dts: pxa: change serial node names
Robert Jarzmik writes: > Change from xxuart to serial to normalize the devicetree pxa serial > support. > > Signed-off-by: Robert Jarzmik > --- > arch/arm/boot/dts/pxa2xx.dtsi | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) Queued to pxa/dt. -- Robert
[PATCH v9] ASoC: pxa: switch to new ac97 bus support
Switch to the new ac97 bus support in sound/ac97 instead of the legacy snd_ac97 one. Signed-off-by: Robert Jarzmik --- Since v8: fixed the trivial compilation error v7 was in https://patchwork.kernel.org/patch/9951919/ --- sound/arm/Kconfig | 1 - sound/soc/pxa/Kconfig | 5 ++--- sound/soc/pxa/pxa2xx-ac97.c | 48 +++-- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/sound/arm/Kconfig b/sound/arm/Kconfig index 5fbd47a9177e..28867732a318 100644 --- a/sound/arm/Kconfig +++ b/sound/arm/Kconfig @@ -31,7 +31,6 @@ endif # SND_ARM config SND_PXA2XX_LIB tristate - select SND_AC97_CODEC if SND_PXA2XX_LIB_AC97 select SND_DMAENGINE_PCM config SND_PXA2XX_LIB_AC97 diff --git a/sound/soc/pxa/Kconfig b/sound/soc/pxa/Kconfig index 776e148b0aa2..29f577e6dfc0 100644 --- a/sound/soc/pxa/Kconfig +++ b/sound/soc/pxa/Kconfig @@ -19,14 +19,13 @@ config SND_MMP_SOC config SND_PXA2XX_AC97 tristate - select SND_AC97_CODEC config SND_PXA2XX_SOC_AC97 tristate - select AC97_BUS + select AC97_BUS_NEW select SND_PXA2XX_LIB select SND_PXA2XX_LIB_AC97 - select SND_SOC_AC97_BUS + select SND_SOC_AC97_BUS_NEW config SND_PXA2XX_SOC_I2S select SND_PXA2XX_LIB diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c index 9f779657bc86..f8a3aa6c6d4e 100644 --- a/sound/soc/pxa/pxa2xx-ac97.c +++ b/sound/soc/pxa/pxa2xx-ac97.c @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -27,43 +28,35 @@ #include #include -static void pxa2xx_ac97_warm_reset(struct snd_ac97 *ac97) +static void pxa2xx_ac97_warm_reset(struct ac97_controller *adrv) { pxa2xx_ac97_try_warm_reset(); pxa2xx_ac97_finish_reset(); } -static void pxa2xx_ac97_cold_reset(struct snd_ac97 *ac97) +static void pxa2xx_ac97_cold_reset(struct ac97_controller *adrv) { pxa2xx_ac97_try_cold_reset(); pxa2xx_ac97_finish_reset(); } -static unsigned short pxa2xx_ac97_legacy_read(struct snd_ac97 *ac97, - unsigned short reg) +static int pxa2xx_ac97_read_actrl(struct ac97_controller *adrv, int slot, + unsigned short reg) { - int ret; - - ret = pxa2xx_ac97_read(ac97->num, reg); - if (ret < 0) - return 0; - else - return (unsigned short)(ret & 0x); + return pxa2xx_ac97_read(slot, reg); } -static void pxa2xx_ac97_legacy_write(struct snd_ac97 *ac97, -unsigned short reg, unsigned short val) +static int pxa2xx_ac97_write_actrl(struct ac97_controller *adrv, int slot, + unsigned short reg, unsigned short val) { - int ret; - - ret = pxa2xx_ac97_write(ac97->num, reg, val); + return pxa2xx_ac97_write(slot, reg, val); } -static struct snd_ac97_bus_ops pxa2xx_ac97_ops = { - .read = pxa2xx_ac97_legacy_read, - .write = pxa2xx_ac97_legacy_write, +static struct ac97_controller_ops pxa2xx_ac97_ops = { + .read = pxa2xx_ac97_read_actrl, + .write = pxa2xx_ac97_write_actrl, .warm_reset = pxa2xx_ac97_warm_reset, .reset = pxa2xx_ac97_cold_reset, }; @@ -233,6 +226,9 @@ MODULE_DEVICE_TABLE(of, pxa2xx_ac97_dt_ids); static int pxa2xx_ac97_dev_probe(struct platform_device *pdev) { int ret; + struct ac97_controller *ctrl; + pxa2xx_audio_ops_t *pdata = pdev->dev.platform_data; + void **codecs_pdata; if (pdev->id != -1) { dev_err(&pdev->dev, "PXA2xx has only one AC97 port.\n"); @@ -245,10 +241,14 @@ static int pxa2xx_ac97_dev_probe(struct platform_device *pdev) return ret; } - ret = snd_soc_set_ac97_ops(&pxa2xx_ac97_ops); - if (ret != 0) - return ret; + codecs_pdata = pdata ? pdata->codec_pdata : NULL; + ctrl = snd_ac97_controller_register(&pxa2xx_ac97_ops, &pdev->dev, + AC97_SLOTS_AVAILABLE_ALL, + codecs_pdata); + if (IS_ERR(ctrl)) + return PTR_ERR(ctrl); + platform_set_drvdata(pdev, ctrl); /* Punt most of the init to the SoC probe; we may need the machine * driver to do interesting things with the clocking to get us up * and running. @@ -259,8 +259,10 @@ static int pxa2xx_ac97_dev_probe(struct platform_device *pdev) static int pxa2xx_ac97_dev_remove(struct platform_device *pdev) { + struct ac97_controller *ctrl = platform_get_drvdata(pdev); + snd_soc_unregister_component(&pdev->dev); - snd_soc_set_ac97_ops(NULL); + snd_ac97_controller_unregister(ctrl); pxa2xx_ac97_hw_remove(pdev); return 0; } -- 2.11.0
[PATCH] gpio: pxa: handle corner case of unprobed device
In the corner case where the gpio driver probe fails, for whatever reason, the suspend and resume handlers will still be called as they have to be registered as syscore operations. This applies as well when no probe was called while the driver has been built in the kernel. Nicolas tracked this in : https://bugzilla.kernel.org/show_bug.cgi?id=200905 Therefore, add a failsafe in these function, and test if a proper probe succeeded and the driver is functional. Signed-off-by: Robert Jarzmik Reported-by: Nicolas Chauvet --- drivers/gpio/gpio-pxa.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c index c18712dabf93..bfe4c5c9f41c 100644 --- a/drivers/gpio/gpio-pxa.c +++ b/drivers/gpio/gpio-pxa.c @@ -776,6 +776,9 @@ static int pxa_gpio_suspend(void) struct pxa_gpio_bank *c; int gpio; + if (!pchip) + return 0; + for_each_gpio_bank(gpio, c, pchip) { c->saved_gplr = readl_relaxed(c->regbase + GPLR_OFFSET); c->saved_gpdr = readl_relaxed(c->regbase + GPDR_OFFSET); @@ -794,6 +797,9 @@ static void pxa_gpio_resume(void) struct pxa_gpio_bank *c; int gpio; + if (!pchip) + return; + for_each_gpio_bank(gpio, c, pchip) { /* restore level with set/clear */ writel_relaxed(c->saved_gplr, c->regbase + GPSR_OFFSET); -- 2.11.0
Re: linux-next: build failure after merge of the arm-soc tree
Olof Johansson writes: > It's a known issue due to dependencies with a driver tree. :( > > Robert, this is unfortunate. What's the dependent patches? We can pick > them up in our tree as duplicates if needed. I'd rather postpone one of the patches, as I explained in the pull request. As Stephen noticed, this will be : 0d0b16b8e008 ("dmaengine: pxa: make the filter function internal") I'll queue this one for the 4.20 cycle. By the way, all of this cames from the fact that I didn't take this very patch in my imutable branch for this change ... I'll also resend a pull request, without this patch if that's good for you, which will solve the breakage. Cheers. -- Robert
[PATCH] ARM: dts: pxa: change serial node names
Change from xxuart to serial to normalize the devicetree pxa serial support. Signed-off-by: Robert Jarzmik --- arch/arm/boot/dts/pxa2xx.dtsi | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/boot/dts/pxa2xx.dtsi b/arch/arm/boot/dts/pxa2xx.dtsi index f609dbb86abf..a5f9efdd2361 100644 --- a/arch/arm/boot/dts/pxa2xx.dtsi +++ b/arch/arm/boot/dts/pxa2xx.dtsi @@ -95,7 +95,7 @@ }; }; - ffuart: uart@4010 { + ffuart: serial@4010 { compatible = "mrvl,pxa-uart"; reg = <0x4010 0x30>; interrupts = <22>; @@ -103,7 +103,7 @@ status = "disabled"; }; - btuart: uart@4020 { + btuart: serial@4020 { compatible = "mrvl,pxa-uart"; reg = <0x4020 0x30>; interrupts = <21>; @@ -111,7 +111,7 @@ status = "disabled"; }; - stuart: uart@4070 { + stuart: serial@4070 { compatible = "mrvl,pxa-uart"; reg = <0x4070 0x30>; interrupts = <20>; @@ -119,7 +119,7 @@ status = "disabled"; }; - hwuart: uart@4110 { + hwuart: serial@4110 { compatible = "mrvl,pxa-uart"; reg = <0x4110 0x30>; interrupts = <7>; -- 2.11.0
Re: [PATCH 2/2] ARM: dts: pxa: add mioa701 board description
Rob Herring writes: Hi Rob, >> + /* compatible = "mitac,mioa701"; */ >> + compatible = "marvell,pxa270"; > > Why the comment? Leftover, I'll remove it. >> + pstore_region:region@0xa200 { > > Drop the 0x Done. >> + compatible = >> "linux,contiguous-memory-region"; >> + reg = <0xa200 1048576>; > > Use hex for the size. Ok. >> + ffuart: uart@4010 { > > Should be "serial@...". You'll have to fix in the base dtsi. Ok for all of these. >> + pxai2c1: i2c@40301680 { >> + mrvl,i2c-fast-mode; >> + pinctrl-names = "default"; >> + pinctrl-0 = <&pinctrl_i2c_default>; >> + status = "okay"; >> + >> + mt9m111: camera@5d { >> + compatible = "micron,mt9m111"; >> + reg = <0x5d>; >> + gpios = <&gpio 56 GPIO_ACTIVE_HIGH>; >> + >> + remote = <&pxa_camera>; > > Not needed with the graph: I don't understand that, do you mean the port node is not needed ? > >> + port { >> + mt9m111_1: endpoint { >> + bus-width = <8>; >> + remote-endpoint = >> <&pxa_camera>; >> + }; >> + }; >> + }; >> + }; >> + gpio-keys { >> + compatible = "gpio-keys"; >> + #address-cells = <1>; >> + #size-cells = <0>; >> + autorepeat; >> + pinctrl-names = "default"; >> + pinctrl-0 = <&pinctrl_gpiokeys_default>; >> + status = "okay"; > > Don't need status here? It shouldn't be defined in the base dtsi. Heuh what ? The status is just above, and gpio-keys is not defined in any dtsi. >> + >> + button@0 { > > If you have unit-address there should also be a reg property. Just > drop and name the node 'power' or 'power-button'. And similarly for > the rest. Ok. >> + >> + regulators { >> + compatible = "simple-bus"; > > Drop this and move children to the top level. This is not an mmio bus. Ok. >> + docg3: flash@0 { > > This probably should be a child of the bus controller. Most certainly yes. > >> + compatible = "m-systems,diskonchip-g3"; >> + reg = <0x0 0x2000>; >> + }; >> + >> + panel { >> + compatible = "toshiba,ltm0305a776"; >> + lcd-type = "color-tft"; > > This should be implied by the compatible. Mmm no. Actually, this is used by the framebuffer controller, ie. pxafb to set it up. And I don't think adding a list of panel compatibles in pxafb is a good idea. The corresponding code is in : drivers/video/fbdev/pxafb.c, see "static const char * const lcd_types[]". >> + display-timings { >> + native-mode = <&timing0>; > > We generally imply this from the compatible (i.e. use simple-panel). But you suppose there is an actual driver for the panel, right ? But there is none. > Could use another level of indentation. Sure. >> + ac_charger: charger@1 { > > Drop the unit-address. Ok. Thanks for the review. -- Robert
[PATCH v2 1/2] ARM: dts: pxa: add pincontrol helpers
Add 3 helpers so that pincontrol definitions for pxa25x and pxa27x are easier, and can be easily converted from old mfp mach-pxa code to devicetree. An example of such conversion would be : static unsigned long mioa701_pin_config[] = { GPIO32_MMC_CLK, GPIO92_MMC_DAT_0, GPIO109_MMC_DAT_1, GPIO110_MMC_DAT_2, GPIO111_MMC_DAT_3, GPIO112_MMC_CMD, MIO_CFG_IN(GPIO78_SDIO_RO, AF0), MIO_CFG_IN(GPIO15_SDIO_INSERT, AF0), MIO_CFG_OUT(GPIO91_SDIO_EN, AF0, DRIVE_LOW), }; into: pinctrl_mmc_default: mmc-default { PMMUX(sd-insert, 15, gpio_in); PMMUX(mmclk, 32, MMCLK); PMMUX(sd-ro, 78, gpio_in); PMMUX_LPM_LOW(sd-enable, 91, gpio_out); PMMUX(mmdat0, 92, MMDAT<0>); PMMUX(mmdat1, 109, MMDAT<1>); PMMUX(mmdat2, 110, MMDAT<2>); PMMUX(mmdat3, 111, MMDAT<3>); PMMUX(mmcmd, 112, MMCMD); }; The third column of PMMUX*() helpers can be found in pincontrol muxing functions, either in pinctrl-pxa27x.c (or pinctrl-pxa25x.c), or by inspecting the pincontrol once booted in debugfs. Signed-off-by: Robert Jarzmik --- arch/arm/boot/dts/pxa2xx.dtsi | 19 +++ 1 file changed, 19 insertions(+) diff --git a/arch/arm/boot/dts/pxa2xx.dtsi b/arch/arm/boot/dts/pxa2xx.dtsi index e4ebcde17837..f609dbb86abf 100644 --- a/arch/arm/boot/dts/pxa2xx.dtsi +++ b/arch/arm/boot/dts/pxa2xx.dtsi @@ -9,6 +9,25 @@ #include "skeleton.dtsi" #include "dt-bindings/clock/pxa-clock.h" +#define PMGROUP(pin) #pin +#define PMMUX(func, pin, af) \ + mux- ## func { \ + groups = PMGROUP(P ## pin); \ + function = #af; \ + } +#define PMMUX_LPM_LOW(func, pin, af) \ + mux- ## func { \ + groups = PMGROUP(P ## pin); \ + function = #af; \ + low-power-disable; \ + } +#define PMMUX_LPM_HIGH(func, pin, af) \ + mux- ## func { \ + groups = PMGROUP(P ## pin); \ + function = #af; \ + low-power-enable; \ + } + / { model = "Marvell PXA2xx family SoC"; compatible = "marvell,pxa2xx"; -- 2.11.0
[PATCH v2 2/2] ARM: dts: pxa: add mioa701 board description
Add device-tree description of the Mitac MIO A701 board. This is aimed at replacing mioa701.c board file, and once stabilized, the leftover, such as the suspend resume mechanics will rely on a new IPL, and not the legacy Windows CE one. Signed-off-by: Robert Jarzmik --- Since v1: fix lcd_supply and lcd_backlight These were depending on my internal tree changes, fit it. This patch deserves some special "love review". As it will probably serve for a more broad pxa conversion to devicetree of the other boards, and because it touches almost all domains for a pxa platform (camera, video, audio, i2c, ...), it should be as clean as possible so that mistakes are not carried on ... Therefore I expect the review of this one to be long (ie. it won't land for v4.19), until it looks good enough. --- arch/arm/boot/dts/Makefile| 1 + arch/arm/boot/dts/mioa701.dts | 564 ++ 2 files changed, 565 insertions(+) create mode 100644 arch/arm/boot/dts/mioa701.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index 37a3de760d40..6b12ab50c8d1 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -756,6 +756,7 @@ dtb-$(CONFIG_ARCH_PRIMA2) += \ dtb-$(CONFIG_ARCH_OXNAS) += \ ox810se-wd-mbwe.dtb \ ox820-cloudengines-pogoplug-series-3.dtb +dtb-$(CONFIG_ARCH_PXA) += mioa701.dtb dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8060-dragonboard.dtb \ qcom-apq8064-arrow-sd-600eval.dtb \ diff --git a/arch/arm/boot/dts/mioa701.dts b/arch/arm/boot/dts/mioa701.dts new file mode 100644 index ..a6893226e20e --- /dev/null +++ b/arch/arm/boot/dts/mioa701.dts @@ -0,0 +1,564 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2018 Robert Jarzmik + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * publishhed by the Free Software Foundation. + */ + +/dts-v1/; +#include "pxa27x.dtsi" +#include +#include + +/ { + model = "Mitac Mio A701 Board"; + /* compatible = "mitac,mioa701"; */ + compatible = "marvell,pxa270"; + + chosen { + bootargs = "mtdparts=docg3.0:256k@3456k(barebox)ro,256k(barebox-logo),128k(barebox-env),4M(kernel),-(root) ubi.mtd=4 rootfstype=ubifs root=ubi0:linux_root ro"; + }; + + memory { + reg = <0xa000 0x0400>; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + + pstore_region:region@0xa200 { + compatible = "linux,contiguous-memory-region"; + reg = <0xa200 1048576>; + }; + }; + }; + + cpus { + cpu { + cpu-supply = <&vcc_core>; + }; + }; + + pxabus { + pinctrl: pinctrl@40e0 { + status = "okay"; + pinctrl_ac97_default: ac97-default { + PMMUX(hpjack-detect, 12, gpio_in); + PMMUX(ac97-bitclk, 28, AC97_BITCLK); + PMMUX(ac97-sdata-in-0, 29, AC97_SDATA_IN_0); + PMMUX(ac97-sdata-out, 30, AC97_SDATA_OUT); + PMMUX(ac97-sync, 31, AC97_SYNC); + PMMUX(ac97-sysclk, 89, AC97_SYSCLK); + }; + pinctrl_btuart_default: btuart-default { + PMMUX(btuart-nactivity, 14, gpio_in); + PMMUX(btuart-rxd, 42, BTRXD); + PMMUX(btuart-txd, 43, BTTXD); + PMMUX(btuart-cts, 44, BTCTS); + PMMUX(btuart-rts, 45, BTRTS); + PMMUX_LPM_LOW(bt-on, 83, gpio_out); + PMMUX_LPM_HIGH(bt-unknown, 77, gpio_out); + PMMUX_LPM_HIGH(bt-nreset, 86, gpio_out); + }; + pinctrl_ffuart_default: ffuart-default { + PMMUX(ffuart-rxd, 34, FFRXD); + PMMUX(ffuart-cts, 35, FFCTS); + PMMUX(ffuart-dcd, 36, FFDCD); + PMMUX(ffuart-dsr, 37, FFDSR); + PMMUX(ffuart-txd, 39, FFTXD); + PMMUX(ffuart-dtr, 40, FFDTR); + PMMUX(ffuart-rts, 41, FFRTS); + PMMUX_LPM_LOW(gsm-reset, 24, gpio_out); + PMMUX(gsm-is-on, 25, gpio_in); +
Re: [PATCH v4 1/2] clk: pxa: export 32kHz PLL
Stephen Boyd writes: > Quoting Robert Jarzmik (2018-07-04 22:34:10) >> Robert Jarzmik writes: >> >> > This clock is especially used by the RTC driver, so export it so that >> > devicetree users can use it. >> > >> > Signed-off-by: Robert Jarzmik >> > --- >> > Since v2: fix missing parenthesis in clk-pxa25x.c and clk-pxa3xx.c >> >> Hi Michael and Stephen, >> >> Could you have a look please ? >> > > I'll apply patch 1, and leave patch 2 to someone else? As there is a dependency of patch 2 on patch 1, and with the Reviewed-by provided by Rob, I'd appreciate you take it as well. If not, I'll queue it up for the next cycle in my pxa tree. Cheers. -- Robert
Re: linux-next: Tree for Jul 2 (sound/soc/pxa/)
Randy Dunlap writes: > [add other maintainers] > on i386 or x86_64: > > builtin: > sound/soc/pxa/pxa-ssp.o:(.rodata+0x228): undefined reference to > `pxa2xx_soc_pcm_new' > sound/soc/pxa/pxa-ssp.o:(.rodata+0x22c): undefined reference to > `pxa2xx_pcm_free_dma_buffers' > sound/soc/pxa/pxa-ssp.o:(.rodata+0x250): undefined reference to > `pxa2xx_pcm_ops' Hi Randy, I think the fix is already queued in Mark's tree, the commit message should be "ASoC: pxa: select SND_PXA2XX_LIB for drivers that depend on it". Adding Daniel as he is the original author. Cheers. -- Robert
[PATCH 1/2] ARM: dts: pxa: add pincontrol helpers
Add 3 helpers so that pincontrol definitions for pxa25x and pxa27x are easier, and can be easily converted from old mfp mach-pxa code to devicetree. An example of such conversion would be : static unsigned long mioa701_pin_config[] = { GPIO32_MMC_CLK, GPIO92_MMC_DAT_0, GPIO109_MMC_DAT_1, GPIO110_MMC_DAT_2, GPIO111_MMC_DAT_3, GPIO112_MMC_CMD, MIO_CFG_IN(GPIO78_SDIO_RO, AF0), MIO_CFG_IN(GPIO15_SDIO_INSERT, AF0), MIO_CFG_OUT(GPIO91_SDIO_EN, AF0, DRIVE_LOW), }; into: pinctrl_mmc_default: mmc-default { PMMUX(sd-insert, 15, gpio_in); PMMUX(mmclk, 32, MMCLK); PMMUX(sd-ro, 78, gpio_in); PMMUX_LPM_LOW(sd-enable, 91, gpio_out); PMMUX(mmdat0, 92, MMDAT<0>); PMMUX(mmdat1, 109, MMDAT<1>); PMMUX(mmdat2, 110, MMDAT<2>); PMMUX(mmdat3, 111, MMDAT<3>); PMMUX(mmcmd, 112, MMCMD); }; The third column of PMMUX*() helpers can be found in pincontrol muxing functions, either in pinctrl-pxa27x.c (or pinctrl-pxa25x.c), or by inspecting the pincontrol once booted in debugfs. Signed-off-by: Robert Jarzmik --- arch/arm/boot/dts/pxa2xx.dtsi | 19 +++ 1 file changed, 19 insertions(+) diff --git a/arch/arm/boot/dts/pxa2xx.dtsi b/arch/arm/boot/dts/pxa2xx.dtsi index e4ebcde17837..f609dbb86abf 100644 --- a/arch/arm/boot/dts/pxa2xx.dtsi +++ b/arch/arm/boot/dts/pxa2xx.dtsi @@ -9,6 +9,25 @@ #include "skeleton.dtsi" #include "dt-bindings/clock/pxa-clock.h" +#define PMGROUP(pin) #pin +#define PMMUX(func, pin, af) \ + mux- ## func { \ + groups = PMGROUP(P ## pin); \ + function = #af; \ + } +#define PMMUX_LPM_LOW(func, pin, af) \ + mux- ## func { \ + groups = PMGROUP(P ## pin); \ + function = #af; \ + low-power-disable; \ + } +#define PMMUX_LPM_HIGH(func, pin, af) \ + mux- ## func { \ + groups = PMGROUP(P ## pin); \ + function = #af; \ + low-power-enable; \ + } + / { model = "Marvell PXA2xx family SoC"; compatible = "marvell,pxa2xx"; -- 2.11.0
[PATCH 2/2] ARM: dts: pxa: add mioa701 board description
Add device-tree description of the Mitac MIO A701 board. This is aimed at replacing mioa701.c board file, and once stabilized, the leftover, such as the suspend resume mechanics will rely on a new IPL, and not the legacy Windows CE one. Signed-off-by: Robert Jarzmik --- This patch deserves some special "love review". As it will probably serve for a more broad pxa conversion to devicetree of the other boards, and because it touches almost all domains for a pxa platform (camera, video, audio, i2c, ...), it should be as clean as possible so that mistakes are not carried on ... Therefore I expect the review of this one to be long (ie. it won't land for v4.19), until it looks good enough. --- arch/arm/boot/dts/Makefile| 1 + arch/arm/boot/dts/mioa701.dts | 565 ++ 2 files changed, 566 insertions(+) create mode 100644 arch/arm/boot/dts/mioa701.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index 37a3de760d40..6b12ab50c8d1 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -756,6 +756,7 @@ dtb-$(CONFIG_ARCH_PRIMA2) += \ dtb-$(CONFIG_ARCH_OXNAS) += \ ox810se-wd-mbwe.dtb \ ox820-cloudengines-pogoplug-series-3.dtb +dtb-$(CONFIG_ARCH_PXA) += mioa701.dtb dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8060-dragonboard.dtb \ qcom-apq8064-arrow-sd-600eval.dtb \ diff --git a/arch/arm/boot/dts/mioa701.dts b/arch/arm/boot/dts/mioa701.dts new file mode 100644 index ..680e0e44d526 --- /dev/null +++ b/arch/arm/boot/dts/mioa701.dts @@ -0,0 +1,565 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2018 Robert Jarzmik + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * publishhed by the Free Software Foundation. + */ + +/dts-v1/; +#include "pxa27x.dtsi" +#include +#include + +/ { + model = "Mitac Mio A701 Board"; + /* compatible = "mitac,mioa701"; */ + compatible = "marvell,pxa270"; + + chosen { + bootargs = "mtdparts=docg3.0:256k@3456k(barebox)ro,256k(barebox-logo),128k(barebox-env),4M(kernel),-(root) ubi.mtd=4 rootfstype=ubifs root=ubi0:linux_root ro"; + }; + + memory { + reg = <0xa000 0x0400>; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + + pstore_region:region@0xa200 { + compatible = "linux,contiguous-memory-region"; + reg = <0xa200 1048576>; + }; + }; + }; + + cpus { + cpu { + cpu-supply = <&vcc_core>; + }; + }; + + pxabus { + pinctrl: pinctrl@40e0 { + status = "okay"; + pinctrl_ac97_default: ac97-default { + PMMUX(hpjack-detect, 12, gpio_in); + PMMUX(ac97-bitclk, 28, AC97_BITCLK); + PMMUX(ac97-sdata-in-0, 29, AC97_SDATA_IN_0); + PMMUX(ac97-sdata-out, 30, AC97_SDATA_OUT); + PMMUX(ac97-sync, 31, AC97_SYNC); + PMMUX(ac97-sysclk, 89, AC97_SYSCLK); + }; + pinctrl_btuart_default: btuart-default { + PMMUX(btuart-nactivity, 14, gpio_in); + PMMUX(btuart-rxd, 42, BTRXD); + PMMUX(btuart-txd, 43, BTTXD); + PMMUX(btuart-cts, 44, BTCTS); + PMMUX(btuart-rts, 45, BTRTS); + PMMUX_LPM_LOW(bt-on, 83, gpio_out); + PMMUX_LPM_HIGH(bt-unknown, 77, gpio_out); + PMMUX_LPM_HIGH(bt-nreset, 86, gpio_out); + }; + pinctrl_ffuart_default: ffuart-default { + PMMUX(ffuart-rxd, 34, FFRXD); + PMMUX(ffuart-cts, 35, FFCTS); + PMMUX(ffuart-dcd, 36, FFDCD); + PMMUX(ffuart-dsr, 37, FFDSR); + PMMUX(ffuart-txd, 39, FFTXD); + PMMUX(ffuart-dtr, 40, FFDTR); + PMMUX(ffuart-rts, 41, FFRTS); + PMMUX_LPM_LOW(gsm-reset, 24, gpio_out); + PMMUX(gsm-is-on, 25, gpio_in); + PMMUX_LPM_HIGH(gsm-nset-on, 88, gpio_out); + PMMUX_LPM_HIGH(gsm-nset-off, 90, gpio_out); +
[PATCH v4 2/2] ARM: dts: pxa: fix the rtc controller
The RTC controller is fed by an external fixed 32kHz clock. Yet the driver wants to acquire this clock, even though it doesn't make any use of it, ie. doesn't get the rate to make calculation. Therefore, use the exported 32.768kHz clock in the PXA clock tree to make the driver happy and working. Signed-off-by: Robert Jarzmik --- Since v1: change the dummy clock by the actual 32.768kHz Since v3: remove spurious bracket --- arch/arm/boot/dts/pxa25x.dtsi | 4 arch/arm/boot/dts/pxa27x.dtsi | 4 2 files changed, 8 insertions(+) diff --git a/arch/arm/boot/dts/pxa25x.dtsi b/arch/arm/boot/dts/pxa25x.dtsi index 95d59be97213..8494b5787170 100644 --- a/arch/arm/boot/dts/pxa25x.dtsi +++ b/arch/arm/boot/dts/pxa25x.dtsi @@ -80,6 +80,10 @@ #pwm-cells = <1>; clocks = <&clks CLK_PWM1>; }; + + rtc@4090 { + clocks = <&clks CLK_OSC32k768>; + }; }; timer@40a0 { diff --git a/arch/arm/boot/dts/pxa27x.dtsi b/arch/arm/boot/dts/pxa27x.dtsi index 747f750f675d..2ab6986433c8 100644 --- a/arch/arm/boot/dts/pxa27x.dtsi +++ b/arch/arm/boot/dts/pxa27x.dtsi @@ -113,6 +113,10 @@ status = "disabled"; }; + + rtc@4090 { + clocks = <&clks CLK_OSC32k768>; + }; }; clocks { -- 2.11.0
[PATCH v4 1/2] clk: pxa: export 32kHz PLL
This clock is especially used by the RTC driver, so export it so that devicetree users can use it. Signed-off-by: Robert Jarzmik --- Since v2: fix missing parenthesis in clk-pxa25x.c and clk-pxa3xx.c --- drivers/clk/pxa/clk-pxa25x.c | 6 -- drivers/clk/pxa/clk-pxa27x.c | 7 --- drivers/clk/pxa/clk-pxa3xx.c | 7 --- include/dt-bindings/clock/pxa-clock.h | 3 ++- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/clk/pxa/clk-pxa25x.c b/drivers/clk/pxa/clk-pxa25x.c index 6416c1f8e632..e88f8e01fe3a 100644 --- a/drivers/clk/pxa/clk-pxa25x.c +++ b/drivers/clk/pxa/clk-pxa25x.c @@ -292,8 +292,10 @@ static void __init pxa25x_register_plls(void) { clk_register_fixed_rate(NULL, "osc_3_6864mhz", NULL, CLK_GET_RATE_NOCACHE, 3686400); - clk_register_fixed_rate(NULL, "osc_32_768khz", NULL, - CLK_GET_RATE_NOCACHE, 32768); + clkdev_pxa_register(CLK_OSC32k768, "osc_32_768khz", NULL, + clk_register_fixed_rate(NULL, "osc_32_768khz", NULL, + CLK_GET_RATE_NOCACHE, + 32768)); clk_register_fixed_rate(NULL, "clk_dummy", NULL, 0, 0); clk_register_fixed_factor(NULL, "ppll_95_85mhz", "osc_3_6864mhz", 0, 26, 1); diff --git a/drivers/clk/pxa/clk-pxa27x.c b/drivers/clk/pxa/clk-pxa27x.c index 25a30194d27a..d40b63e7bbce 100644 --- a/drivers/clk/pxa/clk-pxa27x.c +++ b/drivers/clk/pxa/clk-pxa27x.c @@ -314,9 +314,10 @@ static void __init pxa27x_register_plls(void) clk_register_fixed_rate(NULL, "osc_13mhz", NULL, CLK_GET_RATE_NOCACHE, 13 * MHz); - clk_register_fixed_rate(NULL, "osc_32_768khz", NULL, - CLK_GET_RATE_NOCACHE, - 32768 * KHz); + clkdev_pxa_register(CLK_OSC32k768, "osc_32_768khz", NULL, + clk_register_fixed_rate(NULL, "osc_32_768khz", NULL, + CLK_GET_RATE_NOCACHE, + 32768 * KHz)); clk_register_fixed_rate(NULL, "clk_dummy", NULL, 0, 0); clk_register_fixed_factor(NULL, "ppll_312mhz", "osc_13mhz", 0, 24, 1); } diff --git a/drivers/clk/pxa/clk-pxa3xx.c b/drivers/clk/pxa/clk-pxa3xx.c index 2d126df2bccd..7aa120c3bd08 100644 --- a/drivers/clk/pxa/clk-pxa3xx.c +++ b/drivers/clk/pxa/clk-pxa3xx.c @@ -286,9 +286,10 @@ static void __init pxa3xx_register_plls(void) clk_register_fixed_rate(NULL, "osc_13mhz", NULL, CLK_GET_RATE_NOCACHE, 13 * MHz); - clk_register_fixed_rate(NULL, "osc_32_768khz", NULL, - CLK_GET_RATE_NOCACHE, - 32768); + clkdev_pxa_register(CLK_OSC32k768, "osc_32_768khz", NULL, + clk_register_fixed_rate(NULL, "osc_32_768khz", NULL, + CLK_GET_RATE_NOCACHE, + 32768)); clk_register_fixed_rate(NULL, "ring_osc_120mhz", NULL, CLK_GET_RATE_NOCACHE, 120 * MHz); diff --git a/include/dt-bindings/clock/pxa-clock.h b/include/dt-bindings/clock/pxa-clock.h index e65803b1dc7e..0b0fd2b01538 100644 --- a/include/dt-bindings/clock/pxa-clock.h +++ b/include/dt-bindings/clock/pxa-clock.h @@ -72,6 +72,7 @@ #define CLK_USIM 58 #define CLK_USIM1 59 #define CLK_USMI0 60 -#define CLK_MAX 61 +#define CLK_OSC32k768 61 +#define CLK_MAX 62 #endif -- 2.11.0
Re: [PATCH v3 2/2] ARM: dts: pxa: fix the rtc controller
Thomas Petazzoni writes: > Hello, >> +rtc@4090 { >> +clocks = <&clks CLK_OSC32k768>>; > > Double closing bracket, doesn't look good. Rrrr you're right ... I swear this patchset is cursed ... Thanks for spotting that, I'll send a v4. Cheers. -- Robert
Re: [PATCH v3 00/14] ARM: pxa: switch to DMA slave maps
Mark Brown writes: > On Mon, Jun 18, 2018 at 09:56:20PM +0200, Robert Jarzmik wrote: > >> I must insist on "Wednesday", as I need to have one last pass from 0-day >> kernel >> checker to be fully covered, and I'd like as well to know which tree the ASoC >> patch will take, ie. if Mark commits to take it, or rather wants to pull from >> the imutable branch. > > I'll pull the branch in (a signed tag would've been nicer but it's not > the end of the world). Yeah, I realised that too ... late. Anyways, the immutable branch doesn't contain the specific ASoC patch "ASoC: pxa: remove the dmaengine compat need", and up to my better understanding neither does your for-next branch. So until I see it in your branch it will dwelve happily in pxa/for-next. If it has to be routed through your tree, so that Daniel can work on ASoC pxa, I'd like to know at -rc4 time so that I drop it from my pxa/for-next branch. Cheers. -- Robert
[PATCH v3 2/2] ARM: dts: pxa: fix the rtc controller
The RTC controller is fed by an external fixed 32kHz clock. Yet the driver wants to acquire this clock, even though it doesn't make any use of it, ie. doesn't get the rate to make calculation. Therefore, use the exported 32.768kHz clock in the PXA clock tree to make the driver happy and working. Signed-off-by: Robert Jarzmik --- Since v1: change the dummy clock by the actual 32.768kHz --- arch/arm/boot/dts/pxa25x.dtsi | 4 arch/arm/boot/dts/pxa27x.dtsi | 4 2 files changed, 8 insertions(+) diff --git a/arch/arm/boot/dts/pxa25x.dtsi b/arch/arm/boot/dts/pxa25x.dtsi index 95d59be97213..78a413ea0e88 100644 --- a/arch/arm/boot/dts/pxa25x.dtsi +++ b/arch/arm/boot/dts/pxa25x.dtsi @@ -80,6 +80,10 @@ #pwm-cells = <1>; clocks = <&clks CLK_PWM1>; }; + + rtc@4090 { + clocks = <&clks CLK_OSC32k768>>; + }; }; timer@40a0 { diff --git a/arch/arm/boot/dts/pxa27x.dtsi b/arch/arm/boot/dts/pxa27x.dtsi index 747f750f675d..2ab6986433c8 100644 --- a/arch/arm/boot/dts/pxa27x.dtsi +++ b/arch/arm/boot/dts/pxa27x.dtsi @@ -113,6 +113,10 @@ status = "disabled"; }; + + rtc@4090 { + clocks = <&clks CLK_OSC32k768>; + }; }; clocks { -- 2.11.0
[PATCH v3 1/2] clk: pxa: export 32kHz PLL
This clock is especially used by the RTC driver, so export it so that devicetree users can use it. Signed-off-by: Robert Jarzmik --- Since v2: fix missing parenthesis in clk-pxa25x.c and clk-pxa3xx.c --- drivers/clk/pxa/clk-pxa25x.c | 6 -- drivers/clk/pxa/clk-pxa27x.c | 7 --- drivers/clk/pxa/clk-pxa3xx.c | 7 --- include/dt-bindings/clock/pxa-clock.h | 3 ++- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/clk/pxa/clk-pxa25x.c b/drivers/clk/pxa/clk-pxa25x.c index 6416c1f8e632..e88f8e01fe3a 100644 --- a/drivers/clk/pxa/clk-pxa25x.c +++ b/drivers/clk/pxa/clk-pxa25x.c @@ -292,8 +292,10 @@ static void __init pxa25x_register_plls(void) { clk_register_fixed_rate(NULL, "osc_3_6864mhz", NULL, CLK_GET_RATE_NOCACHE, 3686400); - clk_register_fixed_rate(NULL, "osc_32_768khz", NULL, - CLK_GET_RATE_NOCACHE, 32768); + clkdev_pxa_register(CLK_OSC32k768, "osc_32_768khz", NULL, + clk_register_fixed_rate(NULL, "osc_32_768khz", NULL, + CLK_GET_RATE_NOCACHE, + 32768)); clk_register_fixed_rate(NULL, "clk_dummy", NULL, 0, 0); clk_register_fixed_factor(NULL, "ppll_95_85mhz", "osc_3_6864mhz", 0, 26, 1); diff --git a/drivers/clk/pxa/clk-pxa27x.c b/drivers/clk/pxa/clk-pxa27x.c index 25a30194d27a..d40b63e7bbce 100644 --- a/drivers/clk/pxa/clk-pxa27x.c +++ b/drivers/clk/pxa/clk-pxa27x.c @@ -314,9 +314,10 @@ static void __init pxa27x_register_plls(void) clk_register_fixed_rate(NULL, "osc_13mhz", NULL, CLK_GET_RATE_NOCACHE, 13 * MHz); - clk_register_fixed_rate(NULL, "osc_32_768khz", NULL, - CLK_GET_RATE_NOCACHE, - 32768 * KHz); + clkdev_pxa_register(CLK_OSC32k768, "osc_32_768khz", NULL, + clk_register_fixed_rate(NULL, "osc_32_768khz", NULL, + CLK_GET_RATE_NOCACHE, + 32768 * KHz)); clk_register_fixed_rate(NULL, "clk_dummy", NULL, 0, 0); clk_register_fixed_factor(NULL, "ppll_312mhz", "osc_13mhz", 0, 24, 1); } diff --git a/drivers/clk/pxa/clk-pxa3xx.c b/drivers/clk/pxa/clk-pxa3xx.c index 2d126df2bccd..7aa120c3bd08 100644 --- a/drivers/clk/pxa/clk-pxa3xx.c +++ b/drivers/clk/pxa/clk-pxa3xx.c @@ -286,9 +286,10 @@ static void __init pxa3xx_register_plls(void) clk_register_fixed_rate(NULL, "osc_13mhz", NULL, CLK_GET_RATE_NOCACHE, 13 * MHz); - clk_register_fixed_rate(NULL, "osc_32_768khz", NULL, - CLK_GET_RATE_NOCACHE, - 32768); + clkdev_pxa_register(CLK_OSC32k768, "osc_32_768khz", NULL, + clk_register_fixed_rate(NULL, "osc_32_768khz", NULL, + CLK_GET_RATE_NOCACHE, + 32768)); clk_register_fixed_rate(NULL, "ring_osc_120mhz", NULL, CLK_GET_RATE_NOCACHE, 120 * MHz); diff --git a/include/dt-bindings/clock/pxa-clock.h b/include/dt-bindings/clock/pxa-clock.h index e65803b1dc7e..0b0fd2b01538 100644 --- a/include/dt-bindings/clock/pxa-clock.h +++ b/include/dt-bindings/clock/pxa-clock.h @@ -72,6 +72,7 @@ #define CLK_USIM 58 #define CLK_USIM1 59 #define CLK_USMI0 60 -#define CLK_MAX 61 +#define CLK_OSC32k768 61 +#define CLK_MAX 62 #endif -- 2.11.0
Re: [PATCH v2 1/2] clk: pxa: export 32kHz PLL
kbuild test robot writes: > All errors (new ones prefixed by >>): > >drivers/clk/pxa/clk-pxa25x.c: In function 'pxa25x_register_plls': >>> drivers/clk/pxa/clk-pxa25x.c:298:17: error: expected ')' before ';' token > 32768); > ^ >>> drivers/clk/pxa/clk-pxa25x.c:304:1: error: expected ';' before '}' token > } Meh a missing closing parenthesis ... I'll send a v3. Cheers. -- Robert
[PATCH v2 1/2] clk: pxa: export 32kHz PLL
This clock is especially used by the RTC driver, so export it so that devicetree users can use it. Signed-off-by: Robert Jarzmik --- drivers/clk/pxa/clk-pxa25x.c | 6 -- drivers/clk/pxa/clk-pxa27x.c | 7 --- drivers/clk/pxa/clk-pxa3xx.c | 7 --- include/dt-bindings/clock/pxa-clock.h | 3 ++- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/clk/pxa/clk-pxa25x.c b/drivers/clk/pxa/clk-pxa25x.c index 6416c1f8e632..c0e7c74ebd7b 100644 --- a/drivers/clk/pxa/clk-pxa25x.c +++ b/drivers/clk/pxa/clk-pxa25x.c @@ -292,8 +292,10 @@ static void __init pxa25x_register_plls(void) { clk_register_fixed_rate(NULL, "osc_3_6864mhz", NULL, CLK_GET_RATE_NOCACHE, 3686400); - clk_register_fixed_rate(NULL, "osc_32_768khz", NULL, - CLK_GET_RATE_NOCACHE, 32768); + clkdev_pxa_register(CLK_OSC32k768, "osc_32_768khz", NULL, + clk_register_fixed_rate(NULL, "osc_32_768khz", NULL, + CLK_GET_RATE_NOCACHE, + 32768); clk_register_fixed_rate(NULL, "clk_dummy", NULL, 0, 0); clk_register_fixed_factor(NULL, "ppll_95_85mhz", "osc_3_6864mhz", 0, 26, 1); diff --git a/drivers/clk/pxa/clk-pxa27x.c b/drivers/clk/pxa/clk-pxa27x.c index 25a30194d27a..d40b63e7bbce 100644 --- a/drivers/clk/pxa/clk-pxa27x.c +++ b/drivers/clk/pxa/clk-pxa27x.c @@ -314,9 +314,10 @@ static void __init pxa27x_register_plls(void) clk_register_fixed_rate(NULL, "osc_13mhz", NULL, CLK_GET_RATE_NOCACHE, 13 * MHz); - clk_register_fixed_rate(NULL, "osc_32_768khz", NULL, - CLK_GET_RATE_NOCACHE, - 32768 * KHz); + clkdev_pxa_register(CLK_OSC32k768, "osc_32_768khz", NULL, + clk_register_fixed_rate(NULL, "osc_32_768khz", NULL, + CLK_GET_RATE_NOCACHE, + 32768 * KHz)); clk_register_fixed_rate(NULL, "clk_dummy", NULL, 0, 0); clk_register_fixed_factor(NULL, "ppll_312mhz", "osc_13mhz", 0, 24, 1); } diff --git a/drivers/clk/pxa/clk-pxa3xx.c b/drivers/clk/pxa/clk-pxa3xx.c index 2d126df2bccd..814b651c0504 100644 --- a/drivers/clk/pxa/clk-pxa3xx.c +++ b/drivers/clk/pxa/clk-pxa3xx.c @@ -286,9 +286,10 @@ static void __init pxa3xx_register_plls(void) clk_register_fixed_rate(NULL, "osc_13mhz", NULL, CLK_GET_RATE_NOCACHE, 13 * MHz); - clk_register_fixed_rate(NULL, "osc_32_768khz", NULL, - CLK_GET_RATE_NOCACHE, - 32768); + clkdev_pxa_register(CLK_OSC32k768, "osc_32_768khz", NULL, + clk_register_fixed_rate(NULL, "osc_32_768khz", NULL, + CLK_GET_RATE_NOCACHE, + 32768); clk_register_fixed_rate(NULL, "ring_osc_120mhz", NULL, CLK_GET_RATE_NOCACHE, 120 * MHz); diff --git a/include/dt-bindings/clock/pxa-clock.h b/include/dt-bindings/clock/pxa-clock.h index e65803b1dc7e..0b0fd2b01538 100644 --- a/include/dt-bindings/clock/pxa-clock.h +++ b/include/dt-bindings/clock/pxa-clock.h @@ -72,6 +72,7 @@ #define CLK_USIM 58 #define CLK_USIM1 59 #define CLK_USMI0 60 -#define CLK_MAX 61 +#define CLK_OSC32k768 61 +#define CLK_MAX 62 #endif -- 2.11.0
[PATCH v2 2/2] ARM: dts: pxa: fix the rtc controller
The RTC controller is fed by an external fixed 32kHz clock. Yet the driver wants to acquire this clock, even though it doesn't make any use of it, ie. doesn't get the rate to make calculation. Therefore, use the exported 32.768kHz clock in the PXA clock tree to make the driver happy and working. Signed-off-by: Robert Jarzmik --- Since v1: change the dummy clock by the actual 32.768kHz --- arch/arm/boot/dts/pxa25x.dtsi | 4 arch/arm/boot/dts/pxa27x.dtsi | 4 2 files changed, 8 insertions(+) diff --git a/arch/arm/boot/dts/pxa25x.dtsi b/arch/arm/boot/dts/pxa25x.dtsi index 95d59be97213..78a413ea0e88 100644 --- a/arch/arm/boot/dts/pxa25x.dtsi +++ b/arch/arm/boot/dts/pxa25x.dtsi @@ -80,6 +80,10 @@ #pwm-cells = <1>; clocks = <&clks CLK_PWM1>; }; + + rtc@4090 { + clocks = <&clks CLK_OSC32k768>>; + }; }; timer@40a0 { diff --git a/arch/arm/boot/dts/pxa27x.dtsi b/arch/arm/boot/dts/pxa27x.dtsi index 747f750f675d..2ab6986433c8 100644 --- a/arch/arm/boot/dts/pxa27x.dtsi +++ b/arch/arm/boot/dts/pxa27x.dtsi @@ -113,6 +113,10 @@ status = "disabled"; }; + + rtc@4090 { + clocks = <&clks CLK_OSC32k768>; + }; }; clocks { -- 2.11.0
[PATCH] ARM: dts: pxa: fix the rtc controller
The RTC controller is fed by an external fixed 32kHz clock. Yet the driver wants to acquire this clock, even though it doesn't make any use of it, ie. doesn't get the rate to make calculation. Therefore, add the dummy clock in the PXA clock tree to make the driver happy and working. Signed-off-by: Robert Jarzmik --- arch/arm/boot/dts/pxa25x.dtsi | 4 arch/arm/boot/dts/pxa27x.dtsi | 4 2 files changed, 8 insertions(+) diff --git a/arch/arm/boot/dts/pxa25x.dtsi b/arch/arm/boot/dts/pxa25x.dtsi index 95d59be97213..c6ca07e4626b 100644 --- a/arch/arm/boot/dts/pxa25x.dtsi +++ b/arch/arm/boot/dts/pxa25x.dtsi @@ -80,6 +80,10 @@ #pwm-cells = <1>; clocks = <&clks CLK_PWM1>; }; + + rtc@4090 { + clocks = <&clks CLK_NONE>; + }; }; timer@40a0 { diff --git a/arch/arm/boot/dts/pxa27x.dtsi b/arch/arm/boot/dts/pxa27x.dtsi index 747f750f675d..e9cf4192e2e0 100644 --- a/arch/arm/boot/dts/pxa27x.dtsi +++ b/arch/arm/boot/dts/pxa27x.dtsi @@ -113,6 +113,10 @@ status = "disabled"; }; + + rtc@4090 { + clocks = <&clks CLK_NONE>; + }; }; clocks { -- 2.11.0
[PATCH v2 2/2] ALSA: ac97: add codecs devicetree binding
Add a devicetree binding for codecs. This is especially useful if the AC97 bitclk clock is provided by the codec, as it has to be described in the devicetree description for the ac97 bus code to aquire it. Signed-off-by: Robert Jarzmik --- Since v1: handle of_put_node() in codec removal --- sound/ac97/bus.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/sound/ac97/bus.c b/sound/ac97/bus.c index 31f858eceffc..7a0dfca03a57 100644 --- a/sound/ac97/bus.c +++ b/sound/ac97/bus.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -68,6 +69,27 @@ ac97_codec_find(struct ac97_controller *ac97_ctrl, unsigned int codec_num) return ac97_ctrl->codecs[codec_num]; } +static struct device_node * +ac97_of_get_child_device(struct ac97_controller *ac97_ctrl, int idx, +unsigned int vendor_id) +{ + struct device_node *node; + u32 reg; + char compat[] = "ac97,,"; + + snprintf(compat, sizeof(compat), "ac97,%04x,%04x", +vendor_id >> 16, vendor_id & 0x); + + for_each_child_of_node(ac97_ctrl->parent->of_node, node) { + if ((idx != of_property_read_u32(node, "reg", ®)) || + !of_device_is_compatible(node, compat)) + continue; + return of_node_get(node); + } + + return NULL; +} + static void ac97_codec_release(struct device *dev) { struct ac97_codec_device *adev; @@ -76,6 +98,7 @@ static void ac97_codec_release(struct device *dev) adev = to_ac97_device(dev); ac97_ctrl = adev->ac97_ctrl; ac97_ctrl->codecs[adev->num] = NULL; + of_node_put(dev->of_node); kfree(adev); } @@ -98,6 +121,8 @@ static int ac97_codec_add(struct ac97_controller *ac97_ctrl, int idx, device_initialize(&codec->dev); dev_set_name(&codec->dev, "%s:%u", dev_name(ac97_ctrl->parent), idx); + codec->dev.of_node = ac97_of_get_child_device(ac97_ctrl, idx, + vendor_id); ret = device_add(&codec->dev); if (ret) @@ -105,6 +130,7 @@ static int ac97_codec_add(struct ac97_controller *ac97_ctrl, int idx, return 0; err_free_codec: + of_node_put(codec->dev.of_node); put_device(&codec->dev); kfree(codec); ac97_ctrl->codecs[idx] = NULL; -- 2.11.0
[PATCH v2 1/2] ALSA: ac97: add bus binding for codecs
Add the generic ac97 bus binding, especially for ac97 codecs discovered by ac97 hardware probing. Signed-off-by: Robert Jarzmik --- .../devicetree/bindings/sound/ac97-bus.txt | 32 ++ 1 file changed, 32 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/ac97-bus.txt diff --git a/Documentation/devicetree/bindings/sound/ac97-bus.txt b/Documentation/devicetree/bindings/sound/ac97-bus.txt new file mode 100644 index ..103c428f2595 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/ac97-bus.txt @@ -0,0 +1,32 @@ +Generic AC97 Device Properties + +This documents describes the devicetree bindings for an ac97 controller child +node describing ac97 codecs. + +Required properties: +-compatible : Must be "ac97,vendor_id1,vendor_id2 + The ids shall be the 4 characters hexadecimal encoding, such as + given by "%04x" formatting of printf +-reg : Must be the ac97 codec number, between 0 and 3 + +Example: +ac97: sound@4050 { + compatible = "marvell,pxa270-ac97"; + reg = < 0x4050 0x1000 >; + interrupts = <14>; + reset-gpios = <&gpio 95 GPIO_ACTIVE_HIGH>; + #sound-dai-cells = <1>; + pinctrl-names = "default"; + pinctrl-0 = < &pinctrl_ac97_default >; + clocks = <&clks CLK_AC97>, <&clks CLK_AC97CONF>; + clock-names = "AC97CLK", "AC97CONFCLK"; + + #address-cells = <1>; + #size-cells = <0>; + audio-codec@0 { + reg = <0>; + compatible = "ac97,574d,4c13"; + clocks = <&fixed_wm9713_clock>; + clock-names = "ac97_clk"; + } +}; -- 2.11.0
Re: [PATCH 2/2] ALSA: ac97: add codecs devicetree binding
Takashi Iwai writes: >> Special review query: review the "return of_node_get(node)", which >> assumes that upon device removal, of_put_node(dev.of_node) will be >> called... > > Is it really done automagically? I couldn't spot it. Neither could I ... I based this on device_set_of_node_from_dev(), and the it "seemed" logical to me that a device probed from devicetree would take a refcnt on the devicetree node. As the "logical" conflicted with my search for the automagical of_node_get(), I need the special review query. Cheers. -- Robert
[PATCH 2/2] ALSA: ac97: add codecs devicetree binding
Add a devicetree binding for codecs. This is especially useful if the AC97 bitclk clock is provided by the codec, as it has to be described in the devicetree description for the ac97 bus code to aquire it. Signed-off-by: Robert Jarzmik --- Special review query: review the "return of_node_get(node)", which assumes that upon device removal, of_put_node(dev.of_node) will be called... --- sound/ac97/bus.c | 24 1 file changed, 24 insertions(+) diff --git a/sound/ac97/bus.c b/sound/ac97/bus.c index 31f858eceffc..c8e20dd8786f 100644 --- a/sound/ac97/bus.c +++ b/sound/ac97/bus.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -68,6 +69,27 @@ ac97_codec_find(struct ac97_controller *ac97_ctrl, unsigned int codec_num) return ac97_ctrl->codecs[codec_num]; } +static struct device_node * +ac97_of_get_child_device(struct ac97_controller *ac97_ctrl, int idx, +unsigned int vendor_id) +{ + struct device_node *node; + u32 reg; + char compat[] = "ac97,,"; + + snprintf(compat, sizeof(compat), "ac97,%04x,%04x", +vendor_id >> 16, vendor_id & 0x); + + for_each_child_of_node(ac97_ctrl->parent->of_node, node) { + if ((idx != of_property_read_u32(node, "reg", ®)) || + !of_device_is_compatible(node, compat)) + continue; + return of_node_get(node); + } + + return NULL; +} + static void ac97_codec_release(struct device *dev) { struct ac97_codec_device *adev; @@ -98,6 +120,8 @@ static int ac97_codec_add(struct ac97_controller *ac97_ctrl, int idx, device_initialize(&codec->dev); dev_set_name(&codec->dev, "%s:%u", dev_name(ac97_ctrl->parent), idx); + codec->dev.of_node = ac97_of_get_child_device(ac97_ctrl, idx, + vendor_id); ret = device_add(&codec->dev); if (ret) -- 2.11.0
[PATCH 1/2] ALSA: ac97: add bus binding for codecs
Add the generic ac97 bus binding, especially for ac97 codecs discovered by ac97 hardware probing. Signed-off-by: Robert Jarzmik --- .../devicetree/bindings/sound/ac97-bus.txt | 32 ++ 1 file changed, 32 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/ac97-bus.txt diff --git a/Documentation/devicetree/bindings/sound/ac97-bus.txt b/Documentation/devicetree/bindings/sound/ac97-bus.txt new file mode 100644 index ..103c428f2595 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/ac97-bus.txt @@ -0,0 +1,32 @@ +Generic AC97 Device Properties + +This documents describes the devicetree bindings for an ac97 controller child +node describing ac97 codecs. + +Required properties: +-compatible : Must be "ac97,vendor_id1,vendor_id2 + The ids shall be the 4 characters hexadecimal encoding, such as + given by "%04x" formatting of printf +-reg : Must be the ac97 codec number, between 0 and 3 + +Example: +ac97: sound@4050 { + compatible = "marvell,pxa270-ac97"; + reg = < 0x4050 0x1000 >; + interrupts = <14>; + reset-gpios = <&gpio 95 GPIO_ACTIVE_HIGH>; + #sound-dai-cells = <1>; + pinctrl-names = "default"; + pinctrl-0 = < &pinctrl_ac97_default >; + clocks = <&clks CLK_AC97>, <&clks CLK_AC97CONF>; + clock-names = "AC97CLK", "AC97CONFCLK"; + + #address-cells = <1>; + #size-cells = <0>; + audio-codec@0 { + reg = <0>; + compatible = "ac97,574d,4c13"; + clocks = <&fixed_wm9713_clock>; + clock-names = "ac97_clk"; + } +}; -- 2.11.0
Re: [PATCH] ARM: pxa: zylonite: use the new ac97 bus support
Robert Jarzmik writes: > Now the PXA is converted to new ac97 bus support, the wm9713 is > automatically detected and probed. Remove it from the platform bus. > > Signed-off-by: Robert Jarzmik > --- > arch/arm/mach-pxa/zylonite.c | 11 --- > 1 file changed, 11 deletions(-) Queued to pxa/for-next. -- Robert
Re: [PATCH] ARM: pxa: add the missing AC97 clocks
Robert Jarzmik writes: > The AC97 bit clock is added as the pxa internally generated 13MHz > clock. This is a consequence of the new ac97 framework. > > Signed-off-by: Robert Jarzmik > --- > arch/arm/mach-pxa/devices.c | 13 + > 1 file changed, 13 insertions(+) Queued to pxa/for-next. -- Robert
Re: [PATCH] ARM: pxa: mioa701 convert to the new AC97 bus
Robert Jarzmik writes: > This migration implies : > - wm9713 device is removed, it will be auto-probed > > Signed-off-by: Robert Jarzmik > --- > arch/arm/mach-pxa/mioa701.c | 2 -- > 1 file changed, 2 deletions(-) Queued to pxa/for-next. -- Robert
Re: [PATCH] ARM: pxa: hx4700: fix the usb client
Robert Jarzmik writes: > The usb client of the hx4700 is not working because no platform data is > declared. Fix it by adding the missing call. > > Signed-off-by: Robert Jarzmik Queued to pxa/for-next. -- Robert
Re: [PATCH v3 00/14] ARM: pxa: switch to DMA slave maps
Boris Brezillon writes: > Don't worry, we're not planning to merge it unless it happens to be > required (Stephen Rothwell reporting a merge conflict in next), and we > don't have conflicting changes in the pipeline so far. Ok, great. We're good to go, no screaming from 0-day, my internal testbench is happy, everything looks fine, the tag is unmutable until v4.19. Cheers. -- Robert
Re: [PATCH v3 00/14] ARM: pxa: switch to DMA slave maps
Boris Brezillon writes: > Hi Robert, > > On Sun, 17 Jun 2018 19:02:03 +0200 > Robert Jarzmik wrote: > >> As I gathered almost all the required acks, this is an information only post >> before queuing to the PXA tree. > > We'll need an immutable branch/tag containing those changes, just in > case other conflicting changes get submitted to the NAND driver. Sure, this branch will be usable from next Wednesday onward, here : - git fetch https://github.com/rjarzmik/linux.git tags/pxa-for-4.19-dma_slave_map I must insist on "Wednesday", as I need to have one last pass from 0-day kernel checker to be fully covered, and I'd like as well to know which tree the ASoC patch will take, ie. if Mark commits to take it, or rather wants to pull from the imutable branch. Until Wednesday, even if the branch exist, consider it doesn't please, and Thursday morning you can pull if you wish. Cheers. -- Robert
[PATCH v2 2/2] ASoC: pxa: add devicetree support
Add the devicetree support, so that the driver can be used in a devictree platform. Signed-off-by: Robert Jarzmik --- Since v1: changed compatible string to pxa250-ac97, pxa270-ac97... --- sound/arm/pxa2xx-ac97-lib.c | 12 sound/soc/pxa/pxa2xx-ac97.c | 12 2 files changed, 24 insertions(+) diff --git a/sound/arm/pxa2xx-ac97-lib.c b/sound/arm/pxa2xx-ac97-lib.c index 5950a9e218d9..8eafd3d3dff6 100644 --- a/sound/arm/pxa2xx-ac97-lib.c +++ b/sound/arm/pxa2xx-ac97-lib.c @@ -19,6 +19,7 @@ #include #include #include +#include #include @@ -337,6 +338,17 @@ int pxa2xx_ac97_hw_probe(struct platform_device *dev) dev_err(&dev->dev, "Invalid reset GPIO %d\n", pdata->reset_gpio); } + } else if (!pdata && dev->dev.of_node) { + pdata = devm_kzalloc(&dev->dev, sizeof(*pdata), GFP_KERNEL); + if (!pdata) + return -ENOMEM; + pdata->reset_gpio = of_get_named_gpio(dev->dev.of_node, + "reset-gpios", 0); + if (pdata->reset_gpio == -ENOENT) + pdata->reset_gpio = -1; + else if (pdata->reset_gpio < 0) + return pdata->reset_gpio; + reset_gpio = pdata->reset_gpio; } else { if (cpu_is_pxa27x()) reset_gpio = 113; diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c index bd36578ceb86..d6be323a13ec 100644 --- a/sound/soc/pxa/pxa2xx-ac97.c +++ b/sound/soc/pxa/pxa2xx-ac97.c @@ -231,6 +231,17 @@ static const struct snd_soc_component_driver pxa_ac97_component = { .name = "pxa-ac97", }; +#ifdef CONFIG_OF +static const struct of_device_id pxa2xx_ac97_dt_ids[] = { + { .compatible = "marvell,pxa250-ac97", }, + { .compatible = "marvell,pxa270-ac97", }, + { .compatible = "marvell,pxa300-ac97", }, + { } +}; +MODULE_DEVICE_TABLE(of, pxa2xx_ac97_dt_ids); + +#endif + static int pxa2xx_ac97_dev_probe(struct platform_device *pdev) { int ret; @@ -298,6 +309,7 @@ static struct platform_driver pxa2xx_ac97_driver = { #ifdef CONFIG_PM_SLEEP .pm = &pxa2xx_ac97_pm_ops, #endif + .of_match_table = of_match_ptr(pxa2xx_ac97_dt_ids), }, }; -- 2.11.0
[PATCH v2 1/2] ASoC: pxa: add binding for pxa2xx-ac97 audio complex
This adds a binding for the Marvell PXA audio complex, available in pxa2xx and pxa3xx variants. Signed-off-by: Robert Jarzmik --- Since v1: Rob's review, compatible string, reset-gpios, status --- .../bindings/sound/marvell,pxa2xx-ac97.txt | 27 ++ 1 file changed, 27 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/marvell,pxa2xx-ac97.txt diff --git a/Documentation/devicetree/bindings/sound/marvell,pxa2xx-ac97.txt b/Documentation/devicetree/bindings/sound/marvell,pxa2xx-ac97.txt new file mode 100644 index ..2ea85d5be6a4 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/marvell,pxa2xx-ac97.txt @@ -0,0 +1,27 @@ +Marvell PXA2xx audio complex + +This descriptions matches the AC97 controller found in pxa2xx and pxa3xx series. + +Required properties: + - compatible: should be one of the following: +"marvell,pxa250-ac97" +"marvell,pxa270-ac97" +"marvell,pxa300-ac97" + - reg: device MMIO address space + - interrupts: single interrupt generated by AC97 IP + - clocks: input clock of the AC97 IP, refer to clock-bindings.txt + +Optional properties: + - pinctrl-names, pinctrl-0: refer to pinctrl-bindings.txt + - reset-gpios: gpio used for AC97 reset, refer to gpio.txt + +Example: + ac97: sound@4050 { + compatible = "marvell,pxa250-ac97"; + reg = < 0x4050 0x1000 >; + interrupts = <14>; + reset-gpios = <&gpio 113 GPIO_ACTIVE_HIGH>; + #sound-dai-cells = <1>; + pinctrl-names = "default"; + pinctrl-0 = < &pmux_ac97_default >; + }; -- 2.11.0
Re: [PATCH 1/2] ASoC: pxa: add binding for pxa2xx-ac97 audio complex
Rob Herring writes: > On Mon, Jun 11, 2018 at 10:22:10PM +0200, Robert Jarzmik wrote: >> This adds a binding for the Marvell PXA audio complex, available in >> pxa2xx and pxa3xx variants. >> +Required properties: >> + - compatible: "marvell,pxa2xx-ac97" > > Don't use wildcards in compatible strings. Though this is so old... Yes, I could use pxa270-ac97. >> + - reset-gpio: gpio used for AC97 reset, refer to gpio.txt > reset-gpios Right, I'm on it. >> +status = "okay"; > > Don't show status in examples. Sure. Cheers. -- Robert
[PATCH 2/2] ASoC: pxa: add devicetree support
Add the devicetree support, so that the driver can be used in a devictree platform. Signed-off-by: Robert Jarzmik --- sound/arm/pxa2xx-ac97-lib.c | 11 +++ sound/soc/pxa/pxa2xx-ac97.c | 10 ++ 2 files changed, 21 insertions(+) diff --git a/sound/arm/pxa2xx-ac97-lib.c b/sound/arm/pxa2xx-ac97-lib.c index 5950a9e218d9..17c3f26b92b9 100644 --- a/sound/arm/pxa2xx-ac97-lib.c +++ b/sound/arm/pxa2xx-ac97-lib.c @@ -19,6 +19,7 @@ #include #include #include +#include #include @@ -337,6 +338,16 @@ int pxa2xx_ac97_hw_probe(struct platform_device *dev) dev_err(&dev->dev, "Invalid reset GPIO %d\n", pdata->reset_gpio); } + } else if (!pdata && dev->dev.of_node) { + pdata = devm_kzalloc(&dev->dev, sizeof(*pdata), GFP_KERNEL); + if (!pdata) + return -ENOMEM; + pdata->reset_gpio = of_get_named_gpio(dev->dev.of_node, + "reset-gpio", 0); + if (pdata->reset_gpio == -ENOENT) + pdata->reset_gpio = -1; + else if (pdata->reset_gpio < 0) + return pdata->reset_gpio; } else { if (cpu_is_pxa27x()) reset_gpio = 113; diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c index bd36578ceb86..8fda29262ef1 100644 --- a/sound/soc/pxa/pxa2xx-ac97.c +++ b/sound/soc/pxa/pxa2xx-ac97.c @@ -231,6 +231,15 @@ static const struct snd_soc_component_driver pxa_ac97_component = { .name = "pxa-ac97", }; +#ifdef CONFIG_OF +static const struct of_device_id pxa2xx_ac97_dt_ids[] = { + { .compatible = "marvell,pxa2xx-ac97", }, + { } +}; +MODULE_DEVICE_TABLE(of, pxa2xx_ac97_dt_ids); + +#endif + static int pxa2xx_ac97_dev_probe(struct platform_device *pdev) { int ret; @@ -298,6 +307,7 @@ static struct platform_driver pxa2xx_ac97_driver = { #ifdef CONFIG_PM_SLEEP .pm = &pxa2xx_ac97_pm_ops, #endif + .of_match_table = of_match_ptr(pxa2xx_ac97_dt_ids), }, }; -- 2.11.0
[PATCH 1/2] ASoC: pxa: add binding for pxa2xx-ac97 audio complex
This adds a binding for the Marvell PXA audio complex, available in pxa2xx and pxa3xx variants. Signed-off-by: Robert Jarzmik --- .../bindings/sound/marvell,pxa2xx-ac97.txt | 25 ++ 1 file changed, 25 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/marvell,pxa2xx-ac97.txt diff --git a/Documentation/devicetree/bindings/sound/marvell,pxa2xx-ac97.txt b/Documentation/devicetree/bindings/sound/marvell,pxa2xx-ac97.txt new file mode 100644 index ..b3f2882d9c7d --- /dev/null +++ b/Documentation/devicetree/bindings/sound/marvell,pxa2xx-ac97.txt @@ -0,0 +1,25 @@ +Marvell PXA2xx audio complex + +This descriptions matches the AC97 controller found in pxa2xx and pxa3xx series. + +Required properties: + - compatible: "marvell,pxa2xx-ac97" + - reg: device MMIO address space + - interrupts: single interrupt generated by AC97 IP + - clocks: input clock of the AC97 IP, refer to clock-bindings.txt + +Optional properties: + - pinctrl-names, pinctrl-0: refer to pinctrl-bindings.txt + - reset-gpio: gpio used for AC97 reset, refer to gpio.txt + +Example: + ac97: sound@4050 { + compatible = "marvell,pxa2xx-ac97"; + reg = < 0x4050 0x1000 >; + interrupts = <14>; + reset-gpio = <&gpio 113 GPIO_ACTIVE_HIGH>; + #sound-dai-cells = <1>; + pinctrl-names = "default"; + pinctrl-0 = < &pmux_ac97_default >; + status = "okay"; + }; -- 2.11.0
Re: [RESEND v2] dmaengine: pxa: add a default requestor policy
Vinod Koul writes: > On 09-06-18, 14:43, Robert Jarzmik wrote: >> Robert Jarzmik writes: >> >> > As what former drcmr -1 value meant, add a this as a default to each >> > channel, ie. that by default no requestor line is used. >> > >> > This is specifically used for network drivers smc91x and smc911x, and >> > needed for their port to slave maps. >> > >> > Cc: Arnd Bergmann >> > Signed-off-by: Robert Jarzmik >> > --- >> > Since v1: changed -1 to U32_MAX >> Hi Vinod, >> >> Could I have your ack on this so that I add this one to the dma slave map >> serie >> after the merge window is closed please ? > > Sorry I was thinking it would go thru dmaengine tree, please do > indicate if that is not the case. Nevertheless > > Acked-by: Vinod Koul Thanks. As this is a dependency to the serie, I'd rather take it, unless you insist, in which case I'll rely on the fact that it will hit 4.19 cycle. Cheers. -- Robert
Re: [RESEND v2] dmaengine: pxa: add a default requestor policy
Robert Jarzmik writes: > As what former drcmr -1 value meant, add a this as a default to each > channel, ie. that by default no requestor line is used. > > This is specifically used for network drivers smc91x and smc911x, and > needed for their port to slave maps. > > Cc: Arnd Bergmann > Signed-off-by: Robert Jarzmik > --- > Since v1: changed -1 to U32_MAX Hi Vinod, Could I have your ack on this so that I add this one to the dma slave map serie after the merge window is closed please ? Cheers. -- Robert > --- > drivers/dma/pxa_dma.c | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/drivers/dma/pxa_dma.c b/drivers/dma/pxa_dma.c > index 9505334f9c6e..b31c28b67ad3 100644 > --- a/drivers/dma/pxa_dma.c > +++ b/drivers/dma/pxa_dma.c > @@ -762,6 +762,8 @@ static void pxad_free_chan_resources(struct dma_chan > *dchan) > dma_pool_destroy(chan->desc_pool); > chan->desc_pool = NULL; > > + chan->drcmr = U32_MAX; > + chan->prio = PXAD_PRIO_LOWEST; > } > > static void pxad_free_desc(struct virt_dma_desc *vd) > @@ -1386,6 +1388,9 @@ static int pxad_init_dmadev(struct platform_device *op, > c = devm_kzalloc(&op->dev, sizeof(*c), GFP_KERNEL); > if (!c) > return -ENOMEM; > + > + c->drcmr = U32_MAX; > + c->prio = PXAD_PRIO_LOWEST; > c->vc.desc_free = pxad_free_desc; > vchan_init(&c->vc, &pdev->slave); > init_waitqueue_head(&c->wq_state); -- Robert
[PATCH] ARM: pxa: zylonite: use the new ac97 bus support
Now the PXA is converted to new ac97 bus support, the wm9713 is automatically detected and probed. Remove it from the platform bus. Signed-off-by: Robert Jarzmik --- arch/arm/mach-pxa/zylonite.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/arch/arm/mach-pxa/zylonite.c b/arch/arm/mach-pxa/zylonite.c index d69de312d8d9..52e70a5c1281 100644 --- a/arch/arm/mach-pxa/zylonite.c +++ b/arch/arm/mach-pxa/zylonite.c @@ -47,16 +47,6 @@ int wm9713_irq; int lcd_id; int lcd_orientation; -struct platform_device pxa_device_wm9713_audio = { - .name = "wm9713-codec", - .id = -1, -}; - -static void __init zylonite_init_wm9713_audio(void) -{ - platform_device_register(&pxa_device_wm9713_audio); -} - static struct resource smc91x_resources[] = { [0] = { .start = ZYLONITE_ETH_PHYS + 0x300, @@ -428,7 +418,6 @@ static void __init zylonite_init(void) zylonite_init_nand(); zylonite_init_leds(); zylonite_init_ohci(); - zylonite_init_wm9713_audio(); } MACHINE_START(ZYLONITE, "PXA3xx Platform Development Kit (aka Zylonite)") -- 2.11.0
[PATCH] mfd: wm97xx-core: platform data can be NULL
It is not mandatory that platform data is passed along the ac97 codec. Actually there are configuration without a battery connected to the ADC of the codec. This is for example the case for the PXA zylonite platform, so fix the NULL dereferencing by adding a test. Fixes: a5c6951c49fb ("mfd: wm97xx-core: core support for wm97xx Codec") Signed-off-by: Robert Jarzmik --- drivers/mfd/wm97xx-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/wm97xx-core.c b/drivers/mfd/wm97xx-core.c index 4141ee52a70b..f5a8347f837f 100644 --- a/drivers/mfd/wm97xx-core.c +++ b/drivers/mfd/wm97xx-core.c @@ -278,7 +278,7 @@ static int wm97xx_ac97_probe(struct ac97_codec_device *adev) codec_pdata = &wm97xx->codec_pdata; codec_pdata->ac97 = wm97xx->ac97; - codec_pdata->batt_pdata = pdata->batt_pdata; + codec_pdata->batt_pdata = pdata ? pdata->batt_pdata : NULL; switch (adev->vendor_id) { case WM9705_VENDOR_ID: -- 2.11.0
[PATCH] ARM: pxa: add the missing AC97 clocks
The AC97 bit clock is added as the pxa internally generated 13MHz clock. This is a consequence of the new ac97 framework. Signed-off-by: Robert Jarzmik --- arch/arm/mach-pxa/devices.c | 13 + 1 file changed, 13 insertions(+) diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c index 5a16ea74e28a..a24783a03827 100644 --- a/arch/arm/mach-pxa/devices.c +++ b/arch/arm/mach-pxa/devices.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -477,6 +478,18 @@ struct platform_device pxa_device_ac97 = { void __init pxa_set_ac97_info(pxa2xx_audio_ops_t *ops) { + int ret; + + ret = clk_add_alias("ac97_clk", "pxa2xx-ac97:0", "AC97CLK", + &pxa_device_ac97.dev); + if (ret) + pr_err("PXA AC97 clock1 alias error: %d\n", ret); + + ret = clk_add_alias("ac97_clk", "pxa2xx-ac97:1", "AC97CLK", + &pxa_device_ac97.dev); + if (ret) + pr_err("PXA AC97 clock2 alias error: %d\n", ret); + pxa_register_device(&pxa_device_ac97, ops); } -- 2.11.0
[PATCH v9] ASoC: pxa: switch to new ac97 bus support
Switch to the new ac97 bus support in sound/ac97 instead of the legacy snd_ac97 one. Signed-off-by: Robert Jarzmik --- Since v8: fixed the trivial compilation error v7 was in https://patchwork.kernel.org/patch/9951919/ --- sound/arm/Kconfig | 1 - sound/soc/pxa/Kconfig | 5 ++--- sound/soc/pxa/pxa2xx-ac97.c | 48 +++-- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/sound/arm/Kconfig b/sound/arm/Kconfig index 65171f6657a2..f1f25704fe52 100644 --- a/sound/arm/Kconfig +++ b/sound/arm/Kconfig @@ -36,7 +36,6 @@ endif # SND_ARM config SND_PXA2XX_LIB tristate - select SND_AC97_CODEC if SND_PXA2XX_LIB_AC97 select SND_DMAENGINE_PCM config SND_PXA2XX_LIB_AC97 diff --git a/sound/soc/pxa/Kconfig b/sound/soc/pxa/Kconfig index 484ab3c2ad67..1a0b55beb282 100644 --- a/sound/soc/pxa/Kconfig +++ b/sound/soc/pxa/Kconfig @@ -20,13 +20,12 @@ config SND_MMP_SOC config SND_PXA2XX_AC97 tristate - select SND_AC97_CODEC config SND_PXA2XX_SOC_AC97 tristate - select AC97_BUS + select AC97_BUS_NEW select SND_PXA2XX_LIB_AC97 - select SND_SOC_AC97_BUS + select SND_SOC_AC97_BUS_NEW config SND_PXA2XX_SOC_I2S tristate diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c index 1b41c0f2a8fb..80e4757176d8 100644 --- a/sound/soc/pxa/pxa2xx-ac97.c +++ b/sound/soc/pxa/pxa2xx-ac97.c @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -27,43 +28,35 @@ #include #include -static void pxa2xx_ac97_warm_reset(struct snd_ac97 *ac97) +static void pxa2xx_ac97_warm_reset(struct ac97_controller *adrv) { pxa2xx_ac97_try_warm_reset(); pxa2xx_ac97_finish_reset(); } -static void pxa2xx_ac97_cold_reset(struct snd_ac97 *ac97) +static void pxa2xx_ac97_cold_reset(struct ac97_controller *adrv) { pxa2xx_ac97_try_cold_reset(); pxa2xx_ac97_finish_reset(); } -static unsigned short pxa2xx_ac97_legacy_read(struct snd_ac97 *ac97, - unsigned short reg) +static int pxa2xx_ac97_read_actrl(struct ac97_controller *adrv, int slot, + unsigned short reg) { - int ret; - - ret = pxa2xx_ac97_read(ac97->num, reg); - if (ret < 0) - return 0; - else - return (unsigned short)(ret & 0x); + return pxa2xx_ac97_read(slot, reg); } -static void pxa2xx_ac97_legacy_write(struct snd_ac97 *ac97, -unsigned short reg, unsigned short val) +static int pxa2xx_ac97_write_actrl(struct ac97_controller *adrv, int slot, + unsigned short reg, unsigned short val) { - int ret; - - ret = pxa2xx_ac97_write(ac97->num, reg, val); + return pxa2xx_ac97_write(slot, reg, val); } -static struct snd_ac97_bus_ops pxa2xx_ac97_ops = { - .read = pxa2xx_ac97_legacy_read, - .write = pxa2xx_ac97_legacy_write, +static struct ac97_controller_ops pxa2xx_ac97_ops = { + .read = pxa2xx_ac97_read_actrl, + .write = pxa2xx_ac97_write_actrl, .warm_reset = pxa2xx_ac97_warm_reset, .reset = pxa2xx_ac97_cold_reset, }; @@ -219,6 +212,9 @@ static const struct snd_soc_component_driver pxa_ac97_component = { static int pxa2xx_ac97_dev_probe(struct platform_device *pdev) { int ret; + struct ac97_controller *ctrl; + pxa2xx_audio_ops_t *pdata = pdev->dev.platform_data; + void **codecs_pdata; if (pdev->id != -1) { dev_err(&pdev->dev, "PXA2xx has only one AC97 port.\n"); @@ -231,10 +227,14 @@ static int pxa2xx_ac97_dev_probe(struct platform_device *pdev) return ret; } - ret = snd_soc_set_ac97_ops(&pxa2xx_ac97_ops); - if (ret != 0) - return ret; + codecs_pdata = pdata ? pdata->codec_pdata : NULL; + ctrl = snd_ac97_controller_register(&pxa2xx_ac97_ops, &pdev->dev, + AC97_SLOTS_AVAILABLE_ALL, + codecs_pdata); + if (IS_ERR(ctrl)) + return PTR_ERR(ctrl); + platform_set_drvdata(pdev, ctrl); /* Punt most of the init to the SoC probe; we may need the machine * driver to do interesting things with the clocking to get us up * and running. @@ -245,8 +245,10 @@ static int pxa2xx_ac97_dev_probe(struct platform_device *pdev) static int pxa2xx_ac97_dev_remove(struct platform_device *pdev) { + struct ac97_controller *ctrl = platform_get_drvdata(pdev); + snd_soc_unregister_component(&pdev->dev); - snd_soc_set_ac97_ops(NULL); + snd_ac97_controller_unregister(ctrl); pxa2xx_ac97_hw_remove(pdev); return 0; } -- 2.11.0
Re: [PATCH v8] ASoC: pxa: switch to new ac97 bus support
Robert Jarzmik writes: > Switch to the new ac97 bus support in sound/ac97 instead of the legacy > snd_ac97 one. > + codecs_pdata = pdata ? pdata->codecs_pdata : NULL; It's a shame my automated build and test system didn't catch that : it should have been pdata->codec_pdata and not pdata->codecs_pdata. Given that this slipped in, please don't apply this until I find out why my builder lives in utopia. Cheers. -- Robert
[PATCH v8] ASoC: pxa: switch to new ac97 bus support
Switch to the new ac97 bus support in sound/ac97 instead of the legacy snd_ac97 one. Signed-off-by: Robert Jarzmik --- Since v7: added a NULL pointer check v7 was in https://patchwork.kernel.org/patch/9951919/ --- sound/arm/Kconfig | 1 - sound/soc/pxa/Kconfig | 5 ++--- sound/soc/pxa/pxa2xx-ac97.c | 48 +++-- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/sound/arm/Kconfig b/sound/arm/Kconfig index 65171f6657a2..f1f25704fe52 100644 --- a/sound/arm/Kconfig +++ b/sound/arm/Kconfig @@ -36,7 +36,6 @@ endif # SND_ARM config SND_PXA2XX_LIB tristate - select SND_AC97_CODEC if SND_PXA2XX_LIB_AC97 select SND_DMAENGINE_PCM config SND_PXA2XX_LIB_AC97 diff --git a/sound/soc/pxa/Kconfig b/sound/soc/pxa/Kconfig index 484ab3c2ad67..1a0b55beb282 100644 --- a/sound/soc/pxa/Kconfig +++ b/sound/soc/pxa/Kconfig @@ -20,13 +20,12 @@ config SND_MMP_SOC config SND_PXA2XX_AC97 tristate - select SND_AC97_CODEC config SND_PXA2XX_SOC_AC97 tristate - select AC97_BUS + select AC97_BUS_NEW select SND_PXA2XX_LIB_AC97 - select SND_SOC_AC97_BUS + select SND_SOC_AC97_BUS_NEW config SND_PXA2XX_SOC_I2S tristate diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c index 1b41c0f2a8fb..91ead9cbbb9d 100644 --- a/sound/soc/pxa/pxa2xx-ac97.c +++ b/sound/soc/pxa/pxa2xx-ac97.c @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -27,43 +28,35 @@ #include #include -static void pxa2xx_ac97_warm_reset(struct snd_ac97 *ac97) +static void pxa2xx_ac97_warm_reset(struct ac97_controller *adrv) { pxa2xx_ac97_try_warm_reset(); pxa2xx_ac97_finish_reset(); } -static void pxa2xx_ac97_cold_reset(struct snd_ac97 *ac97) +static void pxa2xx_ac97_cold_reset(struct ac97_controller *adrv) { pxa2xx_ac97_try_cold_reset(); pxa2xx_ac97_finish_reset(); } -static unsigned short pxa2xx_ac97_legacy_read(struct snd_ac97 *ac97, - unsigned short reg) +static int pxa2xx_ac97_read_actrl(struct ac97_controller *adrv, int slot, + unsigned short reg) { - int ret; - - ret = pxa2xx_ac97_read(ac97->num, reg); - if (ret < 0) - return 0; - else - return (unsigned short)(ret & 0x); + return pxa2xx_ac97_read(slot, reg); } -static void pxa2xx_ac97_legacy_write(struct snd_ac97 *ac97, -unsigned short reg, unsigned short val) +static int pxa2xx_ac97_write_actrl(struct ac97_controller *adrv, int slot, + unsigned short reg, unsigned short val) { - int ret; - - ret = pxa2xx_ac97_write(ac97->num, reg, val); + return pxa2xx_ac97_write(slot, reg, val); } -static struct snd_ac97_bus_ops pxa2xx_ac97_ops = { - .read = pxa2xx_ac97_legacy_read, - .write = pxa2xx_ac97_legacy_write, +static struct ac97_controller_ops pxa2xx_ac97_ops = { + .read = pxa2xx_ac97_read_actrl, + .write = pxa2xx_ac97_write_actrl, .warm_reset = pxa2xx_ac97_warm_reset, .reset = pxa2xx_ac97_cold_reset, }; @@ -219,6 +212,9 @@ static const struct snd_soc_component_driver pxa_ac97_component = { static int pxa2xx_ac97_dev_probe(struct platform_device *pdev) { int ret; + struct ac97_controller *ctrl; + pxa2xx_audio_ops_t *pdata = pdev->dev.platform_data; + void **codecs_pdata; if (pdev->id != -1) { dev_err(&pdev->dev, "PXA2xx has only one AC97 port.\n"); @@ -231,10 +227,14 @@ static int pxa2xx_ac97_dev_probe(struct platform_device *pdev) return ret; } - ret = snd_soc_set_ac97_ops(&pxa2xx_ac97_ops); - if (ret != 0) - return ret; + codecs_pdata = pdata ? pdata->codecs_pdata : NULL; + ctrl = snd_ac97_controller_register(&pxa2xx_ac97_ops, &pdev->dev, + AC97_SLOTS_AVAILABLE_ALL, + codecs_pdata); + if (IS_ERR(ctrl)) + return PTR_ERR(ctrl); + platform_set_drvdata(pdev, ctrl); /* Punt most of the init to the SoC probe; we may need the machine * driver to do interesting things with the clocking to get us up * and running. @@ -245,8 +245,10 @@ static int pxa2xx_ac97_dev_probe(struct platform_device *pdev) static int pxa2xx_ac97_dev_remove(struct platform_device *pdev) { + struct ac97_controller *ctrl = platform_get_drvdata(pdev); + snd_soc_unregister_component(&pdev->dev); - snd_soc_set_ac97_ops(NULL); + snd_ac97_controller_unregister(ctrl); pxa2xx_ac97_hw_remove(pdev); return 0; } -- 2.11.0
[RESEND v2] dmaengine: pxa: add a default requestor policy
As what former drcmr -1 value meant, add a this as a default to each channel, ie. that by default no requestor line is used. This is specifically used for network drivers smc91x and smc911x, and needed for their port to slave maps. Cc: Arnd Bergmann Signed-off-by: Robert Jarzmik --- Since v1: changed -1 to U32_MAX --- drivers/dma/pxa_dma.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/dma/pxa_dma.c b/drivers/dma/pxa_dma.c index 9505334f9c6e..b31c28b67ad3 100644 --- a/drivers/dma/pxa_dma.c +++ b/drivers/dma/pxa_dma.c @@ -762,6 +762,8 @@ static void pxad_free_chan_resources(struct dma_chan *dchan) dma_pool_destroy(chan->desc_pool); chan->desc_pool = NULL; + chan->drcmr = U32_MAX; + chan->prio = PXAD_PRIO_LOWEST; } static void pxad_free_desc(struct virt_dma_desc *vd) @@ -1386,6 +1388,9 @@ static int pxad_init_dmadev(struct platform_device *op, c = devm_kzalloc(&op->dev, sizeof(*c), GFP_KERNEL); if (!c) return -ENOMEM; + + c->drcmr = U32_MAX; + c->prio = PXAD_PRIO_LOWEST; c->vc.desc_free = pxad_free_desc; vchan_init(&c->vc, &pdev->slave); init_waitqueue_head(&c->wq_state); -- 2.11.0
[PATCH v2] dmaengine: pxa: add a default requestor policy
As what former drcmr -1 value meant, add a this as a default to each channel, ie. that by default no requestor line is used. This is specifically used for network drivers smc91x and smc911x, and needed for their port to slave maps. Cc: Arnd Bergmann Signed-off-by: Robert Jarzmik --- Since v1: changed -1 to U32_MAX --- drivers/dma/pxa_dma.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/dma/pxa_dma.c b/drivers/dma/pxa_dma.c index 9505334f9c6e..b31c28b67ad3 100644 --- a/drivers/dma/pxa_dma.c +++ b/drivers/dma/pxa_dma.c @@ -762,6 +762,8 @@ static void pxad_free_chan_resources(struct dma_chan *dchan) dma_pool_destroy(chan->desc_pool); chan->desc_pool = NULL; + chan->drcmr = U32_MAX; + chan->prio = PXAD_PRIO_LOWEST; } static void pxad_free_desc(struct virt_dma_desc *vd) @@ -1386,6 +1388,9 @@ static int pxad_init_dmadev(struct platform_device *op, c = devm_kzalloc(&op->dev, sizeof(*c), GFP_KERNEL); if (!c) return -ENOMEM; + + c->drcmr = U32_MAX; + c->prio = PXAD_PRIO_LOWEST; c->vc.desc_free = pxad_free_desc; vchan_init(&c->vc, &pdev->slave); init_waitqueue_head(&c->wq_state); -- 2.11.0
Re: [RESEND PATCH] dmaengine: pxa: add a default requestor policy
Vinod writes: > On 26-05-18, 11:54, Robert Jarzmik wrote: >> @@ -762,6 +762,8 @@ static void pxad_free_chan_resources(struct dma_chan >> *dchan) >> dma_pool_destroy(chan->desc_pool); >> chan->desc_pool = NULL; >> >> +chan->drcmr = (u32)-1; > > why not use U32_MAX for this? But of course, anything else you see ? Cheers. -- Robert
[PATCH] ARM: pxa: add the missing AC97 clocks
The AC97 bit clock is added as the pxa internally generated 13MHz clock. This is a consequence of the new ac97 framework. Signed-off-by: Robert Jarzmik --- arch/arm/mach-pxa/devices.c | 13 + 1 file changed, 13 insertions(+) diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c index d7c9a8476d57..018fbfc64851 100644 --- a/arch/arm/mach-pxa/devices.c +++ b/arch/arm/mach-pxa/devices.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -496,6 +497,18 @@ struct platform_device pxa_device_ac97 = { void __init pxa_set_ac97_info(pxa2xx_audio_ops_t *ops) { + int ret; + + ret = clk_add_alias("ac97_clk", "pxa2xx-ac97:0", "AC97CLK", + &pxa_device_ac97.dev); + if (ret) + pr_err("PXA AC97 clock1 alias error: %d\n", ret); + + ret = clk_add_alias("ac97_clk", "pxa2xx-ac97:1", "AC97CLK", + &pxa_device_ac97.dev); + if (ret) + pr_err("PXA AC97 clock2 alias error: %d\n", ret); + pxa_register_device(&pxa_device_ac97, ops); } -- 2.11.0
[PATCH] ARM: pxa: mioa701 convert to the new AC97 bus
This migration implies : - wm9713 device is removed, it will be auto-probed Signed-off-by: Robert Jarzmik --- arch/arm/mach-pxa/mioa701.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c index 9b6c7ea45a40..04dc78d0809f 100644 --- a/arch/arm/mach-pxa/mioa701.c +++ b/arch/arm/mach-pxa/mioa701.c @@ -677,14 +677,12 @@ MIO_SIMPLE_DEV(mioa701_led, "leds-gpio", &gpio_led_info) MIO_SIMPLE_DEV(pxa2xx_pcm, "pxa2xx-pcm", NULL) MIO_SIMPLE_DEV(mioa701_sound,"mioa701-wm9713", NULL) MIO_SIMPLE_DEV(mioa701_board,"mioa701-board", NULL) -MIO_SIMPLE_DEV(wm9713_acodec,"wm9713-codec", NULL); MIO_SIMPLE_DEV(gpio_vbus,"gpio-vbus", &gpio_vbus_data); static struct platform_device *devices[] __initdata = { &mioa701_gpio_keys, &mioa701_backlight, &mioa701_led, - &wm9713_acodec, &pxa2xx_pcm, &mioa701_sound, &power_dev, -- 2.11.0
[RESEND PATCH] dmaengine: pxa: add a default requestor policy
As what former drcmr -1 value meant, add a this as a default to each channel, ie. that by default no requestor line is used. This is specifically used for network drivers smc91x and smc911x, and needed for their port to slave maps. Cc: Arnd Bergmann Signed-off-by: Robert Jarzmik --- drivers/dma/pxa_dma.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/dma/pxa_dma.c b/drivers/dma/pxa_dma.c index 9505334f9c6e..604df1bdadf7 100644 --- a/drivers/dma/pxa_dma.c +++ b/drivers/dma/pxa_dma.c @@ -762,6 +762,8 @@ static void pxad_free_chan_resources(struct dma_chan *dchan) dma_pool_destroy(chan->desc_pool); chan->desc_pool = NULL; + chan->drcmr = (u32)-1; + chan->prio = PXAD_PRIO_LOWEST; } static void pxad_free_desc(struct virt_dma_desc *vd) @@ -1386,6 +1388,9 @@ static int pxad_init_dmadev(struct platform_device *op, c = devm_kzalloc(&op->dev, sizeof(*c), GFP_KERNEL); if (!c) return -ENOMEM; + + c->drcmr = (u32)-1; + c->prio = PXAD_PRIO_LOWEST; c->vc.desc_free = pxad_free_desc; vchan_init(&c->vc, &pdev->slave); init_waitqueue_head(&c->wq_state); -- 2.11.0
[PATCH] ARM: pxa: hx4700: fix the usb client
The usb client of the hx4700 is not working because no platform data is declared. Fix it by adding the missing call. Signed-off-by: Robert Jarzmik --- arch/arm/mach-pxa/hx4700.c | 4 1 file changed, 4 insertions(+) diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c index e2e7f247a645..b79b757fdd41 100644 --- a/arch/arm/mach-pxa/hx4700.c +++ b/arch/arm/mach-pxa/hx4700.c @@ -54,6 +54,7 @@ #include "devices.h" #include "generic.h" +#include "udc.h" /* Physical address space information */ @@ -594,6 +595,8 @@ static struct platform_device gpio_vbus = { }, }; +static struct pxa2xx_udc_mach_info hx4700_udc_info; + /* * Touchscreen - TSC2046 connected to SSP2 */ @@ -891,6 +894,7 @@ static void __init hx4700_init(void) gpio_set_value(GPIO71_HX4700_ASIC3_nRESET, 1); mdelay(10); + pxa_set_udc_info(&hx4700_udc_info); regulator_has_full_constraints(); } -- 2.11.0
[PATCH] mfd: asic3: Fix the broken MMC card detection
The MMC framework requires the ocr_mask to be provided. Without it, the SD card is not detected, especially on the hx4700 platform. Signed-off-by: Robert Jarzmik --- drivers/mfd/asic3.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c index cf2e25ab2940..1531302a50ec 100644 --- a/drivers/mfd/asic3.c +++ b/drivers/mfd/asic3.c @@ -31,6 +31,8 @@ #include #include +#include + enum { ASIC3_CLOCK_SPI, ASIC3_CLOCK_OWM, @@ -719,6 +721,7 @@ static void asic3_mmc_clk_div(struct platform_device *pdev, int state) static struct tmio_mmc_data asic3_mmc_data = { .hclk = 24576000, + .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, .set_pwr= asic3_mmc_pwr, .set_clk_div= asic3_mmc_clk_div, }; -- 2.11.0
[PATCH] dmaengine: pxa: add a default requestor policy
As what former drcmr -1 value meant, add a this as a default to each channel, ie. that by default no requestor line is used. This is specifically used for network drivers smc91x and smc911x, and needed for their port to slave maps. Cc: Arnd Bergmann Signed-off-by: Robert Jarzmik --- drivers/dma/pxa_dma.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/dma/pxa_dma.c b/drivers/dma/pxa_dma.c index 9505334f9c6e..4edc8f927641 100644 --- a/drivers/dma/pxa_dma.c +++ b/drivers/dma/pxa_dma.c @@ -762,6 +762,8 @@ static void pxad_free_chan_resources(struct dma_chan *dchan) dma_pool_destroy(chan->desc_pool); chan->desc_pool = NULL; + chan->drcmr = (u32)-1; + chan->prio = PXAD_PRIO_LOWEST; } static void pxad_free_desc(struct virt_dma_desc *vd) @@ -1386,6 +1388,8 @@ static int pxad_init_dmadev(struct platform_device *op, c = devm_kzalloc(&op->dev, sizeof(*c), GFP_KERNEL); if (!c) return -ENOMEM; + c->drcmr = (u32)-1; + c->prio = PXAD_PRIO_LOWEST; c->vc.desc_free = pxad_free_desc; vchan_init(&c->vc, &pdev->slave); init_waitqueue_head(&c->wq_state); -- 2.11.0
Re: [PATCH v2 02/13] ARM: pxa: add dma slave map
Robert Jarzmik writes: > In order to remove the specific knowledge of the dma mapping from PXA > drivers, add a default slave map for pxa architectures. > > This is the first step, and once all drivers are converted, > pxad_filter_fn() will be made static, and the DMA resources removed from > device.c. > > Signed-off-by: Robert Jarzmik > Reported-by: Arnd Bergmann > + { "smc911x.0", "rx", PDMA_FILTER_PARAM(LOWEST, -1) }, > + { "smc911x.0", "tx", PDMA_FILTER_PARAM(LOWEST, -1) }, > + { "smc91x.0", "data", PDMA_FILTER_PARAM(LOWEST, -1) }, Hi Arnd, Actually after rereading this, I realised that I completely forgot your former comment about having a NULL parameter for network devices (as there is no requestor behind). I will cook it up for v3 ... that will be a minor change in this patch (hence I'll keep any Ack), but for patches 0006 and 0007, things will change, and another patch for Vinod will appear. Cheers. -- Robert
Re: [PATCH v2 05/13] mtd: rawnand: marvell: remove the dmaengine compat need
Miquel Raynal writes: > Hi Robert, Actually, a last time error slipped in this patch here (I'm really doing poorly on the copy paste side): + nfc->dma_chan = dma_request_slave_channel(&nfc->dev, "data"); This should rather be : + nfc->dma_chan = dma_request_slave_channel(nfc->dev, "data"); Would you grant your ack for the next iteration with this change folded in ? Cheers. -- Robert