ARM: PXA multiplatform support
Subsystems (24)
v2 cover ARM: PXA multiplatform support
From: Arnd Bergmann <[email protected]>
This revisits a series I sent a few years ago:
https://lore.kernel.org/lkml/[email protected]/
All the other ARMv5 conversions are under way now, with OMAP1 being the only one still not in linux-next yet, and PXA completing the set.
Most of the patches are unchanged from before, furtunately the PXA code is fairly stable. I addressed Robert's comments, pulled in two patches from Dmitry, and added the last a the final four patches to finish off the multiplatform conversion.
I hope someone is left to test these on PXA: if this works, I'd like to merge it for 5.19. A git tree with these is avaialable for testing at
https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git/log/?h=pxa-multiplatform-5.18
Arnd
Arnd Bergmann (46):
ARM: pxa: split mach/generic.h
ARM: pxa: make mainstone.h private
ARM: pxa: make mach/regs-uart.h private
ARM: pxa: remove mach/dma.h
ARM: pxa: split up mach/hardware.h
ARM: pxa: stop using mach/bitfield.h
ARM: pxa: move mach/sound.h to linux/platform_data/
ARM: pxa: move regs-lcd.h into driver
watchdog: sa1100: use platform device registration
ARM: pxa: pxa2xx-ac97-lib: use IRQ resource
ARM: pxa: move pcmcia board data into mach-pxa
ARM: pxa: make addr-map.h header local
ARM: pxa: use pdev resource for palmld mmio
ARM: pxa: maybe fix gpio lookup tables
ARM: pxa: tosa: use gpio descriptor for audio
ARM: pxa: poodle: use platform data for poodle asoc driver
ARM: pxa: corgi: use gpio descriptors for audio
ARM: pxa: hx4700: use gpio descriptors for audio
ARM: pxa: lubbock: pass udc irqs as resource
ARM: pxa: spitz: use gpio descriptors for audio
ARM: pxa: eseries: use gpio lookup for audio
ARM: pxa: z2: use gpio lookup for audio device
ARM: pxa: magician: use platform driver for audio
ARM: pxa: mainstone-wm97xx: use gpio lookup table
ARM: pxa: zylonite: use gpio lookup instead mfp header
input: touchscreen: mainstone: fix pxa2xx+pxa3xx configuration
input: touchscreen: mainstone: sync with zylonite driver
Input: touchscreen: use wrapper for pxa2xx ac97 registers
ASoC: pxa: use pdev resource for FIFO regs
ASoC: pxa: ac97: use normal MMIO accessors
ASoC: pxa: i2s: use normal MMIO accessors
ARM: pxa: pcmcia: move smemc configuration back to arch
ARM: pxa: remove get_clk_frequency_khz()
cpufreq: pxa3: move clk register access to clk driver
ARM: pxa: move smemc register access from clk to platform
ARM: pxa: move clk register definitions to driver
power: tosa: simplify probe function
ARM: pxa: tosa: use gpio lookup for battery
ARM: pxa: remove unused mach/bitfield.h
ARM: mmp: remove tavorevb board support
ARM: mmp: rename pxa_register_device
ARM: pxa: move plat-pxa to drivers/soc/
ARM: PXA: fix multi-cpu build of xsc3
ARM: pxa: move mach/*.h to mach-pxa/
ARM: pxa: remove support for MTD_XIP
ARM: pxa: convert to multiplatform
Dmitry Torokhov (2):
Input: wm97xx - switch to using threaded IRQ
Input: wm97xx - get rid of irq_enable method in wm97xx_mach_ops
arch/arm/Kconfig | 22 --
arch/arm/Makefile | 1 -
arch/arm/common/locomo.c | 1 -
arch/arm/common/sa1111.c | 5 +-
arch/arm/include/asm/hardware/sa1111.h | 2 -
arch/arm/mach-mmp/Kconfig | 10 +-
arch/arm/mach-mmp/Makefile | 1 -
arch/arm/mach-mmp/devices.c | 2 +-
arch/arm/mach-mmp/devices.h | 10 +-
arch/arm/mach-mmp/mfp.h | 2 +-
arch/arm/mach-mmp/mmp2.h | 48 ++---
arch/arm/mach-mmp/pxa168.h | 60 +++---
arch/arm/mach-mmp/pxa910.h | 38 ++--
arch/arm/mach-mmp/tavorevb.c | 113 -----------
arch/arm/mach-mmp/ttc_dkb.c | 6 +-
arch/arm/mach-pxa/Kconfig | 14 ++
arch/arm/mach-pxa/Makefile | 18 +-
arch/arm/mach-pxa/Makefile.boot | 3 -
.../mach-pxa/{include/mach => }/addr-map.h | 0
arch/arm/mach-pxa/am300epd.c | 2 +-
.../arm/mach-pxa/balloon3-pcmcia.c | 4 +-
arch/arm/mach-pxa/balloon3.c | 4 +-
.../mach-pxa/{include/mach => }/balloon3.h | 0
arch/arm/mach-pxa/cm-x300.c | 12 +-
arch/arm/mach-pxa/colibri-evalboard.c | 1 -
.../arm/mach-pxa/colibri-pcmcia.c | 2 +-
arch/arm/mach-pxa/colibri-pxa270-income.c | 1 -
arch/arm/mach-pxa/colibri-pxa270.c | 2 +-
arch/arm/mach-pxa/colibri-pxa300.c | 3 +-
arch/arm/mach-pxa/colibri-pxa320.c | 2 +-
arch/arm/mach-pxa/colibri-pxa3xx.c | 3 +-
arch/arm/mach-pxa/colibri.h | 2 +-
arch/arm/mach-pxa/corgi.c | 23 ++-
arch/arm/mach-pxa/{include/mach => }/corgi.h | 0
arch/arm/mach-pxa/corgi_pm.c | 5 +-
arch/arm/mach-pxa/csb726.c | 5 +-
arch/arm/mach-pxa/csb726.h | 2 +-
arch/arm/mach-pxa/devices.c | 17 +-
.../arm/mach-pxa/e740-pcmcia.c | 4 +-
.../{include/mach => }/eseries-gpio.h | 0
arch/arm/mach-pxa/eseries.c | 36 +++-
arch/arm/mach-pxa/ezx.c | 1 -
arch/arm/mach-pxa/generic.c | 62 ++++--
arch/arm/mach-pxa/generic.h | 9 -
arch/arm/mach-pxa/gumstix.c | 1 -
arch/arm/mach-pxa/gumstix.h | 2 +-
arch/arm/mach-pxa/h5000.c | 2 +-
.../arm/mach-pxa/hx4700-pcmcia.c | 4 +-
arch/arm/mach-pxa/hx4700.c | 18 +-
arch/arm/mach-pxa/{include/mach => }/hx4700.h | 0
arch/arm/mach-pxa/idp.c | 2 -
arch/arm/mach-pxa/idp.h | 2 +-
arch/arm/mach-pxa/include/mach/bitfield.h | 114 -----------
arch/arm/mach-pxa/include/mach/dma.h | 17 --
arch/arm/mach-pxa/include/mach/generic.h | 1 -
arch/arm/mach-pxa/include/mach/mtd-xip.h | 36 ----
arch/arm/mach-pxa/include/mach/uncompress.h | 70 -------
arch/arm/mach-pxa/irq.c | 5 +-
arch/arm/mach-pxa/{include/mach => }/irqs.h | 0
arch/arm/mach-pxa/littleton.c | 1 -
arch/arm/mach-pxa/lpd270.c | 6 +-
arch/arm/mach-pxa/lubbock.c | 17 +-
.../arm/mach-pxa/{include/mach => }/lubbock.h | 4 +-
arch/arm/mach-pxa/magician.c | 56 +++++-
.../mach-pxa/{include/mach => }/magician.h | 2 +-
arch/arm/mach-pxa/mainstone.c | 17 +-
.../mach-pxa/{include/mach => }/mainstone.h | 4 +-
arch/arm/mach-pxa/mfp-pxa2xx.c | 3 +-
arch/arm/mach-pxa/mfp-pxa2xx.h | 2 +-
arch/arm/mach-pxa/mfp-pxa3xx.c | 3 +-
arch/arm/mach-pxa/mfp-pxa3xx.h | 2 +-
arch/arm/mach-pxa/{include/mach => }/mfp.h | 2 +-
arch/arm/mach-pxa/mioa701.c | 4 +-
arch/arm/mach-pxa/mxm8x10.c | 8 +-
arch/arm/mach-pxa/palm27x.c | 2 +-
.../arm/mach-pxa/palmld-pcmcia.c | 5 +-
arch/arm/mach-pxa/palmld.c | 23 ++-
arch/arm/mach-pxa/{include/mach => }/palmld.h | 0
arch/arm/mach-pxa/palmt5.c | 11 +-
arch/arm/mach-pxa/palmt5.h | 2 +-
.../arm/mach-pxa/palmtc-pcmcia.c | 4 +-
arch/arm/mach-pxa/palmtc.c | 4 +-
arch/arm/mach-pxa/{include/mach => }/palmtc.h | 0
arch/arm/mach-pxa/palmte2.c | 2 +-
arch/arm/mach-pxa/palmtreo.c | 4 +-
.../arm/mach-pxa/palmtx-pcmcia.c | 4 +-
arch/arm/mach-pxa/palmtx.c | 13 +-
arch/arm/mach-pxa/{include/mach => }/palmtx.h | 0
arch/arm/mach-pxa/palmz72.c | 2 +-
arch/arm/mach-pxa/pcm027.h | 2 +-
arch/arm/mach-pxa/pcm990-baseboard.c | 2 +-
arch/arm/mach-pxa/pcm990_baseboard.h | 2 +-
arch/arm/mach-pxa/poodle.c | 31 ++-
arch/arm/mach-pxa/{include/mach => }/poodle.h | 2 -
arch/arm/mach-pxa/pxa-dt.c | 2 +-
arch/arm/mach-pxa/pxa-regs.h | 52 +++++
arch/arm/mach-pxa/pxa25x.c | 12 +-
arch/arm/mach-pxa/pxa25x.h | 6 +-
arch/arm/mach-pxa/pxa27x-udc.h | 2 +
arch/arm/mach-pxa/pxa27x.c | 12 +-
arch/arm/mach-pxa/pxa27x.h | 6 +-
.../mach-pxa/{include/mach => }/pxa2xx-regs.h | 47 +----
arch/arm/mach-pxa/pxa2xx.c | 30 ++-
arch/arm/mach-pxa/pxa300.c | 1 +
arch/arm/mach-pxa/pxa320.c | 1 +
.../mach-pxa/{include/mach => }/pxa3xx-regs.h | 71 +------
arch/arm/mach-pxa/pxa3xx-ulpi.c | 2 +-
arch/arm/mach-pxa/pxa3xx.c | 19 +-
arch/arm/mach-pxa/pxa3xx.h | 6 +-
arch/arm/mach-pxa/pxa930.c | 1 +
.../mach-pxa/{include/mach => }/regs-ost.h | 4 +-
arch/arm/mach-pxa/regs-rtc.h | 2 +-
arch/arm/mach-pxa/regs-u2d.h | 2 -
.../mach-pxa/{include/mach => }/regs-uart.h | 2 +
arch/arm/mach-pxa/reset.c | 9 +-
arch/arm/mach-pxa/{include/mach => }/reset.h | 2 +-
arch/arm/mach-pxa/sharpsl_pm.c | 2 +-
arch/arm/mach-pxa/sleep.S | 9 +-
arch/arm/mach-pxa/smemc.c | 13 +-
arch/arm/mach-pxa/{include/mach => }/smemc.h | 0
arch/arm/mach-pxa/spitz.c | 37 +++-
arch/arm/mach-pxa/{include/mach => }/spitz.h | 0
arch/arm/mach-pxa/spitz_pm.c | 3 +-
arch/arm/mach-pxa/standby.S | 3 +-
arch/arm/mach-pxa/tosa.c | 47 ++++-
arch/arm/mach-pxa/{include/mach => }/tosa.h | 0
.../arm/mach-pxa/trizeps4-pcmcia.c | 6 +-
arch/arm/mach-pxa/trizeps4.c | 6 +-
.../mach-pxa/{include/mach => }/trizeps4.h | 1 +
.../arm/mach-pxa/viper-pcmcia.c | 6 +-
.../arm/mach-pxa/viper-pcmcia.h | 0
arch/arm/mach-pxa/viper.c | 8 +-
.../arm/mach-pxa/vpac270-pcmcia.c | 4 +-
arch/arm/mach-pxa/vpac270.c | 4 +-
.../arm/mach-pxa/{include/mach => }/vpac270.h | 0
arch/arm/mach-pxa/xcep.c | 4 +-
arch/arm/mach-pxa/z2.c | 13 +-
arch/arm/mach-pxa/{include/mach => }/z2.h | 0
arch/arm/mach-pxa/zeus.c | 8 +-
arch/arm/mach-pxa/zylonite.c | 34 +++-
arch/arm/mach-pxa/zylonite.h | 2 +
arch/arm/mach-pxa/zylonite_pxa300.c | 1 +
arch/arm/mach-pxa/zylonite_pxa320.c | 1 +
arch/arm/mach-sa1100/generic.c | 6 +-
arch/arm/mach-sa1100/include/mach/reset.h | 1 -
arch/arm/mm/copypage-xsc3.c | 2 +
arch/mips/alchemy/devboards/db1300.c | 9 -
drivers/ata/pata_palmld.c | 3 +-
drivers/clk/pxa/clk-pxa.c | 8 +-
drivers/clk/pxa/clk-pxa.h | 9 +-
drivers/clk/pxa/clk-pxa25x.c | 46 ++---
drivers/clk/pxa/clk-pxa27x.c | 68 +++----
drivers/clk/pxa/clk-pxa2xx.h | 58 ++++++
drivers/clk/pxa/clk-pxa3xx.c | 139 +++++++++++--
drivers/cpufreq/pxa2xx-cpufreq.c | 6 +-
drivers/cpufreq/pxa3xx-cpufreq.c | 65 +++---
drivers/input/mouse/pxa930_trkball.c | 1 -
drivers/input/touchscreen/Kconfig | 2 +
drivers/input/touchscreen/mainstone-wm97xx.c | 130 ++++++------
drivers/input/touchscreen/wm97xx-core.c | 42 +---
drivers/input/touchscreen/zylonite-wm97xx.c | 43 ++--
drivers/leds/leds-locomo.c | 1 -
drivers/mmc/host/pxamci.c | 2 +-
drivers/mtd/maps/pxa2xx-flash.c | 2 -
drivers/pcmcia/Makefile | 13 --
drivers/pcmcia/pxa2xx_base.c | 48 ++---
drivers/pcmcia/pxa2xx_sharpsl.c | 3 +-
drivers/pcmcia/sa1111_generic.c | 1 -
drivers/pcmcia/sa1111_lubbock.c | 1 -
drivers/pcmcia/soc_common.c | 2 -
drivers/pcmcia/soc_common.h | 120 +----------
drivers/power/supply/tosa_battery.c | 189 ++++++++++--------
drivers/rtc/rtc-pxa.c | 2 -
drivers/soc/Kconfig | 1 +
drivers/soc/Makefile | 1 +
.../arm/plat-pxa => drivers/soc/pxa}/Kconfig | 5 +-
.../arm/plat-pxa => drivers/soc/pxa}/Makefile | 4 -
{arch/arm/plat-pxa => drivers/soc/pxa}/mfp.c | 2 +-
{arch/arm/plat-pxa => drivers/soc/pxa}/ssp.c | 0
drivers/usb/gadget/udc/pxa25x_udc.c | 37 ++--
drivers/usb/gadget/udc/pxa25x_udc.h | 7 +-
drivers/usb/host/ohci-pxa27x.c | 3 +-
.../video/fbdev/pxa3xx-regs.h | 24 +--
drivers/video/fbdev/pxafb.c | 4 +-
drivers/watchdog/sa1100_wdt.c | 88 +++++---
include/linux/clk/pxa.h | 16 ++
include/linux/platform_data/asoc-poodle.h | 16 ++
.../linux/platform_data/asoc-pxa.h | 4 +-
include/linux/platform_data/video-pxafb.h | 22 +-
.../hardware.h => include/linux/soc/pxa/cpu.h | 61 +-----
.../plat => include/linux/soc/pxa}/mfp.h | 6 +-
include/linux/soc/pxa/smemc.h | 13 ++
include/linux/wm97xx.h | 4 -
include/pcmcia/soc_common.h | 125 ++++++++++++
include/sound/pxa2xx-lib.h | 4 +
sound/arm/pxa2xx-ac97-lib.c | 145 +++++++++-----
.../arm/pxa2xx-ac97-regs.h | 42 ++--
sound/arm/pxa2xx-ac97.c | 3 +-
sound/soc/pxa/corgi.c | 43 ++--
sound/soc/pxa/e740_wm9705.c | 37 ++--
sound/soc/pxa/e750_wm9705.c | 33 ++-
sound/soc/pxa/e800_wm9712.c | 33 ++-
sound/soc/pxa/em-x270.c | 2 +-
sound/soc/pxa/hx4700.c | 34 ++--
sound/soc/pxa/magician.c | 141 ++++---------
sound/soc/pxa/mioa701_wm9713.c | 2 +-
sound/soc/pxa/palm27x.c | 2 +-
sound/soc/pxa/poodle.c | 51 ++---
sound/soc/pxa/pxa2xx-ac97.c | 24 ++-
sound/soc/pxa/pxa2xx-i2s.c | 112 ++++++-----
sound/soc/pxa/spitz.c | 58 +++---
sound/soc/pxa/tosa.c | 18 +-
sound/soc/pxa/z2.c | 8 +-
213 files changed, 1902 insertions(+), 1936 deletions(-)
delete mode 100644 arch/arm/mach-mmp/tavorevb.c
delete mode 100644 arch/arm/mach-pxa/Makefile.boot
rename arch/arm/mach-pxa/{include/mach => }/addr-map.h (100%)
rename drivers/pcmcia/pxa2xx_balloon3.c => arch/arm/mach-pxa/balloon3-pcmcia.c (98%)
rename arch/arm/mach-pxa/{include/mach => }/balloon3.h (100%)
rename drivers/pcmcia/pxa2xx_colibri.c => arch/arm/mach-pxa/colibri-pcmcia.c (99%)
rename arch/arm/mach-pxa/{include/mach => }/corgi.h (100%)
rename drivers/pcmcia/pxa2xx_e740.c => arch/arm/mach-pxa/e740-pcmcia.c (98%)
rename arch/arm/mach-pxa/{include/mach => }/eseries-gpio.h (100%)
rename drivers/pcmcia/pxa2xx_hx4700.c => arch/arm/mach-pxa/hx4700-pcmcia.c (98%)
rename arch/arm/mach-pxa/{include/mach => }/hx4700.h (100%)
delete mode 100644 arch/arm/mach-pxa/include/mach/bitfield.h
delete mode 100644 arch/arm/mach-pxa/include/mach/dma.h
delete mode 100644 arch/arm/mach-pxa/include/mach/generic.h
delete mode 100644 arch/arm/mach-pxa/include/mach/mtd-xip.h
delete mode 100644 arch/arm/mach-pxa/include/mach/uncompress.h
rename arch/arm/mach-pxa/{include/mach => }/irqs.h (100%)
rename arch/arm/mach-pxa/{include/mach => }/lubbock.h (95%)
rename arch/arm/mach-pxa/{include/mach => }/magician.h (99%)
rename arch/arm/mach-pxa/{include/mach => }/mainstone.h (98%)
rename arch/arm/mach-pxa/{include/mach => }/mfp.h (91%)
rename drivers/pcmcia/pxa2xx_palmld.c => arch/arm/mach-pxa/palmld-pcmcia.c (98%)
rename arch/arm/mach-pxa/{include/mach => }/palmld.h (100%)
rename drivers/pcmcia/pxa2xx_palmtc.c => arch/arm/mach-pxa/palmtc-pcmcia.c (98%)
rename arch/arm/mach-pxa/{include/mach => }/palmtc.h (100%)
rename drivers/pcmcia/pxa2xx_palmtx.c => arch/arm/mach-pxa/palmtx-pcmcia.c (98%)
rename arch/arm/mach-pxa/{include/mach => }/palmtx.h (100%)
rename arch/arm/mach-pxa/{include/mach => }/poodle.h (98%)
create mode 100644 arch/arm/mach-pxa/pxa-regs.h
rename arch/arm/mach-pxa/{include/mach => }/pxa2xx-regs.h (76%)
rename arch/arm/mach-pxa/{include/mach => }/pxa3xx-regs.h (61%)
rename arch/arm/mach-pxa/{include/mach => }/regs-ost.h (94%)
rename arch/arm/mach-pxa/{include/mach => }/regs-uart.h (99%)
rename arch/arm/mach-pxa/{include/mach => }/reset.h (92%)
rename arch/arm/mach-pxa/{include/mach => }/smemc.h (100%)
rename arch/arm/mach-pxa/{include/mach => }/spitz.h (100%)
rename arch/arm/mach-pxa/{include/mach => }/tosa.h (100%)
rename drivers/pcmcia/pxa2xx_trizeps4.c => arch/arm/mach-pxa/trizeps4-pcmcia.c (98%)
rename arch/arm/mach-pxa/{include/mach => }/trizeps4.h (99%)
rename drivers/pcmcia/pxa2xx_viper.c => arch/arm/mach-pxa/viper-pcmcia.c (97%)
rename include/linux/platform_data/pcmcia-pxa2xx_viper.h => arch/arm/mach-pxa/viper-pcmcia.h (100%)
rename drivers/pcmcia/pxa2xx_vpac270.c => arch/arm/mach-pxa/vpac270-pcmcia.c (98%)
rename arch/arm/mach-pxa/{include/mach => }/vpac270.h (100%)
rename arch/arm/mach-pxa/{include/mach => }/z2.h (100%)
create mode 100644 drivers/clk/pxa/clk-pxa2xx.h
rename {arch/arm/plat-pxa => drivers/soc/pxa}/Kconfig (83%)
rename {arch/arm/plat-pxa => drivers/soc/pxa}/Makefile (51%)
rename {arch/arm/plat-pxa => drivers/soc/pxa}/mfp.c (99%)
rename {arch/arm/plat-pxa => drivers/soc/pxa}/ssp.c (100%)
rename arch/arm/mach-pxa/include/mach/regs-lcd.h => drivers/video/fbdev/pxa3xx-regs.h (90%)
create mode 100644 include/linux/clk/pxa.h
create mode 100644 include/linux/platform_data/asoc-poodle.h
rename arch/arm/mach-pxa/include/mach/audio.h => include/linux/platform_data/asoc-pxa.h (93%)
rename arch/arm/mach-pxa/include/mach/hardware.h => include/linux/soc/pxa/cpu.h (75%)
rename {arch/arm/plat-pxa/include/plat => include/linux/soc/pxa}/mfp.h (98%)
create mode 100644 include/linux/soc/pxa/smemc.h
create mode 100644 include/pcmcia/soc_common.h
rename arch/arm/mach-pxa/include/mach/regs-ac97.h => sound/arm/pxa2xx-ac97-regs.h (71%)Signature · 39 lines
2.29.2 Cc: Daniel Mack <[email protected]> Cc: Haojian Zhuang <[email protected]> Cc: Robert Jarzmik <[email protected]> Cc: Marek Vasut <[email protected]> Cc: Philipp Zabel <[email protected]> Cc: Lubomir Rintel <[email protected]> Cc: Paul Parsons <[email protected]> Cc: Tomas Cech <[email protected]> Cc: Sergey Lapin <[email protected]> Cc: Thomas Bogendoerfer <[email protected]> Cc: Michael Turquette <[email protected]> Cc: Stephen Boyd <[email protected]> Cc: "Rafael J. Wysocki" <[email protected]> Cc: Viresh Kumar <[email protected]> Cc: Dmitry Torokhov <[email protected]> Cc: Ulf Hansson <[email protected]> Cc: Dominik Brodowski <[email protected]> Cc: Helge Deller <[email protected]> Cc: Mark Brown <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Linus Walleij <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected]
PATCH v2 1/48 ARM: pxa: split mach/generic.h
From: Arnd Bergmann <[email protected]>
Only one declaration from this header is actually used in drivers, so move that one into the global location and leave everything else private.
--- arch/arm/mach-pxa/generic.h | 6 +----- arch/arm/mach-pxa/include/mach/generic.h | 6 +++++- 2 files changed, 6 insertions(+), 6 deletions(-)
arch/arm/mach-pxa/generic.h +1 -5
@@ -7,6 +7,7 @@*/ #include <linux/reboot.h> +#include <mach/generic.h> struct irq_data ;
@@ -71,8 +72,3 @@ extern unsigned pxa25x_get_clk_frequency_khz(int);#define pxa27x_get_clk_frequency_khz (x) (0)#endif -#ifdef CONFIG_PXA3xx -extern unsigned pxa3xx_get_clk_frequency_khz (int ); -#else -#define pxa3xx_get_clk_frequency_khz (x) (0) -#endif
arch/arm/mach-pxa/include/mach/generic.h +5 -1
@@ -1 +1,5 @@ -#include "../../generic.h" +#ifdef CONFIG_PXA3xx +extern unsigned pxa3xx_get_clk_frequency_khz (int ); +#else +#define pxa3xx_get_clk_frequency_khz (x) (0) +#endif
Signature · 1 line
2.29.2
PATCH v2 2/48 ARM: pxa: make mainstone.h private
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
No driver includes this any more, so don't expose it globally.
---
arch/arm/mach-pxa/mainstone.c | 2 +-
arch/arm/mach-pxa/{include/mach => }/mainstone.h | 2 --
2 files changed, 1 insertion(+), 3 deletions(-)
rename arch/arm/mach-pxa/{include/mach => }/mainstone.h (99%)arch/arm/mach-pxa/mainstone.c +1 -1
@@ -45,7 +45,7 @@#include <asm/mach/flash.h> #include "pxa27x.h" -#include <mach/mainstone.h> +#include "mainstone.h" #include <mach/audio.h> #include <linux/platform_data/video-pxafb.h> #include <linux/platform_data/mmc-pxamci.h>
arch/arm/mach-pxa/mainstone.h renamed from arch/arm/mach-pxa/include/mach/mainstone.h +0 -2
@@ -1,7 +1,5 @@/* SPDX-License-Identifier: GPL-2.0-only */ /* -* arch/arm/mach-pxa/include/mach/mainstone.h -* * Author: Nicolas Pitre * Created: Nov 14, 2002 * Copyright: MontaVista Software Inc.
Signature · 1 line
2.29.2
PATCH v2 3/48 ARM: pxa: make mach/regs-uart.h private
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
This is not used by any drivers, so make it private to the platform.
---
arch/arm/mach-pxa/{include/mach => }/regs-uart.h | 0
arch/arm/mach-pxa/viper.c | 2 +-
arch/arm/mach-pxa/zeus.c | 2 +-
3 files changed, 2 insertions(+), 2 deletions(-)
rename arch/arm/mach-pxa/{include/mach => }/regs-uart.h (100%)arch/arm/mach-pxa/regs-uart.h renamed from arch/arm/mach-pxa/include/mach/regs-uart.h +0 -0
arch/arm/mach-pxa/viper.c +1 -1
@@ -48,7 +48,7 @@#include "pxa25x.h" #include <mach/audio.h> #include <linux/platform_data/video-pxafb.h> -#include <mach/regs-uart.h> +#include "regs-uart.h" #include <linux/platform_data/pcmcia-pxa2xx_viper.h> #include "viper.h"
arch/arm/mach-pxa/zeus.c +1 -1
@@ -39,7 +39,7 @@#include "pxa27x.h" #include "devices.h" -#include <mach/regs-uart.h> +#include "regs-uart.h" #include <linux/platform_data/usb-ohci-pxa27x.h> #include <linux/platform_data/mmc-pxamci.h> #include "pxa27x-udc.h"
Signature · 1 line
2.29.2
PATCH v2 4/48 ARM: pxa: remove mach/dma.h
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
The file no longer contains anything useful, so remove it.
--- arch/arm/mach-pxa/include/mach/dma.h | 17 ----------------- arch/arm/mach-pxa/pxa25x.c | 1 - arch/arm/mach-pxa/pxa27x.c | 1 - arch/arm/mach-pxa/pxa3xx.c | 1 - 4 files changed, 20 deletions(-) delete mode 100644 arch/arm/mach-pxa/include/mach/dma.h
arch/arm/mach-pxa/include/mach/dma.h deleted +0 -17
@@ -1,17 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* -* arch/arm/mach-pxa/include/mach/dma.h -* -* Author: Nicolas Pitre -* Created: Jun 15, 2001 -* Copyright: MontaVista Software, Inc. -*/ -#ifndef __ASM_ARCH_DMA_H -#define __ASM_ARCH_DMA_H - -#include <mach/hardware.h> - -/* DMA Controller Registers Definitions */ -#define DMAC_REGS_VIRT io_p2v(0x40000000) - -#endif /* _ASM_ARCH_DMA_H */
arch/arm/mach-pxa/pxa25x.c +0 -1
@@ -34,7 +34,6 @@#include "pxa25x.h" #include <mach/reset.h> #include "pm.h" -#include <mach/dma.h> #include <mach/smemc.h> #include "generic.h"
arch/arm/mach-pxa/pxa27x.c +0 -1
@@ -33,7 +33,6 @@#include <mach/reset.h> #include <linux/platform_data/usb-ohci-pxa27x.h> #include "pm.h" -#include <mach/dma.h> #include <mach/smemc.h> #include "generic.h"
arch/arm/mach-pxa/pxa3xx.c +0 -1
@@ -32,7 +32,6 @@#include <mach/reset.h> #include <linux/platform_data/usb-ohci-pxa27x.h> #include "pm.h" -#include <mach/dma.h> #include <mach/smemc.h> #include <mach/irqs.h>
Signature · 1 line
2.29.2
PATCH v2 5/48 ARM: pxa: split up mach/hardware.h
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
The mach/hardware.h is included in lots of places, and it provides three different things on pxa:
- the cpu_is_pxa* macros
- an indirect inclusion of mach/addr-map.h
- the __REG() and io_pv2() helper macros
Split it up into separate <linux/soc/pxa/cpu.h> and mach/pxa-regs.h headers, then change all the files that use mach/hardware.h to include the exact set of those three headers that they actually need, allowing for further more targeted cleanup.
linux/soc/pxa/cpu.h can remain permanently exported and is now in a global location along with similar headers. pxa-regs.h and addr-map.h are only used in a very small number of drivers now and can be moved to arch/arm/mach-pxa/ directly when those drivers are to pass the necessary data as resources.
--- arch/arm/common/locomo.c | 1 - arch/arm/common/sa1111.c | 5 +- arch/arm/mach-pxa/cm-x300.c | 2 + arch/arm/mach-pxa/colibri-evalboard.c | 1 - arch/arm/mach-pxa/colibri-pxa270-income.c | 1 - arch/arm/mach-pxa/colibri-pxa300.c | 1 + arch/arm/mach-pxa/colibri-pxa3xx.c | 1 - arch/arm/mach-pxa/corgi.c | 1 - arch/arm/mach-pxa/corgi_pm.c | 1 - arch/arm/mach-pxa/csb726.c | 1 + arch/arm/mach-pxa/devices.c | 2 +- arch/arm/mach-pxa/ezx.c | 1 - arch/arm/mach-pxa/generic.c | 3 +- arch/arm/mach-pxa/gumstix.c | 1 - arch/arm/mach-pxa/hx4700.c | 2 +- arch/arm/mach-pxa/idp.c | 1 - arch/arm/mach-pxa/include/mach/pxa-regs.h | 52 ++++++++++++++++ arch/arm/mach-pxa/include/mach/pxa2xx-regs.h | 2 +- arch/arm/mach-pxa/include/mach/pxa3xx-regs.h | 2 +- arch/arm/mach-pxa/include/mach/regs-ac97.h | 2 +- arch/arm/mach-pxa/include/mach/regs-ost.h | 2 +- arch/arm/mach-pxa/include/mach/trizeps4.h | 1 + arch/arm/mach-pxa/irq.c | 3 +- arch/arm/mach-pxa/littleton.c | 1 - arch/arm/mach-pxa/lpd270.c | 2 +- arch/arm/mach-pxa/lubbock.c | 1 - arch/arm/mach-pxa/magician.c | 2 +- arch/arm/mach-pxa/mainstone.c | 2 +- arch/arm/mach-pxa/mfp-pxa2xx.c | 1 + arch/arm/mach-pxa/mfp-pxa3xx.c | 1 - arch/arm/mach-pxa/poodle.c | 1 - arch/arm/mach-pxa/pxa-regs.h | 1 + arch/arm/mach-pxa/pxa25x.c | 3 +- arch/arm/mach-pxa/pxa25x.h | 2 +- arch/arm/mach-pxa/pxa27x-udc.h | 2 + arch/arm/mach-pxa/pxa27x.c | 3 +- arch/arm/mach-pxa/pxa27x.h | 2 +- arch/arm/mach-pxa/pxa2xx.c | 1 - arch/arm/mach-pxa/pxa300.c | 1 + arch/arm/mach-pxa/pxa320.c | 1 + arch/arm/mach-pxa/pxa3xx-ulpi.c | 2 +- arch/arm/mach-pxa/pxa3xx.c | 3 +- arch/arm/mach-pxa/pxa3xx.h | 2 +- arch/arm/mach-pxa/pxa930.c | 1 + arch/arm/mach-pxa/regs-rtc.h | 2 +- arch/arm/mach-pxa/regs-uart.h | 2 + arch/arm/mach-pxa/sleep.S | 1 - arch/arm/mach-pxa/smemc.c | 2 +- arch/arm/mach-pxa/spitz_pm.c | 1 - arch/arm/mach-pxa/standby.S | 1 - arch/arm/mach-pxa/xcep.c | 2 +- arch/arm/mach-pxa/zylonite.c | 1 + arch/arm/mach-pxa/zylonite.h | 2 + arch/arm/mach-pxa/zylonite_pxa300.c | 1 + arch/arm/mach-pxa/zylonite_pxa320.c | 1 + drivers/clk/pxa/clk-pxa3xx.c | 1 + drivers/cpufreq/pxa2xx-cpufreq.c | 1 + drivers/cpufreq/pxa3xx-cpufreq.c | 1 + drivers/input/mouse/pxa930_trkball.c | 1 - drivers/input/touchscreen/zylonite-wm97xx.c | 2 +- drivers/leds/leds-locomo.c | 1 - drivers/mmc/host/pxamci.c | 2 +- drivers/mtd/maps/pxa2xx-flash.c | 2 - drivers/pcmcia/pxa2xx_base.c | 2 +- drivers/pcmcia/pxa2xx_sharpsl.c | 1 - drivers/pcmcia/sa1111_generic.c | 1 - drivers/pcmcia/sa1111_lubbock.c | 1 - drivers/pcmcia/soc_common.c | 2 - drivers/rtc/rtc-pxa.c | 2 - drivers/usb/host/ohci-pxa27x.c | 3 +- drivers/video/fbdev/pxafb.c | 2 +- drivers/watchdog/sa1100_wdt.c | 1 - .../hardware.h => include/linux/soc/pxa/cpu.h | 61 ++----------------- sound/arm/pxa2xx-ac97-lib.c | 1 + sound/soc/pxa/pxa2xx-ac97.c | 2 +- sound/soc/pxa/pxa2xx-i2s.c | 2 +- sound/soc/pxa/z2.c | 1 - 77 files changed, 116 insertions(+), 117 deletions(-) create mode 100644 arch/arm/mach-pxa/include/mach/pxa-regs.h create mode 100644 arch/arm/mach-pxa/pxa-regs.h rename arch/arm/mach-pxa/include/mach/hardware.h => include/linux/soc/pxa/cpu.h (75%)
arch/arm/common/locomo.c +0 -1
@@ -23,7 +23,6 @@#include <linux/spinlock.h> #include <linux/io.h> -#include <mach/hardware.h> #include <asm/irq.h> #include <asm/mach/irq.h>
arch/arm/common/sa1111.c +4 -1
@@ -26,13 +26,16 @@#include <linux/clk.h> #include <linux/io.h> -#include <mach/hardware.h> #include <asm/mach/irq.h> #include <asm/mach-types.h> #include <linux/sizes.h> #include <asm/hardware/sa1111.h> +#ifdef CONFIG_ARCH_SA1100 +#include <mach/hardware.h> +#endif +/* SA1111 IRQs */ #define IRQ_GPAIN0 (0)#define IRQ_GPAIN1 (1)
arch/arm/mach-pxa/cm-x300.c +2 -0
@@ -40,6 +40,8 @@#include <linux/spi/spi_gpio.h> #include <linux/spi/tdo24m.h> +#include <linux/soc/pxa/cpu.h> +#include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/setup.h>
arch/arm/mach-pxa/colibri-evalboard.c +0 -1
@@ -13,7 +13,6 @@#include <linux/interrupt.h> #include <linux/gpio/machine.h> #include <asm/mach-types.h> -#include <mach/hardware.h> #include <asm/mach/arch.h> #include <linux/i2c.h> #include <linux/platform_data/i2c-pxa.h>
arch/arm/mach-pxa/colibri-pxa270-income.c +0 -1
@@ -25,7 +25,6 @@#include <asm/irq.h> #include <asm/mach-types.h> -#include <mach/hardware.h> #include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/usb-ohci-pxa27x.h> #include "pxa27x.h"
arch/arm/mach-pxa/colibri-pxa300.c +1 -0
@@ -13,6 +13,7 @@#include <linux/platform_device.h> #include <linux/gpio.h> #include <linux/interrupt.h> +#include <linux/soc/pxa/cpu.h> #include <asm/mach-types.h> #include <linux/sizes.h>
arch/arm/mach-pxa/colibri-pxa3xx.c +0 -1
@@ -13,7 +13,6 @@#include <linux/gpio.h> #include <linux/etherdevice.h> #include <asm/mach-types.h> -#include <mach/hardware.h> #include <linux/sizes.h> #include <asm/system_info.h> #include <asm/mach/arch.h>
arch/arm/mach-pxa/corgi.c +0 -1
@@ -39,7 +39,6 @@#include <asm/setup.h> #include <asm/memory.h> #include <asm/mach-types.h> -#include <mach/hardware.h> #include <asm/irq.h> #include <asm/mach/arch.h>
arch/arm/mach-pxa/corgi_pm.c +0 -1
@@ -19,7 +19,6 @@#include <asm/irq.h> #include <asm/mach-types.h> -#include <mach/hardware.h> #include <mach/corgi.h> #include <mach/pxa2xx-regs.h>
arch/arm/mach-pxa/csb726.c +1 -0
@@ -17,6 +17,7 @@#include <asm/mach-types.h> #include <asm/mach/arch.h> +#include "csb726.h" #include "pxa27x.h" #include <linux/platform_data/mmc-pxamci.h>
arch/arm/mach-pxa/devices.c +1 -1
@@ -9,6 +9,7 @@#include <linux/dmaengine.h> #include <linux/spi/pxa2xx_spi.h> #include <linux/platform_data/i2c-pxa.h> +#include <linux/soc/pxa/cpu.h> #include "udc.h" #include <linux/platform_data/usb-pxa3xx-ulpi.h>
@@ -20,7 +21,6 @@#include <linux/platform_data/keypad-pxa27x.h> #include <linux/platform_data/media/camera-pxa.h> #include <mach/audio.h> -#include <mach/hardware.h> #include <linux/platform_data/mmp_dma.h> #include <linux/platform_data/mtd-nand-pxa3xx.h>
arch/arm/mach-pxa/ezx.c +0 -1
@@ -29,7 +29,6 @@#include "pxa27x.h" #include <linux/platform_data/video-pxafb.h> #include <linux/platform_data/usb-ohci-pxa27x.h> -#include <mach/hardware.h> #include <linux/platform_data/keypad-pxa27x.h> #include <linux/platform_data/media/camera-pxa.h>
arch/arm/mach-pxa/generic.c +2 -1
@@ -17,11 +17,12 @@#include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> +#include <linux/soc/pxa/cpu.h> -#include <mach/hardware.h> #include <asm/mach/map.h> #include <asm/mach-types.h> +#include <mach/addr-map.h> #include <mach/irqs.h> #include <mach/reset.h> #include <mach/smemc.h>
arch/arm/mach-pxa/gumstix.c +0 -1
@@ -28,7 +28,6 @@#include <asm/setup.h> #include <asm/memory.h> #include <asm/mach-types.h> -#include <mach/hardware.h> #include <asm/irq.h> #include <linux/sizes.h>
arch/arm/mach-pxa/hx4700.c +1 -1
@@ -36,11 +36,11 @@#include <linux/spi/pxa2xx_spi.h> #include <linux/platform_data/i2c-pxa.h> -#include <mach/hardware.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include "pxa27x.h" +#include <mach/addr-map.h> #include <mach/hx4700.h> #include <linux/platform_data/irda-pxaficp.h>
arch/arm/mach-pxa/idp.c +0 -1
@@ -22,7 +22,6 @@#include <asm/setup.h> #include <asm/memory.h> #include <asm/mach-types.h> -#include <mach/hardware.h> #include <asm/irq.h> #include <asm/mach/arch.h>
arch/arm/mach-pxa/include/mach/pxa-regs.h new file +52 -0
52 lines not on this page · raw message
arch/arm/mach-pxa/include/mach/pxa2xx-regs.h +1 -1
@@ -11,7 +11,7 @@#ifndef __PXA2XX_REGS_H#define __PXA2XX_REGS_H -#include <mach/hardware.h> +#include "pxa-regs.h" /* * Power Manager
arch/arm/mach-pxa/include/mach/pxa3xx-regs.h +1 -1
@@ -10,7 +10,7 @@#ifndef __ASM_ARCH_PXA3XX_REGS_H#define __ASM_ARCH_PXA3XX_REGS_H -#include <mach/hardware.h> +#include "pxa-regs.h" /* * Oscillator Configuration Register (OSCC)
arch/arm/mach-pxa/include/mach/regs-ac97.h +1 -1
@@ -2,7 +2,7 @@#ifndef __ASM_ARCH_REGS_AC97_H#define __ASM_ARCH_REGS_AC97_H -#include <mach/hardware.h> +#include "pxa-regs.h" /* * AC97 Controller registers
arch/arm/mach-pxa/include/mach/regs-ost.h +1 -1
@@ -2,7 +2,7 @@#ifndef __ASM_MACH_REGS_OST_H#define __ASM_MACH_REGS_OST_H -#include <mach/hardware.h> +#include "pxa-regs.h" /* * OS Timer & Match Registers
arch/arm/mach-pxa/include/mach/trizeps4.h +1 -0
@@ -11,6 +11,7 @@#ifndef _TRIPEPS4_H_#define _TRIPEPS4_H_ +#include <mach/addr-map.h> #include "irqs.h" /* PXA_GPIO_TO_IRQ */ /* physical memory regions */
arch/arm/mach-pxa/irq.c +2 -1
@@ -17,13 +17,14 @@#include <linux/irq.h> #include <linux/of_address.h> #include <linux/of_irq.h> +#include <linux/soc/pxa/cpu.h> #include <asm/exception.h> -#include <mach/hardware.h> #include <mach/irqs.h> #include "generic.h" +#include "pxa-regs.h" #define ICIP (0x000)#define ICMR (0x004)
arch/arm/mach-pxa/littleton.c +0 -1
@@ -31,7 +31,6 @@#include <asm/setup.h> #include <asm/memory.h> #include <asm/mach-types.h> -#include <mach/hardware.h> #include <asm/irq.h> #include <asm/mach/arch.h>
arch/arm/mach-pxa/lpd270.c +1 -1
@@ -28,7 +28,6 @@#include <asm/setup.h> #include <asm/memory.h> #include <asm/mach-types.h> -#include <mach/hardware.h> #include <asm/irq.h> #include <linux/sizes.h>
@@ -39,6 +38,7 @@#include "pxa27x.h" #include "lpd270.h" +#include <mach/addr-map.h> #include <mach/audio.h> #include <linux/platform_data/video-pxafb.h> #include <linux/platform_data/mmc-pxamci.h>
arch/arm/mach-pxa/lubbock.c +0 -1
@@ -34,7 +34,6 @@#include <asm/setup.h> #include <asm/memory.h> #include <asm/mach-types.h> -#include <mach/hardware.h> #include <asm/irq.h> #include <linux/sizes.h>
arch/arm/mach-pxa/magician.c +1 -1
@@ -29,12 +29,12 @@#include <linux/regulator/machine.h> #include <linux/platform_data/i2c-pxa.h> -#include <mach/hardware.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/system_info.h> #include "pxa27x.h" +#include <mach/addr-map.h> #include <mach/magician.h> #include <linux/platform_data/video-pxafb.h> #include <linux/platform_data/mmc-pxamci.h>
arch/arm/mach-pxa/mainstone.c +1 -1
@@ -35,7 +35,6 @@#include <asm/setup.h> #include <asm/memory.h> #include <asm/mach-types.h> -#include <mach/hardware.h> #include <asm/irq.h> #include <linux/sizes.h>
@@ -52,6 +51,7 @@#include <linux/platform_data/irda-pxaficp.h> #include <linux/platform_data/usb-ohci-pxa27x.h> #include <linux/platform_data/keypad-pxa27x.h> +#include <mach/addr-map.h> #include <mach/smemc.h> #include "generic.h"
arch/arm/mach-pxa/mfp-pxa2xx.c +1 -0
@@ -16,6 +16,7 @@#include <linux/init.h> #include <linux/io.h> #include <linux/syscore_ops.h> +#include <linux/soc/pxa/cpu.h> #include <mach/pxa2xx-regs.h> #include "mfp-pxa2xx.h"
arch/arm/mach-pxa/mfp-pxa3xx.c +0 -1
@@ -16,7 +16,6 @@#include <linux/io.h> #include <linux/syscore_ops.h> -#include <mach/hardware.h> #include "mfp-pxa3xx.h" #include <mach/pxa3xx-regs.h>
arch/arm/mach-pxa/poodle.c +0 -1
@@ -30,7 +30,6 @@#include <linux/mtd/sharpsl.h> #include <linux/memblock.h> -#include <mach/hardware.h> #include <asm/mach-types.h> #include <asm/irq.h> #include <asm/setup.h>
arch/arm/mach-pxa/pxa-regs.h new file +1 -0
@@ -0,0 +1 @@ +#include <mach/pxa-regs.h>
arch/arm/mach-pxa/pxa25x.c +2 -1
@@ -26,14 +26,15 @@#include <linux/irq.h> #include <linux/irqchip.h> #include <linux/platform_data/mmp_dma.h> +#include <linux/soc/pxa/cpu.h> #include <asm/mach/map.h> #include <asm/suspend.h> -#include <mach/hardware.h> #include <mach/irqs.h> #include "pxa25x.h" #include <mach/reset.h> #include "pm.h" +#include <mach/addr-map.h> #include <mach/smemc.h> #include "generic.h"
arch/arm/mach-pxa/pxa25x.h +1 -1
@@ -2,7 +2,7 @@#ifndef __MACH_PXA25x_H#define __MACH_PXA25x_H -#include <mach/hardware.h> +#include <mach/addr-map.h> #include <mach/pxa2xx-regs.h> #include "mfp-pxa25x.h" #include <mach/irqs.h>
arch/arm/mach-pxa/pxa27x-udc.h +2 -0
@@ -2,6 +2,8 @@#ifndef _ASM_ARCH_PXA27X_UDC_H#define _ASM_ARCH_PXA27X_UDC_H +#include "pxa-regs.h" +#ifdef _ASM_ARCH_PXA25X_UDC_H#error You cannot include both PXA25x and PXA27x UDC support#endif
arch/arm/mach-pxa/pxa27x.c +2 -1
@@ -23,9 +23,9 @@#include <linux/irq.h> #include <linux/platform_data/i2c-pxa.h> #include <linux/platform_data/mmp_dma.h> +#include <linux/soc/pxa/cpu.h> #include <asm/mach/map.h> -#include <mach/hardware.h> #include <asm/irq.h> #include <asm/suspend.h> #include <mach/irqs.h>
@@ -33,6 +33,7 @@#include <mach/reset.h> #include <linux/platform_data/usb-ohci-pxa27x.h> #include "pm.h" +#include <mach/addr-map.h> #include <mach/smemc.h> #include "generic.h"
arch/arm/mach-pxa/pxa27x.h +1 -1
@@ -3,7 +3,7 @@#define __MACH_PXA27x_H#include <linux/suspend.h> -#include <mach/hardware.h> +#include <mach/addr-map.h> #include <mach/pxa2xx-regs.h> #include "mfp-pxa27x.h" #include <mach/irqs.h>
arch/arm/mach-pxa/pxa2xx.c +0 -1
@@ -12,7 +12,6 @@#include <linux/device.h> #include <linux/io.h> -#include <mach/hardware.h> #include <mach/pxa2xx-regs.h> #include "mfp-pxa25x.h" #include <mach/reset.h>
arch/arm/mach-pxa/pxa300.c +1 -0
@@ -14,6 +14,7 @@#include <linux/kernel.h> #include <linux/platform_device.h> #include <linux/io.h> +#include <linux/soc/pxa/cpu.h> #include "pxa300.h"
arch/arm/mach-pxa/pxa320.c +1 -0
@@ -14,6 +14,7 @@#include <linux/kernel.h> #include <linux/platform_device.h> #include <linux/io.h> +#include <linux/soc/pxa/cpu.h> #include "pxa320.h"
arch/arm/mach-pxa/pxa3xx-ulpi.c +1 -1
@@ -21,8 +21,8 @@#include <linux/clk.h> #include <linux/usb.h> #include <linux/usb/otg.h> +#include <linux/soc/pxa/cpu.h> -#include <mach/hardware.h> #include "regs-u2d.h" #include <linux/platform_data/usb-pxa3xx-ulpi.h>
arch/arm/mach-pxa/pxa3xx.c +2 -1
@@ -24,14 +24,15 @@#include <linux/syscore_ops.h> #include <linux/platform_data/i2c-pxa.h> #include <linux/platform_data/mmp_dma.h> +#include <linux/soc/pxa/cpu.h> #include <asm/mach/map.h> #include <asm/suspend.h> -#include <mach/hardware.h> #include <mach/pxa3xx-regs.h> #include <mach/reset.h> #include <linux/platform_data/usb-ohci-pxa27x.h> #include "pm.h" +#include <mach/addr-map.h> #include <mach/smemc.h> #include <mach/irqs.h>
arch/arm/mach-pxa/pxa3xx.h +1 -1
@@ -2,7 +2,7 @@#ifndef __MACH_PXA3XX_H#define __MACH_PXA3XX_H -#include <mach/hardware.h> +#include <mach/addr-map.h> #include <mach/pxa3xx-regs.h> #include <mach/irqs.h>
arch/arm/mach-pxa/pxa930.c +1 -0
@@ -13,6 +13,7 @@#include <linux/irq.h> #include <linux/gpio-pxa.h> #include <linux/platform_device.h> +#include <linux/soc/pxa/cpu.h> #include "pxa930.h"
arch/arm/mach-pxa/regs-rtc.h +1 -1
@@ -2,7 +2,7 @@#ifndef __ASM_MACH_REGS_RTC_H#define __ASM_MACH_REGS_RTC_H -#include <mach/hardware.h> +#include "pxa-regs.h" /* * Real Time Clock
arch/arm/mach-pxa/regs-uart.h +2 -0
@@ -2,6 +2,8 @@#ifndef __ASM_ARCH_REGS_UART_H#define __ASM_ARCH_REGS_UART_H +#include "pxa-regs.h" +/* * UARTs */
arch/arm/mach-pxa/sleep.S +0 -1
@@ -13,7 +13,6 @@ #include <linux/linkage.h> #include <asm/assembler.h> -#include <mach/hardware.h> #include <mach/smemc.h> #include <mach/pxa2xx-regs.h>
arch/arm/mach-pxa/smemc.c +1 -1
@@ -8,8 +8,8 @@#include <linux/init.h> #include <linux/io.h> #include <linux/syscore_ops.h> +#include <linux/soc/pxa/cpu.h> -#include <mach/hardware.h> #include <mach/smemc.h> #ifdef CONFIG_PM
arch/arm/mach-pxa/spitz_pm.c +0 -1
@@ -18,7 +18,6 @@#include <asm/irq.h> #include <asm/mach-types.h> -#include <mach/hardware.h> #include <mach/spitz.h> #include "pxa27x.h"
arch/arm/mach-pxa/standby.S +0 -1
@@ -11,7 +11,6 @@ #include <linux/linkage.h> #include <asm/assembler.h> -#include <mach/hardware.h> #include <mach/pxa2xx-regs.h>
arch/arm/mach-pxa/xcep.c +1 -1
@@ -24,8 +24,8 @@#include <asm/mach/irq.h> #include <asm/mach/map.h> -#include <mach/hardware.h> #include "pxa25x.h" +#include <mach/addr-map.h> #include <mach/smemc.h> #include "generic.h"
arch/arm/mach-pxa/zylonite.c +1 -0
@@ -20,6 +20,7 @@#include <linux/pwm.h> #include <linux/pwm_backlight.h> #include <linux/smc91x.h> +#include <linux/soc/pxa/cpu.h> #include <asm/mach-types.h> #include <asm/mach/arch.h>
arch/arm/mach-pxa/zylonite.h +2 -0
@@ -2,6 +2,8 @@#ifndef __ASM_ARCH_ZYLONITE_H#define __ASM_ARCH_ZYLONITE_H +#include <linux/soc/pxa/cpu.h> +#define ZYLONITE_ETH_PHYS 0x14000000#define EXT_GPIO (x) (128 + (x))
arch/arm/mach-pxa/zylonite_pxa300.c +1 -0
@@ -17,6 +17,7 @@#include <linux/platform_data/i2c-pxa.h> #include <linux/platform_data/pca953x.h> #include <linux/gpio.h> +#include <linux/soc/pxa/cpu.h> #include "pxa300.h" #include "devices.h"
arch/arm/mach-pxa/zylonite_pxa320.c +1 -0
@@ -14,6 +14,7 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/gpio.h> +#include <linux/soc/pxa/cpu.h> #include "pxa320.h" #include "zylonite.h"
drivers/clk/pxa/clk-pxa3xx.c +1 -0
@@ -14,6 +14,7 @@#include <linux/clk-provider.h> #include <linux/clkdev.h> #include <linux/of.h> +#include <linux/soc/pxa/cpu.h> #include <mach/smemc.h> #include <mach/pxa3xx-regs.h>
drivers/cpufreq/pxa2xx-cpufreq.c +1 -0
@@ -24,6 +24,7 @@#include <linux/cpufreq.h> #include <linux/err.h> #include <linux/regulator/consumer.h> +#include <linux/soc/pxa/cpu.h> #include <linux/io.h> #include <mach/pxa2xx-regs.h>
drivers/cpufreq/pxa3xx-cpufreq.c +1 -0
@@ -8,6 +8,7 @@#include <linux/sched.h> #include <linux/init.h> #include <linux/cpufreq.h> +#include <linux/soc/pxa/cpu.h> #include <linux/slab.h> #include <linux/io.h>
drivers/input/mouse/pxa930_trkball.c +0 -1
@@ -15,7 +15,6 @@#include <linux/io.h> #include <linux/slab.h> -#include <mach/hardware.h> #include <linux/platform_data/mouse-pxa930_trkball.h> /* Trackball Controller Register Definitions */
drivers/input/touchscreen/zylonite-wm97xx.c +1 -1
@@ -21,9 +21,9 @@#include <linux/irq.h> #include <linux/interrupt.h> #include <linux/io.h> +#include <linux/soc/pxa/cpu.h> #include <linux/wm97xx.h> -#include <mach/hardware.h> #include <mach/mfp.h> #include <mach/regs-ac97.h>
drivers/leds/leds-locomo.c +0 -1
@@ -11,7 +11,6 @@#include <linux/device.h> #include <linux/leds.h> -#include <mach/hardware.h> #include <asm/hardware/locomo.h> static void locomoled_brightness_set(struct led_classdev *led_cdev,
drivers/mmc/host/pxamci.c +1 -1
@@ -31,10 +31,10 @@#include <linux/gfp.h> #include <linux/of.h> #include <linux/of_device.h> +#include <linux/soc/pxa/cpu.h> #include <linux/sizes.h> -#include <mach/hardware.h> #include <linux/platform_data/mmc-pxamci.h> #include "pxamci.h"
drivers/mtd/maps/pxa2xx-flash.c +0 -2
@@ -16,8 +16,6 @@#include <linux/mtd/partitions.h> #include <asm/io.h> -#include <mach/hardware.h> -#include <asm/mach/flash.h> #define CACHELINESIZE 32
drivers/pcmcia/pxa2xx_base.c +1 -1
@@ -23,8 +23,8 @@#include <linux/kernel.h> #include <linux/spinlock.h> #include <linux/platform_device.h> +#include <linux/soc/pxa/cpu.h> -#include <mach/hardware.h> #include <mach/smemc.h> #include <asm/io.h> #include <asm/irq.h>
drivers/pcmcia/pxa2xx_sharpsl.c +0 -1
@@ -15,7 +15,6 @@#include <linux/platform_device.h> #include <asm/mach-types.h> -#include <mach/hardware.h> #include <asm/irq.h> #include <asm/hardware/scoop.h>
drivers/pcmcia/sa1111_generic.c +0 -1
@@ -17,7 +17,6 @@#include <pcmcia/ss.h> -#include <mach/hardware.h> #include <asm/hardware/sa1111.h> #include <asm/mach-types.h> #include <asm/irq.h>
drivers/pcmcia/sa1111_lubbock.c +0 -1
@@ -17,7 +17,6 @@#include <linux/init.h> #include <linux/delay.h> -#include <mach/hardware.h> #include <asm/hardware/sa1111.h> #include <asm/mach-types.h>
drivers/pcmcia/soc_common.c +0 -2
@@ -47,8 +47,6 @@#include <linux/spinlock.h> #include <linux/timer.h> -#include <mach/hardware.h> -#include "soc_common.h" static irqreturn_t soc_common_pcmcia_interrupt (int irq,void *dev);
drivers/rtc/rtc-pxa.c +0 -2
@@ -16,8 +16,6 @@#include <linux/of.h> #include <linux/of_device.h> -#include <mach/hardware.h> -#include "rtc-sa1100.h" #define RTC_DEF_DIVIDER (32768 - 1)
drivers/usb/host/ohci-pxa27x.c +1 -2
@@ -36,8 +36,7 @@#include <linux/usb.h> #include <linux/usb/hcd.h> #include <linux/usb/otg.h> - -#include <mach/hardware.h> +#include <linux/soc/pxa/cpu.h> #include "ohci.h"
drivers/video/fbdev/pxafb.c +1 -1
@@ -57,10 +57,10 @@#include <linux/console.h> #include <linux/of_graph.h> #include <linux/regulator/consumer.h> +#include <linux/soc/pxa/cpu.h> #include <video/of_display_timing.h> #include <video/videomode.h> -#include <mach/hardware.h> #include <asm/io.h> #include <asm/irq.h> #include <asm/div64.h>
drivers/watchdog/sa1100_wdt.c +0 -1
@@ -35,7 +35,6 @@#endif #include <mach/reset.h> -#include <mach/hardware.h> static unsigned long oscr_freq;static unsigned long sa1100wdt_users;
include/linux/soc/pxa/cpu.h renamed from arch/arm/mach-pxa/include/mach/hardware.h +4 -57
77 lines not on this page · raw message
sound/arm/pxa2xx-ac97-lib.c +1 -0
@@ -17,6 +17,7 @@#include <linux/io.h> #include <linux/gpio.h> #include <linux/of_gpio.h> +#include <linux/soc/pxa/cpu.h> #include <sound/pxa2xx-lib.h>
sound/soc/pxa/pxa2xx-ac97.c +1 -1
@@ -21,7 +21,7 @@#include <sound/pxa2xx-lib.h> #include <sound/dmaengine_pcm.h> -#include <mach/hardware.h> +#include <mach/pxa-regs.h> #include <mach/regs-ac97.h> #include <mach/audio.h>
sound/soc/pxa/pxa2xx-i2s.c +1 -1
@@ -21,7 +21,7 @@#include <sound/pxa2xx-lib.h> #include <sound/dmaengine_pcm.h> -#include <mach/hardware.h> +#include <mach/pxa-regs.h> #include <mach/audio.h> #include "pxa2xx-i2s.h"
sound/soc/pxa/z2.c +0 -1
@@ -21,7 +21,6 @@#include <sound/jack.h> #include <asm/mach-types.h> -#include <mach/hardware.h> #include <mach/audio.h> #include <mach/z2.h>
Signature · 1 line
2.29.2
PATCH v2 6/48 ARM: pxa: stop using mach/bitfield.h
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
There are two identical copies of mach/bitfield.h, one for mach-sa1100 and one for mach-pxa. The pxafb driver only makes use of two macros, which can be trivially open-coded in the header.
--- arch/arm/mach-pxa/idp.c | 1 - arch/arm/mach-pxa/include/mach/regs-lcd.h | 5 +++-- arch/arm/mach-pxa/regs-u2d.h | 2 -- drivers/video/fbdev/pxafb.c | 1 - 4 files changed, 3 insertions(+), 6 deletions(-)
arch/arm/mach-pxa/idp.c +0 -1
@@ -30,7 +30,6 @@#include "pxa25x.h" #include "idp.h" #include <linux/platform_data/video-pxafb.h> -#include <mach/bitfield.h> #include <linux/platform_data/mmc-pxamci.h> #include <linux/smc91x.h>
arch/arm/mach-pxa/include/mach/regs-lcd.h +3 -2
@@ -2,8 +2,6 @@#ifndef __ASM_ARCH_REGS_LCD_H#define __ASM_ARCH_REGS_LCD_H -#include <mach/bitfield.h> -/* * LCD Controller Registers and Bits Definitions */
@@ -86,6 +84,9 @@#define LCCR0_OUC (1 << 25)/* Overlay Underlay control bit */ #define LCCR0_LDDALT (1 << 26)/* LDD alternate mapping control */ +#define Fld (Size, Shft) (((Size) << 16) + (Shft)) +#define FShft (Field) ((Field) & 0x0000FFFF) +#define LCCR1_PPL Fld (10, 0)/* Pixels Per Line - 1 */ #define LCCR1_DisWdth (Pixel) (((Pixel) - 1) << FShft (LCCR1_PPL))
arch/arm/mach-pxa/regs-u2d.h +0 -2
@@ -2,8 +2,6 @@#ifndef __ASM_ARCH_PXA3xx_U2D_H#define __ASM_ARCH_PXA3xx_U2D_H -#include <mach/bitfield.h> -/* * USB2 device controller registers and bits definitions */
drivers/video/fbdev/pxafb.c +0 -1
@@ -64,7 +64,6 @@#include <asm/io.h> #include <asm/irq.h> #include <asm/div64.h> -#include <mach/bitfield.h> #include <linux/platform_data/video-pxafb.h> /*
Signature · 1 line
2.29.2
PATCH v2 7/48 ARM: pxa: move mach/sound.h to linux/platform_data/
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
This is a basically a platform_data file, so move it out of the mach/* header directory.
--- arch/arm/mach-pxa/balloon3.c | 2 +- arch/arm/mach-pxa/cm-x300.c | 2 +- arch/arm/mach-pxa/colibri-pxa270.c | 2 +- arch/arm/mach-pxa/colibri-pxa300.c | 2 +- arch/arm/mach-pxa/colibri-pxa320.c | 2 +- arch/arm/mach-pxa/csb726.c | 2 +- arch/arm/mach-pxa/devices.c | 2 +- arch/arm/mach-pxa/eseries.c | 2 +- arch/arm/mach-pxa/lpd270.c | 2 +- arch/arm/mach-pxa/lubbock.c | 2 +- arch/arm/mach-pxa/mainstone.c | 2 +- arch/arm/mach-pxa/mioa701.c | 2 +- arch/arm/mach-pxa/palm27x.c | 2 +- arch/arm/mach-pxa/palmld.c | 2 +- arch/arm/mach-pxa/palmt5.c | 2 +- arch/arm/mach-pxa/palmtc.c | 2 +- arch/arm/mach-pxa/palmte2.c | 2 +- arch/arm/mach-pxa/palmtreo.c | 2 +- arch/arm/mach-pxa/palmtx.c | 2 +- arch/arm/mach-pxa/palmz72.c | 2 +- arch/arm/mach-pxa/pcm990-baseboard.c | 2 +- arch/arm/mach-pxa/tosa.c | 2 +- arch/arm/mach-pxa/trizeps4.c | 2 +- arch/arm/mach-pxa/viper.c | 2 +- arch/arm/mach-pxa/vpac270.c | 2 +- arch/arm/mach-pxa/zeus.c | 2 +- arch/arm/mach-pxa/zylonite.c | 2 +- .../mach/audio.h => include/linux/platform_data/asoc-pxa.h | 4 ++-- sound/arm/pxa2xx-ac97-lib.c | 2 +- sound/arm/pxa2xx-ac97.c | 2 +- sound/soc/pxa/corgi.c | 2 +- sound/soc/pxa/e740_wm9705.c | 2 +- sound/soc/pxa/e750_wm9705.c | 2 +- sound/soc/pxa/e800_wm9712.c | 2 +- sound/soc/pxa/em-x270.c | 2 +- sound/soc/pxa/mioa701_wm9713.c | 2 +- sound/soc/pxa/palm27x.c | 2 +- sound/soc/pxa/poodle.c | 2 +- sound/soc/pxa/pxa2xx-ac97.c | 2 +- sound/soc/pxa/pxa2xx-i2s.c | 2 +- sound/soc/pxa/tosa.c | 2 +- sound/soc/pxa/z2.c | 2 +- 42 files changed, 43 insertions(+), 43 deletions(-) rename arch/arm/mach-pxa/include/mach/audio.h => include/linux/platform_data/asoc-pxa.h (93%)
arch/arm/mach-pxa/balloon3.c +1 -1
@@ -41,7 +41,7 @@#include "pxa27x.h" #include <mach/balloon3.h> -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include <linux/platform_data/video-pxafb.h> #include <linux/platform_data/mmc-pxamci.h> #include "udc.h"
arch/arm/mach-pxa/cm-x300.c +1 -1
@@ -53,7 +53,7 @@#include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/usb-ohci-pxa27x.h> #include <linux/platform_data/mtd-nand-pxa3xx.h> -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include <linux/platform_data/usb-pxa3xx-ulpi.h> #include <asm/mach/map.h>
arch/arm/mach-pxa/colibri-pxa270.c +1 -1
@@ -23,7 +23,7 @@#include <asm/mach-types.h> #include <linux/sizes.h> -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include "colibri.h" #include "pxa27x.h"
arch/arm/mach-pxa/colibri-pxa300.c +1 -1
@@ -24,7 +24,7 @@#include "colibri.h" #include <linux/platform_data/usb-ohci-pxa27x.h> #include <linux/platform_data/video-pxafb.h> -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include "generic.h" #include "devices.h"
arch/arm/mach-pxa/colibri-pxa320.c +1 -1
@@ -24,7 +24,7 @@#include "colibri.h" #include <linux/platform_data/video-pxafb.h> #include <linux/platform_data/usb-ohci-pxa27x.h> -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include "pxa27x-udc.h" #include "udc.h"
arch/arm/mach-pxa/csb726.c +1 -1
@@ -22,7 +22,7 @@#include "pxa27x.h" #include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/usb-ohci-pxa27x.h> -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include <mach/smemc.h> #include "generic.h"
arch/arm/mach-pxa/devices.c +1 -1
@@ -20,7 +20,7 @@#include <linux/platform_data/usb-ohci-pxa27x.h> #include <linux/platform_data/keypad-pxa27x.h> #include <linux/platform_data/media/camera-pxa.h> -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include <linux/platform_data/mmp_dma.h> #include <linux/platform_data/mtd-nand-pxa3xx.h>
arch/arm/mach-pxa/eseries.c +1 -1
@@ -34,7 +34,7 @@#include "pxa25x.h" #include <mach/eseries-gpio.h> #include "eseries-irq.h" -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include <linux/platform_data/video-pxafb.h> #include "udc.h" #include <linux/platform_data/irda-pxaficp.h>
arch/arm/mach-pxa/lpd270.c +1 -1
@@ -39,7 +39,7 @@#include "pxa27x.h" #include "lpd270.h" #include <mach/addr-map.h> -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include <linux/platform_data/video-pxafb.h> #include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/irda-pxaficp.h>
arch/arm/mach-pxa/lubbock.c +1 -1
@@ -45,7 +45,7 @@#include <asm/hardware/sa1111.h> #include "pxa25x.h" -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include <mach/lubbock.h> #include "udc.h" #include <linux/platform_data/irda-pxaficp.h>
arch/arm/mach-pxa/mainstone.c +1 -1
@@ -45,7 +45,7 @@#include "pxa27x.h" #include "mainstone.h" -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include <linux/platform_data/video-pxafb.h> #include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/irda-pxaficp.h>
arch/arm/mach-pxa/mioa701.c +1 -1
@@ -41,7 +41,7 @@#include "udc.h" #include "pxa27x-udc.h" #include <linux/platform_data/media/camera-pxa.h> -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include <mach/smemc.h> #include "mioa701.h"
arch/arm/mach-pxa/palm27x.c +1 -1
@@ -25,7 +25,7 @@#include <asm/mach/map.h> #include "pxa27x.h" -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/video-pxafb.h> #include <linux/platform_data/irda-pxaficp.h>
arch/arm/mach-pxa/palmld.c +1 -1
@@ -29,7 +29,7 @@#include <asm/mach/map.h> #include "pxa27x.h" -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include <mach/palmld.h> #include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/video-pxafb.h>
arch/arm/mach-pxa/palmt5.c +1 -1
@@ -29,7 +29,7 @@#include <asm/mach/map.h> #include "pxa27x.h" -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include "palmt5.h" #include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/video-pxafb.h>
arch/arm/mach-pxa/palmtc.c +1 -1
@@ -29,7 +29,7 @@#include <asm/mach/map.h> #include "pxa25x.h" -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include <mach/palmtc.h> #include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/video-pxafb.h>
arch/arm/mach-pxa/palmte2.c +1 -1
@@ -29,7 +29,7 @@#include <asm/mach/map.h> #include "pxa25x.h" -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include "palmte2.h" #include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/video-pxafb.h>
arch/arm/mach-pxa/palmtreo.c +1 -1
@@ -29,7 +29,7 @@#include "pxa27x.h" #include "pxa27x-udc.h" -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include "palmtreo.h" #include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/video-pxafb.h>
arch/arm/mach-pxa/palmtx.c +1 -1
@@ -32,7 +32,7 @@#include <asm/mach/map.h> #include "pxa27x.h" -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include <mach/palmtx.h> #include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/video-pxafb.h>
arch/arm/mach-pxa/palmz72.c +1 -1
@@ -34,7 +34,7 @@#include <asm/mach/map.h> #include "pxa27x.h" -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include "palmz72.h" #include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/video-pxafb.h>
arch/arm/mach-pxa/pcm990-baseboard.c +1 -1
@@ -26,7 +26,7 @@#include <asm/mach/map.h> #include "pxa27x.h" -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/usb-ohci-pxa27x.h> #include "pcm990_baseboard.h"
arch/arm/mach-pxa/tosa.c +1 -1
@@ -45,7 +45,7 @@#include <linux/platform_data/mmc-pxamci.h> #include "udc.h" #include "tosa_bt.h" -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include <mach/smemc.h> #include <asm/mach/arch.h>
arch/arm/mach-pxa/trizeps4.c +1 -1
@@ -41,7 +41,7 @@#include "pxa27x.h" #include <mach/trizeps4.h> -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include <linux/platform_data/video-pxafb.h> #include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/irda-pxaficp.h>
arch/arm/mach-pxa/viper.c +1 -1
@@ -46,7 +46,7 @@#include <linux/syscore_ops.h> #include "pxa25x.h" -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include <linux/platform_data/video-pxafb.h> #include "regs-uart.h" #include <linux/platform_data/pcmcia-pxa2xx_viper.h>
arch/arm/mach-pxa/vpac270.c +1 -1
@@ -29,7 +29,7 @@#include <asm/mach/arch.h> #include "pxa27x.h" -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include <mach/vpac270.h> #include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/video-pxafb.h>
arch/arm/mach-pxa/zeus.c +1 -1
@@ -46,7 +46,7 @@#include "udc.h" #include <linux/platform_data/video-pxafb.h> #include "pm.h" -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include <linux/platform_data/pcmcia-pxa2xx_viper.h> #include "zeus.h" #include <mach/smemc.h>
arch/arm/mach-pxa/zylonite.c +1 -1
@@ -25,7 +25,7 @@#include <asm/mach-types.h> #include <asm/mach/arch.h> #include "pxa3xx.h" -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include <linux/platform_data/video-pxafb.h> #include "zylonite.h" #include <linux/platform_data/mmc-pxamci.h>
include/linux/platform_data/asoc-pxa.h renamed from arch/arm/mach-pxa/include/mach/audio.h +2 -2
@@ -1,6 +1,6 @@/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __ASM_ARCH_AUDIO_H__ -#define __ASM_ARCH_AUDIO_H__ +#ifndef __SOC_PXA_AUDIO_H__ +#define __SOC_PXA_AUDIO_H__#include <sound/core.h> #include <sound/pcm.h>
sound/arm/pxa2xx-ac97-lib.c +1 -1
@@ -23,7 +23,7 @@#include <mach/irqs.h> #include <mach/regs-ac97.h> -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> static DEFINE_MUTEX (car_mutex);static DECLARE_WAIT_QUEUE_HEAD (gsr_wq);
sound/arm/pxa2xx-ac97.c +1 -1
@@ -22,7 +22,7 @@#include <sound/dmaengine_pcm.h> #include <mach/regs-ac97.h> -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> static void pxa2xx_ac97_legacy_reset (struct snd_ac97 *ac97) {
sound/soc/pxa/corgi.c +1 -1
@@ -22,7 +22,7 @@#include <asm/mach-types.h> #include <mach/corgi.h> -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include "../codecs/wm8731.h" #include "pxa2xx-i2s.h"
sound/soc/pxa/e740_wm9705.c +1 -1
@@ -13,7 +13,7 @@#include <sound/pcm.h> #include <sound/soc.h> -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include <mach/eseries-gpio.h> #include <asm/mach-types.h>
sound/soc/pxa/e750_wm9705.c +1 -1
@@ -13,7 +13,7 @@#include <sound/pcm.h> #include <sound/soc.h> -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include <mach/eseries-gpio.h> #include <asm/mach-types.h>
sound/soc/pxa/e800_wm9712.c +1 -1
@@ -14,7 +14,7 @@#include <sound/soc.h> #include <asm/mach-types.h> -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include <mach/eseries-gpio.h> static int e800_spk_amp_event(struct snd_soc_dapm_widget *w,
sound/soc/pxa/em-x270.c +1 -1
@@ -23,7 +23,7 @@#include <sound/soc.h> #include <asm/mach-types.h> -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> SND_SOC_DAILINK_DEFS(ac97, DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-ac97")),
sound/soc/pxa/mioa701_wm9713.c +1 -1
@@ -33,7 +33,7 @@#include <linux/platform_device.h> #include <asm/mach-types.h> -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include <sound/core.h> #include <sound/pcm.h>
sound/soc/pxa/palm27x.c +1 -1
@@ -20,7 +20,7 @@#include <sound/jack.h> #include <asm/mach-types.h> -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include <linux/platform_data/asoc-palm27x.h> static struct snd_soc_jack hs_jack;
sound/soc/pxa/poodle.c +1 -1
@@ -22,7 +22,7 @@#include <asm/mach-types.h> #include <asm/hardware/locomo.h> #include <mach/poodle.h> -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include "../codecs/wm8731.h" #include "pxa2xx-i2s.h"
sound/soc/pxa/pxa2xx-ac97.c +1 -1
@@ -23,7 +23,7 @@#include <mach/pxa-regs.h> #include <mach/regs-ac97.h> -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> static void pxa2xx_ac97_warm_reset (struct ac97_controller *adrv) {
sound/soc/pxa/pxa2xx-i2s.c +1 -1
@@ -22,7 +22,7 @@#include <sound/dmaengine_pcm.h> #include <mach/pxa-regs.h> -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include "pxa2xx-i2s.h"
sound/soc/pxa/tosa.c +1 -1
@@ -24,7 +24,7 @@#include <asm/mach-types.h> #include <mach/tosa.h> -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #define TOSA_HP 0#define TOSA_MIC_INT 1
sound/soc/pxa/z2.c +1 -1
@@ -21,7 +21,7 @@#include <sound/jack.h> #include <asm/mach-types.h> -#include <mach/audio.h> +#include <linux/platform_data/asoc-pxa.h> #include <mach/z2.h> #include "../codecs/wm8750.h"
Signature · 1 line
2.29.2
PATCH v2 8/48 ARM: pxa: move regs-lcd.h into driver
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
Only the pxafb driver uses this header, so move it into the same directory. The SMART_* macros are required by some platform data definitions and can go into the linux/platform_data/video-pxafb.h header.
--- .../video/fbdev/pxa3xx-regs.h | 19 ---------------- drivers/video/fbdev/pxafb.c | 1 + include/linux/platform_data/video-pxafb.h | 22 ++++++++++++++++++- 3 files changed, 22 insertions(+), 20 deletions(-) rename arch/arm/mach-pxa/include/mach/regs-lcd.h => drivers/video/fbdev/pxa3xx-regs.h (90%)
drivers/video/fbdev/pxa3xx-regs.h renamed from arch/arm/mach-pxa/include/mach/regs-lcd.h +0 -19
@@ -177,23 +177,4 @@#define PRSR_ST_OK (1 << 9)/* Status OK */ #define PRSR_CON_NT (1 << 10)/* Continue to Next Command */ -#define SMART_CMD_A0 (0x1 << 8) -#define SMART_CMD_READ_STATUS_REG (0x0 << 9) -#define SMART_CMD_READ_FRAME_BUFFER ((0x0 << 9) | SMART_CMD_A0) -#define SMART_CMD_WRITE_COMMAND (0x1 << 9) -#define SMART_CMD_WRITE_DATA ((0x1 << 9) | SMART_CMD_A0) -#define SMART_CMD_WRITE_FRAME ((0x2 << 9) | SMART_CMD_A0) -#define SMART_CMD_WAIT_FOR_VSYNC (0x3 << 9) -#define SMART_CMD_NOOP (0x4 << 9) -#define SMART_CMD_INTERRUPT (0x5 << 9) - -#define SMART_CMD (x) (SMART_CMD_WRITE_COMMAND | ((x) & 0xff)) -#define SMART_DAT (x) (SMART_CMD_WRITE_DATA | ((x) & 0xff)) - -/* SMART_DELAY() is introduced for software controlled delay primitive which -* can be inserted between command sequences, unused command 0x6 is used here -* and delay ranges from 0ms ~ 255ms -*/ -#define SMART_CMD_DELAY (0x6 << 9) -#define SMART_DELAY (ms) (SMART_CMD_DELAY | ((ms) & 0xff))#endif /* __ASM_ARCH_REGS_LCD_H */
drivers/video/fbdev/pxafb.c +1 -0
@@ -72,6 +72,7 @@#define DEBUG_VAR 1#include "pxafb.h" +#include "pxa3xx-regs.h" /* Bits which should not be set in machine configuration structures */ #define LCCR0_INVALID_CONFIG_MASK (LCCR0_OUM | LCCR0_BM | LCCR0_QDM |\
include/linux/platform_data/video-pxafb.h +21 -1
@@ -8,7 +8,6 @@*/ #include <linux/fb.h> -#include <mach/regs-lcd.h> /* * Supported LCD connections
@@ -153,6 +152,27 @@ struct pxafb_mach_info {void pxa_set_fb_info (struct device *,struct pxafb_mach_info *);unsigned long pxafb_get_hsync_time (struct device *dev); +/* smartpanel related */ +#define SMART_CMD_A0 (0x1 << 8) +#define SMART_CMD_READ_STATUS_REG (0x0 << 9) +#define SMART_CMD_READ_FRAME_BUFFER ((0x0 << 9) | SMART_CMD_A0) +#define SMART_CMD_WRITE_COMMAND (0x1 << 9) +#define SMART_CMD_WRITE_DATA ((0x1 << 9) | SMART_CMD_A0) +#define SMART_CMD_WRITE_FRAME ((0x2 << 9) | SMART_CMD_A0) +#define SMART_CMD_WAIT_FOR_VSYNC (0x3 << 9) +#define SMART_CMD_NOOP (0x4 << 9) +#define SMART_CMD_INTERRUPT (0x5 << 9) + +#define SMART_CMD (x) (SMART_CMD_WRITE_COMMAND | ((x) & 0xff)) +#define SMART_DAT (x) (SMART_CMD_WRITE_DATA | ((x) & 0xff)) + +/* SMART_DELAY() is introduced for software controlled delay primitive which +* can be inserted between command sequences, unused command 0x6 is used here +* and delay ranges from 0ms ~ 255ms +*/ +#define SMART_CMD_DELAY (0x6 << 9) +#define SMART_DELAY (ms) (SMART_CMD_DELAY | ((ms) & 0xff)) +#ifdef CONFIG_FB_PXA_SMARTPANEL extern int pxafb_smart_queue (struct fb_info *info,uint16_t *cmds,int );extern int pxafb_smart_flush (struct fb_info *info);
Signature · 1 line
2.29.2
PATCH v2 9/48 watchdog: sa1100: use platform device registration
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
Rather than relying on machine specific headers to pass down the reboot status and the register locations, use resources and platform_data.
Aside from this, keep the changes to a minimum.
--- arch/arm/mach-pxa/devices.c | 11 +++ arch/arm/mach-pxa/include/mach/regs-ost.h | 2 + arch/arm/mach-pxa/include/mach/reset.h | 2 +- arch/arm/mach-pxa/pxa25x.c | 2 +- arch/arm/mach-pxa/pxa27x.c | 2 +- arch/arm/mach-pxa/pxa3xx.c | 2 +- arch/arm/mach-pxa/reset.c | 3 - arch/arm/mach-sa1100/generic.c | 6 +- arch/arm/mach-sa1100/include/mach/reset.h | 1 - drivers/watchdog/sa1100_wdt.c | 87 ++++++++++++++++------- 10 files changed, 83 insertions(+), 35 deletions(-)
arch/arm/mach-pxa/devices.c +11 -0
@@ -24,6 +24,8 @@#include <linux/platform_data/mmp_dma.h> #include <linux/platform_data/mtd-nand-pxa3xx.h> +#include <mach/regs-ost.h> +#include <mach/reset.h> #include "devices.h" #include "generic.h"
@@ -1118,3 +1120,12 @@ void __init pxa2xx_set_dmac_info(struct mmp_dma_platdata *dma_pdata) {pxa_register_device (&pxa2xx_pxa_dma, dma_pdata); } + +void __init pxa_register_wdt (unsigned int reset_status) +{ +struct resource res =DEFINE_RES_MEM (OST_PHYS ,OST_LEN ); + + reset_status &=RESET_STATUS_WATCHDOG ; +platform_device_register_resndata (NULL ,"sa1100_wdt" ,-1 , &res,1 , + &reset_status,sizeof (reset_status)); +}
arch/arm/mach-pxa/include/mach/regs-ost.h +2 -0
@@ -7,6 +7,8 @@/* * OS Timer & Match Registers */ +#define OST_PHYS 0x40A00000 +#define OST_LEN 0x00000020#define OSMR0 io_p2v(0x40A00000)/* */ #define OSMR1 io_p2v(0x40A00004)/* */
arch/arm/mach-pxa/include/mach/reset.h +1 -1
@@ -8,8 +8,8 @@#define RESET_STATUS_GPIO (1 << 3)/* GPIO Reset */ #define RESET_STATUS_ALL (0xf) -extern unsigned int reset_status;extern void clear_reset_status (unsigned int mask); +extern void pxa_register_wdt (unsigned int reset_status);/** * init_gpio_reset() - register GPIO as reset generator
arch/arm/mach-pxa/pxa25x.c +1 -1
@@ -240,7 +240,7 @@ static int __init pxa25x_init(void)if (cpu_is_pxa25x ()) { - reset_status =RCSR ; +pxa_register_wdt (RCSR );pxa25x_init_pm ();
arch/arm/mach-pxa/pxa27x.c +1 -1
@@ -337,7 +337,7 @@ static int __init pxa27x_init(void)if (cpu_is_pxa27x ()) { - reset_status =RCSR ; +pxa_register_wdt (RCSR );pxa27x_init_pm ();
arch/arm/mach-pxa/pxa3xx.c +1 -1
@@ -463,7 +463,7 @@ static int __init pxa3xx_init(void)if (cpu_is_pxa3xx ()) { - reset_status =ARSR ; +pxa_register_wdt (ARSR );/* * clear RDH bit every time after reset
arch/arm/mach-pxa/reset.c +0 -3
@@ -11,9 +11,6 @@#include <mach/reset.h> #include <mach/smemc.h> -unsigned int reset_status; -EXPORT_SYMBOL (reset_status); -static void do_hw_reset (void );static int reset_gpio =-1 ;
arch/arm/mach-sa1100/generic.c +3 -3
@@ -39,9 +39,6 @@#include "generic.h" #include <clocksource/pxa.h> -unsigned int reset_status; -EXPORT_SYMBOL (reset_status); -#define NR_FREQS 16/*
@@ -319,10 +316,13 @@ static struct platform_device *sa11x0_devices[] __initdata = {static int __init sa1100_init (void ) { +struct resource wdt_res =DEFINE_RES_MEM (0x90000000 ,0x20 ); pm_power_off = sa1100_power_off;regulator_has_full_constraints (); +platform_device_register_simple ("sa1100_wdt" ,-1 , &wdt_res,1 ); +return platform_add_devices (sa11x0_devices,ARRAY_SIZE (sa11x0_devices)); }
arch/arm/mach-sa1100/include/mach/reset.h +0 -1
@@ -10,7 +10,6 @@#define RESET_STATUS_GPIO (1 << 3)/* GPIO Reset */ #define RESET_STATUS_ALL (0xf) -extern unsigned int reset_status;static inline void clear_reset_status (unsigned int mask) {RCSR = mask;
drivers/watchdog/sa1100_wdt.c +63 -24
163 lines not on this page · raw message
Signature · 1 line
2.29.2
Re: [PATCH 09/48] watchdog: sa1100: use platform device registration
Quoted 6 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
Rather than relying on machine specific headers to pass down the reboot status and the register locations, use resources and
platform_data.
Quoted 6 lines
Aside from this, keep the changes to a minimum.
Cc Wim Van Sebroeck <[email protected]>Cc Guenter Roeck <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>
Quoted 336 lines
--- arch/arm/mach-pxa/devices.c | 11 +++ arch/arm/mach-pxa/include/mach/regs-ost.h | 2 + arch/arm/mach-pxa/include/mach/reset.h | 2 +- arch/arm/mach-pxa/pxa25x.c | 2 +- arch/arm/mach-pxa/pxa27x.c | 2 +- arch/arm/mach-pxa/pxa3xx.c | 2 +- arch/arm/mach-pxa/reset.c | 3 - arch/arm/mach-sa1100/generic.c | 6 +- arch/arm/mach-sa1100/include/mach/reset.h | 1 - drivers/watchdog/sa1100_wdt.c | 87 ++++++++++++++++------- 10 files changed, 83 insertions(+), 35 deletions(-)arch/arm/mach-pxa/devices.c +11
-0@@ -24,6 +24,8 @@#include <linux/platform_data/mmp_dma.h> #include <linux/platform_data/mtd-nand-pxa3xx.h> +#include <mach/regs-ost.h> +#include <mach/reset.h> #include "devices.h" #include "generic.h" @@ -1118,3 +1120,12 @@ void __init pxa2xx_set_dmac_info(struct mmp_dma_platdata *dma_pdata) {pxa_register_device (&pxa2xx_pxa_dma, dma_pdata); } + +void __init pxa_register_wdt (unsigned int reset_status) +{ +struct resource res =DEFINE_RES_MEM (OST_PHYS ,OST_LEN ); + + reset_status &=RESET_STATUS_WATCHDOG ; +platform_device_register_resndata (NULL ,"sa1100_wdt" ,-1 , &res,1 , + &reset_status,sizeof (reset_status)); +}arch/arm/mach-pxa/include/mach/regs-ost.h +2
-0@@ -7,6 +7,8 @@/* * OS Timer & Match Registers */ +#define OST_PHYS 0x40A00000 +#define OST_LEN 0x00000020#define OSMR0 io_p2v(0x40A00000)/* */ #define OSMR1 io_p2v(0x40A00004)/* */ arch/arm/mach-pxa/include/mach/reset.h +1
-1@@ -8,8 +8,8 @@#define RESET_STATUS_GPIO (1 << 3)/* GPIO Reset */ #define RESET_STATUS_ALL (0xf) -extern unsigned int reset_status;extern void clear_reset_status (unsigned int mask); +extern void pxa_register_wdt (unsigned int reset_status);/** * init_gpio_reset() - register GPIO as reset generator arch/arm/mach-pxa/pxa25x.c +1
-1@@ -240,7 +240,7 @@ static int __init pxa25x_init(void)if (cpu_is_pxa25x ()) { - reset_status =RCSR ; +pxa_register_wdt (RCSR );pxa25x_init_pm ();arch/arm/mach-pxa/pxa27x.c +1
-1@@ -337,7 +337,7 @@ static int __init pxa27x_init(void)if (cpu_is_pxa27x ()) { - reset_status =RCSR ; +pxa_register_wdt (RCSR );pxa27x_init_pm ();arch/arm/mach-pxa/pxa3xx.c +1
-1@@ -463,7 +463,7 @@ static int __init pxa3xx_init(void)if (cpu_is_pxa3xx ()) { - reset_status =ARSR ; +pxa_register_wdt (ARSR );/* * clear RDH bit every time after reset arch/arm/mach-pxa/reset.c +0
-3@@ -11,9 +11,6 @@#include <mach/reset.h> #include <mach/smemc.h> -unsigned int reset_status; -EXPORT_SYMBOL (reset_status); -static void do_hw_reset (void );static int reset_gpio =-1 ;arch/arm/mach-sa1100/generic.c +3
-3@@ -39,9 +39,6 @@#include "generic.h" #include <clocksource/pxa.h> -unsigned int reset_status; -EXPORT_SYMBOL (reset_status); -#define NR_FREQS 16/* @@ -319,10 +316,13 @@ static struct platform_device *sa11x0_devices[] __initdata = {static int __init sa1100_init (void ) { +struct resource wdt_res =DEFINE_RES_MEM (0x90000000 ,0x20 ); pm_power_off = sa1100_power_off;regulator_has_full_constraints (); +platform_device_register_simple ("sa1100_wdt" ,-1 , &wdt_res,1 ); +return platform_add_devices (sa11x0_devices,ARRAY_SIZE (sa11x0_devices)); }arch/arm/mach-sa1100/include/mach/reset.h +0
-1@@ -10,7 +10,6 @@#define RESET_STATUS_GPIO (1 << 3)/* GPIO Reset */ #define RESET_STATUS_ALL (0xf) -extern unsigned int reset_status;static inline void clear_reset_status (unsigned int mask) {RCSR = mask;drivers/watchdog/sa1100_wdt.c +63
-24@@ -22,6 +22,7 @@#include <linux/types.h> #include <linux/kernel.h> #include <linux/fs.h> +#include <linux/platform_device.h> #include <linux/miscdevice.h> #include <linux/watchdog.h> #include <linux/init.h> @@ -30,16 +31,42 @@#include <linux/uaccess.h> #include <linux/timex.h> -#ifdef CONFIG_ARCH_PXA -#include <mach/regs-ost.h> -#endif +#define REG_OSMR0 0x0000/* OS timer Match Reg. 0 */ +#define REG_OSMR1 0x0004/* OS timer Match Reg. 1 */ +#define REG_OSMR2 0x0008/* OS timer Match Reg. 2 */ +#define REG_OSMR3 0x000c/* OS timer Match Reg. 3 */ +#define REG_OSCR 0x0010/* OS timer Counter Reg. */ +#define REG_OSSR 0x0014/* OS timer Status Reg. */ +#define REG_OWER 0x0018/* OS timer Watch-dog Enable Reg. */ +#define REG_OIER 0x001C/* OS timer Interrupt Enable Reg. */ -#include <mach/reset.h> +#define OSSR_M3 (1 << 3)/* Match status channel 3 */ +#define OSSR_M2 (1 << 2)/* Match status channel 2 */ +#define OSSR_M1 (1 << 1)/* Match status channel 1 */ +#define OSSR_M0 (1 << 0)/* Match status channel 0 */ + +#define OWER_WME (1 << 0)/* Watchdog Match Enable */ + +#define OIER_E3 (1 << 3)/* Interrupt enable channel 3 */ +#define OIER_E2 (1 << 2)/* Interrupt enable channel 2 */ +#define OIER_E1 (1 << 1)/* Interrupt enable channel 1 */ +#define OIER_E0 (1 << 0)/* Interrupt enable channel 0 */ static unsigned long oscr_freq;static unsigned long sa1100wdt_users;static unsigned int pre_margin;static int boot_status; +static void __iomem *reg_base; + +static inline void sa1100_wr (u32 val,u32 offset) +{ +writel_relaxed (val, reg_base + offset); +} + +static inline u32 sa1100_rd (u32 offset) +{ +return readl_relaxed (reg_base + offset); +}/* * Allow only one person to hold it open @@ -50,10 +77,10 @@ static int sa1100dog_open(struct inode *inode, struct file *file)return -EBUSY ;/* Activate SA1100 Watchdog timer */ -writel_relaxed (readl_relaxed (OSCR ) + pre_margin,OSMR3 ); -writel_relaxed (OSSR_M3 ,OSSR ); -writel_relaxed (OWER_WME ,OWER ); -writel_relaxed (readl_relaxed (OIER ) |OIER_E3 ,OIER ); +sa1100_wr (sa1100_rd (REG_OSCR ) + pre_margin,REG_OSMR3 ); +sa1100_wr (OSSR_M3 ,REG_OSSR ); +sa1100_wr (OWER_WME ,REG_OWER ); +sa1100_wr (sa1100_rd (REG_OIER ) |OIER_E3 ,REG_OIER );return stream_open (inode, file); }@@ -61,7 +88,7 @@ static int sa1100dog_open(struct inode *inode, struct file *file)* The watchdog cannot be disabled. * * Previous comments suggested that turning off the interrupt by -* clearing OIER[E3] would prevent the watchdog timing out but this +* clearing REG_OIER[E3] would prevent the watchdog timing out but this * does not appear to be true (at least on the PXA255). */ static int sa1100dog_release (struct inode *inode,struct file *file)@@ -76,7 +103,7 @@ static ssize_t sa1100dog_write(struct file *file, const char __user *data, {if (len)/* Refresh OSMR3 timer. */ -writel_relaxed (readl_relaxed (OSCR ) + pre_margin,OSMR3 ); +sa1100_wr (sa1100_rd (REG_OSCR ) + pre_margin,REG_OSMR3 );return len; }@@ -110,7 +137,7 @@ static long sa1100dog_ioctl(struct file *file, unsigned int cmd,break ;case WDIOC_KEEPALIVE : -writel_relaxed (readl_relaxed (OSCR ) + pre_margin,OSMR3 ); +sa1100_wr (sa1100_rd (REG_OSCR ) + pre_margin,REG_OSMR3 ); ret =0 ;break ;@@ -125,7 +152,7 @@ static long sa1100dog_ioctl(struct file *file, unsigned int cmd, } pre_margin = oscr_freq * time; -writel_relaxed (readl_relaxed (OSCR ) + pre_margin,OSMR3 ); +sa1100_wr (sa1100_rd (REG_OSCR ) + pre_margin,REG_OSMR3 ); fallthrough;case WDIOC_GETTIMEOUT :@@ -151,12 +178,22 @@ static struct miscdevice sa1100dog_miscdev = { .fops = &sa1100dog_fops, }; -static int margin__initdata =60 ;/* (secs) Default is 1 minute */ +static int margin =60 ;/* (secs) Default is 1 minute */ static struct clk *clk; -static int __init sa1100dog_init (void ) +static int sa1100dog_probe (struct platform_device *pdev) {int ret; +int *platform_data; +struct resource *res; + + res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); +if (!res) +return -ENXIO ; + reg_base =devm_ioremap (&pdev->dev, res->start,resource_size (res)); + ret =PTR_ERR_OR_ZERO (reg_base); +if (ret) +return ret; clk =clk_get (NULL ,"OSTIMER0" );if (IS_ERR (clk)) {@@ -174,13 +211,9 @@ static int __init sa1100dog_init(void) oscr_freq =clk_get_rate (clk); -/* -* Read the reset status, and save it for later. If -* we suspend, RCSR will be cleared, and the watchdog -* reset reason will be lost. -*/ - boot_status = (reset_status &RESET_STATUS_WATCHDOG ) ? -WDIOF_CARDRESET :0 ; + platform_data = pdev->dev.platform_data; +if (platform_data && *platform_data) + boot_status =WDIOF_CARDRESET ; pre_margin = oscr_freq * margin; ret =misc_register (&sa1100dog_miscdev);@@ -196,15 +229,21 @@ static int __init sa1100dog_init(void)return ret; } -static void __exit sa1100dog_exit(void) +static int sa1100dog_remove (struct platform_device *pdev) {misc_deregister (&sa1100dog_miscdev);clk_disable_unprepare (clk);clk_put (clk); + +return 0 ; } -module_init (sa1100dog_init); -module_exit (sa1100dog_exit); +struct platform_driver sa1100dog_driver = { + .driver.name ="sa1100_wdt" , + .probe = sa1100dog_probe, + .remove = sa1100dog_remove, +}; +module_platform_driver (sa1100dog_driver);MODULE_AUTHOR ("Oleg Drokin <[email protected]>" );MODULE_DESCRIPTION ("SA1100/PXA2xx Watchdog" );
PATCH v2 10/48 ARM: pxa: pxa2xx-ac97-lib: use IRQ resource
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
The pxa2xx-ac97-lib code is the last driver to use mach/irqs.h for PXA. Almost everything already passes the interrupt as a resource, so use it from there.
The one exception is the mxm8x10 machine, which apparently has a resource-less device. Replacing it with the correct one enables the driver here as well.
--- arch/arm/mach-pxa/mxm8x10.c | 8 ++------ sound/arm/pxa2xx-ac97-lib.c | 10 +++++++--- 2 files changed, 9 insertions(+), 9 deletions(-)
arch/arm/mach-pxa/mxm8x10.c +2 -6
@@ -26,6 +26,7 @@#include <linux/platform_data/video-pxafb.h> #include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/usb-ohci-pxa27x.h> +#include <linux/platform_data/asoc-pxa.h> #include "pxa320.h" #include "mxm8x10.h"
@@ -356,14 +357,9 @@ void __init mxm_8x10_usb_host_init(void)pxa_set_ohci_info (&mxm_8x10_ohci_platform_data); } -/* AC97 Sound Support */ -static struct platform_device mxm_8x10_ac97_device = { - .name ="pxa2xx-ac97" -}; -void __init mxm_8x10_ac97_init (void ) { -platform_device_register (&mxm_8x10_ac97_device); +pxa_set_ac97_info (NULL ); }/* NAND flash Support */
sound/arm/pxa2xx-ac97-lib.c +7 -3
@@ -21,7 +21,6 @@#include <sound/pxa2xx-lib.h> -#include <mach/irqs.h> #include <mach/regs-ac97.h> #include <linux/platform_data/asoc-pxa.h>
@@ -319,6 +318,7 @@ EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_resume);int pxa2xx_ac97_hw_probe (struct platform_device *dev) {int ret; +int irq;pxa2xx_audio_ops_t *pdata = dev->dev.platform_data;if (pdata) {
@@ -387,7 +387,11 @@ int pxa2xx_ac97_hw_probe(struct platform_device *dev)if (ret) goto err_clk2; - ret =request_irq (IRQ_AC97 , pxa2xx_ac97_irq,0 ,"AC97" ,NULL ); + irq =platform_get_irq (dev,0 ); +if (!irq) + goto err_irq; + + ret =request_irq (irq, pxa2xx_ac97_irq,0 ,"AC97" ,NULL );if (ret <0 ) goto err_irq;
@@ -413,7 +417,7 @@ void pxa2xx_ac97_hw_remove(struct platform_device *dev)if (cpu_is_pxa27x ())gpio_free (reset_gpio);GCR |=GCR_ACLINK_OFF ; -free_irq (IRQ_AC97 ,NULL ); +free_irq (platform_get_irq (dev,0 ),NULL );if (ac97conf_clk) {clk_put (ac97conf_clk); ac97conf_clk =NULL ;
Signature · 1 line
2.29.2
PATCH v2 11/48 ARM: pxa: move pcmcia board data into mach-pxa
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
The drivers/pcmcia/pxa2xx_*.c are essentially part of the board files, but for historic reasons located in drivers/pcmcia.
Move them into the same place as the actual board file to avoid lots of machine header inclusions.
---
arch/arm/mach-pxa/Makefile | 18 ++-
.../arm/mach-pxa/balloon3-pcmcia.c | 4 +-
arch/arm/mach-pxa/balloon3.c | 2 +-
.../mach-pxa/{include/mach => }/balloon3.h | 2 +-
.../arm/mach-pxa/colibri-pcmcia.c | 2 +-
.../arm/mach-pxa/e740-pcmcia.c | 2 +-
.../arm/mach-pxa/hx4700-pcmcia.c | 2 +-
.../arm/mach-pxa/palmld-pcmcia.c | 2 +-
.../arm/mach-pxa/palmtc-pcmcia.c | 4 +-
arch/arm/mach-pxa/palmtc.c | 2 +-
arch/arm/mach-pxa/{include/mach => }/palmtc.h | 2 +-
.../arm/mach-pxa/palmtx-pcmcia.c | 4 +-
arch/arm/mach-pxa/palmtx.c | 2 +-
arch/arm/mach-pxa/{include/mach => }/palmtx.h | 2 +-
.../arm/mach-pxa/trizeps4-pcmcia.c | 4 +-
arch/arm/mach-pxa/trizeps4.c | 2 +-
.../mach-pxa/{include/mach => }/trizeps4.h | 2 +-
.../arm/mach-pxa/viper-pcmcia.c | 6 +-
.../arm/mach-pxa/viper-pcmcia.h | 0
arch/arm/mach-pxa/viper.c | 2 +-
.../arm/mach-pxa/vpac270-pcmcia.c | 4 +-
arch/arm/mach-pxa/vpac270.c | 2 +-
.../arm/mach-pxa/{include/mach => }/vpac270.h | 0
arch/arm/mach-pxa/zeus.c | 2 +-
drivers/pcmcia/Makefile | 13 --
drivers/pcmcia/pxa2xx_sharpsl.c | 2 +-
drivers/pcmcia/soc_common.h | 120 +----------------
include/pcmcia/soc_common.h | 125 ++++++++++++++++++
28 files changed, 165 insertions(+), 169 deletions(-)
rename drivers/pcmcia/pxa2xx_balloon3.c => arch/arm/mach-pxa/balloon3-pcmcia.c (98%)
rename arch/arm/mach-pxa/{include/mach => }/balloon3.h (99%)
rename drivers/pcmcia/pxa2xx_colibri.c => arch/arm/mach-pxa/colibri-pcmcia.c (99%)
rename drivers/pcmcia/pxa2xx_e740.c => arch/arm/mach-pxa/e740-pcmcia.c (98%)
rename drivers/pcmcia/pxa2xx_hx4700.c => arch/arm/mach-pxa/hx4700-pcmcia.c (98%)
rename drivers/pcmcia/pxa2xx_palmld.c => arch/arm/mach-pxa/palmld-pcmcia.c (98%)
rename drivers/pcmcia/pxa2xx_palmtc.c => arch/arm/mach-pxa/palmtc-pcmcia.c (98%)
rename arch/arm/mach-pxa/{include/mach => }/palmtc.h (98%)
rename drivers/pcmcia/pxa2xx_palmtx.c => arch/arm/mach-pxa/palmtx-pcmcia.c (98%)
rename arch/arm/mach-pxa/{include/mach => }/palmtx.h (98%)
rename drivers/pcmcia/pxa2xx_trizeps4.c => arch/arm/mach-pxa/trizeps4-pcmcia.c (98%)
rename arch/arm/mach-pxa/{include/mach => }/trizeps4.h (99%)
rename drivers/pcmcia/pxa2xx_viper.c => arch/arm/mach-pxa/viper-pcmcia.c (97%)
rename include/linux/platform_data/pcmcia-pxa2xx_viper.h => arch/arm/mach-pxa/viper-pcmcia.h (100%)
rename drivers/pcmcia/pxa2xx_vpac270.c => arch/arm/mach-pxa/vpac270-pcmcia.c (98%)
rename arch/arm/mach-pxa/{include/mach => }/vpac270.h (100%)
create mode 100644 include/pcmcia/soc_common.harch/arm/mach-pxa/Makefile +11 -7
@@ -37,7 +37,8 @@ obj-$(CONFIG_MACH_SAAR) += saar.o obj-$(CONFIG_ARCH_PXA_IDP) += idp.o obj-$(CONFIG_ARCH_VIPER) += viper.o obj-$(CONFIG_MACH_ARCOM_ZEUS) += zeus.o -obj-$(CONFIG_MACH_BALLOON3) += balloon3.o +obj-$(CONFIG_ARCOM_PCMCIA) += viper-pcmcia.o +obj-$(CONFIG_MACH_BALLOON3) += balloon3.o balloon3-pcmcia.o obj-$(CONFIG_MACH_CSB726) += csb726.o obj-$(CONFIG_CSB726_CSB701) += csb701.o obj-$(CONFIG_MACH_CM_X300) += cm-x300.o
@@ -47,18 +48,20 @@ obj-$(CONFIG_GUMSTIX_AM200EPD) += am200epd.o obj-$(CONFIG_GUMSTIX_AM300EPD) += am300epd.o obj-$(CONFIG_MACH_XCEP) += xcep.o obj-$(CONFIG_MACH_TRIZEPS4) += trizeps4.o +obj-$(CONFIG_TRIZEPS_PCMCIA) += trizeps4-pcmcia.o obj-$(CONFIG_MACH_LOGICPD_PXA270) += lpd270.o obj-$(CONFIG_MACH_PCM027) += pcm027.o obj-$(CONFIG_MACH_PCM990_BASEBOARD) += pcm990-baseboard.o -obj-$(CONFIG_MACH_COLIBRI) += colibri-pxa270.o +obj-$(CONFIG_MACH_COLIBRI) += colibri-pxa270.o colibri-pcmcia.o obj-$(CONFIG_MACH_COLIBRI_EVALBOARD) += colibri-evalboard.o obj-$(CONFIG_MACH_COLIBRI_PXA270_INCOME) += colibri-pxa270-income.o obj-$(CONFIG_MACH_COLIBRI300) += colibri-pxa3xx.o colibri-pxa300.o -obj-$(CONFIG_MACH_COLIBRI320) += colibri-pxa3xx.o colibri-pxa320.o -obj-$(CONFIG_MACH_VPAC270) += vpac270.o +obj-$(CONFIG_MACH_COLIBRI320) += colibri-pxa3xx.o colibri-pxa320.o colibri-pcmcia.o +obj-$(CONFIG_MACH_VPAC270) += vpac270.o vpac270-pcmcia.o # End-user Products obj-$(CONFIG_MACH_H4700) += hx4700.o +obj-$(CONFIG_MACH_H4700) += hx4700-pcmcia.o obj-$(CONFIG_MACH_H5000) += h5000.o obj-$(CONFIG_MACH_HIMALAYA) += himalaya.o obj-$(CONFIG_MACH_MAGICIAN) += magician.o
@@ -66,12 +69,12 @@ obj-$(CONFIG_MACH_MIOA701) += mioa701.o mioa701_bootresume.o obj-$(CONFIG_PXA_EZX) += ezx.o obj-$(CONFIG_MACH_MP900C) += mp900.o obj-$(CONFIG_MACH_PALMTE2) += palmte2.o -obj-$(CONFIG_MACH_PALMTC) += palmtc.o +obj-$(CONFIG_MACH_PALMTC) += palmtc.o palmtc-pcmcia.o obj-$(CONFIG_MACH_PALM27X) += palm27x.o obj-$(CONFIG_MACH_PALMT5) += palmt5.o -obj-$(CONFIG_MACH_PALMTX) += palmtx.o +obj-$(CONFIG_MACH_PALMTX) += palmtx.o palmtx-pcmcia.o obj-$(CONFIG_MACH_PALMZ72) += palmz72.o -obj-$(CONFIG_MACH_PALMLD) += palmld.o +obj-$(CONFIG_MACH_PALMLD) += palmld.o palmld-pcmcia.o obj-$(CONFIG_PALM_TREO) += palmtreo.o obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o sharpsl_pm.o corgi_pm.o obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o sharpsl_pm.o spitz_pm.o
@@ -79,6 +82,7 @@ obj-$(CONFIG_MACH_POODLE) += poodle.o obj-$(CONFIG_MACH_TOSA) += tosa.o obj-$(CONFIG_MACH_ICONTROL) += icontrol.o mxm8x10.o obj-$(CONFIG_ARCH_PXA_ESERIES) += eseries.o +obj-$(CONFIG_MACH_E740) += e740-pcmcia.o obj-$(CONFIG_MACH_ZIPIT2) += z2.o obj-$(CONFIG_PXA_SYSTEMS_CPLDS) += pxa_cplds_irqs.o
arch/arm/mach-pxa/balloon3-pcmcia.c renamed from drivers/pcmcia/pxa2xx_balloon3.c +2 -2
@@ -20,11 +20,11 @@#include <linux/irq.h> #include <linux/io.h> -#include <mach/balloon3.h> +#include "balloon3.h" #include <asm/mach-types.h> -#include "soc_common.h" +#include <pcmcia/soc_common.h> static int balloon3_pcmcia_hw_init (struct soc_pcmcia_socket *skt) {
arch/arm/mach-pxa/balloon3.c +1 -1
@@ -40,7 +40,7 @@#include <asm/mach/flash.h> #include "pxa27x.h" -#include <mach/balloon3.h> +#include "balloon3.h" #include <linux/platform_data/asoc-pxa.h> #include <linux/platform_data/video-pxafb.h> #include <linux/platform_data/mmc-pxamci.h>
arch/arm/mach-pxa/balloon3.h renamed from arch/arm/mach-pxa/include/mach/balloon3.h +1 -1
@@ -11,7 +11,7 @@#ifndef ASM_ARCH_BALLOON3_H #define ASM_ARCH_BALLOON3_H -#include "irqs.h" /* PXA_NR_BUILTIN_GPIO */ +#include <mach/irqs.h> /* PXA_NR_BUILTIN_GPIO */ enum balloon3_features { BALLOON3_FEATURE_OHCI,
arch/arm/mach-pxa/colibri-pcmcia.c renamed from drivers/pcmcia/pxa2xx_colibri.c +1 -1
@@ -14,7 +14,7 @@#include <asm/mach-types.h> -#include "soc_common.h" +#include <pcmcia/soc_common.h> #define COLIBRI270_RESET_GPIO 53#define COLIBRI270_PPEN_GPIO 107
arch/arm/mach-pxa/e740-pcmcia.c renamed from drivers/pcmcia/pxa2xx_e740.c +1 -1
@@ -18,7 +18,7 @@#include <asm/irq.h> #include <asm/mach-types.h> -#include "soc_common.h" +#include <pcmcia/soc_common.h> static int e740_pcmcia_hw_init (struct soc_pcmcia_socket *skt) {
arch/arm/mach-pxa/hx4700-pcmcia.c renamed from drivers/pcmcia/pxa2xx_hx4700.c +1 -1
@@ -12,7 +12,7 @@#include <asm/mach-types.h> #include <mach/hx4700.h> -#include "soc_common.h" +#include <pcmcia/soc_common.h> static struct gpio gpios[] = { {GPIO114_HX4700_CF_RESET ,GPIOF_OUT_INIT_LOW ,"CF reset" },
arch/arm/mach-pxa/palmld-pcmcia.c renamed from drivers/pcmcia/pxa2xx_palmld.c +1 -1
@@ -14,7 +14,7 @@#include <asm/mach-types.h> #include <mach/palmld.h> -#include "soc_common.h" +#include <pcmcia/soc_common.h> static struct gpio palmld_pcmcia_gpios[] = { {GPIO_NR_PALMLD_PCMCIA_POWER ,GPIOF_INIT_LOW ,"PCMCIA Power" },
arch/arm/mach-pxa/palmtc-pcmcia.c renamed from drivers/pcmcia/pxa2xx_palmtc.c +2 -2
@@ -14,8 +14,8 @@#include <linux/delay.h> #include <asm/mach-types.h> -#include <mach/palmtc.h> -#include "soc_common.h" +#include "palmtc.h" +#include <pcmcia/soc_common.h> static struct gpio palmtc_pcmcia_gpios[] = { {GPIO_NR_PALMTC_PCMCIA_POWER1 ,GPIOF_INIT_LOW ,"PCMCIA Power 1" },
arch/arm/mach-pxa/palmtc.c +1 -1
@@ -30,7 +30,7 @@#include "pxa25x.h" #include <linux/platform_data/asoc-pxa.h> -#include <mach/palmtc.h> +#include "palmtc.h" #include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/video-pxafb.h> #include <linux/platform_data/irda-pxaficp.h>
arch/arm/mach-pxa/palmtc.h renamed from arch/arm/mach-pxa/include/mach/palmtc.h +1 -1
@@ -12,7 +12,7 @@#ifndef _INCLUDE_PALMTC_H_#define _INCLUDE_PALMTC_H_ -#include "irqs.h" /* PXA_GPIO_TO_IRQ */ +#include <mach/irqs.h> /* PXA_GPIO_TO_IRQ */ /** HERE ARE GPIOs **/
arch/arm/mach-pxa/palmtx-pcmcia.c renamed from drivers/pcmcia/pxa2xx_palmtx.c +2 -2
@@ -12,8 +12,8 @@#include <linux/gpio.h> #include <asm/mach-types.h> -#include <mach/palmtx.h> -#include "soc_common.h" +#include "palmtx.h" +#include <pcmcia/soc_common.h> static struct gpio palmtx_pcmcia_gpios[] = { {GPIO_NR_PALMTX_PCMCIA_POWER1 ,GPIOF_INIT_LOW ,"PCMCIA Power 1" },
arch/arm/mach-pxa/palmtx.c +1 -1
@@ -33,7 +33,7 @@#include "pxa27x.h" #include <linux/platform_data/asoc-pxa.h> -#include <mach/palmtx.h> +#include "palmtx.h" #include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/video-pxafb.h> #include <linux/platform_data/irda-pxaficp.h>
arch/arm/mach-pxa/palmtx.h renamed from arch/arm/mach-pxa/include/mach/palmtx.h +1 -1
@@ -12,7 +12,7 @@#ifndef _INCLUDE_PALMTX_H_#define _INCLUDE_PALMTX_H_ -#include "irqs.h" /* PXA_GPIO_TO_IRQ */ +#include <mach/irqs.h> /* PXA_GPIO_TO_IRQ */ /** HERE ARE GPIOs **/
arch/arm/mach-pxa/trizeps4-pcmcia.c renamed from drivers/pcmcia/pxa2xx_trizeps4.c +2 -2
@@ -20,9 +20,9 @@#include <asm/irq.h> #include <mach/pxa2xx-regs.h> -#include <mach/trizeps4.h> +#include "trizeps4.h" -#include "soc_common.h" +#include <pcmcia/soc_common.h> extern void board_pcmcia_power (int power);
arch/arm/mach-pxa/trizeps4.c +1 -1
@@ -40,7 +40,7 @@#include <asm/mach/flash.h> #include "pxa27x.h" -#include <mach/trizeps4.h> +#include "trizeps4.h" #include <linux/platform_data/asoc-pxa.h> #include <linux/platform_data/video-pxafb.h> #include <linux/platform_data/mmc-pxamci.h>
arch/arm/mach-pxa/trizeps4.h renamed from arch/arm/mach-pxa/include/mach/trizeps4.h +1 -1
@@ -12,7 +12,7 @@#define _TRIPEPS4_H_#include <mach/addr-map.h> -#include "irqs.h" /* PXA_GPIO_TO_IRQ */ +#include <mach/irqs.h> /* PXA_GPIO_TO_IRQ */ /* physical memory regions */ #define TRIZEPS4_FLASH_PHYS (PXA_CS0_PHYS)/* Flash region */
arch/arm/mach-pxa/viper-pcmcia.c renamed from drivers/pcmcia/pxa2xx_viper.c +2 -4
@@ -22,13 +22,11 @@#include <linux/gpio.h> #include <pcmcia/ss.h> +#include <pcmcia/soc_common.h> #include <asm/irq.h> -#include <linux/platform_data/pcmcia-pxa2xx_viper.h> - -#include "soc_common.h" -#include "pxa2xx_base.h" +#include "viper-pcmcia.h" static struct platform_device *arcom_pcmcia_dev;
arch/arm/mach-pxa/viper-pcmcia.h renamed from include/linux/platform_data/pcmcia-pxa2xx_viper.h +0 -0
arch/arm/mach-pxa/viper.c +1 -1
@@ -49,7 +49,7 @@#include <linux/platform_data/asoc-pxa.h> #include <linux/platform_data/video-pxafb.h> #include "regs-uart.h" -#include <linux/platform_data/pcmcia-pxa2xx_viper.h> +#include "viper-pcmcia.h" #include "viper.h" #include <asm/setup.h>
arch/arm/mach-pxa/vpac270-pcmcia.c renamed from drivers/pcmcia/pxa2xx_vpac270.c +2 -2
@@ -13,9 +13,9 @@#include <asm/mach-types.h> -#include <mach/vpac270.h> +#include "vpac270.h" -#include "soc_common.h" +#include <pcmcia/soc_common.h> static struct gpio vpac270_pcmcia_gpios[] = { {GPIO107_VPAC270_PCMCIA_PPEN ,GPIOF_INIT_LOW ,"PCMCIA PPEN" },
arch/arm/mach-pxa/vpac270.c +1 -1
@@ -30,7 +30,7 @@#include "pxa27x.h" #include <linux/platform_data/asoc-pxa.h> -#include <mach/vpac270.h> +#include "vpac270.h" #include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/video-pxafb.h> #include <linux/platform_data/usb-ohci-pxa27x.h>
arch/arm/mach-pxa/vpac270.h renamed from arch/arm/mach-pxa/include/mach/vpac270.h +0 -0
arch/arm/mach-pxa/zeus.c +1 -1
@@ -47,7 +47,7 @@#include <linux/platform_data/video-pxafb.h> #include "pm.h" #include <linux/platform_data/asoc-pxa.h> -#include <linux/platform_data/pcmcia-pxa2xx_viper.h> +#include "viper-pcmcia.h" #include "zeus.h" #include <mach/smemc.h>
drivers/pcmcia/Makefile +0 -13
@@ -50,18 +50,5 @@ sa1100_cs-$(CONFIG_SA1100_SIMPAD) += sa1100_simpad.o pxa2xx-obj-$(CONFIG_MACH_MAINSTONE) += pxa2xx_mainstone.o pxa2xx-obj-$(CONFIG_PXA_SHARPSL) += pxa2xx_sharpsl.o -pxa2xx-obj-$(CONFIG_ARCOM_PCMCIA) += pxa2xx_viper.o -pxa2xx-obj-$(CONFIG_TRIZEPS_PCMCIA) += pxa2xx_trizeps4.o -pxa2xx-obj-$(CONFIG_MACH_PALMTX) += pxa2xx_palmtx.o -pxa2xx-obj-$(CONFIG_MACH_PALMTC) += pxa2xx_palmtc.o -pxa2xx-obj-$(CONFIG_MACH_PALMLD) += pxa2xx_palmld.o -pxa2xx-obj-$(CONFIG_MACH_E740) += pxa2xx_e740.o -pxa2xx-obj-$(CONFIG_MACH_VPAC270) += pxa2xx_vpac270.o -pxa2xx-obj-$(CONFIG_MACH_BALLOON3) += pxa2xx_balloon3.o -pxa2xx-obj-$(CONFIG_MACH_COLIBRI) += pxa2xx_colibri.o -pxa2xx-obj-$(CONFIG_MACH_COLIBRI320) += pxa2xx_colibri.o -pxa2xx-obj-$(CONFIG_MACH_H4700) += pxa2xx_hx4700.o - obj-$(CONFIG_PCMCIA_PXA2XX) += pxa2xx_base.o $(pxa2xx-obj-y) - obj-$(CONFIG_PCMCIA_XXS1500) += xxs1500_ss.o
drivers/pcmcia/pxa2xx_sharpsl.c +1 -1
@@ -18,7 +18,7 @@#include <asm/irq.h> #include <asm/hardware/scoop.h> -#include "soc_common.h" +#include <pcmcia/soc_common.h> #define NO_KEEP_VS 0x0001#define SCOOP_DEV platform_scoop_config->devs
drivers/pcmcia/soc_common.h +1 -119
138 lines not on this page · raw message
include/pcmcia/soc_common.h new file +125 -0
125 lines not on this page · raw message
Signature · 1 line
2.29.2
PATCH v2 12/48 ARM: pxa: make addr-map.h header local
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
Drivers should not rely on the contents of this file, so move it into the platform directory directly.
---
arch/arm/mach-pxa/{include/mach => }/addr-map.h | 0
arch/arm/mach-pxa/generic.c | 2 +-
arch/arm/mach-pxa/hx4700.c | 2 +-
arch/arm/mach-pxa/lpd270.c | 2 +-
arch/arm/mach-pxa/magician.c | 2 +-
arch/arm/mach-pxa/mainstone.c | 2 +-
arch/arm/mach-pxa/pxa25x.c | 2 +-
arch/arm/mach-pxa/pxa25x.h | 2 +-
arch/arm/mach-pxa/pxa27x.c | 2 +-
arch/arm/mach-pxa/pxa27x.h | 2 +-
arch/arm/mach-pxa/pxa3xx.c | 2 +-
arch/arm/mach-pxa/pxa3xx.h | 2 +-
arch/arm/mach-pxa/trizeps4.h | 2 +-
arch/arm/mach-pxa/xcep.c | 2 +-
14 files changed, 13 insertions(+), 13 deletions(-)
rename arch/arm/mach-pxa/{include/mach => }/addr-map.h (100%)arch/arm/mach-pxa/addr-map.h renamed from arch/arm/mach-pxa/include/mach/addr-map.h +0 -0
arch/arm/mach-pxa/generic.c +1 -1
@@ -22,7 +22,7 @@#include <asm/mach/map.h> #include <asm/mach-types.h> -#include <mach/addr-map.h> +#include "addr-map.h" #include <mach/irqs.h> #include <mach/reset.h> #include <mach/smemc.h>
arch/arm/mach-pxa/hx4700.c +1 -1
@@ -40,7 +40,7 @@#include <asm/mach/arch.h> #include "pxa27x.h" -#include <mach/addr-map.h> +#include "addr-map.h" #include <mach/hx4700.h> #include <linux/platform_data/irda-pxaficp.h>
arch/arm/mach-pxa/lpd270.c +1 -1
@@ -38,7 +38,7 @@#include "pxa27x.h" #include "lpd270.h" -#include <mach/addr-map.h> +#include "addr-map.h" #include <linux/platform_data/asoc-pxa.h> #include <linux/platform_data/video-pxafb.h> #include <linux/platform_data/mmc-pxamci.h>
arch/arm/mach-pxa/magician.c +1 -1
@@ -34,7 +34,7 @@#include <asm/system_info.h> #include "pxa27x.h" -#include <mach/addr-map.h> +#include "addr-map.h" #include <mach/magician.h> #include <linux/platform_data/video-pxafb.h> #include <linux/platform_data/mmc-pxamci.h>
arch/arm/mach-pxa/mainstone.c +1 -1
@@ -51,7 +51,7 @@#include <linux/platform_data/irda-pxaficp.h> #include <linux/platform_data/usb-ohci-pxa27x.h> #include <linux/platform_data/keypad-pxa27x.h> -#include <mach/addr-map.h> +#include "addr-map.h" #include <mach/smemc.h> #include "generic.h"
arch/arm/mach-pxa/pxa25x.c +1 -1
@@ -34,7 +34,7 @@#include "pxa25x.h" #include <mach/reset.h> #include "pm.h" -#include <mach/addr-map.h> +#include "addr-map.h" #include <mach/smemc.h> #include "generic.h"
arch/arm/mach-pxa/pxa25x.h +1 -1
@@ -2,7 +2,7 @@#ifndef __MACH_PXA25x_H#define __MACH_PXA25x_H -#include <mach/addr-map.h> +#include "addr-map.h" #include <mach/pxa2xx-regs.h> #include "mfp-pxa25x.h" #include <mach/irqs.h>
arch/arm/mach-pxa/pxa27x.c +1 -1
@@ -33,7 +33,7 @@#include <mach/reset.h> #include <linux/platform_data/usb-ohci-pxa27x.h> #include "pm.h" -#include <mach/addr-map.h> +#include "addr-map.h" #include <mach/smemc.h> #include "generic.h"
arch/arm/mach-pxa/pxa27x.h +1 -1
@@ -3,7 +3,7 @@#define __MACH_PXA27x_H#include <linux/suspend.h> -#include <mach/addr-map.h> +#include "addr-map.h" #include <mach/pxa2xx-regs.h> #include "mfp-pxa27x.h" #include <mach/irqs.h>
arch/arm/mach-pxa/pxa3xx.c +1 -1
@@ -32,7 +32,7 @@#include <mach/reset.h> #include <linux/platform_data/usb-ohci-pxa27x.h> #include "pm.h" -#include <mach/addr-map.h> +#include "addr-map.h" #include <mach/smemc.h> #include <mach/irqs.h>
arch/arm/mach-pxa/pxa3xx.h +1 -1
@@ -2,7 +2,7 @@#ifndef __MACH_PXA3XX_H#define __MACH_PXA3XX_H -#include <mach/addr-map.h> +#include "addr-map.h" #include <mach/pxa3xx-regs.h> #include <mach/irqs.h>
arch/arm/mach-pxa/trizeps4.h +1 -1
@@ -11,7 +11,7 @@#ifndef _TRIPEPS4_H_#define _TRIPEPS4_H_ -#include <mach/addr-map.h> +#include "addr-map.h" #include <mach/irqs.h> /* PXA_GPIO_TO_IRQ */ /* physical memory regions */
arch/arm/mach-pxa/xcep.c +1 -1
@@ -25,7 +25,7 @@#include <asm/mach/map.h> #include "pxa25x.h" -#include <mach/addr-map.h> +#include "addr-map.h" #include <mach/smemc.h> #include "generic.h"
Signature · 1 line
2.29.2
PATCH v2 13/48 ARM: pxa: use pdev resource for palmld mmio
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
The palmld header is almost unused in drivers, the only remaining thing now is the PATA device address, which should really be passed as a resource.
---
arch/arm/mach-pxa/palmld-pcmcia.c | 3 ++-
arch/arm/mach-pxa/palmld.c | 12 +++++++++---
arch/arm/mach-pxa/{include/mach => }/palmld.h | 2 +-
drivers/ata/pata_palmld.c | 3 +--
4 files changed, 13 insertions(+), 7 deletions(-)
rename arch/arm/mach-pxa/{include/mach => }/palmld.h (98%)arch/arm/mach-pxa/palmld-pcmcia.c +2 -1
@@ -13,9 +13,10 @@#include <linux/gpio.h> #include <asm/mach-types.h> -#include <mach/palmld.h> #include <pcmcia/soc_common.h> +#include "palmld.h" +static struct gpio palmld_pcmcia_gpios[] = { {GPIO_NR_PALMLD_PCMCIA_POWER ,GPIOF_INIT_LOW ,"PCMCIA Power" }, {GPIO_NR_PALMLD_PCMCIA_RESET ,GPIOF_INIT_HIGH ,"PCMCIA Reset" },
arch/arm/mach-pxa/palmld.c +9 -3
@@ -29,8 +29,8 @@#include <asm/mach/map.h> #include "pxa27x.h" +#include "palmld.h" #include <linux/platform_data/asoc-pxa.h> -#include <mach/palmld.h> #include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/video-pxafb.h> #include <linux/platform_data/irda-pxaficp.h>
@@ -279,9 +279,15 @@ static inline void palmld_leds_init(void) {}* HDD ******************************************************************************/ #if defined(CONFIG_PATA_PALMLD ) || defined(CONFIG_PATA_PALMLD_MODULE ) +static struct resource palmld_ide_resources[] = { +DEFINE_RES_MEM (PALMLD_IDE_PHYS ,0x1000 ), +}; +static struct platform_device palmld_ide_device = { - .name ="pata_palmld" , - .id =-1 , + .name ="pata_palmld" , + .id =-1 , + .resource = palmld_ide_resources, + .num_resources =ARRAY_SIZE (palmld_ide_resources), }; static struct gpiod_lookup_table palmld_ide_gpio_table = {
arch/arm/mach-pxa/palmld.h renamed from arch/arm/mach-pxa/include/mach/palmld.h +1 -1
@@ -9,7 +9,7 @@#ifndef _INCLUDE_PALMLD_H_#define _INCLUDE_PALMLD_H_ -#include "irqs.h" /* PXA_GPIO_TO_IRQ */ +#include <mach/irqs.h> /* PXA_GPIO_TO_IRQ */ /** HERE ARE GPIOs **/
drivers/ata/pata_palmld.c +1 -2
@@ -25,7 +25,6 @@#include <linux/gpio/consumer.h> #include <scsi/scsi_host.h> -#include <mach/palmld.h> #define DRV_NAME "pata_palmld"
@@ -63,7 +62,7 @@ static int palmld_pata_probe(struct platform_device *pdev)return -ENOMEM ;/* remap drive's physical memory address */ - mem =devm_ioremap (dev,PALMLD_IDE_PHYS ,0x1000 ); + mem =devm_platform_ioremap_resource (pdev,0 );if (!mem)return -ENOMEM ;
Signature · 1 line
2.29.2
Re: [PATCH 13/48] ARM: pxa: use pdev resource for palmld mmio
Quoted 96 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The palmld header is almost unused in drivers, the only remaining thing now is the PATA device address, which should really be passed as a resource.
Cc Jens Axboe <[email protected]>Acked-by Robert Jarzmik <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>--- arch/arm/mach-pxa/palmld-pcmcia.c | 3 ++- arch/arm/mach-pxa/palmld.c | 12 +++++++++--- arch/arm/mach-pxa/{include/mach => }/palmld.h | 2 +- drivers/ata/pata_palmld.c | 3 +-- 4 files changed, 13 insertions(+), 7 deletions(-) rename arch/arm/mach-pxa/{include/mach => }/palmld.h (98%)arch/arm/mach-pxa/palmld-pcmcia.c +2
-1@@ -13,9 +13,10 @@#include <linux/gpio.h> #include <asm/mach-types.h> -#include <mach/palmld.h> #include <pcmcia/soc_common.h> +#include "palmld.h" +static struct gpio palmld_pcmcia_gpios[] = { {GPIO_NR_PALMLD_PCMCIA_POWER ,GPIOF_INIT_LOW ,"PCMCIA Power" }, {GPIO_NR_PALMLD_PCMCIA_RESET ,GPIOF_INIT_HIGH ,"PCMCIA Reset" },arch/arm/mach-pxa/palmld.c +9
-3@@ -29,8 +29,8 @@#include <asm/mach/map.h> #include "pxa27x.h" +#include "palmld.h" #include <linux/platform_data/asoc-pxa.h> -#include <mach/palmld.h> #include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/video-pxafb.h> #include <linux/platform_data/irda-pxaficp.h> @@ -279,9 +279,15 @@ static inline void palmld_leds_init(void) {}* HDD ******************************************************************************/ #if defined(CONFIG_PATA_PALMLD ) || defined(CONFIG_PATA_PALMLD_MODULE ) +static struct resource palmld_ide_resources[] = { +DEFINE_RES_MEM (PALMLD_IDE_PHYS ,0x1000 ), +}; +static struct platform_device palmld_ide_device = { - .name ="pata_palmld" , - .id =-1 , + .name ="pata_palmld" , + .id =-1 , + .resource = palmld_ide_resources, + .num_resources =ARRAY_SIZE (palmld_ide_resources), }; static struct gpiod_lookup_table palmld_ide_gpio_table = {arch/arm/mach-pxa/palmld.h renamed from arch/arm/mach-pxa/include/mach/palmld.h +1
-1@@ -9,7 +9,7 @@#ifndef _INCLUDE_PALMLD_H_#define _INCLUDE_PALMLD_H_ -#include "irqs.h" /* PXA_GPIO_TO_IRQ */ +#include <mach/irqs.h> /* PXA_GPIO_TO_IRQ */ /** HERE ARE GPIOs **/ drivers/ata/pata_palmld.c +0
-1@@ -25,7 +25,6 @@#include <linux/gpio/consumer.h> #include <scsi/scsi_host.h> -#include <mach/palmld.h> #define DRV_NAME "pata_palmld"
drivers/ata/pata_palmld.c static int palmld_pata_probe(struct platform_device *pdev) · line 68
Quoted 8 lines
drivers/ata/pata_palmld.c +1
-1@@ -63,7 +62,7 @@ static int palmld_pata_probe(struct platform_device *pdev)return -ENOMEM ;/* remap drive's physical memory address */ - mem =devm_ioremap (dev,PALMLD_IDE_PHYS ,0x1000 ); + mem =devm_platform_ioremap_resource (pdev,0 );if (!mem)return -ENOMEM ;
Signature · 2 lines
Damien Le Moal Western Digital Research
PATCH v2 14/48 ARM: pxa: maybe fix gpio lookup tables
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
From inspection I found a couple of GPIO lookups that are listed with device "gpio-pxa", but actually have a number from a different gpio controller.
Try to rectify that here, with a guess of what the actual device name is.
--- arch/arm/mach-pxa/cm-x300.c | 8 ++++---- arch/arm/mach-pxa/magician.c | 2 +- arch/arm/mach-pxa/tosa.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-)
arch/arm/mach-pxa/cm-x300.c +4 -4
@@ -356,13 +356,13 @@ static struct platform_device cm_x300_spi_gpio = {static struct gpiod_lookup_table cm_x300_spi_gpiod_table = { .dev_id ="spi_gpio" , .table = { -GPIO_LOOKUP ("gpio-pxa" ,GPIO_LCD_SCL , +GPIO_LOOKUP ("pca9555.1" ,GPIO_LCD_SCL -GPIO_LCD_BASE ,"sck" ,GPIO_ACTIVE_HIGH ), -GPIO_LOOKUP ("gpio-pxa" ,GPIO_LCD_DIN , +GPIO_LOOKUP ("pca9555.1" ,GPIO_LCD_DIN -GPIO_LCD_BASE ,"mosi" ,GPIO_ACTIVE_HIGH ), -GPIO_LOOKUP ("gpio-pxa" ,GPIO_LCD_DOUT , +GPIO_LOOKUP ("pca9555.1" ,GPIO_LCD_DOUT -GPIO_LCD_BASE ,"miso" ,GPIO_ACTIVE_HIGH ), -GPIO_LOOKUP ("gpio-pxa" ,GPIO_LCD_CS , +GPIO_LOOKUP ("pca9555.1" ,GPIO_LCD_CS -GPIO_LCD_BASE ,"cs" ,GPIO_ACTIVE_HIGH ), { }, },
arch/arm/mach-pxa/magician.c +1 -1
@@ -681,7 +681,7 @@ static struct platform_device bq24022 = {static struct gpiod_lookup_table bq24022_gpiod_table = { .dev_id ="gpio-regulator" , .table = { -GPIO_LOOKUP ("gpio-pxa" ,EGPIO_MAGICIAN_BQ24022_ISET2 , +GPIO_LOOKUP ("htc-egpio-0" ,EGPIO_MAGICIAN_BQ24022_ISET2 -MAGICIAN_EGPIO_BASE ,NULL ,GPIO_ACTIVE_HIGH ),GPIO_LOOKUP ("gpio-pxa" , GPIO30_MAGICIAN_BQ24022_nCHARGE_EN,"enable" ,GPIO_ACTIVE_LOW ),
arch/arm/mach-pxa/tosa.c +2 -2
@@ -296,9 +296,9 @@ static struct gpiod_lookup_table tosa_mci_gpio_table = { .table = {GPIO_LOOKUP ("gpio-pxa" , TOSA_GPIO_nSD_DETECT,"cd" ,GPIO_ACTIVE_LOW ), -GPIO_LOOKUP ("gpio-pxa" ,TOSA_GPIO_SD_WP , +GPIO_LOOKUP ("sharp-scoop.0" ,TOSA_GPIO_SD_WP -TOSA_SCOOP_GPIO_BASE ,"wp" ,GPIO_ACTIVE_LOW ), -GPIO_LOOKUP ("gpio-pxa" ,TOSA_GPIO_PWR_ON , +GPIO_LOOKUP ("sharp-scoop.0" ,TOSA_GPIO_PWR_ON -TOSA_SCOOP_GPIO_BASE , "power", GPIO_ACTIVE_HIGH), { }, },
Signature · 1 line
2.29.2
PATCH v2 15/48 ARM: pxa: tosa: use gpio descriptor for audio
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
The audio driver should not use a hardwired gpio number from the header. Change it to use a lookup table.
--- arch/arm/mach-pxa/tosa.c | 12 ++++++++++++ sound/soc/pxa/tosa.c | 16 +++++++--------- 2 files changed, 19 insertions(+), 9 deletions(-)
arch/arm/mach-pxa/tosa.c +12 -0
@@ -887,6 +887,17 @@ static struct platform_device wm9712_device = { .id = -1, }; +static struct gpiod_lookup_table tosa_audio_gpio_table = { + .dev_id ="tosa-audio" , + .table = { +GPIO_LOOKUP ("tc6393xb" , +TOSA_GPIO_L_MUTE -TOSA_TC6393XB_GPIO_BASE , +"l-mute" ,GPIO_ACTIVE_HIGH ), + { }, + }, +}; + +static struct platform_device tosa_audio_device = { .name ="tosa-audio" , .id =-1 ,
@@ -944,6 +955,7 @@ static void __init tosa_init(void)PMCR =0x01 ;gpiod_add_lookup_table (&tosa_mci_gpio_table); +gpiod_add_lookup_table (&tosa_audio_gpio_table);pxa_set_mci_info (&tosa_mci_platform_data);pxa_set_ficp_info (&tosa_ficp_platform_data);pxa_set_i2c_info (NULL );
sound/soc/pxa/tosa.c +7 -9
@@ -16,14 +16,13 @@#include <linux/module.h> #include <linux/moduleparam.h> #include <linux/device.h> -#include <linux/gpio.h> +#include <linux/gpio/consumer.h> #include <sound/core.h> #include <sound/pcm.h> #include <sound/soc.h> #include <asm/mach-types.h> -#include <mach/tosa.h> #include <linux/platform_data/asoc-pxa.h> #define TOSA_HP 0
@@ -35,6 +34,7 @@static int tosa_jack_func;static int tosa_spk_func; +static struct gpio_desc *l_mute_gpio;static void tosa_ext_control (struct snd_soc_dapm_context *dapm) {
@@ -128,7 +128,7 @@ static int tosa_set_spk(struct snd_kcontrol *kcontrol,static int tosa_hp_event (struct snd_soc_dapm_widget *w,struct snd_kcontrol *k,int event) { -gpio_set_value (TOSA_GPIO_L_MUTE ,SND_SOC_DAPM_EVENT_ON (event) ?1 :0 ); +gpiod_set_value (l_mute_gpio,SND_SOC_DAPM_EVENT_ON (event) ?1 :0 );return 0 ; }
@@ -222,25 +222,23 @@ static int tosa_probe(struct platform_device *pdev)struct snd_soc_card *card = ⤩int ret; - ret =gpio_request_one (TOSA_GPIO_L_MUTE ,GPIOF_OUT_INIT_LOW , -"Headphone Jack" ); + l_mute_gpio =devm_gpiod_get (&pdev->dev,"l-mute" ,GPIOD_OUT_LOW ); + ret =PTR_ERR_OR_ZERO (l_mute_gpio);if (ret)return ret; card->dev = &pdev->dev; ret =devm_snd_soc_register_card (&pdev->dev, card); -if (ret) { +if (ret)dev_err (&pdev->dev,"snd_soc_register_card() failed: %d\n" , ret); -gpio_free (TOSA_GPIO_L_MUTE ); - } +return ret; }static int tosa_remove (struct platform_device *pdev) { -gpio_free (TOSA_GPIO_L_MUTE );return 0 ; }
Signature · 1 line
2.29.2
Re: [PATCH 15/48] ARM: pxa: tosa: use gpio descriptor for audio
Quoted 9 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The audio driver should not use a hardwired gpio number from the header. Change it to use a lookup table.
Acked-by Mark Brown <[email protected]>Acked-by Robert Jarzmik <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>
Looks good to me!
Yours,
Linus Walleij
PATCH v2 16/48 ARM: pxa: poodle: use platform data for poodle asoc driver
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
The poodle audio driver shows its age by using a custom gpio api for the "locomo" support chip.
In a perfect world, this would get converted to use gpiolib and a gpio lookup table.
As the world is not perfect, just pass all the required data in a custom platform_data structure. to avoid the globally visible mach/poodle.h header.
---
arch/arm/mach-pxa/poodle.c | 30 ++++++++----
arch/arm/mach-pxa/{include/mach => }/poodle.h | 4 +-
include/linux/platform_data/asoc-poodle.h | 16 ++++++
sound/soc/pxa/poodle.c | 49 ++++++++++---------
4 files changed, 63 insertions(+), 36 deletions(-)
rename arch/arm/mach-pxa/{include/mach => }/poodle.h (97%)
create mode 100644 include/linux/platform_data/asoc-poodle.harch/arm/mach-pxa/poodle.c +20 -10
@@ -39,11 +39,13 @@#include <asm/mach/irq.h> #include "pxa25x.h" -#include <linux/platform_data/mmc-pxamci.h> #include "udc.h" +#include "poodle.h" + +#include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/irda-pxaficp.h> -#include <mach/poodle.h> #include <linux/platform_data/video-pxafb.h> +#include <linux/platform_data/asoc-poodle.h> #include <asm/hardware/scoop.h> #include <asm/hardware/locomo.h>
@@ -155,12 +157,6 @@ static struct scoop_pcmcia_config poodle_pcmcia_config = {EXPORT_SYMBOL (poodle_scoop_device); - -static struct platform_device poodle_audio_device = { - .name ="poodle-audio" , - .id =-1 , -}; -/* LoCoMo device */ static struct resource locomo_resources[] = { [0 ] = {
@@ -179,7 +175,7 @@ static struct locomo_platform_data locomo_info = { .irq_base = IRQ_BOARD_START, }; -struct platform_device poodle_locomo_device = { +static struct platform_device poodle_locomo_device = { .name ="locomo" , .id =0 , .num_resources =ARRAY_SIZE (locomo_resources),
@@ -189,7 +185,21 @@ struct platform_device poodle_locomo_device = { }, }; -EXPORT_SYMBOL (poodle_locomo_device); +static struct poodle_audio_platform_data poodle_audio_pdata = { + .locomo_dev = &poodle_locomo_device.dev, + + .gpio_amp_on =POODLE_LOCOMO_GPIO_AMP_ON , + .gpio_mute_l =POODLE_LOCOMO_GPIO_MUTE_L , + .gpio_mute_r =POODLE_LOCOMO_GPIO_MUTE_R , + .gpio_232vcc_on =POODLE_LOCOMO_GPIO_232VCC_ON , + .gpio_jk_b =POODLE_LOCOMO_GPIO_JK_B , +}; + +static struct platform_device poodle_audio_device = { + .name ="poodle-audio" , + .id =-1 , + .dev.platform_data = &poodle_audio_pdata, +};#if defined(CONFIG_SPI_PXA2XX ) || defined(CONFIG_SPI_PXA2XX_MODULE ) static struct pxa2xx_spi_controller poodle_spi_info = {
arch/arm/mach-pxa/poodle.h renamed from arch/arm/mach-pxa/include/mach/poodle.h +1 -3
@@ -15,7 +15,7 @@#ifndef __ASM_ARCH_POODLE_H#define __ASM_ARCH_POODLE_H 1 -#include "irqs.h" /* PXA_GPIO_TO_IRQ */ +#include <mach/irqs.h> /* PXA_GPIO_TO_IRQ */ /* * GPIOs
@@ -89,6 +89,4 @@#define POODLE_NR_IRQS (IRQ_BOARD_START + 4)/* 4 for LoCoMo */ -extern struct platform_device poodle_locomo_device; -#endif /* __ASM_ARCH_POODLE_H */
include/linux/platform_data/asoc-poodle.h new file +16 -0
@@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __LINUX_PLATFORM_DATA_POODLE_AUDIO +#define __LINUX_PLATFORM_DATA_POODLE_AUDIO + +/* locomo is not a proper gpio driver, and uses its own api */ +struct poodle_audio_platform_data { +struct device *locomo_dev; + +int gpio_amp_on; +int gpio_mute_l; +int gpio_mute_r; +int gpio_232vcc_on; +int gpio_jk_b; +}; + +#endif
sound/soc/pxa/poodle.c +26 -23
89 lines not on this page · raw message
Signature · 1 line
2.29.2
PATCH v2 17/48 ARM: pxa: corgi: use gpio descriptors for audio
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
The audio driver should not use a hardwired gpio number from the header. Change it to use a lookup table.
---
arch/arm/mach-pxa/corgi.c | 22 ++++++++++-
arch/arm/mach-pxa/{include/mach => }/corgi.h | 2 +-
arch/arm/mach-pxa/corgi_pm.c | 2 +-
sound/soc/pxa/corgi.c | 41 +++++++++++++-------
4 files changed, 51 insertions(+), 16 deletions(-)
rename arch/arm/mach-pxa/{include/mach => }/corgi.h (98%)arch/arm/mach-pxa/corgi.c +21 -1
@@ -49,7 +49,7 @@#include <linux/platform_data/irda-pxaficp.h> #include <linux/platform_data/mmc-pxamci.h> #include "udc.h" -#include <mach/corgi.h> +#include "corgi.h" #include "sharpsl_pm.h" #include <asm/mach/sharpsl_param.h>
@@ -472,6 +472,25 @@ static struct platform_device corgiled_device = { }, }; +static struct gpiod_lookup_table corgi_audio_gpio_table = { + .dev_id ="corgi-audio" , + .table = { +GPIO_LOOKUP ("sharp-scoop" , +CORGI_GPIO_MUTE_L -CORGI_SCOOP_GPIO_BASE , +"mute-l" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("sharp-scoop" , +CORGI_GPIO_MUTE_R -CORGI_SCOOP_GPIO_BASE , +"mute-r" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("sharp-scoop" , +CORGI_GPIO_APM_ON -CORGI_SCOOP_GPIO_BASE , +"apm-on" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("sharp-scoop" , +CORGI_GPIO_MIC_BIAS -CORGI_SCOOP_GPIO_BASE , +"mic-bias" ,GPIO_ACTIVE_HIGH ), + { }, + }, +}; +/* * Corgi Audio */
@@ -744,6 +763,7 @@ static void __init corgi_init(void)pxa_set_udc_info (&udc_info);gpiod_add_lookup_table (&corgi_mci_gpio_table); +gpiod_add_lookup_table (&corgi_audio_gpio_table);pxa_set_mci_info (&corgi_mci_platform_data);pxa_set_ficp_info (&corgi_ficp_platform_data);pxa_set_i2c_info (NULL );
arch/arm/mach-pxa/corgi.h renamed from arch/arm/mach-pxa/include/mach/corgi.h +1 -1
@@ -9,7 +9,7 @@#ifndef __ASM_ARCH_CORGI_H#define __ASM_ARCH_CORGI_H 1 -#include "irqs.h" /* PXA_NR_BUILTIN_GPIO */ +#include <mach/irqs.h> /* PXA_NR_BUILTIN_GPIO */ /* * Corgi (Non Standard) GPIO Definitions
arch/arm/mach-pxa/corgi_pm.c +1 -1
@@ -20,7 +20,7 @@#include <asm/irq.h> #include <asm/mach-types.h> -#include <mach/corgi.h> +#include "corgi.h" #include <mach/pxa2xx-regs.h> #include "sharpsl_pm.h"
sound/soc/pxa/corgi.c +28 -13
101 lines not on this page · raw message
Signature · 1 line
2.29.2
Re: [PATCH 17/48] ARM: pxa: corgi: use gpio descriptors for audio
Quoted 9 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The audio driver should not use a hardwired gpio number from the header. Change it to use a lookup table.
Acked-by Mark Brown <[email protected]>Acked-by Robert Jarzmik <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>
Looks good to me!
Yours,
Linus Walleij
PATCH v2 18/48 ARM: pxa: hx4700: use gpio descriptors for audio
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
The audio driver should not use a hardwired gpio number from the header. Change it to use a lookup table.
---
arch/arm/mach-pxa/hx4700-pcmcia.c | 2 +-
arch/arm/mach-pxa/hx4700.c | 16 ++++++++-
arch/arm/mach-pxa/{include/mach => }/hx4700.h | 2 +-
sound/soc/pxa/hx4700.c | 34 ++++++++-----------
4 files changed, 31 insertions(+), 23 deletions(-)
rename arch/arm/mach-pxa/{include/mach => }/hx4700.h (99%)arch/arm/mach-pxa/hx4700-pcmcia.c +1 -1
@@ -10,7 +10,7 @@#include <linux/irq.h> #include <asm/mach-types.h> -#include <mach/hx4700.h> +#include "hx4700.h" #include <pcmcia/soc_common.h>
arch/arm/mach-pxa/hx4700.c +15 -1
@@ -41,7 +41,7 @@#include "pxa27x.h" #include "addr-map.h" -#include <mach/hx4700.h> +#include "hx4700.h" #include <linux/platform_data/irda-pxaficp.h> #include <sound/ak4641.h>
@@ -834,6 +834,19 @@ static struct i2c_board_info i2c_board_info[] __initdata = { }, }; +static struct gpiod_lookup_table hx4700_audio_gpio_table = { + .dev_id ="hx4700-audio" , + .table = { +GPIO_LOOKUP ("gpio-pxa" , GPIO75_HX4700_EARPHONE_nDET, +"earphone-ndet" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("gpio-pxa" ,GPIO92_HX4700_HP_DRIVER , +"hp-driver" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("gpio-pxa" , GPIO107_HX4700_SPK_nSD, +"spk-nsd" ,GPIO_ACTIVE_HIGH ), + { }, + }, +}; +static struct platform_device audio = { .name ="hx4700-audio" , .id =-1 ,
@@ -895,6 +908,7 @@ static void __init hx4700_init(void)gpiod_add_lookup_table (&bq24022_gpiod_table);gpiod_add_lookup_table (&gpio_vbus_gpiod_table); +gpiod_add_lookup_table (&hx4700_audio_gpio_table);platform_add_devices (devices,ARRAY_SIZE (devices));pwm_add_table (hx4700_pwm_lookup,ARRAY_SIZE (hx4700_pwm_lookup));
arch/arm/mach-pxa/hx4700.h renamed from arch/arm/mach-pxa/include/mach/hx4700.h +1 -1
@@ -10,7 +10,7 @@#include <linux/gpio.h> #include <linux/mfd/asic3.h> -#include "irqs.h" /* PXA_NR_BUILTIN_GPIO */ +#include <mach/irqs.h> /* PXA_NR_BUILTIN_GPIO */ #define HX4700_ASIC3_GPIO_BASE PXA_NR_BUILTIN_GPIO#define HX4700_EGPIO_BASE (HX4700_ASIC3_GPIO_BASE + ASIC3_NUM_GPIOS)
sound/soc/pxa/hx4700.c +14 -20
@@ -10,7 +10,7 @@#include <linux/interrupt.h> #include <linux/platform_device.h> #include <linux/delay.h> -#include <linux/gpio.h> +#include <linux/gpio/consumer.h> #include <sound/core.h> #include <sound/jack.h>
@@ -18,10 +18,10 @@#include <sound/pcm_params.h> #include <sound/soc.h> -#include <mach/hx4700.h> #include <asm/mach-types.h> #include "pxa2xx-i2s.h" +static struct gpio_desc *gpiod_hp_driver, *gpiod_spk_nsd;static struct snd_soc_jack hs_jack;/* Headphones jack detection DAPM pin */
@@ -40,9 +40,8 @@ static struct snd_soc_jack_pin hs_jack_pin[] = {/* Headphones jack detection GPIO */ static struct snd_soc_jack_gpio hs_jack_gpio = { - .gpio = GPIO75_HX4700_EARPHONE_nDET, .invert = true, - .name ="hp-gpio" , + .name ="earphone-ndet" , .report =SND_JACK_HEADPHONE , .debounce_time =200 , };
@@ -81,14 +80,14 @@ static const struct snd_soc_ops hx4700_ops = {static int hx4700_spk_power (struct snd_soc_dapm_widget *w,struct snd_kcontrol *k,int event) { -gpio_set_value (GPIO107_HX4700_SPK_nSD, !!SND_SOC_DAPM_EVENT_ON (event)); +gpiod_set_value (gpiod_spk_nsd, !!SND_SOC_DAPM_EVENT_ON (event));return 0 ; }static int hx4700_hp_power (struct snd_soc_dapm_widget *w,struct snd_kcontrol *k,int event) { -gpio_set_value (GPIO92_HX4700_HP_DRIVER , !!SND_SOC_DAPM_EVENT_ON (event)); +gpiod_set_value (gpiod_hp_driver, !!SND_SOC_DAPM_EVENT_ON (event));return 0 ; }
@@ -162,11 +161,6 @@ static struct snd_soc_card snd_soc_card_hx4700 = { .fully_routed = true, }; -static struct gpio hx4700_audio_gpios[] = { - { GPIO107_HX4700_SPK_nSD,GPIOF_OUT_INIT_HIGH ,"SPK_POWER" }, - {GPIO92_HX4700_HP_DRIVER ,GPIOF_OUT_INIT_LOW ,"EP_POWER" }, -}; -static int hx4700_audio_probe (struct platform_device *pdev) {int ret;
@@ -174,26 +168,26 @@ static int hx4700_audio_probe(struct platform_device *pdev)if (!machine_is_h4700 ())return -ENODEV ; - ret =gpio_request_array (hx4700_audio_gpios, -ARRAY_SIZE (hx4700_audio_gpios)); + gpiod_hp_driver =devm_gpiod_get (&pdev->dev,"hp-driver" ,GPIOD_OUT_HIGH ); + ret =PTR_ERR_OR_ZERO (gpiod_hp_driver); +if (ret) +return ret; + gpiod_spk_nsd =devm_gpiod_get (&pdev->dev,"spk-nsd" ,GPIOD_OUT_HIGH ); + ret =PTR_ERR_OR_ZERO (gpiod_spk_nsd);if (ret)return ret; + hs_jack_gpio.gpiod_dev = &pdev->dev; snd_soc_card_hx4700.dev = &pdev->dev; ret =devm_snd_soc_register_card (&pdev->dev, &snd_soc_card_hx4700); -if (ret) -gpio_free_array (hx4700_audio_gpios, -ARRAY_SIZE (hx4700_audio_gpios));return ret; }static int hx4700_audio_remove (struct platform_device *pdev) { -gpio_set_value (GPIO92_HX4700_HP_DRIVER ,0 ); -gpio_set_value (GPIO107_HX4700_SPK_nSD,0 ); - -gpio_free_array (hx4700_audio_gpios,ARRAY_SIZE (hx4700_audio_gpios)); +gpiod_set_value (gpiod_hp_driver,0 ); +gpiod_set_value (gpiod_spk_nsd,0 );return 0 ; }
Signature · 1 line
2.29.2
Re: [PATCH 18/48] ARM: pxa: hx4700: use gpio descriptors for audio
Quoted 11 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The audio driver should not use a hardwired gpio number from the header. Change it to use a lookup table.
Cc Philipp Zabel <[email protected]>Cc Paul Parsons <[email protected]>Acked-by Mark Brown <[email protected]>Acked-by Robert Jarzmik <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>
(...)
arch/arm/mach-pxa/hx4700.c static struct i2c_board_info i2c_board_info[] __initdata = { · line 841
Quoted 5 lines
arch/arm/mach-pxa/hx4700.c +5
-0+static struct gpiod_lookup_table hx4700_audio_gpio_table = { + .dev_id ="hx4700-audio" , + .table = { +GPIO_LOOKUP ("gpio-pxa" , GPIO75_HX4700_EARPHONE_nDET, +"earphone-ndet" ,GPIO_ACTIVE_HIGH ),
This looks wrong. The n in nDET in the end of the name of the GPIO line means active low does it not?
What I usually do when I see this is to properly set it to GPIO_ACTIVE_LOW in the descriptor table, then invert the logic where it's getting used.
Also rename to earphone-det instead of -ndet
arch/arm/mach-pxa/hx4700.c static struct i2c_board_info i2c_board_info[] __initdata = { · line 845
Quoted 4 lines
arch/arm/mach-pxa/hx4700.c +4
-0+GPIO_LOOKUP ("gpio-pxa" ,GPIO92_HX4700_HP_DRIVER , +"hp-driver" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("gpio-pxa" , GPIO107_HX4700_SPK_nSD, + "spk-nsd", GPIO_ACTIVE_HIGH),
Same here. Rename spk-sd
Yours,
Linus Walleij
Re: [PATCH 18/48] ARM: pxa: hx4700: use gpio descriptors for audio
Quoted 8 lines · Linus Walleij
(...)
Review
Quoted 5 lines
(quoted diff) +5
-0+static struct gpiod_lookup_table hx4700_audio_gpio_table = { + .dev_id = "hx4700-audio", + .table = { + GPIO_LOOKUP("gpio-pxa", GPIO75_HX4700_EARPHONE_nDET, + "earphone-ndet", GPIO_ACTIVE_HIGH),
Quoted 8 lines
This looks wrong. The n in nDET in the end of the name of the GPIO line means active low does it not?
What I usually do when I see this is to properly set it to
GPIO_ACTIVE_LOWin the descriptor table, then invert the logic where it's getting used.Also rename to earphone-det instead of -ndet
Thanks for taking a look! I changed it now, but I don't know if I got the correct number of inversions in the end. How does this look?
Arnd
commit 9d452c9cbee59fc58c940b5f7ae5a40579aab0d2
Author: Arnd Bergmann <[email protected]> Date: Wed Sep 11 14:27:13 2019 +0200
ARM: pxa: hx4700: use gpio descriptors for audio
The audio driver should not use a hardwired gpio number from the header. Change it to use a lookup table.
(quoted diff) +0 -0
b/arch/arm/mach-pxa/hx4700-pcmcia.c
index e8acbfc9ef6c..e2331dfe427d 100644
arch/arm/mach-pxa/hx4700-pcmcia.c +1 -1
@@ -10,7 +10,7 @@#include <linux/irq.h> #include <asm/mach-types.h> -#include <mach/hx4700.h> +#include "hx4700.h" #include <pcmcia/soc_common.h>
arch/arm/mach-pxa/hx4700.c +1 -1
@@ -41,7 +41,7 @@#include "pxa27x.h" #include "addr-map.h" -#include <mach/hx4700.h> +#include "hx4700.h" #include <linux/platform_data/irda-pxaficp.h> #include <sound/ak4641.h>
@@ -834,6 +834,19 @@ static struct i2c_board_info i2c_board_info[]
__initdata = {
},};
+static struct gpiod_lookup_table hx4700_audio_gpio_table = {
+ .dev_id = "hx4700-audio",
+ .table = {
+ GPIO_LOOKUP("gpio-pxa", GPIO75_HX4700_EARPHONE_nDET,
+ "earphone-det", GPIO_ACTIVE_LOW),
+ GPIO_LOOKUP("gpio-pxa", GPIO92_HX4700_HP_DRIVER,
+ "hp-driver", GPIO_ACTIVE_HIGH),
+ GPIO_LOOKUP("gpio-pxa", GPIO107_HX4700_SPK_nSD,
+ "spk-sd", GPIO_ACTIVE_LOW),
+ { },
+ },
+};
+
static struct platform_device audio = {
.name = "hx4700-audio",
.id = -1,@@ -895,6 +908,7 @@ static void __init hx4700_init(void)
gpiod_add_lookup_table(&bq24022_gpiod_table);
gpiod_add_lookup_table(&gpio_vbus_gpiod_table);
+ gpiod_add_lookup_table(&hx4700_audio_gpio_table);
platform_add_devices(devices, ARRAY_SIZE(devices));
pwm_add_table(hx4700_pwm_lookup, ARRAY_SIZE(hx4700_pwm_lookup));(quoted diff) +0 -0
b/arch/arm/mach-pxa/hx4700.h
similarity index 99%
rename from arch/arm/mach-pxa/include/mach/hx4700.h rename to arch/arm/mach-pxa/hx4700.h
index 0c30e6d9c660..ce2db33989e1 100644
arch/arm/mach-pxa/hx4700.h renamed from arch/arm/mach-pxa/include/mach/hx4700.h +1 -1
@@ -10,7 +10,7 @@#include <linux/gpio.h> #include <linux/mfd/asic3.h> -#include "irqs.h" /* PXA_NR_BUILTIN_GPIO */ +#include <mach/irqs.h> /* PXA_NR_BUILTIN_GPIO */ #define HX4700_ASIC3_GPIO_BASE PXA_NR_BUILTIN_GPIO#define HX4700_EGPIO_BASE (HX4700_ASIC3_GPIO_BASE + ASIC3_NUM_GPIOS)
sound/soc/pxa/hx4700.c +5 -12
@@ -10,7 +10,7 @@#include <linux/interrupt.h> #include <linux/platform_device.h> #include <linux/delay.h> -#include <linux/gpio.h> +#include <linux/gpio/consumer.h> #include <sound/core.h> #include <sound/jack.h>
@@ -18,10 +18,10 @@#include <sound/pcm_params.h> #include <sound/soc.h> -#include <mach/hx4700.h> #include <asm/mach-types.h> #include "pxa2xx-i2s.h" +static struct gpio_desc *gpiod_hp_driver, *gpiod_spk_sd;static struct snd_soc_jack hs_jack;/* Headphones jack detection DAPM pin */
@@ -40,9 +40,7 @@ static struct snd_soc_jack_pin hs_jack_pin[] = {/* Headphones jack detection GPIO */ static struct snd_soc_jack_gpio hs_jack_gpio = { - .gpio = GPIO75_HX4700_EARPHONE_nDET, - .invert = true, - .name ="hp-gpio" , + .name ="earphone-det" , .report =SND_JACK_HEADPHONE , .debounce_time =200 , };
@@ -81,14 +79,14 @@ static const struct snd_soc_ops hx4700_ops = {static int hx4700_spk_power (struct snd_soc_dapm_widget *w,struct snd_kcontrol *k,int event) { -gpio_set_value (GPIO107_HX4700_SPK_nSD, !!SND_SOC_DAPM_EVENT_ON (event)); +gpiod_set_value (gpiod_spk_sd, !!SND_SOC_DAPM_EVENT_ON (event));return 0 ; }static int hx4700_hp_power (struct snd_soc_dapm_widget *w,struct snd_kcontrol *k,int event) { -gpio_set_value (GPIO92_HX4700_HP_DRIVER , !!SND_SOC_DAPM_EVENT_ON (event)); +gpiod_set_value (gpiod_hp_driver, !!SND_SOC_DAPM_EVENT_ON (event));return 0 ; }
@@ -162,11 +160,6 @@ static struct snd_soc_card snd_soc_card_hx4700 = { .fully_routed = true, }; -static struct gpio hx4700_audio_gpios[] = { - { GPIO107_HX4700_SPK_nSD,GPIOF_OUT_INIT_HIGH ,"SPK_POWER" }, - {GPIO92_HX4700_HP_DRIVER ,GPIOF_OUT_INIT_LOW ,"EP_POWER" }, -}; -static int hx4700_audio_probe (struct platform_device *pdev) {int ret;
@@ -174,26 +167,26 @@ static int hx4700_audio_probe(struct
platform_device *pdev)
if (!machine_is_h4700())
return -ENODEV;- ret = gpio_request_array(hx4700_audio_gpios,
- ARRAY_SIZE(hx4700_audio_gpios));
+ gpiod_hp_driver = devm_gpiod_get(&pdev->dev, "hp-driver",GPIOD_OUT_HIGH);
+ ret = PTR_ERR_OR_ZERO(gpiod_hp_driver);
+ if (ret)
+ return ret;
+ gpiod_spk_sd = devm_gpiod_get(&pdev->dev, "spk-sd", GPIOD_OUT_LOW);
+ ret = PTR_ERR_OR_ZERO(gpiod_spk_sd);
if (ret)
return ret;+ hs_jack_gpio.gpiod_dev = &pdev->dev;
snd_soc_card_hx4700.dev = &pdev->dev;
ret = devm_snd_soc_register_card(&pdev->dev, &snd_soc_card_hx4700);- if (ret)
- gpio_free_array(hx4700_audio_gpios,
- ARRAY_SIZE(hx4700_audio_gpios));
return ret;
}
static int hx4700_audio_remove(struct platform_device *pdev) {
- gpio_set_value(GPIO92_HX4700_HP_DRIVER, 0);
- gpio_set_value(GPIO107_HX4700_SPK_nSD, 0);
-
- gpio_free_array(hx4700_audio_gpios, ARRAY_SIZE(hx4700_audio_gpios));
+ gpiod_set_value(gpiod_hp_driver, 0);
+ gpiod_set_value(gpiod_spk_sd, 0);
return 0;}
Re: [PATCH 18/48] ARM: pxa: hx4700: use gpio descriptors for audio
Quoted 12 lines · Arnd Bergmann
Quoted 11 lines · Linus Walleij
(...)
Review
Quoted 5 lines
(quoted diff) +5
-0+static struct gpiod_lookup_table hx4700_audio_gpio_table = { + .dev_id = "hx4700-audio", + .table = { + GPIO_LOOKUP("gpio-pxa", GPIO75_HX4700_EARPHONE_nDET, + "earphone-ndet", GPIO_ACTIVE_HIGH),This looks wrong. The n in nDET in the end of the name of the GPIO line means active low does it not?
Quoted 8 lines
Quoted 5 lines
What I usually do when I see this is to properly set it to
GPIO_ACTIVE_LOWin the descriptor table, then invert the logic where it's getting used.Also rename to earphone-det instead of -ndet
Thanks for taking a look! I changed it now, but I don't know if I got the correct number of inversions in the end. How does this look?
Looks wrong, you can just invert the argument to any statement of set_value() after tagging respective line as active low. Then gpilob will do a second inversion.
Review
Quoted 4 lines
(quoted diff) +4
-0+ GPIO_LOOKUP("gpio-pxa", GPIO75_HX4700_EARPHONE_nDET, + "earphone-det", GPIO_ACTIVE_LOW), + GPIO_LOOKUP("gpio-pxa", GPIO107_HX4700_SPK_nSD, + "spk-sd", GPIO_ACTIVE_LOW),
So those two have switched polarity.
sound/soc/pxa/hx4700.c static const struct snd_soc_ops hx4700_ops = { · line 82
Quoted 6 lines
sound/soc/pxa/hx4700.c +1
-1@@ -81,14 +79,14 @@ static const struct snd_soc_ops hx4700_ops = {static int hx4700_spk_power (struct snd_soc_dapm_widget *w,struct snd_kcontrol *k,int event) { -gpio_set_value (GPIO107_HX4700_SPK_nSD, !!SND_SOC_DAPM_EVENT_ON (event)); +gpiod_set_value (gpiod_spk_sd, !!SND_SOC_DAPM_EVENT_ON (event));
Thus drop one ! in front of the expression, just !SND_SOC_DAPM_EVENT_ON(event)
sound/soc/pxa/hx4700.c static const struct snd_soc_ops hx4700_ops = { · line 89
Quoted 2 lines
sound/soc/pxa/hx4700.c +1
-1-gpio_set_value (GPIO92_HX4700_HP_DRIVER , !!SND_SOC_DAPM_EVENT_ON (event)); +gpiod_set_value (gpiod_hp_driver, !!SND_SOC_DAPM_EVENT_ON (event));
But not this.
Review static const struct snd_soc_ops hx4700_ops = { · line 84
Quoted 1 line
(quoted diff) +1
-0+ gpiod_spk_sd = devm_gpiod_get(&pdev->dev, "spk-sd", GPIOD_OUT_LOW);
These initial values don't seem to be set in the old code you could just use GPIOD_ASIS as flag to make sure the new code behaves the same.
Yours,
Linus Walleij
Re: [PATCH 18/48] ARM: pxa: hx4700: use gpio descriptors for audio
Quoted 33 lines · Linus Walleij
Quoted 12 lines · Arnd Bergmann
Quoted 11 lines · Linus Walleij
(...)
Review
Quoted 5 lines
(quoted diff) +5
-0+static struct gpiod_lookup_table hx4700_audio_gpio_table = { + .dev_id = "hx4700-audio", + .table = { + GPIO_LOOKUP("gpio-pxa", GPIO75_HX4700_EARPHONE_nDET, + "earphone-ndet", GPIO_ACTIVE_HIGH),This looks wrong. The n in nDET in the end of the name of the GPIO line means active low does it not?
Quoted 8 lines
Quoted 5 lines
What I usually do when I see this is to properly set it to
GPIO_ACTIVE_LOWin the descriptor table, then invert the logic where it's getting used.Also rename to earphone-det instead of -ndet
Thanks for taking a look! I changed it now, but I don't know if I got the correct number of inversions in the end. How does this look?
Looks wrong, you can just invert the argument to any statement of
set_value()after tagging respective line as active low. Then gpilob will do a second inversion.Review
Quoted 4 lines
(quoted diff) +4
-0+ GPIO_LOOKUP("gpio-pxa", GPIO75_HX4700_EARPHONE_nDET, + "earphone-det", GPIO_ACTIVE_LOW), + GPIO_LOOKUP("gpio-pxa", GPIO107_HX4700_SPK_nSD, + "spk-sd", GPIO_ACTIVE_LOW),So those two have switched polarity.
Quoted 8 lines
sound/soc/pxa/hx4700.c static const struct snd_soc_ops hx4700_ops = { · line 82
Quoted 6 lines
sound/soc/pxa/hx4700.c +1
-1@@ -81,14 +79,14 @@ static const struct snd_soc_ops hx4700_ops = {static int hx4700_spk_power (struct snd_soc_dapm_widget *w,struct snd_kcontrol *k,int event) { -gpio_set_value (GPIO107_HX4700_SPK_nSD, !!SND_SOC_DAPM_EVENT_ON (event)); +gpiod_set_value (gpiod_spk_sd, !!SND_SOC_DAPM_EVENT_ON (event));Thus drop one ! in front of the expression, just !SND_SOC_DAPM_EVENT_ON(event)
Ok, done. But I still leave the extra 'invert=1' in hs_jack_pin[], right?
/* Headphones jack detection DAPM pin */
static struct snd_soc_jack_pin hs_jack_pin[] = {
{
.pin = "Headphone Jack",
.mask = SND_JACK_HEADPHONE,
},
{
.pin = "Speaker",
/* disable speaker when hp jack is inserted */
.mask = SND_JACK_HEADPHONE,
.invert = 1,
},
};Quoted 5 lines
Review static const struct snd_soc_ops hx4700_ops = { · line 83
Quoted 1 line
(quoted diff) +1
-0+ gpiod_spk_sd = devm_gpiod_get(&pdev->dev, "spk-sd", GPIOD_OUT_LOW);These initial values don't seem to be set in the old code you could just use
GPIOD_ASISas flag to make sure the new code behaves the same.
Ok.
Arnd
Re: [PATCH 18/48] ARM: pxa: hx4700: use gpio descriptors for audio
Quoted 7 lines · Arnd Bergmann
Quoted 1 line · Linus Walleij
Thus drop one ! in front of the expression, just !SND_SOC_DAPM_EVENT_ON(event)
Ok, done. But I still leave the extra 'invert=1' in hs_jack_pin[], right?
/* Headphones jack detection DAPM pin */
Quoted 11 lines
static struct snd_soc_jack_pin hs_jack_pin[] = {
{
.pin = "Headphone Jack",
.mask = SND_JACK_HEADPHONE,
},
{
.pin = "Speaker",
/* disable speaker when hp jack is inserted */
.mask = SND_JACK_HEADPHONE,
.invert = 1,
},Hm some ASoC thingie. No idea what that is, but I suppose another place where a subsystem for legacy reasons try to do the gpiolib inversion on it's own accord. That one isn't flagged as active low in the descriptor so it's fine I guess.
Possible this should be fixed in ASoC to rely on gpiolib but we can't fix the entire world.
Yours,
Linus Walleij
Mark Brown
maintainerRe: [PATCH 18/48] ARM: pxa: hx4700: use gpio descriptors for audio
Quoted 15 lines · Linus Walleij
Quoted 12 lines · Arnd Bergmann
/* Headphones jack detection DAPM pin */
static struct snd_soc_jack_pin hs_jack_pin[] = { { .pin = "Headphone Jack", .mask = SND_JACK_HEADPHONE, }, { .pin = "Speaker", /* disable speaker when hp jack is inserted */ .mask = SND_JACK_HEADPHONE, .invert = 1, },
Quoted 4 lines
Hm some ASoC thingie. No idea what that is, but I suppose another place where a subsystem for legacy reasons try to do the gpiolib inversion on it's own accord. That one isn't flagged as active low in the descriptor so it's fine I guess.
It's saying that when the headphone is inserted the headphone output should be enabled and the speaker output should be disabled, and vice versa.
Quoted 2 lines
Possible this should be fixed in ASoC to rely on gpiolib but we can't fix the entire world.
I don't think so.
Re: [PATCH 18/48] ARM: pxa: hx4700: use gpio descriptors for audio
Quoted 16 lines · Mark Brown
Quoted 14 lines · Linus Walleij
Quoted 12 lines · Arnd Bergmann
/* Headphones jack detection DAPM pin */
static struct snd_soc_jack_pin hs_jack_pin[] = { { .pin = "Headphone Jack", .mask = SND_JACK_HEADPHONE, }, { .pin = "Speaker", /* disable speaker when hp jack is inserted */ .mask = SND_JACK_HEADPHONE, .invert = 1, },
Quoted 8 lines
Quoted 4 lines
Hm some ASoC thingie. No idea what that is, but I suppose another place where a subsystem for legacy reasons try to do the gpiolib inversion on it's own accord. That one isn't flagged as active low in the descriptor so it's fine I guess.
It's saying that when the headphone is inserted the headphone output should be enabled and the speaker output should be disabled, and vice versa.
Ok, that sounds like I should remove the flag here if I declare the GPIO line as GPIO_ACTIVE_LOW instead of GPIO_ACTIVE_HIGH, right?
Arnd
Mark Brown
maintainerRe: [PATCH 18/48] ARM: pxa: hx4700: use gpio descriptors for audio
Quoted 21 lines · Arnd Bergmann
Quoted 19 lines · Mark Brown
Quoted 18 lines · Linus Walleij
Quoted 11 lines · Arnd Bergmann
static struct snd_soc_jack_pin hs_jack_pin[] = { { .pin = "Headphone Jack", .mask = SND_JACK_HEADPHONE, }, { .pin = "Speaker", /* disable speaker when hp jack is inserted */ .mask = SND_JACK_HEADPHONE, .invert = 1, },Hm some ASoC thingie. No idea what that is, but I suppose another place where a subsystem for legacy reasons try to do the gpiolib inversion on it's own accord. That one isn't flagged as active low in the descriptor so it's fine I guess.
Quoted 6 lines
Quoted 3 lines
It's saying that when the headphone is inserted the headphone output should be enabled and the speaker output should be disabled, and vice versa.
Ok, that sounds like I should remove the flag here if I declare the GPIO line as
GPIO_ACTIVE_LOWinstead ofGPIO_ACTIVE_HIGH, right?
If you change the sense of the GPIO you'll need to flip the invert to the headphone instead of the speaker - whichever way round the GPIO sense is each of the pins should be taking the opposite sense from the GPIO state to the other.
Re: [PATCH 18/48] ARM: pxa: hx4700: use gpio descriptors for audio
Quoted 26 lines · Mark Brown
Quoted 24 lines · Arnd Bergmann
Quoted 23 lines · Mark Brown
Quoted 14 lines · Linus Walleij
Quoted 11 lines · Arnd Bergmann
static struct snd_soc_jack_pin hs_jack_pin[] = { { .pin = "Headphone Jack", .mask = SND_JACK_HEADPHONE, }, { .pin = "Speaker", /* disable speaker when hp jack is inserted */ .mask = SND_JACK_HEADPHONE, .invert = 1, },Quoted 4 lines
Hm some ASoC thingie. No idea what that is, but I suppose another place where a subsystem for legacy reasons try to do the gpiolib inversion on it's own accord. That one isn't flagged as active low in the descriptor so it's fine I guess.
It's saying that when the headphone is inserted the headphone output should be enabled and the speaker output should be disabled, and vice versa.
Quoted 7 lines
Quoted 2 lines
Ok, that sounds like I should remove the flag here if I declare the GPIO line as
GPIO_ACTIVE_LOWinstead ofGPIO_ACTIVE_HIGH, right?If you change the sense of the GPIO you'll need to flip the invert to the headphone instead of the speaker - whichever way round the GPIO sense is each of the pins should be taking the opposite sense from the GPIO state to the other.
Ok, I hope I got it this time:
- The hs_jack_gpio/"earphone-det" is declared as GPIO_ACTIVE_LOW, with the ".invert" dropped in the snd_soc_jack_gpio definition to match
- "spk-sd" is declared as GPIO_ACTIVE_LOW, so both
this and "hp-driver" are enabled by setting the gpio to active, rather than the two being opposites
- snd_soc_jack_pin flips the 'invert' flag from speaker to headphone, since the "earphone-det" is now reversed
- hx4700_spk_power() flips polarity when setting the output to match the GPIO_ACTIVE_LOW setting, but hx4700_hp_power() does not change.
Arnd
commit 20a9b05eff0488b78aa02c07f58654daa294069a
Author: Arnd Bergmann <[email protected]> Date: Wed Sep 11 14:27:13 2019 +0200
ARM: pxa: hx4700: use gpio descriptors for audio
The audio driver should not use a hardwired gpio number from the header. Change it to use a lookup table.
(quoted diff) +0 -0
b/arch/arm/mach-pxa/hx4700-pcmcia.c
index e8acbfc9ef6c..e2331dfe427d 100644
arch/arm/mach-pxa/hx4700-pcmcia.c +1 -1
@@ -10,7 +10,7 @@#include <linux/irq.h> #include <asm/mach-types.h> -#include <mach/hx4700.h> +#include "hx4700.h" #include <pcmcia/soc_common.h>
arch/arm/mach-pxa/hx4700.c +1 -1
@@ -41,7 +41,7 @@#include "pxa27x.h" #include "addr-map.h" -#include <mach/hx4700.h> +#include "hx4700.h" #include <linux/platform_data/irda-pxaficp.h> #include <sound/ak4641.h>
@@ -834,6 +834,19 @@ static struct i2c_board_info i2c_board_info[]
__initdata = {
},};
+static struct gpiod_lookup_table hx4700_audio_gpio_table = {
+ .dev_id = "hx4700-audio",
+ .table = {
+ GPIO_LOOKUP("gpio-pxa", GPIO75_HX4700_EARPHONE_nDET,
+ "earphone-det", GPIO_ACTIVE_LOW),
+ GPIO_LOOKUP("gpio-pxa", GPIO92_HX4700_HP_DRIVER,
+ "hp-driver", GPIO_ACTIVE_HIGH),
+ GPIO_LOOKUP("gpio-pxa", GPIO107_HX4700_SPK_nSD,
+ "spk-sd", GPIO_ACTIVE_LOW),
+ { },
+ },
+};
+
static struct platform_device audio = {
.name = "hx4700-audio",
.id = -1,@@ -895,6 +908,7 @@ static void __init hx4700_init(void)
gpiod_add_lookup_table(&bq24022_gpiod_table);
gpiod_add_lookup_table(&gpio_vbus_gpiod_table);
+ gpiod_add_lookup_table(&hx4700_audio_gpio_table);
platform_add_devices(devices, ARRAY_SIZE(devices));
pwm_add_table(hx4700_pwm_lookup, ARRAY_SIZE(hx4700_pwm_lookup));(quoted diff) +0 -0
b/arch/arm/mach-pxa/hx4700.h
similarity index 99%
rename from arch/arm/mach-pxa/include/mach/hx4700.h rename to arch/arm/mach-pxa/hx4700.h
index 0c30e6d9c660..ce2db33989e1 100644
arch/arm/mach-pxa/hx4700.h renamed from arch/arm/mach-pxa/include/mach/hx4700.h +1 -1
@@ -10,7 +10,7 @@#include <linux/gpio.h> #include <linux/mfd/asic3.h> -#include "irqs.h" /* PXA_NR_BUILTIN_GPIO */ +#include <mach/irqs.h> /* PXA_NR_BUILTIN_GPIO */ #define HX4700_ASIC3_GPIO_BASE PXA_NR_BUILTIN_GPIO#define HX4700_EGPIO_BASE (HX4700_ASIC3_GPIO_BASE + ASIC3_NUM_GPIOS)
sound/soc/pxa/hx4700.c +6 -13
@@ -10,7 +10,7 @@#include <linux/interrupt.h> #include <linux/platform_device.h> #include <linux/delay.h> -#include <linux/gpio.h> +#include <linux/gpio/consumer.h> #include <sound/core.h> #include <sound/jack.h>
@@ -18,10 +18,10 @@#include <sound/pcm_params.h> #include <sound/soc.h> -#include <mach/hx4700.h> #include <asm/mach-types.h> #include "pxa2xx-i2s.h" +static struct gpio_desc *gpiod_hp_driver, *gpiod_spk_sd;static struct snd_soc_jack hs_jack;/* Headphones jack detection DAPM pin */
@@ -29,20 +29,18 @@ static struct snd_soc_jack_pin hs_jack_pin[] = { { .pin = "Headphone Jack", .mask = SND_JACK_HEADPHONE, + .invert = 1, }, { .pin = "Speaker", /* disable speaker when hp jack is inserted */ .mask = SND_JACK_HEADPHONE, - .invert = 1, }, };/* Headphones jack detection GPIO */ static struct snd_soc_jack_gpio hs_jack_gpio = { - .gpio = GPIO75_HX4700_EARPHONE_nDET, - .invert = true, - .name ="hp-gpio" , + .name ="earphone-det" , .report =SND_JACK_HEADPHONE , .debounce_time =200 , };
@@ -81,14 +79,14 @@ static const struct snd_soc_ops hx4700_ops = {static int hx4700_spk_power (struct snd_soc_dapm_widget *w,struct snd_kcontrol *k,int event) { -gpio_set_value (GPIO107_HX4700_SPK_nSD, !!SND_SOC_DAPM_EVENT_ON (event)); +gpiod_set_value (gpiod_spk_sd, !SND_SOC_DAPM_EVENT_ON (event));return 0 ; }static int hx4700_hp_power (struct snd_soc_dapm_widget *w,struct snd_kcontrol *k,int event) { -gpio_set_value (GPIO92_HX4700_HP_DRIVER , !!SND_SOC_DAPM_EVENT_ON (event)); +gpiod_set_value (gpiod_hp_driver, !!SND_SOC_DAPM_EVENT_ON (event));return 0 ; }
@@ -162,11 +160,6 @@ static struct snd_soc_card snd_soc_card_hx4700 = { .fully_routed = true, }; -static struct gpio hx4700_audio_gpios[] = { - { GPIO107_HX4700_SPK_nSD,GPIOF_OUT_INIT_HIGH ,"SPK_POWER" }, - {GPIO92_HX4700_HP_DRIVER ,GPIOF_OUT_INIT_LOW ,"EP_POWER" }, -}; -static int hx4700_audio_probe (struct platform_device *pdev) {int ret;
@@ -174,26 +167,26 @@ static int hx4700_audio_probe(struct
platform_device *pdev)
if (!machine_is_h4700())
return -ENODEV;- ret = gpio_request_array(hx4700_audio_gpios,
- ARRAY_SIZE(hx4700_audio_gpios));
+ gpiod_hp_driver = devm_gpiod_get(&pdev->dev, "hp-driver", GPIOD_ASIS);
+ ret = PTR_ERR_OR_ZERO(gpiod_hp_driver);
+ if (ret)
+ return ret;
+ gpiod_spk_sd = devm_gpiod_get(&pdev->dev, "spk-sd", GPIOD_ASIS);
+ ret = PTR_ERR_OR_ZERO(gpiod_spk_sd);
if (ret)
return ret;+ hs_jack_gpio.gpiod_dev = &pdev->dev;
snd_soc_card_hx4700.dev = &pdev->dev;
ret = devm_snd_soc_register_card(&pdev->dev, &snd_soc_card_hx4700);- if (ret)
- gpio_free_array(hx4700_audio_gpios,
- ARRAY_SIZE(hx4700_audio_gpios));
return ret;
}
static int hx4700_audio_remove(struct platform_device *pdev) {
- gpio_set_value(GPIO92_HX4700_HP_DRIVER, 0);
- gpio_set_value(GPIO107_HX4700_SPK_nSD, 0);
-
- gpio_free_array(hx4700_audio_gpios, ARRAY_SIZE(hx4700_audio_gpios));
+ gpiod_set_value(gpiod_hp_driver, 0);
+ gpiod_set_value(gpiod_spk_sd, 0);
return 0;}
PATCH v2 19/48 ARM: pxa: lubbock: pass udc irqs as resource
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
Lubbock is the only machine that has three IRQs for the UDC. These are currently hardcoded in the driver based on a machine header file.
Change this to use platform device resources as we use for the generic IRQ anyway.
---
arch/arm/mach-pxa/lubbock.c | 12 +++++-
.../arm/mach-pxa/{include/mach => }/lubbock.h | 2 -
drivers/usb/gadget/udc/pxa25x_udc.c | 37 ++++++++++---------
drivers/usb/gadget/udc/pxa25x_udc.h | 7 +---
4 files changed, 32 insertions(+), 26 deletions(-)
rename arch/arm/mach-pxa/{include/mach => }/lubbock.h (97%)arch/arm/mach-pxa/lubbock.c +11 -1
@@ -46,7 +46,7 @@#include "pxa25x.h" #include <linux/platform_data/asoc-pxa.h> -#include <mach/lubbock.h> +#include "lubbock.h" #include "udc.h" #include <linux/platform_data/irda-pxaficp.h> #include <linux/platform_data/video-pxafb.h>
@@ -131,6 +131,13 @@ static struct pxa2xx_udc_mach_info udc_info __initdata = {// no D+ pullup; lubbock can't connect/disconnect in software }; +static struct resource lubbock_udc_resources[] = { +DEFINE_RES_MEM (0x40600000 ,0x10000 ), +DEFINE_RES_IRQ (IRQ_USB ), +DEFINE_RES_IRQ (LUBBOCK_USB_IRQ ), +DEFINE_RES_IRQ (LUBBOCK_USB_DISC_IRQ ), +}; +/* GPIOs for SA1111 PCMCIA */ static struct gpiod_lookup_table sa1111_pcmcia_gpio_table = { .dev_id ="1800" ,
@@ -496,6 +503,9 @@ static void __init lubbock_init(void)lubbock_init_pcmcia ();clk_add_alias ("SA1111_CLK" ,NULL ,"GPIO11_CLK" ,NULL ); +/* lubbock has two extra IRQs */ + pxa25x_device_udc.resource = lubbock_udc_resources; + pxa25x_device_udc.num_resources =ARRAY_SIZE (lubbock_udc_resources);pxa_set_udc_info (&udc_info);pxa_set_fb_info (NULL , &sharp_lm8v31);pxa_set_mci_info (&lubbock_mci_platform_data);
arch/arm/mach-pxa/lubbock.h renamed from arch/arm/mach-pxa/include/mach/lubbock.h +0 -2
@@ -1,7 +1,5 @@/* SPDX-License-Identifier: GPL-2.0-only */ /* -* arch/arm/mach-pxa/include/mach/lubbock.h -* * Author: Nicolas Pitre * Created: Jun 15, 2001 * Copyright: MontaVista Software Inc.
drivers/usb/gadget/udc/pxa25x_udc.c +19 -18
@@ -44,10 +44,6 @@#include <linux/usb/gadget.h> #include <linux/usb/otg.h> -#ifdef CONFIG_ARCH_LUBBOCK -#include <mach/lubbock.h> -#endif -#define UDCCR 0x0000/* UDC Control Register */ #define UDC_RES1 0x0004/* UDC Undocumented - Reserved1 */ #define UDC_RES2 0x0008/* UDC Undocumented - Reserved2 */
@@ -1578,18 +1574,15 @@ lubbock_vbus_irq(int irq, void *_dev)int vbus; dev->stats.irqs++; -switch (irq) { -case LUBBOCK_USB_IRQ : +if (irq == dev->usb_irq) { vbus =1 ; -disable_irq (LUBBOCK_USB_IRQ ); -enable_irq (LUBBOCK_USB_DISC_IRQ ); -break ; -case LUBBOCK_USB_DISC_IRQ : +disable_irq (dev->usb_irq); +enable_irq (dev->usb_disc_irq); + }else if (irq == dev->usb_disc_irq) { vbus =0 ; -disable_irq (LUBBOCK_USB_DISC_IRQ ); -enable_irq (LUBBOCK_USB_IRQ ); -break ; -default : +disable_irq (dev->usb_disc_irq); +enable_irq (dev->usb_irq); + }else {return IRQ_NONE ; }
@@ -2422,20 +2415,28 @@ static int pxa25x_udc_probe(struct platform_device *pdev)#ifdef CONFIG_ARCH_LUBBOCK if (machine_is_lubbock ()) { - retval =devm_request_irq (&pdev->dev,LUBBOCK_USB_DISC_IRQ , + dev->usb_irq =platform_get_irq (pdev,1 ); +if (dev->usb_irq <0 ) +return dev->usb_irq; + + dev->usb_disc_irq =platform_get_irq (pdev,2 ); +if (dev->usb_disc_irq <0 ) +return dev->usb_disc_irq; + + retval =devm_request_irq (&pdev->dev, dev->usb_disc_irq, lubbock_vbus_irq,0 , driver_name, dev);if (retval !=0 ) {pr_err ("%s: can't get irq %i, err %d\n" , - driver_name,LUBBOCK_USB_DISC_IRQ , retval); + driver_name, dev->usb_disc_irq, retval); goto err; } - retval =devm_request_irq (&pdev->dev,LUBBOCK_USB_IRQ , + retval =devm_request_irq (&pdev->dev, dev->usb_irq, lubbock_vbus_irq,0 , driver_name, dev);if (retval !=0 ) {pr_err ("%s: can't get irq %i, err %d\n" , - driver_name,LUBBOCK_USB_IRQ , retval); + driver_name, dev->usb_irq, retval); goto err; } }else
drivers/usb/gadget/udc/pxa25x_udc.h +2 -5
@@ -117,16 +117,13 @@ struct pxa25x_udc {u64 dma_mask;struct pxa25x_ep ep [PXA_UDC_NUM_ENDPOINTS ];void __iomem *regs; +int usb_irq; +int usb_disc_irq; };#define to_pxa25x (g) (container_of((g), struct pxa25x_udc, gadget))/*-------------------------------------------------------------------------*/ -#ifdef CONFIG_ARCH_LUBBOCK -#include <mach/lubbock.h> -/* lubbock can also report usb connect/disconnect irqs */ -#endif -static struct pxa25x_udc *the_controller;/*-------------------------------------------------------------------------*/
Signature · 1 line
2.29.2
PATCH v2 20/48 ARM: pxa: spitz: use gpio descriptors for audio
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
The audio driver should not use a hardwired gpio number from the header. Change it to use a lookup table.
---
arch/arm/mach-pxa/spitz.c | 33 ++++++++++-
arch/arm/mach-pxa/{include/mach => }/spitz.h | 2 +-
arch/arm/mach-pxa/spitz_pm.c | 2 +-
sound/soc/pxa/spitz.c | 58 ++++++++------------
4 files changed, 57 insertions(+), 38 deletions(-)
rename arch/arm/mach-pxa/{include/mach => }/spitz.h (99%)arch/arm/mach-pxa/spitz.c +32 -1
@@ -44,7 +44,7 @@#include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/usb-ohci-pxa27x.h> #include <linux/platform_data/video-pxafb.h> -#include <mach/spitz.h> +#include "spitz.h" #include "sharpsl_pm.h" #include <mach/smemc.h>
@@ -962,11 +962,42 @@ static void __init spitz_i2c_init(void)static inline void spitz_i2c_init (void ) {}#endif +static struct gpiod_lookup_table spitz_audio_gpio_table = { + .dev_id ="spitz-audio" , + .table = { +GPIO_LOOKUP ("sharp-scoop.0" ,SPITZ_GPIO_MUTE_L -SPITZ_SCP_GPIO_BASE , +"mute-l" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("sharp-scoop.0" ,SPITZ_GPIO_MUTE_R -SPITZ_SCP_GPIO_BASE , +"mute-r" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("sharp-scoop.1" ,SPITZ_GPIO_MIC_BIAS -SPITZ_SCP2_GPIO_BASE , +"mic" ,GPIO_ACTIVE_HIGH ), + { }, + }, +}; + +static struct gpiod_lookup_table akita_audio_gpio_table = { + .dev_id ="spitz-audio" , + .table = { +GPIO_LOOKUP ("sharp-scoop.0" ,SPITZ_GPIO_MUTE_L -SPITZ_SCP_GPIO_BASE , +"mute-l" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("sharp-scoop.0" ,SPITZ_GPIO_MUTE_R -SPITZ_SCP_GPIO_BASE , +"mute-r" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("i2c-max7310" ,AKITA_GPIO_MIC_BIAS -AKITA_IOEXP_GPIO_BASE , +"mic" ,GPIO_ACTIVE_HIGH ), + { }, + }, +}; +/****************************************************************************** * Audio devices ******************************************************************************/ static inline void spitz_audio_init (void ) { +if (machine_is_akita ()) +gpiod_add_lookup_table (&akita_audio_gpio_table); +else +gpiod_add_lookup_table (&spitz_audio_gpio_table); +platform_device_register_simple ("spitz-audio" ,-1 ,NULL ,0 ); }
arch/arm/mach-pxa/spitz.h renamed from arch/arm/mach-pxa/include/mach/spitz.h +1 -1
@@ -11,7 +11,7 @@#define __ASM_ARCH_SPITZ_H 1#endif -#include "irqs.h" /* PXA_NR_BUILTIN_GPIO, PXA_GPIO_TO_IRQ */ +#include <mach/irqs.h> /* PXA_NR_BUILTIN_GPIO, PXA_GPIO_TO_IRQ */ #include <linux/fb.h> /* Spitz/Akita GPIOs */
arch/arm/mach-pxa/spitz_pm.c +1 -1
@@ -19,7 +19,7 @@#include <asm/irq.h> #include <asm/mach-types.h> -#include <mach/spitz.h> +#include "spitz.h" #include "pxa27x.h" #include "sharpsl_pm.h"
sound/soc/pxa/spitz.c +23 -35
129 lines not on this page · raw message
Signature · 1 line
2.29.2
Re: [PATCH 20/48] ARM: pxa: spitz: use gpio descriptors for audio
Quoted 8 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The audio driver should not use a hardwired gpio number from the header. Change it to use a lookup table.
Acked-by Mark Brown <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>
Looks good to me!
Yours,
Linus Walleij
PATCH v2 21/48 ARM: pxa: eseries: use gpio lookup for audio
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
The three eseries machines have very similar drivers for audio, all using the mach/eseries-gpio.h header for finding the gpio numbers.
Change these to use gpio descriptors to avoid the header file dependency.
I convert the _OFF gpio numbers into GPIO_ACTIVE_LOW ones for consistency here.
--- arch/arm/mach-pxa/eseries.c | 32 ++++++++++++++++++++++++++++++++ sound/soc/pxa/e740_wm9705.c | 35 ++++++++++++++++++----------------- sound/soc/pxa/e750_wm9705.c | 31 ++++++++++++++----------------- sound/soc/pxa/e800_wm9712.c | 31 ++++++++++++++----------------- 4 files changed, 78 insertions(+), 51 deletions(-)
arch/arm/mach-pxa/eseries.c +32 -0
@@ -24,6 +24,7 @@#include <linux/mtd/rawnand.h> #include <linux/mtd/partitions.h> #include <linux/memblock.h> +#include <linux/gpio/machine.h> #include <video/w100fb.h>
@@ -520,6 +521,16 @@ static struct platform_device e740_audio_device = { .id = -1, }; +static struct gpiod_lookup_table e740_audio_gpio_table = { + .dev_id ="e740-audio" , + .table = { +GPIO_LOOKUP ("gpio-pxa" , GPIO_E740_WM9705_nAVDD2,"Audio power" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("gpio-pxa" ,GPIO_E740_AMP_ON ,"Output amp" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("gpio-pxa" ,GPIO_E740_MIC_ON ,"Mic amp" ,GPIO_ACTIVE_HIGH ), + { }, + }, +}; +/* ----------------------------------------------------------------------- */ static struct platform_device *e740_devices[]__initdata = {
@@ -540,6 +551,7 @@ static void __init e740_init(void) "UDCCLK", &pxa25x_device_udc.dev),eseries_get_tmio_gpios ();gpiod_add_lookup_table (&e7xx_gpio_vbus_gpiod_table); +gpiod_add_lookup_table (&e740_audio_gpio_table);platform_add_devices (ARRAY_AND_SIZE (e740_devices));pxa_set_ac97_info (NULL );pxa_set_ficp_info (&e7xx_ficp_platform_data);
@@ -716,6 +728,15 @@ static struct platform_device e750_tc6393xb_device = { .resource = eseries_tmio_resources, }; +static struct gpiod_lookup_table e750_audio_gpio_table = { + .dev_id ="e750-audio" , + .table = { +GPIO_LOOKUP ("gpio-pxa" ,GPIO_E750_HP_AMP_OFF ,"Output amp" ,GPIO_ACTIVE_LOW ), +GPIO_LOOKUP ("gpio-pxa" ,GPIO_E750_SPK_AMP_OFF ,"Mic amp" ,GPIO_ACTIVE_LOW ), + { }, + }, +}; +static struct platform_device e750_audio_device = { .name ="e750-audio" , .id =-1 ,
@@ -740,6 +761,7 @@ static void __init e750_init(void) "GPIO11_CLK", NULL),eseries_get_tmio_gpios ();gpiod_add_lookup_table (&e7xx_gpio_vbus_gpiod_table); +gpiod_add_lookup_table (&e750_audio_gpio_table);platform_add_devices (ARRAY_AND_SIZE (e750_devices));pxa_set_ac97_info (NULL );pxa_set_ficp_info (&e7xx_ficp_platform_data);
@@ -935,6 +957,15 @@ static struct platform_device e800_tc6393xb_device = { .resource = eseries_tmio_resources, }; +static struct gpiod_lookup_table e800_audio_gpio_table = { + .dev_id ="e800-audio" , + .table = { +GPIO_LOOKUP ("gpio-pxa" ,GPIO_E800_HP_AMP_OFF ,"Output amp" ,GPIO_ACTIVE_LOW ), +GPIO_LOOKUP ("gpio-pxa" ,GPIO_E800_SPK_AMP_ON ,"Mic amp" ,GPIO_ACTIVE_HIGH ), + { }, + }, +}; +static struct platform_device e800_audio_device = { .name ="e800-audio" , .id =-1 ,
@@ -959,6 +990,7 @@ static void __init e800_init(void) "GPIO11_CLK", NULL),eseries_get_tmio_gpios ();gpiod_add_lookup_table (&e800_gpio_vbus_gpiod_table); +gpiod_add_lookup_table (&e800_audio_gpio_table);platform_add_devices (ARRAY_AND_SIZE (e800_devices));pxa_set_ac97_info (NULL ); }
sound/soc/pxa/e740_wm9705.c +18 -17
@@ -7,17 +7,19 @@#include <linux/module.h> #include <linux/moduleparam.h> -#include <linux/gpio.h> +#include <linux/gpio/consumer.h> #include <sound/core.h> #include <sound/pcm.h> #include <sound/soc.h> #include <linux/platform_data/asoc-pxa.h> -#include <mach/eseries-gpio.h> #include <asm/mach-types.h> +static struct gpio_desc *gpiod_output_amp, *gpiod_input_amp; +static struct gpio_desc *gpiod_audio_power; +#define E740_AUDIO_OUT 1#define E740_AUDIO_IN 2
@@ -25,9 +27,9 @@ static int e740_audio_power;static void e740_sync_audio_power (int status) { -gpio_set_value (GPIO_E740_WM9705_nAVDD2, !status); -gpio_set_value (GPIO_E740_AMP_ON , (status &E740_AUDIO_OUT ) ?1 :0 ); -gpio_set_value (GPIO_E740_MIC_ON , (status &E740_AUDIO_IN ) ?1 :0 ); +gpiod_set_value (gpiod_audio_power, !status); +gpiod_set_value (gpiod_output_amp, (status &E740_AUDIO_OUT ) ?1 :0 ); +gpiod_set_value (gpiod_input_amp, (status &E740_AUDIO_IN ) ?1 :0 ); } static int e740_mic_amp_event(struct snd_soc_dapm_widget *w,
@@ -116,36 +118,35 @@ static struct snd_soc_card e740 = { .fully_routed = true, }; -static struct gpio e740_audio_gpios[] = { - {GPIO_E740_MIC_ON ,GPIOF_OUT_INIT_LOW ,"Mic amp" }, - {GPIO_E740_AMP_ON ,GPIOF_OUT_INIT_LOW ,"Output amp" }, - { GPIO_E740_WM9705_nAVDD2,GPIOF_OUT_INIT_HIGH ,"Audio power" }, -}; -static int e740_probe (struct platform_device *pdev) {struct snd_soc_card *card = &e740;int ret; - ret =gpio_request_array (e740_audio_gpios, -ARRAY_SIZE (e740_audio_gpios)); + gpiod_input_amp =devm_gpiod_get (&pdev->dev,"Mic amp" ,GPIOD_OUT_LOW ); + ret =PTR_ERR_OR_ZERO (gpiod_input_amp); +if (ret) +return ret; + gpiod_output_amp =devm_gpiod_get (&pdev->dev,"Output amp" ,GPIOD_OUT_LOW ); + ret =PTR_ERR_OR_ZERO (gpiod_output_amp); +if (ret) +return ret; + gpiod_audio_power =devm_gpiod_get (&pdev->dev,"Audio power" ,GPIOD_OUT_HIGH ); + ret =PTR_ERR_OR_ZERO (gpiod_audio_power);if (ret)return ret; card->dev = &pdev->dev; ret =devm_snd_soc_register_card (&pdev->dev, card); -if (ret) { +if (ret)dev_err (&pdev->dev,"snd_soc_register_card() failed: %d\n" , ret); -gpio_free_array (e740_audio_gpios,ARRAY_SIZE (e740_audio_gpios)); - }return ret; }static int e740_remove (struct platform_device *pdev) { -gpio_free_array (e740_audio_gpios,ARRAY_SIZE (e740_audio_gpios));return 0 ; }
sound/soc/pxa/e750_wm9705.c +14 -17
@@ -7,24 +7,25 @@#include <linux/module.h> #include <linux/moduleparam.h> -#include <linux/gpio.h> +#include <linux/gpio/consumer.h> #include <sound/core.h> #include <sound/pcm.h> #include <sound/soc.h> #include <linux/platform_data/asoc-pxa.h> -#include <mach/eseries-gpio.h> #include <asm/mach-types.h> +static struct gpio_desc *gpiod_spk_amp, *gpiod_hp_amp; +static int e750_spk_amp_event (struct snd_soc_dapm_widget *w,struct snd_kcontrol *kcontrol,int event) {if (event &SND_SOC_DAPM_PRE_PMU ) -gpio_set_value (GPIO_E750_SPK_AMP_OFF ,0 ); +gpiod_set_value (gpiod_spk_amp,1 );else if (event &SND_SOC_DAPM_POST_PMD ) -gpio_set_value (GPIO_E750_SPK_AMP_OFF ,1 ); +gpiod_set_value (gpiod_spk_amp,0 );return 0 ; }
@@ -33,9 +34,9 @@ static int e750_hp_amp_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) {if (event &SND_SOC_DAPM_PRE_PMU ) -gpio_set_value (GPIO_E750_HP_AMP_OFF ,0 ); +gpiod_set_value (gpiod_hp_amp,1 );else if (event &SND_SOC_DAPM_POST_PMD ) -gpio_set_value (GPIO_E750_HP_AMP_OFF ,1 ); +gpiod_set_value (gpiod_hp_amp,0 );return 0 ; }
@@ -100,35 +101,31 @@ static struct snd_soc_card e750 = { .fully_routed = true, }; -static struct gpio e750_audio_gpios[] = { - {GPIO_E750_HP_AMP_OFF ,GPIOF_OUT_INIT_HIGH ,"Headphone amp" }, - {GPIO_E750_SPK_AMP_OFF ,GPIOF_OUT_INIT_HIGH ,"Speaker amp" }, -}; -static int e750_probe (struct platform_device *pdev) {struct snd_soc_card *card = &e750;int ret; - ret =gpio_request_array (e750_audio_gpios, -ARRAY_SIZE (e750_audio_gpios)); + gpiod_hp_amp =devm_gpiod_get (&pdev->dev,"Headphone amp" ,GPIOD_OUT_LOW ); + ret =PTR_ERR_OR_ZERO (gpiod_hp_amp); +if (ret) +return ret; + gpiod_spk_amp =devm_gpiod_get (&pdev->dev,"Speaker amp" ,GPIOD_OUT_LOW ); + ret =PTR_ERR_OR_ZERO (gpiod_spk_amp);if (ret)return ret; card->dev = &pdev->dev; ret =devm_snd_soc_register_card (&pdev->dev, card); -if (ret) { +if (ret)dev_err (&pdev->dev,"snd_soc_register_card() failed: %d\n" , ret); -gpio_free_array (e750_audio_gpios,ARRAY_SIZE (e750_audio_gpios)); - }return ret; }static int e750_remove (struct platform_device *pdev) { -gpio_free_array (e750_audio_gpios,ARRAY_SIZE (e750_audio_gpios));return 0 ; }
sound/soc/pxa/e800_wm9712.c +14 -17
@@ -7,7 +7,7 @@#include <linux/module.h> #include <linux/moduleparam.h> -#include <linux/gpio.h> +#include <linux/gpio/consumer.h> #include <sound/core.h> #include <sound/pcm.h>
@@ -15,15 +15,16 @@#include <asm/mach-types.h> #include <linux/platform_data/asoc-pxa.h> -#include <mach/eseries-gpio.h> + +static struct gpio_desc *gpiod_spk_amp, *gpiod_hp_amp;static int e800_spk_amp_event (struct snd_soc_dapm_widget *w,struct snd_kcontrol *kcontrol,int event) {if (event &SND_SOC_DAPM_PRE_PMU ) -gpio_set_value (GPIO_E800_SPK_AMP_ON ,1 ); +gpiod_set_value (gpiod_spk_amp,1 );else if (event &SND_SOC_DAPM_POST_PMD ) -gpio_set_value (GPIO_E800_SPK_AMP_ON ,0 ); +gpiod_set_value (gpiod_spk_amp,0 );return 0 ; }
@@ -32,9 +33,9 @@ static int e800_hp_amp_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) {if (event &SND_SOC_DAPM_PRE_PMU ) -gpio_set_value (GPIO_E800_HP_AMP_OFF ,0 ); +gpiod_set_value (gpiod_hp_amp,1 );else if (event &SND_SOC_DAPM_POST_PMD ) -gpio_set_value (GPIO_E800_HP_AMP_OFF ,1 ); +gpiod_set_value (gpiod_hp_amp,0 );return 0 ; }
@@ -100,35 +101,31 @@ static struct snd_soc_card e800 = { .num_dapm_routes = ARRAY_SIZE(audio_map), }; -static struct gpio e800_audio_gpios[] = { - {GPIO_E800_SPK_AMP_ON ,GPIOF_OUT_INIT_HIGH ,"Headphone amp" }, - {GPIO_E800_HP_AMP_OFF ,GPIOF_OUT_INIT_HIGH ,"Speaker amp" }, -}; -static int e800_probe (struct platform_device *pdev) {struct snd_soc_card *card = &e800;int ret; - ret =gpio_request_array (e800_audio_gpios, -ARRAY_SIZE (e800_audio_gpios)); + gpiod_hp_amp =devm_gpiod_get (&pdev->dev,"Headphone amp" ,GPIOD_OUT_LOW ); + ret =PTR_ERR_OR_ZERO (gpiod_hp_amp); +if (ret) +return ret; + gpiod_spk_amp =devm_gpiod_get (&pdev->dev,"Speaker amp" ,GPIOD_OUT_LOW ); + ret =PTR_ERR_OR_ZERO (gpiod_spk_amp);if (ret)return ret; card->dev = &pdev->dev; ret =devm_snd_soc_register_card (&pdev->dev, card); -if (ret) { +if (ret)dev_err (&pdev->dev,"snd_soc_register_card() failed: %d\n" , ret); -gpio_free_array (e800_audio_gpios,ARRAY_SIZE (e800_audio_gpios)); - }return ret; }static int e800_remove (struct platform_device *pdev) { -gpio_free_array (e800_audio_gpios,ARRAY_SIZE (e800_audio_gpios));return 0 ; }
Signature · 1 line
2.29.2
Re: [PATCH 21/48] ARM: pxa: eseries: use gpio lookup for audio
Quoted 8 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The three eseries machines have very similar drivers for audio, all using the
mach/eseries-gpio.hheader for finding the gpio numbers.Change these to use gpio descriptors to avoid the header file dependency.
Quoted 8 lines
I convert the
_OFFgpio numbers intoGPIO_ACTIVE_LOWones for consistency here.Acked-by Mark Brown <[email protected]>Acked-by Robert Jarzmik <[email protected]>Reviewed-by Linus Walleij <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>
Nice use of active low. Maybe I would simply have dropped the _OFF suffix on these GPIO lines as it can be confusing now that their active level is encoded but no big deal.
Yours,
Linus Walleij
PATCH v2 22/48 ARM: pxa: z2: use gpio lookup for audio device
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
The audio device is allocated by the audio driver, and it uses a gpio number from the mach/z2.h header file.
Change it to use a gpio lookup table for the device allocated by the driver to keep the header file local to the machine.
--- arch/arm/mach-pxa/z2.c | 11 +++++++++++ sound/soc/pxa/z2.c | 5 ++--- 2 files changed, 13 insertions(+), 3 deletions(-)
arch/arm/mach-pxa/z2.c +11 -0
@@ -651,6 +651,15 @@ static void __init z2_spi_init(void)static inline void z2_spi_init (void ) {}#endif +static struct gpiod_lookup_table z2_audio_gpio_table = { + .dev_id ="soc-audio" , + .table = { +GPIO_LOOKUP ("gpio-pxa" ,GPIO37_ZIPITZ2_HEADSET_DETECT , +"hsdet-gpio" ,GPIO_ACTIVE_HIGH ), + { }, + }, +}; +/****************************************************************************** * Core power regulator ******************************************************************************/
@@ -755,6 +764,8 @@ static void __init z2_init(void)z2_keys_init ();z2_pmic_init (); +gpiod_add_lookup_table (&z2_audio_gpio_table); + pm_power_off = z2_power_off; }
sound/soc/pxa/z2.c +2 -3
@@ -13,7 +13,7 @@#include <linux/timer.h> #include <linux/interrupt.h> #include <linux/platform_device.h> -#include <linux/gpio.h> +#include <linux/gpio/consumer.h> #include <sound/core.h> #include <sound/pcm.h>
@@ -22,7 +22,6 @@#include <asm/mach-types.h> #include <linux/platform_data/asoc-pxa.h> -#include <mach/z2.h> #include "../codecs/wm8750.h" #include "pxa2xx-i2s.h"
@@ -89,7 +88,6 @@ static struct snd_soc_jack_pin hs_jack_pins[] = {/* Headset jack detection gpios */ static struct snd_soc_jack_gpio hs_jack_gpios[] = { { - .gpio =GPIO37_ZIPITZ2_HEADSET_DETECT , .name ="hsdet-gpio" , .report =SND_JACK_HEADSET , .debounce_time =200 ,
@@ -195,6 +193,7 @@ static int __init z2_init(void)if (!z2_snd_device)return -ENOMEM ; + hs_jack_gpios[0 ].gpiod_dev = &z2_snd_device->dev;platform_set_drvdata (z2_snd_device, &snd_soc_z2); ret =platform_device_add (z2_snd_device);
Signature · 1 line
2.29.2
Re: [PATCH 22/48] ARM: pxa: z2: use gpio lookup for audio device
Quoted 5 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The audio device is allocated by the audio driver, and it uses a gpio number from the
mach/z2.hheader file.
Quoted 8 lines
Change it to use a gpio lookup table for the device allocated by the driver to keep the header file local to the machine.
Acked-by Mark Brown <[email protected]>Reviewed-by Linus Walleij <[email protected]>Acked-by Robert Jarzmik <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>
Looks good to me!
Yours,
Linus Walleij
PATCH v2 23/48 ARM: pxa: magician: use platform driver for audio
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
The magician audio driver creates a codec device and gets data from a board specific header file, both of which is a bit suspicious. Move these into the board file itself, using a gpio lookup table.
--- arch/arm/mach-pxa/magician.c | 50 +++++++++++++ sound/soc/pxa/magician.c | 141 +++++++++-------------------------- 2 files changed, 87 insertions(+), 104 deletions(-)
arch/arm/mach-pxa/magician.c +50 -0
@@ -53,6 +53,7 @@#include <linux/spi/spi.h> #include <linux/spi/pxa2xx_spi.h> #include <linux/spi/ads7846.h> +#include <sound/uda1380.h> static unsigned long magician_pin_config[]__initdata = {
@@ -898,6 +899,53 @@ static struct platform_device strataflash = { }, }; +/* +* audio support +*/ +static struct uda1380_platform_data uda1380_info = { + .gpio_power =EGPIO_MAGICIAN_CODEC_POWER , + .gpio_reset =EGPIO_MAGICIAN_CODEC_RESET , + .dac_clk =UDA1380_DAC_CLK_WSPLL , +}; + +static struct i2c_board_info magician_audio_i2c_board_info[] = { + { +I2C_BOARD_INFO ("uda1380" ,0x18 ), + .platform_data = &uda1380_info, + }, +}; + +static struct gpiod_lookup_table magician_audio_gpio_table = { + .dev_id ="magician-audio" , + .table = { +GPIO_LOOKUP ("htc-egpio-0" , +EGPIO_MAGICIAN_SPK_POWER -MAGICIAN_EGPIO_BASE , +"SPK_POWER" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("htc-egpio-0" , +EGPIO_MAGICIAN_EP_POWER -MAGICIAN_EGPIO_BASE , +"EP_POWER" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("htc-egpio-0" , +EGPIO_MAGICIAN_MIC_POWER -MAGICIAN_EGPIO_BASE , +"MIC_POWER" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("htc-egpio-0" , +EGPIO_MAGICIAN_IN_SEL0 -MAGICIAN_EGPIO_BASE , +"IN_SEL0" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("htc-egpio-0" , +EGPIO_MAGICIAN_IN_SEL1 -MAGICIAN_EGPIO_BASE , +"IN_SEL1" ,GPIO_ACTIVE_HIGH ), + { }, + }, +}; + +static void magician_audio_init (void ) +{ +i2c_register_board_info (0 , +ARRAY_AND_SIZE (magician_audio_i2c_board_info)); + +gpiod_add_lookup_table (&magician_audio_gpio_table); +platform_device_register_simple ("magician-audio" ,-1 ,NULL ,0 ); +} +/* * PXA I2C main controller */
@@ -1048,6 +1096,8 @@ static void __init magician_init(void)gpiod_add_lookup_table (&bq24022_gpiod_table);gpiod_add_lookup_table (&gpio_vbus_gpiod_table);platform_add_devices (ARRAY_AND_SIZE (devices)); + +magician_audio_init (); }MACHINE_START (MAGICIAN ,"HTC Magician" )
sound/soc/pxa/magician.c +37 -104
196 lines not on this page · raw message
Signature · 1 line
2.29.2
Re: [PATCH 23/48] ARM: pxa: magician: use platform driver for audio
Quoted 11 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The magician audio driver creates a codec device and gets data from a board specific header file, both of which is a bit suspicious. Move these into the board file itself, using a gpio lookup table.
Acked-by Mark Brown <[email protected]>Acked-by Robert Jarzmik <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>
Looks good to me!
Yours,
Linus Walleij
PATCH v2 24/48 ARM: pxa: mainstone-wm97xx: use gpio lookup table
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
This driver hardcodes gpio numbers without a header file. Use lookup tables instead.
--- arch/arm/mach-pxa/mainstone.c | 9 +++++ arch/arm/mach-pxa/palmld.c | 9 +++++ arch/arm/mach-pxa/palmt5.c | 9 +++++ arch/arm/mach-pxa/palmtx.c | 9 +++++ drivers/input/touchscreen/mainstone-wm97xx.c | 35 ++++++++------------ 5 files changed, 50 insertions(+), 21 deletions(-)
arch/arm/mach-pxa/mainstone.c +9 -0
@@ -548,6 +548,14 @@ static struct gpiod_lookup_table mainstone_pcmcia_gpio_table = { }, }; +static struct gpiod_lookup_table mainstone_wm97xx_gpio_table = { + .dev_id ="wm97xx-touch" , + .table = { +GPIO_LOOKUP ("gpio-pxa" ,4 ,"touch" ,GPIO_ACTIVE_HIGH ), + { }, + }, +}; +static void __init mainstone_init (void ) {int SW7 =0 ;/* FIXME: get from SCR (Mst doc section 3.2.1.1) */
@@ -562,6 +570,7 @@ static void __init mainstone_init(void)"mst-pcmcia1" ,MST_PCMCIA_INPUTS ,0 ,NULL , NULL, mst_pcmcia1_irqs);gpiod_add_lookup_table (&mainstone_pcmcia_gpio_table); +gpiod_add_lookup_table (&mainstone_wm97xx_gpio_table);pxa_set_ffuart_info (NULL );pxa_set_btuart_info (NULL );
arch/arm/mach-pxa/palmld.c +9 -0
@@ -347,6 +347,14 @@ static struct gpiod_lookup_table palmld_mci_gpio_table = { }, }; +static struct gpiod_lookup_table palmld_wm97xx_touch_gpio_table = { + .dev_id ="wm97xx-touch" , + .table = { +GPIO_LOOKUP ("gpio-pxa" ,27 ,"touch" ,GPIO_ACTIVE_HIGH ), + { }, + }, +}; +static void __init palmld_init (void ) {pxa2xx_mfp_config (ARRAY_AND_SIZE (palmld_pin_config));
@@ -355,6 +363,7 @@ static void __init palmld_init(void)pxa_set_stuart_info (NULL );palm27x_mmc_init (&palmld_mci_gpio_table); +gpiod_add_lookup_table (&palmld_wm97xx_touch_gpio_table);palm27x_pm_init (PALMLD_STR_BASE );palm27x_lcd_init (-1 , &palm_320x480_lcd_mode);palm27x_irda_init (GPIO_NR_PALMLD_IR_DISABLE );
arch/arm/mach-pxa/palmt5.c +9 -0
@@ -190,6 +190,14 @@ static struct gpiod_lookup_table palmt5_mci_gpio_table = { }, }; +static struct gpiod_lookup_table palmt5_wm97xx_touch_gpio_table = { + .dev_id ="wm97xx-touch" , + .table = { +GPIO_LOOKUP ("gpio-pxa" ,27 ,"touch" ,GPIO_ACTIVE_HIGH ), + { }, + }, +}; +static void __init palmt5_init (void ) {pxa2xx_mfp_config (ARRAY_AND_SIZE (palmt5_pin_config));
@@ -198,6 +206,7 @@ static void __init palmt5_init(void)pxa_set_stuart_info (NULL );palm27x_mmc_init (&palmt5_mci_gpio_table); +gpiod_add_lookup_table (&palmt5_wm97xx_touch_gpio_table);palm27x_pm_init (PALMT5_STR_BASE );palm27x_lcd_init (-1 , &palm_320x480_lcd_mode); palm27x_udc_init(GPIO_NR_PALMT5_USB_DETECT_N,
arch/arm/mach-pxa/palmtx.c +9 -0
@@ -345,6 +345,14 @@ static struct gpiod_lookup_table palmtx_mci_gpio_table = { }, }; +static struct gpiod_lookup_table palmtx_wm97xx_touch_gpio_table = { + .dev_id ="wm97xx-touch" , + .table = { +GPIO_LOOKUP ("gpio-pxa" ,27 ,"touch" ,GPIO_ACTIVE_HIGH ), + { }, + }, +}; +static void __init palmtx_init (void ) {pxa2xx_mfp_config (ARRAY_AND_SIZE (palmtx_pin_config));
@@ -353,6 +361,7 @@ static void __init palmtx_init(void)pxa_set_stuart_info (NULL );palm27x_mmc_init (&palmtx_mci_gpio_table); +gpiod_add_lookup_table (&palmtx_wm97xx_touch_gpio_table);palm27x_pm_init (PALMTX_STR_BASE );palm27x_lcd_init (-1 , &palm_320x480_lcd_mode); palm27x_udc_init(GPIO_NR_PALMTX_USB_DETECT_N,
drivers/input/touchscreen/mainstone-wm97xx.c +14 -21
@@ -21,6 +21,7 @@#include <linux/moduleparam.h> #include <linux/kernel.h> #include <linux/delay.h> +#include <linux/gpio/consumer.h> #include <linux/irq.h> #include <linux/interrupt.h> #include <linux/wm97xx.h>
@@ -58,7 +59,7 @@ static const struct continuous cinfo[] = {/* continuous speed index */ static int sp_idx;static u16 last, tries; -static int irq; +static struct gpio_desc *gpiod_irq;/* * Pen sampling frequency (Hz) in continuous mode.
@@ -194,28 +195,21 @@ static int wm97xx_acc_startup(struct wm97xx *wm)/* IRQ driven touchscreen is used on Palm hardware */ if (machine_is_palmt5 () ||machine_is_palmtx () ||machine_is_palmld ()) { pen_int =1 ; - irq =27 ;/* There is some obscure mutant of WM9712 interbred with WM9713 * used on Palm HW */ wm->variant = WM97xx_WM1613; - }else if (machine_is_mainstone () && pen_int) - irq =4 ; - -if (irq) { - ret =gpio_request (irq,"Touchscreen IRQ" ); -if (ret) - goto out; - - ret =gpio_direction_input (irq); -if (ret) { -gpio_free (irq); - goto out; - } + } + +if (pen_int) { + gpiod_irq =gpiod_get (wm->dev,"touch" ,GPIOD_IN ); +if (IS_ERR (gpiod_irq)) + pen_int =0 ; + } - wm->pen_irq =gpio_to_irq (irq); +if (pen_int) { + wm->pen_irq =gpiod_to_irq (gpiod_irq);irq_set_irq_type (wm->pen_irq,IRQ_TYPE_EDGE_BOTH ); - }else /* pen irq not supported */ - pen_int =0 ; + }/* codec specific irq config */ if (pen_int) {
@@ -242,7 +236,6 @@ static int wm97xx_acc_startup(struct wm97xx *wm) } } -out:return ret; }
@@ -250,8 +243,8 @@ static void wm97xx_acc_shutdown(struct wm97xx *wm) {/* codec specific deconfig */ if (pen_int) { -if (irq) -gpio_free (irq); +if (gpiod_irq) +gpiod_put (gpiod_irq); wm->pen_irq =0 ; } }
Signature · 1 line
2.29.2
Re: [PATCH 24/48] ARM: pxa: mainstone-wm97xx: use gpio lookup table
Quoted 11 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
This driver hardcodes gpio numbers without a header file. Use lookup tables instead.
Cc Marek Vasut <[email protected]>Acked-by Dmitry Torokhov <[email protected]>Acked-by Robert Jarzmik <[email protected]>Reviewed-by Linus Walleij <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>
Looks good to me!
Yours,
Linus Walleij
PATCH v2 25/48 ARM: pxa: zylonite: use gpio lookup instead mfp header
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
The mach/mfp.h header is only used by this one driver for hardcoded gpio numbers. Change that to use a lookup table instead.
--- arch/arm/mach-pxa/zylonite.c | 31 +++++++++++++++++++++ drivers/input/touchscreen/zylonite-wm97xx.c | 20 +++++++------ 2 files changed, 42 insertions(+), 9 deletions(-)
arch/arm/mach-pxa/zylonite.c +31 -0
@@ -32,6 +32,7 @@#include <linux/platform_data/usb-ohci-pxa27x.h> #include <linux/platform_data/keypad-pxa27x.h> #include <linux/platform_data/mtd-nand-pxa3xx.h> +#include <mach/mfp.h> #include "devices.h" #include "generic.h"
@@ -425,6 +426,35 @@ static void __init zylonite_init_ohci(void)static inline void zylonite_init_ohci (void ) {}#endif /* CONFIG_USB_OHCI_HCD || CONFIG_USB_OHCI_HCD_MODULE */ +static struct gpiod_lookup_table zylonite_wm97xx_touch_gpio15_table = { + .dev_id ="wm97xx-touch.0" , + .table = { +GPIO_LOOKUP ("gpio-pxa" ,mfp_to_gpio (MFP_PIN_GPIO15 ), +"touch" ,GPIO_ACTIVE_LOW ), + { }, + }, +}; + +static struct gpiod_lookup_table zylonite_wm97xx_touch_gpio26_table = { + .dev_id ="wm97xx-touch.0" , + .table = { +GPIO_LOOKUP ("gpio-pxa" ,mfp_to_gpio (MFP_PIN_GPIO26 ), +"touch" ,GPIO_ACTIVE_LOW ), + { }, + }, +}; + +static void __init zylonite_init_wm97xx_touch (void ) +{ +if (!IS_ENABLED (CONFIG_TOUCHSCREEN_WM97XX_ZYLONITE )) +return ; + +if (cpu_is_pxa320 ()) +gpiod_add_lookup_table (&zylonite_wm97xx_touch_gpio15_table); +else +gpiod_add_lookup_table (&zylonite_wm97xx_touch_gpio26_table); +} +static void __init zylonite_init (void ) {pxa_set_ffuart_info (NULL );
@@ -450,6 +480,7 @@ static void __init zylonite_init(void)zylonite_init_nand ();zylonite_init_leds ();zylonite_init_ohci (); +zylonite_init_wm97xx_touch (); }MACHINE_START (ZYLONITE ,"PXA3xx Platform Development Kit (aka Zylonite)" )
drivers/input/touchscreen/zylonite-wm97xx.c +11 -9
@@ -17,14 +17,13 @@#include <linux/moduleparam.h> #include <linux/kernel.h> #include <linux/delay.h> -#include <linux/gpio.h> +#include <linux/gpio/consumer.h> #include <linux/irq.h> #include <linux/interrupt.h> #include <linux/io.h> #include <linux/soc/pxa/cpu.h> #include <linux/wm97xx.h> -#include <mach/mfp.h> #include <mach/regs-ac97.h> struct continuous {
@@ -181,14 +180,17 @@ static struct wm97xx_mach_ops zylonite_mach_ops = {static int zylonite_wm97xx_probe (struct platform_device *pdev) {struct wm97xx *wm =platform_get_drvdata (pdev); -int gpio_touch_irq; - -if (cpu_is_pxa320 ()) - gpio_touch_irq =mfp_to_gpio (MFP_PIN_GPIO15 ); -else - gpio_touch_irq =mfp_to_gpio (MFP_PIN_GPIO26 ); +struct gpio_desc *gpio_touch_irq; +int err; + + gpio_touch_irq =devm_gpiod_get (&pdev->dev,"touch" ,GPIOD_IN ); + err =PTR_ERR_OR_ZERO (gpio_touch_irq); +if (err) { +dev_err (&pdev->dev,"Cannot get irq gpio: %d\n" , err); +return err; + } - wm->pen_irq =gpio_to_irq (gpio_touch_irq); + wm->pen_irq =gpiod_to_irq (gpio_touch_irq);irq_set_irq_type (wm->pen_irq,IRQ_TYPE_EDGE_BOTH ); wm97xx_config_gpio(wm, WM97XX_GPIO_13, WM97XX_GPIO_IN,
Signature · 1 line
2.29.2
Re: [PATCH 25/48] ARM: pxa: zylonite: use gpio lookup instead mfp header
Quoted 11 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The
mach/mfp.hheader is only used by this one driver for hardcoded gpio numbers. Change that to use a lookup table instead.Cc Dmitry Torokhov <[email protected]>Acked-by Robert Jarzmik <[email protected]>Acked-by Linus Walleij <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>
Looks good to me!
Yours,
Linus Walleij
PATCH v2 26/48 input: touchscreen: mainstone: fix pxa2xx+pxa3xx configuration
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
There are two different ways of flushing the ac97 queue in this driver, selected by a compile time option.
Change this to a runtime selection to make it work when both are enabled.
--- drivers/input/touchscreen/mainstone-wm97xx.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-)
drivers/input/touchscreen/mainstone-wm97xx.c +7 -12
@@ -98,25 +98,20 @@ MODULE_PARM_DESC(ac97_touch_slot, "Touch screen data slot AC97 number");/* flush AC97 slot 5 FIFO on pxa machines */ -#ifdef CONFIG_PXA27x -static void wm97xx_acc_pen_up (struct wm97xx *wm) -{ -schedule_timeout_uninterruptible (1 ); - -while (MISR & (1 <<2 )) -MODR ; -} -#else static void wm97xx_acc_pen_up (struct wm97xx *wm) {unsigned int count;schedule_timeout_uninterruptible (1 ); -for (count =0 ; count <16 ; count++) -MODR ; +if (cpu_is_pxa27x ()) { +while (MISR & (1 <<2 )) +MODR ; + }else if (cpu_is_pxa3xx ()) { +for (count =0 ; count <16 ; count++) +MODR ; + } } -#endif static int wm97xx_acc_pen_down (struct wm97xx *wm) {
Signature · 1 line
2.29.2
PATCH v2 27/48 input: touchscreen: mainstone: sync with zylonite driver
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
The two drivers are almost identical and can work on a variety of hardware in principle. The mainstone driver supports additional hardware, and the zylonite driver has a few cleanup patches.
Sync the two by adding the zylonite changes into the mainstone one, and checking for the zylonite board to order to keep the default behavior (interrupt enabled) there.
--- drivers/input/touchscreen/mainstone-wm97xx.c | 59 ++++++++++---------- 1 file changed, 31 insertions(+), 28 deletions(-)
drivers/input/touchscreen/mainstone-wm97xx.c +31 -28
@@ -24,9 +24,9 @@#include <linux/gpio/consumer.h> #include <linux/irq.h> #include <linux/interrupt.h> -#include <linux/wm97xx.h> #include <linux/io.h> -#include <linux/gpio.h> +#include <linux/soc/pxa/cpu.h> +#include <linux/wm97xx.h> #include <mach/regs-ac97.h>
@@ -42,23 +42,22 @@ struct continuous {#define WM_READS (sp) ((sp / HZ) + 1)static const struct continuous cinfo[] = { - {WM9705_ID2 ,0 ,WM_READS (94 ),94 }, - {WM9705_ID2 ,1 ,WM_READS (188 ),188 }, - {WM9705_ID2 ,2 ,WM_READS (375 ),375 }, - {WM9705_ID2 ,3 ,WM_READS (750 ),750 }, - {WM9712_ID2 ,0 ,WM_READS (94 ),94 }, - {WM9712_ID2 ,1 ,WM_READS (188 ),188 }, - {WM9712_ID2 ,2 ,WM_READS (375 ),375 }, - {WM9712_ID2 ,3 ,WM_READS (750 ),750 }, - {WM9713_ID2 ,0 ,WM_READS (94 ),94 }, - {WM9713_ID2 ,1 ,WM_READS (120 ),120 }, - {WM9713_ID2 ,2 ,WM_READS (154 ),154 }, - {WM9713_ID2 ,3 ,WM_READS (188 ),188 }, + {WM9705_ID2 ,0 ,WM_READS (94 ),94 }, + {WM9705_ID2 ,1 ,WM_READS (188 ),188 }, + {WM9705_ID2 ,2 ,WM_READS (375 ),375 }, + {WM9705_ID2 ,3 ,WM_READS (750 ),750 }, + {WM9712_ID2 ,0 ,WM_READS (94 ),94 }, + {WM9712_ID2 ,1 ,WM_READS (188 ),188 }, + {WM9712_ID2 ,2 ,WM_READS (375 ),375 }, + {WM9712_ID2 ,3 ,WM_READS (750 ),750 }, + {WM9713_ID2 ,0 ,WM_READS (94 ),94 }, + {WM9713_ID2 ,1 ,WM_READS (120 ),120 }, + {WM9713_ID2 ,2 ,WM_READS (154 ),154 }, + {WM9713_ID2 ,3 ,WM_READS (188 ),188 }, };/* continuous speed index */ static int sp_idx; -static u16 last, tries;static struct gpio_desc *gpiod_irq;/*
@@ -102,7 +101,7 @@ static void wm97xx_acc_pen_up(struct wm97xx *wm) {unsigned int count; -schedule_timeout_uninterruptible (1 ); +msleep (1 );if (cpu_is_pxa27x ()) {while (MISR & (1 <<2 ))
@@ -117,13 +116,14 @@ static int wm97xx_acc_pen_down(struct wm97xx *wm) {u16 x, y, p =0x100 |WM97XX_ADCSEL_PRES ;int reads =0 ; +static u16 last, tries;/* When the AC97 queue has been drained we need to allow time * to buffer up samples otherwise we end up spinning polling * for samples. The controller can't have a suitably low * threshold set to use the notifications it gives. */ -schedule_timeout_uninterruptible (1 ); +msleep (1 );if (tries >5 ) { tries =0 ;
@@ -193,6 +193,8 @@ static int wm97xx_acc_startup(struct wm97xx *wm)/* There is some obscure mutant of WM9712 interbred with WM9713 * used on Palm HW */ wm->variant = WM97xx_WM1613; + }else if (machine_is_zylonite ()) { + pen_int =1 ; }if (pen_int) {
@@ -253,13 +255,13 @@ static void wm97xx_irq_enable(struct wm97xx *wm, int enable) }static struct wm97xx_mach_ops mainstone_mach_ops = { - .acc_enabled =1 , - .acc_pen_up = wm97xx_acc_pen_up, - .acc_pen_down = wm97xx_acc_pen_down, - .acc_startup = wm97xx_acc_startup, - .acc_shutdown = wm97xx_acc_shutdown, - .irq_enable = wm97xx_irq_enable, - .irq_gpio =WM97XX_GPIO_2 , + .acc_enabled =1 , + .acc_pen_up = wm97xx_acc_pen_up, + .acc_pen_down = wm97xx_acc_pen_down, + .acc_startup = wm97xx_acc_startup, + .acc_shutdown = wm97xx_acc_shutdown, + .irq_enable = wm97xx_irq_enable, + .irq_gpio =WM97XX_GPIO_2 , };static int mainstone_wm97xx_probe (struct platform_device *pdev)
@@ -274,14 +276,15 @@ static int mainstone_wm97xx_remove(struct platform_device *pdev)struct wm97xx *wm =platform_get_drvdata (pdev);wm97xx_unregister_mach_ops (wm); +return 0 ; }static struct platform_driver mainstone_wm97xx_driver = { - .probe = mainstone_wm97xx_probe, - .remove = mainstone_wm97xx_remove, - .driver = { - .name ="wm97xx-touch" , + .probe = mainstone_wm97xx_probe, + .remove = mainstone_wm97xx_remove, + .driver = { + .name ="wm97xx-touch" , }, };module_platform_driver (mainstone_wm97xx_driver);
Signature · 1 line
2.29.2
PATCH v2 28/48 Input: touchscreen: use wrapper for pxa2xx ac97 registers
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
To avoid a dependency on the pxa platform header files with hardcoded registers, change the driver to call a wrapper in the pxa2xx-ac97-lib that encapsulates all the other ac97 stuff.
--- drivers/input/touchscreen/Kconfig | 2 ++ drivers/input/touchscreen/mainstone-wm97xx.c | 16 ++++++++-------- drivers/input/touchscreen/zylonite-wm97xx.c | 12 ++++++------ include/sound/pxa2xx-lib.h | 4 ++++ sound/arm/pxa2xx-ac97-lib.c | 12 ++++++++++++ 5 files changed, 32 insertions(+), 14 deletions(-)
drivers/input/touchscreen/Kconfig +2 -0
@@ -902,6 +902,7 @@ config TOUCHSCREEN_WM9713 config TOUCHSCREEN_WM97XX_MAINSTONE tristate "WM97xx Mainstone/Palm accelerated touch" depends on TOUCHSCREEN_WM97XX && ARCH_PXA + depends on SND_PXA2XX_LIB_AC97 help Say Y here for support for streaming mode with WM97xx touchscreens on Mainstone, Palm Tungsten T5, TX and LifeDrive systems.
@@ -914,6 +915,7 @@ config TOUCHSCREEN_WM97XX_MAINSTONE config TOUCHSCREEN_WM97XX_ZYLONITE tristate "Zylonite accelerated touch" depends on TOUCHSCREEN_WM97XX && MACH_ZYLONITE + depends on SND_PXA2XX_LIB_AC97 select TOUCHSCREEN_WM9713 help Say Y here for support for streaming mode with the touchscreen
drivers/input/touchscreen/mainstone-wm97xx.c +8 -8
@@ -28,7 +28,7 @@#include <linux/soc/pxa/cpu.h> #include <linux/wm97xx.h> -#include <mach/regs-ac97.h> +#include <sound/pxa2xx-lib.h> #include <asm/mach-types.h>
@@ -104,11 +104,11 @@ static void wm97xx_acc_pen_up(struct wm97xx *wm)msleep (1 );if (cpu_is_pxa27x ()) { -while (MISR & (1 <<2 )) -MODR ; +while (pxa2xx_ac97_read_misr () & (1 <<2 )) +pxa2xx_ac97_read_modr (); }else if (cpu_is_pxa3xx ()) {for (count =0 ; count <16 ; count++) -MODR ; +pxa2xx_ac97_read_modr (); } }
@@ -130,7 +130,7 @@ static int wm97xx_acc_pen_down(struct wm97xx *wm)return RC_PENUP ; } - x =MODR ; + x =pxa2xx_ac97_read_modr ();if (x == last) { tries++;return RC_AGAIN ;
@@ -138,10 +138,10 @@ static int wm97xx_acc_pen_down(struct wm97xx *wm) last = x; do { if (reads) - x = MODR; - y = MODR; + x = pxa2xx_ac97_read_modr(); + y = pxa2xx_ac97_read_modr(); if (pressure) - p = MODR; + p = pxa2xx_ac97_read_modr(); dev_dbg(wm->dev, "Raw coordinates: x=%x, y=%x, p=%x\n", x, y, p);
drivers/input/touchscreen/zylonite-wm97xx.c +6 -6
@@ -24,7 +24,7 @@#include <linux/soc/pxa/cpu.h> #include <linux/wm97xx.h> -#include <mach/regs-ac97.h> +#include <sound/pxa2xx-lib.h> struct continuous {u16 id;/* codec id */
@@ -79,7 +79,7 @@ static void wm97xx_acc_pen_up(struct wm97xx *wm)msleep (1 );for (i =0 ; i <16 ; i++) -MODR ; +pxa2xx_ac97_read_modr (); }static int wm97xx_acc_pen_down (struct wm97xx *wm)
@@ -100,7 +100,7 @@ static int wm97xx_acc_pen_down(struct wm97xx *wm)return RC_PENUP ; } - x =MODR ; + x =pxa2xx_ac97_read_modr ();if (x == last) { tries++;return RC_AGAIN ;
@@ -108,10 +108,10 @@ static int wm97xx_acc_pen_down(struct wm97xx *wm) last = x; do { if (reads) - x = MODR; - y = MODR; + x = pxa2xx_ac97_read_modr(); + y = pxa2xx_ac97_read_modr(); if (pressure) - p = MODR; + p = pxa2xx_ac97_read_modr(); dev_dbg(wm->dev, "Raw coordinates: x=%x, y=%x, p=%x\n", x, y, p);
include/sound/pxa2xx-lib.h +4 -0
@@ -52,4 +52,8 @@ extern int pxa2xx_ac97_hw_resume(void);extern int pxa2xx_ac97_hw_probe (struct platform_device *dev);extern void pxa2xx_ac97_hw_remove (struct platform_device *dev); +/* modem registers, used by touchscreen driver */ +u32 pxa2xx_ac97_read_modr (void ); +u32 pxa2xx_ac97_read_misr (void ); +#endif
sound/arm/pxa2xx-ac97-lib.c +12 -0
@@ -428,6 +428,18 @@ void pxa2xx_ac97_hw_remove(struct platform_device *dev) }EXPORT_SYMBOL_GPL (pxa2xx_ac97_hw_remove); +u32 pxa2xx_ac97_read_modr (void ) +{ +return MODR ; +} +EXPORT_SYMBOL_GPL (pxa2xx_ac97_read_modr); + +u32 pxa2xx_ac97_read_misr (void ) +{ +return MISR ; +} +EXPORT_SYMBOL_GPL (pxa2xx_ac97_read_misr); +MODULE_AUTHOR ("Nicolas Pitre" );MODULE_DESCRIPTION ("Intel/Marvell PXA sound library" );MODULE_LICENSE ("GPL" );
Signature · 1 line
2.29.2
PATCH v2 29/48 Input: wm97xx - switch to using threaded IRQ
In reply to Arnd BergmannFrom: Dmitry Torokhov <[email protected]>
Instead of manually disabling and enabling interrupts and scheduling work to access the device, let's use threaded oneshot interrupt handler. It simplifies things.
--- drivers/input/touchscreen/wm97xx-core.c | 42 +++++-------------------- include/linux/wm97xx.h | 1 - 2 files changed, 7 insertions(+), 36 deletions(-)
drivers/input/touchscreen/wm97xx-core.c +7 -35
@@ -285,11 +285,12 @@ void wm97xx_set_suspend_mode(struct wm97xx *wm, u16 mode)EXPORT_SYMBOL_GPL (wm97xx_set_suspend_mode);/* -* Handle a pen down interrupt. +* Codec PENDOWN irq handler +* */ -static void wm97xx_pen_irq_worker (struct work_struct *work) +static irqreturn_t wm97xx_pen_interrupt (int irq,void *dev_id) { - struct wm97xx *wm = container_of(work, struct wm97xx, pen_event_work); +struct wm97xx *wm = dev_id;int pen_was_down = wm->pen_is_down;/* do we need to enable the touch panel reader */
@@ -343,27 +344,6 @@ static void wm97xx_pen_irq_worker(struct work_struct *work)if (!wm->pen_is_down && wm->mach_ops->acc_enabled) wm->mach_ops->acc_pen_up (wm); - wm->mach_ops->irq_enable (wm,1 ); -} - -/* -* Codec PENDOWN irq handler -* -* We have to disable the codec interrupt in the handler because it -* can take up to 1ms to clear the interrupt source. We schedule a task -* in a work queue to do the actual interaction with the chip. The -* interrupt is then enabled again in the slow handler when the source -* has been cleared. -*/ -static irqreturn_t wm97xx_pen_interrupt (int irq,void *dev_id) -{ -struct wm97xx *wm = dev_id; - -if (!work_pending (&wm->pen_event_work)) { - wm->mach_ops->irq_enable (wm,0 ); -queue_work (wm->ts_workq, &wm->pen_event_work); - } -return IRQ_HANDLED ; }
@@ -374,12 +354,9 @@ static int wm97xx_init_pen_irq(struct wm97xx *wm) {u16 reg; -/* If an interrupt is supplied an IRQ enable operation must also be -* provided. */ -BUG_ON (!wm->mach_ops->irq_enable); - -if (request_irq (wm->pen_irq, wm97xx_pen_interrupt,IRQF_SHARED , -"wm97xx-pen" , wm)) { +if (request_threaded_irq (wm->pen_irq,NULL , wm97xx_pen_interrupt, +IRQF_SHARED |IRQF_ONESHOT , +"wm97xx-pen" , wm)) {dev_err (wm->dev,"Failed to register pen down interrupt, polling" ); wm->pen_irq =0 ;
@@ -509,7 +486,6 @@ static int wm97xx_ts_input_open(struct input_dev *idev) wm->codec->dig_enable (wm,1 );INIT_DELAYED_WORK (&wm->ts_reader, wm97xx_ts_reader); -INIT_WORK (&wm->pen_event_work, wm97xx_pen_irq_worker); wm->ts_reader_min_interval =HZ >=100 ?HZ /100 :1 ;if (wm->ts_reader_min_interval <1 )
@@ -560,10 +536,6 @@ static void wm97xx_ts_input_close(struct input_dev *idev) wm->pen_is_down =0 ; -/* Balance out interrupt disables/enables */ -if (cancel_work_sync (&wm->pen_event_work)) - wm->mach_ops->irq_enable (wm,1 ); -/* ts_reader rearms itself so we need to explicitly stop it * before we destroy the workqueue. */
include/linux/wm97xx.h +0 -1
@@ -281,7 +281,6 @@ struct wm97xx {unsigned long ts_reader_min_interval;/* Minimum interval */ unsigned int pen_irq;/* Pen IRQ number in use */ struct workqueue_struct *ts_workq; -struct work_struct pen_event_work;u16 acc_slot;/* AC97 slot used for acc touch data */ u16 acc_rate;/* acc touch data rate */ unsigned pen_is_down:1; /* Pen is down */
Signature · 1 line
2.29.2
PATCH v2 30/48 Input: wm97xx - get rid of irq_enable method in wm97xx_mach_ops
In reply to Arnd BergmannFrom: Dmitry Torokhov <[email protected]>
Now that we are using oneshot threaded IRQ this method is not used anymore.
--- arch/mips/alchemy/devboards/db1300.c | 9 --------- drivers/input/touchscreen/mainstone-wm97xx.c | 9 --------- drivers/input/touchscreen/zylonite-wm97xx.c | 9 --------- include/linux/wm97xx.h | 3 --- 4 files changed, 30 deletions(-)
arch/mips/alchemy/devboards/db1300.c +0 -9
@@ -732,16 +732,7 @@ static struct platform_device db1300_lcd_dev = {/**********************************************************************/ #if IS_ENABLED (CONFIG_TOUCHSCREEN_WM97XX ) -static void db1300_wm97xx_irqen (struct wm97xx *wm,int enable) -{ -if (enable) -enable_irq (DB1300_AC97_PEN_INT ); -else -disable_irq_nosync (DB1300_AC97_PEN_INT ); -} -static struct wm97xx_mach_ops db1300_wm97xx_ops = { - .irq_enable = db1300_wm97xx_irqen, .irq_gpio =WM97XX_GPIO_3 , };
drivers/input/touchscreen/mainstone-wm97xx.c +0 -9
@@ -246,21 +246,12 @@ static void wm97xx_acc_shutdown(struct wm97xx *wm) } } -static void wm97xx_irq_enable (struct wm97xx *wm,int enable) -{ -if (enable) -enable_irq (wm->pen_irq); -else -disable_irq_nosync (wm->pen_irq); -} -static struct wm97xx_mach_ops mainstone_mach_ops = { .acc_enabled =1 , .acc_pen_up = wm97xx_acc_pen_up, .acc_pen_down = wm97xx_acc_pen_down, .acc_startup = wm97xx_acc_startup, .acc_shutdown = wm97xx_acc_shutdown, - .irq_enable = wm97xx_irq_enable, .irq_gpio =WM97XX_GPIO_2 , };
drivers/input/touchscreen/zylonite-wm97xx.c +0 -9
@@ -160,20 +160,11 @@ static int wm97xx_acc_startup(struct wm97xx *wm)return 0 ; } -static void wm97xx_irq_enable (struct wm97xx *wm,int enable) -{ -if (enable) -enable_irq (wm->pen_irq); -else -disable_irq_nosync (wm->pen_irq); -} -static struct wm97xx_mach_ops zylonite_mach_ops = { .acc_enabled =1 , .acc_pen_up = wm97xx_acc_pen_up, .acc_pen_down = wm97xx_acc_pen_down, .acc_startup = wm97xx_acc_startup, - .irq_enable = wm97xx_irq_enable, .irq_gpio =WM97XX_GPIO_2 , };
include/linux/wm97xx.h +0 -3
@@ -254,9 +254,6 @@ struct wm97xx_mach_ops {int (*acc_startup) (struct wm97xx *);void (*acc_shutdown) (struct wm97xx *); -/* interrupt mask control - required for accelerated operation */ -void (*irq_enable) (struct wm97xx *,int enable); -/* GPIO pin used for accelerated operation */ int irq_gpio;
Signature · 1 line
2.29.2
PATCH v2 31/48 ASoC: pxa: use pdev resource for FIFO regs
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
The driver currently takes the hardwired FIFO address from a header file that we want to eliminate. Change it to use the mmio resource instead and stop including the here.
--- sound/soc/pxa/pxa2xx-ac97.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-)
sound/soc/pxa/pxa2xx-ac97.c +15 -7
@@ -21,10 +21,12 @@#include <sound/pxa2xx-lib.h> #include <sound/dmaengine_pcm.h> -#include <mach/pxa-regs.h> -#include <mach/regs-ac97.h> #include <linux/platform_data/asoc-pxa.h> +#define PCDR 0x0040/* PCM FIFO Data Register */ +#define MODR 0x0140/* Modem FIFO Data Register */ +#define MCDR 0x0060/* Mic-in FIFO Data Register */ +static void pxa2xx_ac97_warm_reset (struct ac97_controller *adrv) {pxa2xx_ac97_try_warm_reset ();
@@ -59,35 +61,30 @@ static struct ac97_controller_ops pxa2xx_ac97_ops = { };static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_in = { - .addr =__PREG (PCDR ), .addr_width =DMA_SLAVE_BUSWIDTH_4_BYTES , .chan_name ="pcm_pcm_stereo_in" , .maxburst =32 , };static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_out = { - .addr =__PREG (PCDR ), .addr_width =DMA_SLAVE_BUSWIDTH_4_BYTES , .chan_name ="pcm_pcm_stereo_out" , .maxburst =32 , };static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_aux_mono_out = { - .addr =__PREG (MODR ), .addr_width =DMA_SLAVE_BUSWIDTH_2_BYTES , .chan_name ="pcm_aux_mono_out" , .maxburst =16 , };static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_aux_mono_in = { - .addr =__PREG (MODR ), .addr_width =DMA_SLAVE_BUSWIDTH_2_BYTES , .chan_name ="pcm_aux_mono_in" , .maxburst =16 , };static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_mic_mono_in = { - .addr =__PREG (MCDR ), .addr_width =DMA_SLAVE_BUSWIDTH_2_BYTES , .chan_name ="pcm_aux_mic_mono" , .maxburst =16 ,
@@ -226,6 +223,7 @@ 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; +struct resource *regs;void **codecs_pdata;if (pdev->id !=-1 ) {
@@ -233,6 +231,16 @@ static int pxa2xx_ac97_dev_probe(struct platform_device *pdev)return -ENXIO ; } + regs =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); +if (!regs) +return -ENXIO ; + + pxa2xx_ac97_pcm_stereo_in.addr = regs->start +PCDR ; + pxa2xx_ac97_pcm_stereo_out.addr = regs->start +PCDR ; + pxa2xx_ac97_pcm_aux_mono_out.addr = regs->start +MODR ; + pxa2xx_ac97_pcm_aux_mono_in.addr = regs->start +MODR ; + pxa2xx_ac97_pcm_mic_mono_in.addr = regs->start +MCDR ; + ret =pxa2xx_ac97_hw_probe (pdev);if (ret) {dev_err (&pdev->dev,"PXA2xx AC97 hw probe error (%d)\n" , ret);
Signature · 1 line
2.29.2
PATCH v2 32/48 ASoC: pxa: ac97: use normal MMIO accessors
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
To avoid dereferencing hardwired constant pointers from a global header file, change the driver to use devm_platform_ioremap_resource for getting an __iomem pointer, and then using readl/writel on that.
Each pointer dereference gets changed by a search&replace, which leads to a few overlong lines, but seems less risky than trying to clean up the code at the same time.
--- sound/arm/pxa2xx-ac97-lib.c | 124 ++++++++++-------- .../arm/pxa2xx-ac97-regs.h | 42 +++--- sound/arm/pxa2xx-ac97.c | 1 - 3 files changed, 92 insertions(+), 75 deletions(-) rename arch/arm/mach-pxa/include/mach/regs-ac97.h => sound/arm/pxa2xx-ac97-regs.h (71%)
sound/arm/pxa2xx-ac97-lib.c +72 -52
@@ -21,15 +21,17 @@#include <sound/pxa2xx-lib.h> -#include <mach/regs-ac97.h> #include <linux/platform_data/asoc-pxa.h> +#include "pxa2xx-ac97-regs.h" +static DEFINE_MUTEX (car_mutex);static DECLARE_WAIT_QUEUE_HEAD (gsr_wq);static volatile long gsr_bits;static struct clk *ac97_clk;static struct clk *ac97conf_clk;static int reset_gpio; +static void __iomem *ac97_reg_base;extern void pxa27x_configure_ac97reset (int reset_gpio,bool to_gpio);
@@ -46,7 +48,7 @@ extern void pxa27x_configure_ac97reset(int reset_gpio, bool to_gpio);int pxa2xx_ac97_read (int slot,unsigned short reg) {int val = -ENODEV ; -volatile u32 *reg_addr; +u32 __iomem *reg_addr;if (slot >0 )return -ENODEV ;
@@ -55,31 +57,33 @@ int pxa2xx_ac97_read(int slot, unsigned short reg)/* set up primary or secondary codec space */ if (cpu_is_pxa25x () && reg ==AC97_GPIO_STATUS ) - reg_addr = slot ? &SMC_REG_BASE : &PMC_REG_BASE ; + reg_addr = ac97_reg_base + + (slot ?SMC_REG_BASE :PMC_REG_BASE );else - reg_addr = slot ? &SAC_REG_BASE : &PAC_REG_BASE ; + reg_addr = ac97_reg_base + + (slot ?SAC_REG_BASE :PAC_REG_BASE ); reg_addr += (reg >>1 );/* start read access across the ac97 link */ -GSR =GSR_CDONE |GSR_SDONE ; +writel (GSR_CDONE |GSR_SDONE , ac97_reg_base +GSR ); gsr_bits =0 ; - val = (*reg_addr &0xffff ); + val = (readl (reg_addr) &0xffff );if (reg ==AC97_GPIO_STATUS ) goto out; -if (wait_event_timeout (gsr_wq, (GSR | gsr_bits) &GSR_SDONE ,1 ) <=0 && - !((GSR | gsr_bits) &GSR_SDONE )) { +if (wait_event_timeout (gsr_wq, (readl (ac97_reg_base +GSR ) | gsr_bits) &GSR_SDONE ,1 ) <=0 && + !((readl (ac97_reg_base +GSR ) | gsr_bits) &GSR_SDONE )) {printk (KERN_ERR "%s: read error (ac97_reg=%d GSR=%#lx)\n" , - __func__, reg,GSR | gsr_bits); + __func__, reg,readl (ac97_reg_base +GSR ) | gsr_bits); val = -ETIMEDOUT ; goto out; }/* valid data now */ -GSR =GSR_CDONE |GSR_SDONE ; +writel (GSR_CDONE |GSR_SDONE , ac97_reg_base +GSR ); gsr_bits =0 ; - val = (*reg_addr &0xffff ); + val = (readl (reg_addr) &0xffff );/* but we've just started another cycle... */ -wait_event_timeout (gsr_wq, (GSR | gsr_bits) &GSR_SDONE ,1 ); +wait_event_timeout (gsr_wq, (readl (ac97_reg_base +GSR ) | gsr_bits) &GSR_SDONE ,1 ); out:mutex_unlock (&car_mutex);return val;
@@ -88,25 +92,27 @@ EXPORT_SYMBOL_GPL(pxa2xx_ac97_read);int pxa2xx_ac97_write (int slot,unsigned short reg,unsigned short val) { -volatile u32 *reg_addr; +u32 __iomem *reg_addr;int ret =0 ;mutex_lock (&car_mutex);/* set up primary or secondary codec space */ if (cpu_is_pxa25x () && reg ==AC97_GPIO_STATUS ) - reg_addr = slot ? &SMC_REG_BASE : &PMC_REG_BASE ; + reg_addr = ac97_reg_base + + (slot ?SMC_REG_BASE :PMC_REG_BASE );else - reg_addr = slot ? &SAC_REG_BASE : &PAC_REG_BASE ; + reg_addr = ac97_reg_base + + (slot ?SAC_REG_BASE :PAC_REG_BASE ); reg_addr += (reg >>1 ); -GSR =GSR_CDONE |GSR_SDONE ; +writel (GSR_CDONE |GSR_SDONE , ac97_reg_base +GSR ); gsr_bits =0 ; - *reg_addr = val; -if (wait_event_timeout (gsr_wq, (GSR | gsr_bits) &GSR_CDONE ,1 ) <=0 && - !((GSR | gsr_bits) &GSR_CDONE )) { +writel (val, reg_addr); +if (wait_event_timeout (gsr_wq, (readl (ac97_reg_base +GSR ) | gsr_bits) &GSR_CDONE ,1 ) <=0 && + !((readl (ac97_reg_base +GSR ) | gsr_bits) &GSR_CDONE )) {printk (KERN_ERR "%s: write error (ac97_reg=%d GSR=%#lx)\n" , - __func__, reg,GSR | gsr_bits); + __func__, reg,readl (ac97_reg_base +GSR ) | gsr_bits); ret = -EIO ; }
@@ -120,17 +126,17 @@ static inline void pxa_ac97_warm_pxa25x(void) { gsr_bits =0 ; -GCR |=GCR_WARM_RST ; +writel (readl (ac97_reg_base +GCR ) | (GCR_WARM_RST ), ac97_reg_base +GCR ); }static inline void pxa_ac97_cold_pxa25x (void ) { -GCR &=GCR_COLD_RST ;/* clear everything but nCRST */ -GCR &= ~GCR_COLD_RST ;/* then assert nCRST */ +writel (readl (ac97_reg_base +GCR ) & (GCR_COLD_RST ), ac97_reg_base +GCR );/* clear everything but nCRST */ +writel (readl (ac97_reg_base +GCR ) & (~GCR_COLD_RST ), ac97_reg_base +GCR );/* then assert nCRST */ gsr_bits =0 ; -GCR =GCR_COLD_RST ; +writel (GCR_COLD_RST , ac97_reg_base +GCR ); }#endif
@@ -142,15 +148,15 @@ static inline void pxa_ac97_warm_pxa27x(void)/* warm reset broken on Bulverde, so manually keep AC97 reset high */ pxa27x_configure_ac97reset (reset_gpio, true);udelay (10 ); -GCR |=GCR_WARM_RST ; +writel (readl (ac97_reg_base +GCR ) | (GCR_WARM_RST ), ac97_reg_base +GCR );pxa27x_configure_ac97reset (reset_gpio, false);udelay (500 ); }static inline void pxa_ac97_cold_pxa27x (void ) { -GCR &=GCR_COLD_RST ;/* clear everything but nCRST */ -GCR &= ~GCR_COLD_RST ;/* then assert nCRST */ +writel (readl (ac97_reg_base +GCR ) & (GCR_COLD_RST ), ac97_reg_base +GCR );/* clear everything but nCRST */ +writel (readl (ac97_reg_base +GCR ) & (~GCR_COLD_RST ), ac97_reg_base +GCR );/* then assert nCRST */ gsr_bits =0 ;
@@ -158,7 +164,7 @@ static inline void pxa_ac97_cold_pxa27x(void)clk_prepare_enable (ac97conf_clk);udelay (5 );clk_disable_unprepare (ac97conf_clk); - GCR = GCR_COLD_RST | GCR_WARM_RST; + writel(GCR_COLD_RST | GCR_WARM_RST, ac97_reg_base + GCR); }#endif
@@ -168,26 +174,26 @@ static inline void pxa_ac97_warm_pxa3xx(void) gsr_bits =0 ;/* Can't use interrupts */ - GCR |= GCR_WARM_RST; +writel (readl (ac97_reg_base +GCR ) | (GCR_WARM_RST ), ac97_reg_base +GCR ); }static inline void pxa_ac97_cold_pxa3xx (void ) {/* Hold CLKBPB for 100us */ -GCR =0 ; -GCR =GCR_CLKBPB ; +writel (0 , ac97_reg_base +GCR ); +writel (GCR_CLKBPB , ac97_reg_base +GCR );udelay (100 ); -GCR =0 ; +writel (0 , ac97_reg_base +GCR ); -GCR &=GCR_COLD_RST ;/* clear everything but nCRST */ -GCR &= ~GCR_COLD_RST ;/* then assert nCRST */ +writel (readl (ac97_reg_base +GCR ) & (GCR_COLD_RST ), ac97_reg_base +GCR );/* clear everything but nCRST */ +writel (readl (ac97_reg_base +GCR ) & (~GCR_COLD_RST ), ac97_reg_base +GCR );/* then assert nCRST */ gsr_bits =0 ;/* Can't use interrupts on PXA3xx */ -GCR &= ~(GCR_PRIRDY_IEN |GCR_SECRDY_IEN ); +writel (readl (ac97_reg_base +GCR ) & (~(GCR_PRIRDY_IEN |GCR_SECRDY_IEN )), ac97_reg_base +GCR ); -GCR =GCR_WARM_RST |GCR_COLD_RST ; +writel (GCR_WARM_RST |GCR_COLD_RST , ac97_reg_base +GCR ); }#endif
@@ -213,10 +219,10 @@ bool pxa2xx_ac97_try_warm_reset(void)#endif snd_BUG (); -while (!((GSR | gsr_bits) & (GSR_PCR |GSR_SCR )) && timeout--) +while (!((readl (ac97_reg_base +GSR ) | gsr_bits) & (GSR_PCR |GSR_SCR )) && timeout--)mdelay (1 ); - gsr =GSR | gsr_bits; + gsr =readl (ac97_reg_base +GSR ) | gsr_bits;if (!(gsr & (GSR_PCR |GSR_SCR ))) {printk (KERN_INFO "%s: warm reset timeout (GSR=%#lx)\n" , __func__, gsr);
@@ -250,10 +256,10 @@ bool pxa2xx_ac97_try_cold_reset(void)#endif snd_BUG (); -while (!((GSR | gsr_bits) & (GSR_PCR |GSR_SCR )) && timeout--) +while (!((readl (ac97_reg_base +GSR ) | gsr_bits) & (GSR_PCR |GSR_SCR )) && timeout--)mdelay (1 ); - gsr =GSR | gsr_bits; + gsr =readl (ac97_reg_base +GSR ) | gsr_bits;if (!(gsr & (GSR_PCR |GSR_SCR ))) {printk (KERN_INFO "%s: cold reset timeout (GSR=%#lx)\n" , __func__, gsr);
@@ -268,8 +274,10 @@ EXPORT_SYMBOL_GPL(pxa2xx_ac97_try_cold_reset);void pxa2xx_ac97_finish_reset (void ) { -GCR &= ~(GCR_PRIRDY_IEN |GCR_SECRDY_IEN ); -GCR |=GCR_SDONE_IE |GCR_CDONE_IE ; +u32 gcr =readl (ac97_reg_base +GCR ); + gcr &= ~(GCR_PRIRDY_IEN |GCR_SECRDY_IEN ); + gcr |=GCR_SDONE_IE |GCR_CDONE_IE ; +writel (gcr, ac97_reg_base +GCR ); }EXPORT_SYMBOL_GPL (pxa2xx_ac97_finish_reset);
@@ -277,9 +285,9 @@ static irqreturn_t pxa2xx_ac97_irq(int irq, void *dev_id) {long status; - status =GSR ; + status =readl (ac97_reg_base +GSR );if (status) { -GSR = status; +writel (status, ac97_reg_base +GSR ); gsr_bits |= status;wake_up (&gsr_wq);
@@ -287,9 +295,9 @@ static irqreturn_t pxa2xx_ac97_irq(int irq, void *dev_id)since they tend to spuriously trigger when MMC is used (hardware bug? go figure)... */ if (cpu_is_pxa27x ()) { -MISR =MISR_EOC ; -PISR =PISR_EOC ; -MCSR =MCSR_EOC ; +writel (MISR_EOC , ac97_reg_base +MISR ); +writel (PISR_EOC , ac97_reg_base +PISR ); +writel (MCSR_EOC , ac97_reg_base +MCSR ); }return IRQ_HANDLED ;
@@ -301,7 +309,7 @@ static irqreturn_t pxa2xx_ac97_irq(int irq, void *dev_id)#ifdef CONFIG_PM int pxa2xx_ac97_hw_suspend (void ) { -GCR |=GCR_ACLINK_OFF ; +writel (readl (ac97_reg_base +GCR ) | (GCR_ACLINK_OFF ), ac97_reg_base +GCR );clk_disable_unprepare (ac97_clk);return 0 ; }
@@ -321,6 +329,12 @@ int pxa2xx_ac97_hw_probe(struct platform_device *dev)int irq;pxa2xx_audio_ops_t *pdata = dev->dev.platform_data; + ac97_reg_base =devm_platform_ioremap_resource (dev,0 ); +if (IS_ERR (ac97_reg_base)) { +dev_err (&dev->dev,"Missing MMIO resource\n" ); +return PTR_ERR (ac97_reg_base); + } +if (pdata) {switch (pdata->reset_gpio) {case 95 :
@@ -398,7 +412,7 @@ int pxa2xx_ac97_hw_probe(struct platform_device *dev)return 0 ; err_irq: -GCR |=GCR_ACLINK_OFF ; +writel (readl (ac97_reg_base +GCR ) | (GCR_ACLINK_OFF ), ac97_reg_base +GCR ); err_clk2:clk_put (ac97_clk); ac97_clk =NULL ;
@@ -416,7 +430,7 @@ void pxa2xx_ac97_hw_remove(struct platform_device *dev) {if (cpu_is_pxa27x ())gpio_free (reset_gpio); -GCR |=GCR_ACLINK_OFF ; +writel (readl (ac97_reg_base +GCR ) | (GCR_ACLINK_OFF ), ac97_reg_base +GCR );free_irq (platform_get_irq (dev,0 ),NULL );if (ac97conf_clk) {clk_put (ac97conf_clk);
@@ -430,13 +444,19 @@ EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_remove);u32 pxa2xx_ac97_read_modr (void ) { -return MODR ; +if (!ac97_reg_base) +return 0 ; + +return readl (ac97_reg_base +MODR ); }EXPORT_SYMBOL_GPL (pxa2xx_ac97_read_modr);u32 pxa2xx_ac97_read_misr (void ) { -return MISR ; +if (!ac97_reg_base) +return 0 ; + +return readl (ac97_reg_base +MISR ); }EXPORT_SYMBOL_GPL (pxa2xx_ac97_read_misr);
sound/arm/pxa2xx-ac97-regs.h renamed from arch/arm/mach-pxa/include/mach/regs-ac97.h +20 -22
100 lines not on this page · raw message
sound/arm/pxa2xx-ac97.c +0 -1
@@ -21,7 +21,6 @@#include <sound/pxa2xx-lib.h> #include <sound/dmaengine_pcm.h> -#include <mach/regs-ac97.h> #include <linux/platform_data/asoc-pxa.h> static void pxa2xx_ac97_legacy_reset (struct snd_ac97 *ac97)
Signature · 1 line
2.29.2
PATCH v2 33/48 ASoC: pxa: i2s: use normal MMIO accessors
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
To avoid dereferencing hardwired constant pointers from a global header file, change the driver to use devm_platform_ioremap_resource for getting an __iomem pointer, and then using readl/writel on that.
Each pointer dereference gets changed by a search&replace, which leads to a few overlong lines, but seems less risky than trying to clean up the code at the same time.
--- sound/soc/pxa/pxa2xx-i2s.c | 110 +++++++++++++++++++++---------------- 1 file changed, 62 insertions(+), 48 deletions(-)
sound/soc/pxa/pxa2xx-i2s.c +62 -48
@@ -21,7 +21,6 @@#include <sound/pxa2xx-lib.h> #include <sound/dmaengine_pcm.h> -#include <mach/pxa-regs.h> #include <linux/platform_data/asoc-pxa.h> #include "pxa2xx-i2s.h"
@@ -29,13 +28,13 @@/* * I2S Controller Register and Bit Definitions */ -#define SACR0 __REG(0x40400000)/* Global Control Register */ -#define SACR1 __REG(0x40400004)/* Serial Audio I 2 S/MSB-Justified Control Register */ -#define SASR0 __REG(0x4040000C)/* Serial Audio I 2 S/MSB-Justified Interface and FIFO Status Register */ -#define SAIMR __REG(0x40400014)/* Serial Audio Interrupt Mask Register */ -#define SAICR __REG(0x40400018)/* Serial Audio Interrupt Clear Register */ -#define SADIV __REG(0x40400060)/* Audio Clock Divider Register. */ -#define SADR __REG(0x40400080)/* Serial Audio Data Register (TX and RX FIFO access Register). */ +#define SACR0 (0x0000)/* Global Control Register */ +#define SACR1 (0x0004)/* Serial Audio I 2 S/MSB-Justified Control Register */ +#define SASR0 (0x000C)/* Serial Audio I 2 S/MSB-Justified Interface and FIFO Status Register */ +#define SAIMR (0x0014)/* Serial Audio Interrupt Mask Register */ +#define SAICR (0x0018)/* Serial Audio Interrupt Clear Register */ +#define SADIV (0x0060)/* Audio Clock Divider Register. */ +#define SADR (0x0080)/* Serial Audio Data Register (TX and RX FIFO access Register). */ #define SACR0_RFTH (x) ((x) << 12)/* Rx FIFO Interrupt or DMA Trigger Threshold */ #define SACR0_TFTH (x) ((x) << 8)/* Tx FIFO Interrupt or DMA Trigger Threshold */
@@ -77,16 +76,15 @@ struct pxa_i2s_port {static struct pxa_i2s_port pxa_i2s;static struct clk *clk_i2s;static int clk_ena =0 ; +static void __iomem *i2s_reg_base;static struct snd_dmaengine_dai_dma_data pxa2xx_i2s_pcm_stereo_out = { - .addr =__PREG (SADR ), .addr_width =DMA_SLAVE_BUSWIDTH_4_BYTES , .chan_name ="tx" , .maxburst =32 , };static struct snd_dmaengine_dai_dma_data pxa2xx_i2s_pcm_stereo_in = { - .addr =__PREG (SADR ), .addr_width =DMA_SLAVE_BUSWIDTH_4_BYTES , .chan_name ="rx" , .maxburst =32 ,
@@ -102,7 +100,7 @@ static int pxa2xx_i2s_startup(struct snd_pcm_substream *substream,return PTR_ERR (clk_i2s);if (!snd_soc_dai_active (cpu_dai)) -SACR0 =0 ; +writel (0 , i2s_reg_base +SACR0 );return 0 ; }
@@ -114,7 +112,7 @@ static int pxa_i2s_wait(void)/* flush the Rx FIFO */ for (i =0 ; i <16 ; i++) -SADR ; +readl (i2s_reg_base +SADR );return 0 ; }
@@ -174,39 +172,39 @@ static int pxa2xx_i2s_hw_params(struct snd_pcm_substream *substream,/* is port used by another stream */ if (!(SACR0 &SACR0_ENB )) { -SACR0 =0 ; +writel (0 , i2s_reg_base +SACR0 );if (pxa_i2s.master) -SACR0 |=SACR0_BCKD ; +writel (readl (i2s_reg_base +SACR0 ) | (SACR0_BCKD ), i2s_reg_base +SACR0 ); -SACR0 |=SACR0_RFTH (14 ) |SACR0_TFTH (1 ); -SACR1 |= pxa_i2s.fmt; +writel (readl (i2s_reg_base +SACR0 ) | (SACR0_RFTH (14 ) |SACR0_TFTH (1 )), i2s_reg_base +SACR0 ); +writel (readl (i2s_reg_base +SACR1 ) | (pxa_i2s.fmt), i2s_reg_base +SACR1 ); }if (substream->stream ==SNDRV_PCM_STREAM_PLAYBACK ) -SAIMR |=SAIMR_TFS ; +writel (readl (i2s_reg_base +SAIMR ) | (SAIMR_TFS ), i2s_reg_base +SAIMR );else -SAIMR |=SAIMR_RFS ; +writel (readl (i2s_reg_base +SAIMR ) | (SAIMR_RFS ), i2s_reg_base +SAIMR );switch (params_rate (params)) {case 8000 : -SADIV =0x48 ; +writel (0x48 , i2s_reg_base +SADIV );break ;case 11025 : -SADIV =0x34 ; +writel (0x34 , i2s_reg_base +SADIV );break ;case 16000 : -SADIV =0x24 ; +writel (0x24 , i2s_reg_base +SADIV );break ;case 22050 : -SADIV =0x1a ; +writel (0x1a , i2s_reg_base +SADIV );break ;case 44100 : -SADIV =0xd ; +writel (0xd , i2s_reg_base +SADIV );break ;case 48000 : -SADIV =0xc ; +writel (0xc , i2s_reg_base +SADIV );break ;case 96000 :/* not in manual and possibly slightly inaccurate */ -SADIV =0x6 ; +writel (0x6 , i2s_reg_base +SADIV );break ; }
@@ -221,10 +219,10 @@ static int pxa2xx_i2s_trigger(struct snd_pcm_substream *substream, int cmd,switch (cmd) {case SNDRV_PCM_TRIGGER_START :if (substream->stream ==SNDRV_PCM_STREAM_PLAYBACK ) -SACR1 &= ~SACR1_DRPL ; +writel (readl (i2s_reg_base +SACR1 ) & (~SACR1_DRPL ), i2s_reg_base +SACR1 );else -SACR1 &= ~SACR1_DREC ; -SACR0 |=SACR0_ENB ; +writel (readl (i2s_reg_base +SACR1 ) & (~SACR1_DREC ), i2s_reg_base +SACR1 ); +writel (readl (i2s_reg_base +SACR0 ) | (SACR0_ENB ), i2s_reg_base +SACR0 );break ;case SNDRV_PCM_TRIGGER_RESUME :case SNDRV_PCM_TRIGGER_PAUSE_RELEASE :
@@ -243,15 +241,15 @@ static void pxa2xx_i2s_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) {if (substream->stream ==SNDRV_PCM_STREAM_PLAYBACK ) { -SACR1 |=SACR1_DRPL ; -SAIMR &= ~SAIMR_TFS ; +writel (readl (i2s_reg_base +SACR1 ) | (SACR1_DRPL ), i2s_reg_base +SACR1 ); +writel (readl (i2s_reg_base +SAIMR ) & (~SAIMR_TFS ), i2s_reg_base +SAIMR ); }else { -SACR1 |=SACR1_DREC ; -SAIMR &= ~SAIMR_RFS ; +writel (readl (i2s_reg_base +SACR1 ) | (SACR1_DREC ), i2s_reg_base +SACR1 ); +writel (readl (i2s_reg_base +SAIMR ) & (~SAIMR_RFS ), i2s_reg_base +SAIMR ); } -if ((SACR1 & (SACR1_DREC |SACR1_DRPL )) == (SACR1_DREC |SACR1_DRPL )) { -SACR0 &= ~SACR0_ENB ; +if ((readl (i2s_reg_base +SACR1 ) & (SACR1_DREC |SACR1_DRPL )) == (SACR1_DREC |SACR1_DRPL )) { +writel (readl (i2s_reg_base +SACR0 ) & (~SACR0_ENB ), i2s_reg_base +SACR0 );pxa_i2s_wait ();if (clk_ena) {clk_disable_unprepare (clk_i2s);
@@ -264,13 +262,13 @@ static void pxa2xx_i2s_shutdown(struct snd_pcm_substream *substream,static int pxa2xx_soc_pcm_suspend (struct snd_soc_component *component) {/* store registers */ - pxa_i2s.sacr0 =SACR0 ; - pxa_i2s.sacr1 =SACR1 ; - pxa_i2s.saimr =SAIMR ; - pxa_i2s.sadiv =SADIV ; + pxa_i2s.sacr0 =readl (i2s_reg_base +SACR0 ); + pxa_i2s.sacr1 =readl (i2s_reg_base +SACR1 ); + pxa_i2s.saimr =readl (i2s_reg_base +SAIMR ); + pxa_i2s.sadiv =readl (i2s_reg_base +SADIV );/* deactivate link */ -SACR0 &= ~SACR0_ENB ; +writel (readl (i2s_reg_base +SACR0 ) & (~SACR0_ENB ), i2s_reg_base +SACR0 );pxa_i2s_wait ();return 0 ; }
@@ -279,12 +277,12 @@ static int pxa2xx_soc_pcm_resume(struct snd_soc_component *component) {pxa_i2s_wait (); -SACR0 = pxa_i2s.sacr0 & ~SACR0_ENB ; -SACR1 = pxa_i2s.sacr1; -SAIMR = pxa_i2s.saimr; -SADIV = pxa_i2s.sadiv; +writel (pxa_i2s.sacr0 & ~SACR0_ENB , i2s_reg_base +SACR0 ); +writel (pxa_i2s.sacr1, i2s_reg_base +SACR1 ); +writel (pxa_i2s.saimr, i2s_reg_base +SAIMR ); +writel (pxa_i2s.sadiv, i2s_reg_base +SADIV ); -SACR0 = pxa_i2s.sacr0; +writel (pxa_i2s.sacr0, i2s_reg_base +SACR0 );return 0 ; }
@@ -306,12 +304,12 @@ static int pxa2xx_i2s_probe(struct snd_soc_dai *dai)* the SACR0[RST] bit must also be set and cleared to reset all * I2S controller registers. */ -SACR0 =SACR0_RST ; -SACR0 =0 ; +writel (SACR0_RST , i2s_reg_base +SACR0 ); +writel (0 , i2s_reg_base +SACR0 );/* Make sure RPL and REC are disabled */ -SACR1 =SACR1_DRPL |SACR1_DREC ; +writel (SACR1_DRPL |SACR1_DREC , i2s_reg_base +SACR1 );/* Along with FIFO servicing */ -SAIMR &= ~(SAIMR_RFS |SAIMR_TFS ); +writel (readl (i2s_reg_base +SAIMR ) & (~(SAIMR_RFS |SAIMR_TFS )), i2s_reg_base +SAIMR );snd_soc_dai_init_dma_data (dai, &pxa2xx_i2s_pcm_stereo_out, &pxa2xx_i2s_pcm_stereo_in);
@@ -371,6 +369,22 @@ static const struct snd_soc_component_driver pxa_i2s_component = {static int pxa2xx_i2s_drv_probe (struct platform_device *pdev) { +struct resource *res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); + +if (!res) { +dev_err (&pdev->dev,"missing MMIO resource\n" ); +return -ENXIO ; + } + + i2s_reg_base =devm_ioremap_resource (&pdev->dev, res); +if (IS_ERR (i2s_reg_base)) { +dev_err (&pdev->dev,"ioremap failed\n" ); +return PTR_ERR (i2s_reg_base); + } + + pxa2xx_i2s_pcm_stereo_out.addr = res->start +SADR ; + pxa2xx_i2s_pcm_stereo_in.addr = res->start +SADR ; +return devm_snd_soc_register_component (&pdev->dev, &pxa_i2s_component, &pxa_i2s_dai,1 ); }
Signature · 1 line
2.29.2
PATCH v2 34/48 ARM: pxa: pcmcia: move smemc configuration back to arch
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
Rather than poking at the smemc registers directly from the pcmcia/pxa2xx_base driver, move those bits into machine file to have a cleaner interface.
--- arch/arm/mach-pxa/generic.c | 29 ++++++++++++++++++++++ drivers/pcmcia/pxa2xx_base.c | 46 ++++++++++++----------------------- include/linux/soc/pxa/smemc.h | 10 ++++++++ 3 files changed, 55 insertions(+), 30 deletions(-) create mode 100644 include/linux/soc/pxa/smemc.h
arch/arm/mach-pxa/generic.c +29 -0
@@ -70,6 +70,35 @@ unsigned int get_clk_frequency_khz(int info) }EXPORT_SYMBOL (get_clk_frequency_khz); +void pxa_smemc_set_pcmcia_timing (int sock,u32 mcmem,u32 mcatt,u32 mcio) +{ +__raw_writel (mcmem,MCMEM (sock)); +__raw_writel (mcatt,MCATT (sock)); +__raw_writel (mcio,MCIO (sock)); +} +EXPORT_SYMBOL_GPL (pxa_smemc_set_pcmcia_timing); + +void pxa_smemc_set_pcmcia_socket (int nr) +{ +switch (nr) { +case 0 : +__raw_writel (0 ,MECR ); +break ; +case 1 : +/* +* We have at least one socket, so set MECR:CIT +* (Card Is There) +*/ +__raw_writel (MECR_CIT ,MECR ); +break ; +case 2 : +/* Set CIT and MECR:NOS (Number Of Sockets) */ +__raw_writel (MECR_CIT |MECR_NOS ,MECR ); +break ; + } +} +EXPORT_SYMBOL_GPL (pxa_smemc_set_pcmcia_socket); +/* * Intel PXA2xx internal register mapping. *
drivers/pcmcia/pxa2xx_base.c +16 -30
107 lines not on this page · raw message
include/linux/soc/pxa/smemc.h new file +10 -0
@@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __PXA_REGS_H +#define __PXA_REGS_H + +#include <linux/types.h> + +void pxa_smemc_set_pcmcia_timing (int sock,u32 mcmem,u32 mcatt,u32 mcio); +void pxa_smemc_set_pcmcia_socket (int nr); + +#endif
Signature · 1 line
2.29.2
PATCH v2 35/48 ARM: pxa: remove get_clk_frequency_khz()
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
get_clk_frequency_khz() is not a proper name for a global function, and there is only one caller.
Convert viper to use the properly namespaced pxa25x_get_clk_frequency_khz() and remove the other references.
--- arch/arm/mach-pxa/generic.c | 15 --------------- arch/arm/mach-pxa/generic.h | 1 - arch/arm/mach-pxa/viper.c | 2 +- drivers/cpufreq/pxa2xx-cpufreq.c | 2 -- 4 files changed, 1 insertion(+), 19 deletions(-)
arch/arm/mach-pxa/generic.c +0 -15
@@ -55,21 +55,6 @@ void __init pxa_timer_init(void)pxa_timer_nodt_init (IRQ_OST0 ,io_p2v (0x40a00000 )); } -/* -* Get the clock frequency as reflected by CCCR and the turbo flag. -* We assume these values have been applied via a fcs. -* If info is not 0 we also display the current settings. -*/ -unsigned int get_clk_frequency_khz (int info) -{ -if (cpu_is_pxa25x ()) -return pxa25x_get_clk_frequency_khz (info); -else if (cpu_is_pxa27x ()) -return pxa27x_get_clk_frequency_khz (info); -return 0 ; -} -EXPORT_SYMBOL (get_clk_frequency_khz); -void pxa_smemc_set_pcmcia_timing (int sock,u32 mcmem,u32 mcatt,u32 mcio) {__raw_writel (mcmem,MCMEM (sock));
arch/arm/mach-pxa/generic.h +0 -1
@@ -11,7 +11,6 @@struct irq_data ; -extern unsigned int get_clk_frequency_khz (int info);extern void __init pxa_dt_irq_init (int (*fn)(struct irq_data *,unsigned int ));extern void __init pxa_map_io (void );
arch/arm/mach-pxa/viper.c +1 -1
@@ -851,7 +851,7 @@ static void __init viper_init_vcore_gpios(void) goto err_dir;/* c/should assume redboot set the correct level ??? */ -viper_set_core_cpu_voltage (get_clk_frequency_khz (0 ),1 ); +viper_set_core_cpu_voltage (pxa25x_get_clk_frequency_khz (0 ),1 );return ;
drivers/cpufreq/pxa2xx-cpufreq.c +0 -2
@@ -107,8 +107,6 @@ static struct pxa_freqs pxa27x_freqs[] = {static struct cpufreq_frequency_table pxa27x_freq_table[NUM_PXA27x_FREQS+1 ]; -extern unsigned get_clk_frequency_khz (int info); -#ifdef CONFIG_REGULATOR static int pxa_cpufreq_change_voltage (const struct pxa_freqs *pxa_freq)
Signature · 1 line
2.29.2
PATCH v2 36/48 cpufreq: pxa3: move clk register access to clk driver
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
The driver needs some low-level register access for setting the core and bus frequencies. These registers are owned by the clk driver, so move the low-level access into that driver with a slightly higher-level interface and avoid any machine header file dependencies.
--- arch/arm/mach-pxa/generic.h | 1 - arch/arm/mach-pxa/include/mach/generic.h | 5 -- arch/arm/mach-pxa/pxa3xx.c | 1 + drivers/clk/pxa/clk-pxa3xx.c | 16 ++++++ drivers/cpufreq/pxa2xx-cpufreq.c | 3 -- drivers/cpufreq/pxa3xx-cpufreq.c | 64 +++++++++++++----------- include/linux/clk/pxa.h | 9 ++++ 7 files changed, 62 insertions(+), 37 deletions(-) delete mode 100644 arch/arm/mach-pxa/include/mach/generic.h create mode 100644 include/linux/clk/pxa.h
arch/arm/mach-pxa/generic.h +0 -1
@@ -7,7 +7,6 @@*/ #include <linux/reboot.h> -#include <mach/generic.h> struct irq_data ;
arch/arm/mach-pxa/include/mach/generic.h deleted +0 -5
@@ -1,5 +0,0 @@ -#ifdef CONFIG_PXA3xx -extern unsigned pxa3xx_get_clk_frequency_khz (int ); -#else -#define pxa3xx_get_clk_frequency_khz (x) (0) -#endif
arch/arm/mach-pxa/pxa3xx.c +1 -0
@@ -25,6 +25,7 @@#include <linux/platform_data/i2c-pxa.h> #include <linux/platform_data/mmp_dma.h> #include <linux/soc/pxa/cpu.h> +#include <linux/clk/pxa.h> #include <asm/mach/map.h> #include <asm/suspend.h>
drivers/clk/pxa/clk-pxa3xx.c +16 -0
@@ -16,6 +16,7 @@#include <linux/of.h> #include <linux/soc/pxa/cpu.h> #include <mach/smemc.h> +#include <linux/clk/pxa.h> #include <mach/pxa3xx-regs.h> #include <dt-bindings/clock/pxa-clock.h>
@@ -79,6 +80,21 @@ unsigned int pxa3xx_get_clk_frequency_khz(int info)return (unsigned int )clks[0 ] / KHz; } +void pxa3xx_clk_update_accr (u32 disable,u32 enable,u32 xclkcfg,u32 mask) +{ +u32 accr =ACCR ; + + accr &= ~disable; + accr |= enable; + +ACCR = accr; +if (xclkcfg) + __asm__("mcr p14, 0, %0, c6, c0, 0\n" : :"r" (xclkcfg)); + +while ((ACSR & mask) != (accr & mask)) +cpu_relax (); +} +static unsigned long clk_pxa3xx_ac97_get_rate (struct clk_hw *hw,unsigned long parent_rate) {
drivers/cpufreq/pxa2xx-cpufreq.c +0 -3
@@ -27,9 +27,6 @@#include <linux/soc/pxa/cpu.h> #include <linux/io.h> -#include <mach/pxa2xx-regs.h> -#include <mach/smemc.h> -#ifdef DEBUG static unsigned int freq_debug;module_param (freq_debug, uint,0 );
drivers/cpufreq/pxa3xx-cpufreq.c +36 -28
95 lines not on this page · raw message
include/linux/clk/pxa.h new file +9 -0
@@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifdef CONFIG_PXA3xx +extern unsigned pxa3xx_get_clk_frequency_khz (int ); +extern void pxa3xx_clk_update_accr (u32 disable,u32 enable,u32 xclkcfg,u32 mask); +#else +#define pxa3xx_get_clk_frequency_khz (x) (0) +#define pxa3xx_clk_update_accr (disable, enable, xclkcfg, mask) do { } while (0) +#endif
Signature · 1 line
2.29.2
Stephen Boyd
maintainerRe: [PATCH 36/48] cpufreq: pxa3: move clk register access to clk driver
Quoting Arnd Bergmann (2022-04-19 09:37:58)
include/linux/clk/pxa.h line 4
Quoted 10 lines
include/linux/clk/pxa.h new file +4
-0@@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifdef CONFIG_PXA3xx +extern unsigned pxa3xx_get_clk_frequency_khz (int );
What is the spacing about here?
include/linux/clk/pxa.h line 8
Quoted 4 lines
include/linux/clk/pxa.h new file +4
-0+extern void pxa3xx_clk_update_accr (u32 disable,u32 enable,u32 xclkcfg,u32 mask); +#else +#define pxa3xx_get_clk_frequency_khz (x) (0) +#define pxa3xx_clk_update_accr (disable, enable, xclkcfg, mask) do { } while (0)
Why not static inline with types?
PATCH v2 37/48 ARM: pxa: move smemc register access from clk to platform
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
The get_sdram_rows() and get_memclkdiv() helpers need smemc register that are separate from the clk registers, move them out of the clk driver, and use an extern declaration instead.
--- arch/arm/mach-pxa/generic.c | 6 ++++++ arch/arm/mach-pxa/pxa2xx.c | 25 +++++++++++++++++++++++++ arch/arm/mach-pxa/pxa3xx.c | 4 ++++ arch/arm/mach-pxa/smemc.c | 9 +++++++++ drivers/clk/pxa/clk-pxa.c | 4 +++- drivers/clk/pxa/clk-pxa.h | 5 +++-- drivers/clk/pxa/clk-pxa25x.c | 30 +++--------------------------- drivers/clk/pxa/clk-pxa27x.c | 31 +++---------------------------- drivers/clk/pxa/clk-pxa3xx.c | 8 +++----- include/linux/soc/pxa/smemc.h | 3 +++ 10 files changed, 62 insertions(+), 63 deletions(-)
arch/arm/mach-pxa/generic.c +6 -0
@@ -18,6 +18,7 @@#include <linux/kernel.h> #include <linux/init.h> #include <linux/soc/pxa/cpu.h> +#include <linux/soc/pxa/smemc.h> #include <asm/mach/map.h> #include <asm/mach-types.h>
@@ -84,6 +85,11 @@ void pxa_smemc_set_pcmcia_socket(int nr) }EXPORT_SYMBOL_GPL (pxa_smemc_set_pcmcia_socket); +void __iomem *pxa_smemc_get_mdrefr (void ) +{ +return MDREFR ; +} +/* * Intel PXA2xx internal register mapping. *
arch/arm/mach-pxa/pxa2xx.c +25 -0
@@ -15,6 +15,7 @@#include <mach/pxa2xx-regs.h> #include "mfp-pxa25x.h" #include <mach/reset.h> +#include <mach/smemc.h> #include <linux/platform_data/irda-pxaficp.h> void pxa2xx_clear_reset_status (unsigned int mask)
@@ -50,3 +51,27 @@ void pxa2xx_transceiver_mode(struct device *dev, int mode)BUG (); }EXPORT_SYMBOL_GPL (pxa2xx_transceiver_mode); + +#define MDCNFG_DRAC2 (mdcnfg) (((mdcnfg) >> 21) & 0x3) +#define MDCNFG_DRAC0 (mdcnfg) (((mdcnfg) >> 5) & 0x3) + +int pxa2xx_smemc_get_sdram_rows (void ) +{ +static int sdram_rows; +unsigned int drac2 =0 , drac0 =0 ; +u32 mdcnfg; + +if (sdram_rows) +return sdram_rows; + + mdcnfg =readl_relaxed (MDCNFG ); + +if (mdcnfg & (MDCNFG_DE2 |MDCNFG_DE3 )) + drac2 =MDCNFG_DRAC2 (mdcnfg); + +if (mdcnfg & (MDCNFG_DE0 |MDCNFG_DE1 )) + drac0 =MDCNFG_DRAC0 (mdcnfg); + + sdram_rows =1 << (11 +max (drac0, drac2)); +return sdram_rows; +}
arch/arm/mach-pxa/pxa3xx.c +4 -0
@@ -52,6 +52,10 @@ extern void __init pxa_dt_irq_init(int (*fn)(struct irq_data *, unsigned int));#define NDCR_ND_ARB_EN (1 << 12)#define NDCR_ND_ARB_CNTL (1 << 19) +#define CKEN_BOOT 11/* < Boot rom clock enable */ +#define CKEN_TPM 19/* < TPM clock enable */ +#define CKEN_HSIO2 41/* < HSIO2 clock enable */ +#ifdef CONFIG_PM #define ISRAM_START 0x5c000000
arch/arm/mach-pxa/smemc.c +9 -0
@@ -69,4 +69,13 @@ static int __init smemc_init(void) return 0; }subsys_initcall (smemc_init); +#endif + +static const unsigned int df_clkdiv[4 ] = {1 ,2 ,4 ,1 }; +unsigned int pxa3xx_smemc_get_memclkdiv (void ) +{ +unsigned long memclkcfg =__raw_readl (MEMCLKCFG ); + +return df_clkdiv[(memclkcfg >>16 ) &0x3 ]; +}
drivers/clk/pxa/clk-pxa.c +3 -1
@@ -11,6 +11,7 @@#include <linux/clkdev.h> #include <linux/io.h> #include <linux/of.h> +#include <linux/soc/pxa/smemc.h> #include <dt-bindings/clock/pxa-clock.h> #include "clk-pxa.h"
@@ -150,12 +151,13 @@ void pxa2xx_core_turbo_switch(bool on) }void pxa2xx_cpll_change (struct pxa2xx_freq *freq, -u32 (*mdrefr_dri)(unsigned int ),void __iomem *mdrefr, +u32 (*mdrefr_dri)(unsigned int ),void __iomem *cccr) {unsigned int clkcfg = freq->clkcfg;unsigned int unused, preset_mdrefr, postset_mdrefr;unsigned long flags; +void __iomem *mdrefr =pxa_smemc_get_mdrefr ();local_irq_save (flags);
drivers/clk/pxa/clk-pxa.h +3 -2
@@ -146,12 +146,13 @@ static inline int dummy_clk_set_parent(struct clk_hw *hw, u8 index)extern void clkdev_pxa_register (int ckid,const char *con_id,const char *dev_id,struct clk *clk); -extern int clk_pxa_cken_init (const struct desc_clk_cken *clks,int nb_clks); +extern int clk_pxa_cken_init (const struct desc_clk_cken *clks, +int nb_clks);void clk_pxa_dt_common_init (struct device_node *np);void pxa2xx_core_turbo_switch (bool on);void pxa2xx_cpll_change (struct pxa2xx_freq *freq, -u32 (*mdrefr_dri)(unsigned int ),void __iomem *mdrefr, +u32 (*mdrefr_dri)(unsigned int ),void __iomem *cccr);int pxa2xx_determine_rate (struct clk_rate_request *req,struct pxa2xx_freq *freqs,int nb_freqs);
drivers/clk/pxa/clk-pxa25x.c +3 -27
@@ -15,7 +15,7 @@#include <linux/io.h> #include <linux/of.h> #include <mach/pxa2xx-regs.h> -#include <mach/smemc.h> +#include <linux/soc/pxa/smemc.h> #include <dt-bindings/clock/pxa-clock.h> #include "clk-pxa.h"
@@ -33,9 +33,6 @@ enum { ((T) ? CLKCFG_TURBO : 0))#define PXA25x_CCCR (N2 ,M ,L ) (N2 << 7 | M << 5 | L) -#define MDCNFG_DRAC2 (mdcnfg) (((mdcnfg) >> 21) & 0x3) -#define MDCNFG_DRAC0 (mdcnfg) (((mdcnfg) >> 5) & 0x3) -/* Define the refresh period in mSec for the SDRAM and the number of rows */ #define SDRAM_TREF 64/* standard 64ms SDRAM */
@@ -57,30 +54,9 @@ static const char * const get_freq_khz[] = { "core", "run", "cpll", "memory" }; -static int get_sdram_rows (void ) -{ -static int sdram_rows; -unsigned int drac2 =0 , drac0 =0 ; -u32 mdcnfg; - -if (sdram_rows) -return sdram_rows; - - mdcnfg =readl_relaxed (MDCNFG ); - -if (mdcnfg & (MDCNFG_DE2 |MDCNFG_DE3 )) - drac2 =MDCNFG_DRAC2 (mdcnfg); - -if (mdcnfg & (MDCNFG_DE0 |MDCNFG_DE1 )) - drac0 =MDCNFG_DRAC0 (mdcnfg); - - sdram_rows =1 << (11 +max (drac0, drac2)); -return sdram_rows; -} -static u32 mdrefr_dri (unsigned int freq_khz) { -u32 interval = freq_khz *SDRAM_TREF /get_sdram_rows (); +u32 interval = freq_khz *SDRAM_TREF /pxa2xx_smemc_get_sdram_rows ();return interval /32 ; }
@@ -268,7 +244,7 @@ static int clk_pxa25x_cpll_set_rate(struct clk_hw *hw, unsigned long rate,if (i >=ARRAY_SIZE (pxa25x_freqs))return -EINVAL ; -pxa2xx_cpll_change (&pxa25x_freqs[i], mdrefr_dri,MDREFR ,CCCR ); +pxa2xx_cpll_change (&pxa25x_freqs[i], mdrefr_dri,CCCR );return 0 ; }
drivers/clk/pxa/clk-pxa27x.c +3 -28
@@ -12,8 +12,7 @@#include <linux/clk.h> #include <linux/clkdev.h> #include <linux/of.h> - -#include <mach/smemc.h> +#include <linux/soc/pxa/smemc.h> #include <dt-bindings/clock/pxa-clock.h> #include "clk-pxa.h"
@@ -50,9 +49,6 @@ enum { ((T) ? CLKCFG_TURBO : 0))#define PXA27x_CCCR (A ,L ,N2 ) (A << 25 | N2 << 7 | L) -#define MDCNFG_DRAC2 (mdcnfg) (((mdcnfg) >> 21) & 0x3) -#define MDCNFG_DRAC0 (mdcnfg) (((mdcnfg) >> 5) & 0x3) -/* Define the refresh period in mSec for the SDRAM and the number of rows */ #define SDRAM_TREF 64/* standard 64ms SDRAM */
@@ -61,30 +57,9 @@ static const char * const get_freq_khz[] = { "system_bus" }; -static int get_sdram_rows (void ) -{ -static int sdram_rows; -unsigned int drac2 =0 , drac0 =0 ; -u32 mdcnfg; - -if (sdram_rows) -return sdram_rows; - - mdcnfg =readl_relaxed (MDCNFG ); - -if (mdcnfg & (MDCNFG_DE2 |MDCNFG_DE3 )) - drac2 =MDCNFG_DRAC2 (mdcnfg); - -if (mdcnfg & (MDCNFG_DE0 |MDCNFG_DE1 )) - drac0 =MDCNFG_DRAC0 (mdcnfg); - - sdram_rows =1 << (11 +max (drac0, drac2)); -return sdram_rows; -} -static u32 mdrefr_dri (unsigned int freq_khz) { -u32 interval = freq_khz *SDRAM_TREF /get_sdram_rows (); +u32 interval = freq_khz *SDRAM_TREF /pxa2xx_smemc_get_sdram_rows ();return (interval -31 ) /32 ; }
@@ -260,7 +235,7 @@ static int clk_pxa27x_cpll_set_rate(struct clk_hw *hw, unsigned long rate,if (i >=ARRAY_SIZE (pxa27x_freqs))return -EINVAL ; -pxa2xx_cpll_change (&pxa27x_freqs[i], mdrefr_dri,MDREFR ,CCCR ); +pxa2xx_cpll_change (&pxa27x_freqs[i], mdrefr_dri,CCCR );return 0 ; }
drivers/clk/pxa/clk-pxa3xx.c +3 -5
@@ -15,7 +15,7 @@#include <linux/clkdev.h> #include <linux/of.h> #include <linux/soc/pxa/cpu.h> -#include <mach/smemc.h> +#include <linux/soc/pxa/smemc.h> #include <linux/clk/pxa.h> #include <mach/pxa3xx-regs.h>
@@ -41,8 +41,6 @@ static unsigned char hss_mult[4] = { 8, 12, 16, 24 };/* crystal frequency to static memory controller multiplier (SMCFS) */ static unsigned int smcfs_mult[8 ] = {6 ,0 ,8 ,0 ,0 ,16 , }; -static unsigned int df_clkdiv[4 ] = {1 ,2 ,4 ,1 }; -static const char *const get_freq_khz[] = {"core" ,"ring_osc_60mhz" ,"run" ,"cpll" ,"system_bus" };
@@ -118,10 +116,10 @@ static unsigned long clk_pxa3xx_smemc_get_rate(struct clk_hw *hw, unsigned long parent_rate) {unsigned long acsr =ACSR ; -unsigned long memclkcfg =__raw_readl (MEMCLKCFG );return (parent_rate /48 ) * smcfs_mult[(acsr >>23 ) &0x7 ] / - df_clkdiv[(memclkcfg >>16 ) &0x3 ]; +pxa3xx_smemc_get_memclkdiv (); + }PARENTS (clk_pxa3xx_smemc) = {"spll_624mhz" };RATE_RO_OPS (clk_pxa3xx_smemc,"smemc" );
include/linux/soc/pxa/smemc.h +3 -0
@@ -6,5 +6,8 @@void pxa_smemc_set_pcmcia_timing (int sock,u32 mcmem,u32 mcatt,u32 mcio);void pxa_smemc_set_pcmcia_socket (int nr); +int pxa2xx_smemc_get_sdram_rows (void ); +unsigned int pxa3xx_smemc_get_memclkdiv (void ); +void __iomem *pxa_smemc_get_mdrefr (void );#endif
Signature · 1 line
2.29.2
Re: [PATCH 37/48] ARM: pxa: move smemc register access from clk to platform
Quoting Arnd Bergmann (2022-04-19 09:37:59)
Quoted 7 lines
From: Arnd Bergmann <[email protected]>
The
get_sdram_rows()andget_memclkdiv()helpers need smemc register that are separate from the clk registers, move them out of the clk driver, and use an extern declaration instead.
Quoted 6 lines
Cc Michael Turquette <[email protected]>Cc Stephen Boyd <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>---
PATCH v2 38/48 ARM: pxa: move clk register definitions to driver
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
The clock register definitions are now used (almost) exclusively in the clk driver, and that relies on no other mach/*.h header files any more.
Remove the dependency on mach/pxa*-regs.h by addressing the registers as offsets from a void __iomem * pointer, which is either passed from a board file, or (for the moment) ioremapped at boot time from a hardcoded address in case of DT (this should be moved into the DT of course).
--- arch/arm/mach-pxa/generic.c | 7 +- arch/arm/mach-pxa/generic.h | 3 - arch/arm/mach-pxa/include/mach/pxa2xx-regs.h | 45 ------- arch/arm/mach-pxa/include/mach/pxa3xx-regs.h | 69 ----------- arch/arm/mach-pxa/sleep.S | 4 +- drivers/clk/pxa/clk-pxa.c | 4 +- drivers/clk/pxa/clk-pxa.h | 6 +- drivers/clk/pxa/clk-pxa25x.c | 18 +-- drivers/clk/pxa/clk-pxa27x.c | 39 +++--- drivers/clk/pxa/clk-pxa2xx.h | 58 +++++++++ drivers/clk/pxa/clk-pxa3xx.c | 120 +++++++++++++++---- include/linux/clk/pxa.h | 7 ++ 12 files changed, 210 insertions(+), 170 deletions(-) create mode 100644 drivers/clk/pxa/clk-pxa2xx.h
arch/arm/mach-pxa/generic.c +4 -3
@@ -19,6 +19,7 @@#include <linux/init.h> #include <linux/soc/pxa/cpu.h> #include <linux/soc/pxa/smemc.h> +#include <linux/clk/pxa.h> #include <asm/mach/map.h> #include <asm/mach-types.h>
@@ -48,11 +49,11 @@ void clear_reset_status(unsigned int mask)void __init pxa_timer_init (void ) {if (cpu_is_pxa25x ()) -pxa25x_clocks_init (); +pxa25x_clocks_init (io_p2v (0x41300000 ));if (cpu_is_pxa27x ()) -pxa27x_clocks_init (); +pxa27x_clocks_init (io_p2v (0x41300000 ));if (cpu_is_pxa3xx ()) -pxa3xx_clocks_init (); +pxa3xx_clocks_init (io_p2v (0x41340000 ),io_p2v (0x41350000 ));pxa_timer_nodt_init (IRQ_OST0 ,io_p2v (0x40a00000 )); }
arch/arm/mach-pxa/generic.h +0 -3
@@ -22,19 +22,16 @@ extern void pxa_timer_init(void);#define ARRAY_AND_SIZE (x) (x), ARRAY_SIZE(x)#define pxa25x_handle_irq icip_handle_irq -extern int __init pxa25x_clocks_init (void );extern void __init pxa25x_init_irq (void );extern void __init pxa25x_map_io (void );extern void __init pxa26x_init_irq (void );#define pxa27x_handle_irq ichp_handle_irq -extern int __init pxa27x_clocks_init (void );extern unsigned pxa27x_get_clk_frequency_khz (int );extern void __init pxa27x_init_irq (void );extern void __init pxa27x_map_io (void );#define pxa3xx_handle_irq ichp_handle_irq -extern int __init pxa3xx_clocks_init (void );extern void __init pxa3xx_init_irq (void );extern void __init pxa3xx_map_io (void );
arch/arm/mach-pxa/include/mach/pxa2xx-regs.h +0 -45
51 lines not on this page · raw message
arch/arm/mach-pxa/include/mach/pxa3xx-regs.h +0 -69
73 lines not on this page · raw message
arch/arm/mach-pxa/sleep.S +3 -1
@@ -18,7 +18,9 @@ #define MDREFR_KDIV 0x200a4000 // all banks #define CCCR_SLEEP 0x00000107 // L=7 2N=2 A=0 PPDIS=0 CPDIS=0 - +#define CCCR_N_MASK 0x00000380 +#define CCCR_M_MASK 0x00000060 +#define CCCR_L_MASK 0x0000001f .text #ifdef CONFIG_PXA3xx
drivers/clk/pxa/clk-pxa.c +3 -1
@@ -95,7 +95,8 @@ void __init clkdev_pxa_register(int ckid, const char *con_id,clk_register_clkdev (clk, con_id, dev_id); } -int __init clk_pxa_cken_init (const struct desc_clk_cken *clks,int nb_clks) +int __init clk_pxa_cken_init (const struct desc_clk_cken *clks, +int nb_clks,void __iomem *clk_regs) {int i;struct pxa_clk *pxa_clk;
@@ -107,6 +108,7 @@ int __init clk_pxa_cken_init(const struct desc_clk_cken *clks, int nb_clks) pxa_clk->lp = clks[i].lp; pxa_clk->hp = clks[i].hp; pxa_clk->gate = clks[i].gate; + pxa_clk->gate.reg = clk_regs + clks[i].cken_reg; pxa_clk->gate.lock = &pxa_clk_lock; clk = clk_register_composite(NULL, clks[i].name, clks[i].parent_names, 2,
drivers/clk/pxa/clk-pxa.h +4 -2
@@ -105,6 +105,7 @@struct desc_clk_cken {struct clk_hw hw;int ckid; +int cken_reg;const char *name;const char *dev_id;const char *con_id;
@@ -119,11 +120,12 @@ struct desc_clk_cken {#define PXA_CKEN (_dev_id, _con_id, _name, parents, _mult_lp, _div_lp, \ _mult_hp, _div_hp, is_lp, _cken_reg, _cken_bit, flag) \ { .ckid = CLK_ ## _name, .name = #_name, \ + .cken_reg = _cken_reg, \ .dev_id = _dev_id, .con_id = _con_id, .parent_names = parents,\ .lp = { .mult = _mult_lp, .div = _div_lp }, \ .hp = { .mult = _mult_hp, .div = _div_hp }, \ .is_in_low_power = is_lp, \ - .gate = { .reg = (void __iomem *)_cken_reg, .bit_idx = _cken_bit }, \ + .gate = { .bit_idx = _cken_bit }, \ .flags = flag, \ } #define PXA_CKEN_1RATE(dev_id, con_id, name, parents, cken_reg, \
@@ -147,7 +149,7 @@ static inline int dummy_clk_set_parent(struct clk_hw *hw, u8 index)extern void clkdev_pxa_register (int ckid,const char *con_id,const char *dev_id,struct clk *clk);extern int clk_pxa_cken_init (const struct desc_clk_cken *clks, -int nb_clks); +int nb_clks,void __iomem *clk_regs);void clk_pxa_dt_common_init (struct device_node *np);void pxa2xx_core_turbo_switch (bool on);
drivers/clk/pxa/clk-pxa25x.c +10 -8
@@ -14,11 +14,11 @@#include <linux/clkdev.h> #include <linux/io.h> #include <linux/of.h> -#include <mach/pxa2xx-regs.h> #include <linux/soc/pxa/smemc.h> #include <dt-bindings/clock/pxa-clock.h> #include "clk-pxa.h" +#include "clk-pxa2xx.h" #define KHz 1000#define MHz (1000 * 1000)
@@ -39,6 +39,7 @@ enum {/* * Various clock factors driven by the CCCR register. */ +static void __iomem *clk_regs;/* Crystal Frequency to Memory Frequency Multiplier (L) */ static unsigned char L_clk_mult[32 ] = {0 ,27 ,32 ,36 ,40 ,45 ,0 , };
@@ -97,7 +98,7 @@ unsigned int pxa25x_get_clk_frequency_khz(int info)static unsigned long clk_pxa25x_memory_get_rate (struct clk_hw *hw,unsigned long parent_rate) { -unsigned long cccr =readl (CCCR ); +unsigned long cccr =readl (clk_regs +CCCR );unsigned int m = M_clk_mult[(cccr >>5 ) &0x03 ];return parent_rate / m;
@@ -201,7 +202,7 @@ MUX_OPS(clk_pxa25x_core, "core", CLK_SET_RATE_PARENT);static unsigned long clk_pxa25x_run_get_rate (struct clk_hw *hw,unsigned long parent_rate) { -unsigned long cccr =readl (CCCR ); +unsigned long cccr =readl (clk_regs +CCCR );unsigned int n2 = N2_clk_mult[(cccr >>7 ) &0x07 ];return (parent_rate / n2) *2 ;
@@ -212,7 +213,7 @@ RATE_RO_OPS(clk_pxa25x_run, "run");static unsigned long clk_pxa25x_cpll_get_rate (struct clk_hw *hw,unsigned long parent_rate) { -unsigned long clkcfg, cccr =readl (CCCR ); +unsigned long clkcfg, cccr =readl (clk_regs +CCCR );unsigned int l, m, n2, t; asm("mrc\tp14, 0, %0, c6, c0, 0" :"=r" (clkcfg));
@@ -244,7 +245,7 @@ static int clk_pxa25x_cpll_set_rate(struct clk_hw *hw, unsigned long rate,if (i >=ARRAY_SIZE (pxa25x_freqs))return -EINVAL ; -pxa2xx_cpll_change (&pxa25x_freqs[i], mdrefr_dri,CCCR ); +pxa2xx_cpll_change (&pxa25x_freqs[i], mdrefr_dri, clk_regs +CCCR );return 0 ; }
@@ -321,16 +322,17 @@ static void __init pxa25x_dummy_clocks_init(void) } } -int __init pxa25x_clocks_init (void ) +int __init pxa25x_clocks_init (void __iomem *regs) { + clk_regs = regs;pxa25x_base_clocks_init ();pxa25x_dummy_clocks_init (); -return clk_pxa_cken_init (pxa25x_clocks,ARRAY_SIZE (pxa25x_clocks)); +return clk_pxa_cken_init (pxa25x_clocks,ARRAY_SIZE (pxa25x_clocks), clk_regs); }static void __init pxa25x_dt_clocks_init (struct device_node *np) { -pxa25x_clocks_init (); +pxa25x_clocks_init (ioremap (0x41300000ul ,0x10 ));clk_pxa_dt_common_init (np); } CLK_OF_DECLARE(pxa25x_clks, "marvell,pxa250-core-clocks",
drivers/clk/pxa/clk-pxa27x.c +21 -18
@@ -7,7 +7,6 @@* Heavily inspired from former arch/arm/mach-pxa/clock.c. */ #include <linux/clk-provider.h> -#include <mach/pxa2xx-regs.h> #include <linux/io.h> #include <linux/clk.h> #include <linux/clkdev.h>
@@ -16,6 +15,7 @@#include <dt-bindings/clock/pxa-clock.h> #include "clk-pxa.h" +#include "clk-pxa2xx.h" #define KHz 1000#define MHz (1000 * 1000)
@@ -52,6 +52,8 @@ enum {/* Define the refresh period in mSec for the SDRAM and the number of rows */ #define SDRAM_TREF 64/* standard 64ms SDRAM */ +static void __iomem *clk_regs; +static const char *const get_freq_khz[] = {"core" ,"run" ,"cpll" ,"memory" ,"system_bus"
@@ -99,7 +101,7 @@ unsigned int pxa27x_get_clk_frequency_khz(int info)bool pxa27x_is_ppll_disabled (void ) { -unsigned long ccsr =readl (CCSR ); +unsigned long ccsr =readl (clk_regs +CCSR );return ccsr & (1 <<CCCR_PPDIS_BIT ); }
@@ -201,7 +203,7 @@ static unsigned long clk_pxa27x_cpll_get_rate(struct clk_hw *hw,unsigned long clkcfg;unsigned int t, ht;unsigned int l,L , n2,N ; -unsigned long ccsr =readl (CCSR ); +unsigned long ccsr =readl (clk_regs +CCSR ); asm("mrc\tp14, 0, %0, c6, c0, 0" :"=r" (clkcfg)); t = clkcfg & (1 <<0 );
@@ -235,7 +237,7 @@ static int clk_pxa27x_cpll_set_rate(struct clk_hw *hw, unsigned long rate,if (i >=ARRAY_SIZE (pxa27x_freqs))return -EINVAL ; -pxa2xx_cpll_change (&pxa27x_freqs[i], mdrefr_dri,CCCR ); +pxa2xx_cpll_change (&pxa27x_freqs[i], mdrefr_dri, clk_regs +CCCR );return 0 ; }
@@ -246,8 +248,8 @@ static unsigned long clk_pxa27x_lcd_base_get_rate(struct clk_hw *hw, unsigned long parent_rate) {unsigned int l, osc_forced; -unsigned long ccsr =readl (CCSR ); -unsigned long cccr =readl (CCCR ); +unsigned long ccsr =readl (clk_regs +CCSR ); +unsigned long cccr =readl (clk_regs +CCCR ); l = ccsr &CCSR_L_MASK ; osc_forced = ccsr & (1 <<CCCR_CPDIS_BIT );
@@ -268,7 +270,7 @@ static unsigned long clk_pxa27x_lcd_base_get_rate(struct clk_hw *hw,static u8 clk_pxa27x_lcd_base_get_parent (struct clk_hw *hw) {unsigned int osc_forced; -unsigned long ccsr =readl (CCSR ); +unsigned long ccsr =readl (clk_regs +CCSR ); osc_forced = ccsr & (1 <<CCCR_CPDIS_BIT );if (osc_forced)
@@ -297,7 +299,7 @@ static u8 clk_pxa27x_core_get_parent(struct clk_hw *hw) {unsigned long clkcfg;unsigned int t, ht, osc_forced; -unsigned long ccsr =readl (CCSR ); +unsigned long ccsr =readl (clk_regs +CCSR ); osc_forced = ccsr & (1 <<CCCR_CPDIS_BIT );if (osc_forced)
@@ -334,7 +336,7 @@ MUX_OPS(clk_pxa27x_core, "core", CLK_SET_RATE_PARENT);static unsigned long clk_pxa27x_run_get_rate (struct clk_hw *hw,unsigned long parent_rate) { -unsigned long ccsr =readl (CCSR ); +unsigned long ccsr =readl (clk_regs +CCSR );unsigned int n2 = (ccsr &CCSR_N2_MASK ) >>CCSR_N2_SHIFT ;return (parent_rate / n2) *2 ;
@@ -357,7 +359,7 @@ static unsigned long clk_pxa27x_system_bus_get_rate(struct clk_hw *hw, {unsigned long clkcfg;unsigned int b, osc_forced; -unsigned long ccsr =readl (CCSR ); +unsigned long ccsr =readl (clk_regs +CCSR ); osc_forced = ccsr & (1 <<CCCR_CPDIS_BIT ); asm("mrc\tp14, 0, %0, c6, c0, 0" :"=r" (clkcfg));
@@ -374,7 +376,7 @@ static unsigned long clk_pxa27x_system_bus_get_rate(struct clk_hw *hw,static u8 clk_pxa27x_system_bus_get_parent (struct clk_hw *hw) {unsigned int osc_forced; -unsigned long ccsr =readl (CCSR ); +unsigned long ccsr =readl (clk_regs +CCSR ); osc_forced = ccsr & (1 <<CCCR_CPDIS_BIT );if (osc_forced)
@@ -390,8 +392,8 @@ static unsigned long clk_pxa27x_memory_get_rate(struct clk_hw *hw, unsigned long parent_rate) {unsigned int a, l, osc_forced; -unsigned long cccr =readl (CCCR ); -unsigned long ccsr =readl (CCSR ); +unsigned long cccr =readl (clk_regs +CCCR ); +unsigned long ccsr =readl (clk_regs +CCSR ); osc_forced = ccsr & (1 <<CCCR_CPDIS_BIT ); a = cccr & (1 <<CCCR_A_BIT );
@@ -409,8 +411,8 @@ static unsigned long clk_pxa27x_memory_get_rate(struct clk_hw *hw,static u8 clk_pxa27x_memory_get_parent (struct clk_hw *hw) {unsigned int osc_forced, a; -unsigned long cccr =readl (CCCR ); -unsigned long ccsr =readl (CCSR ); +unsigned long cccr =readl (clk_regs +CCCR ); +unsigned long ccsr =readl (clk_regs +CCSR ); osc_forced = ccsr & (1 <<CCCR_CPDIS_BIT ); a = cccr & (1 <<CCCR_A_BIT );
@@ -465,16 +467,17 @@ static void __init pxa27x_base_clocks_init(void)clk_register_clk_pxa27x_lcd_base (); } -int __init pxa27x_clocks_init (void ) +int __init pxa27x_clocks_init (void __iomem *regs) { + clk_regs = regs;pxa27x_base_clocks_init ();pxa27x_dummy_clocks_init (); -return clk_pxa_cken_init (pxa27x_clocks,ARRAY_SIZE (pxa27x_clocks)); +return clk_pxa_cken_init (pxa27x_clocks,ARRAY_SIZE (pxa27x_clocks), regs); }static void __init pxa27x_dt_clocks_init (struct device_node *np) { -pxa27x_clocks_init (); +pxa27x_clocks_init (ioremap (0x41300000ul ,0x10 ));clk_pxa_dt_common_init (np); }CLK_OF_DECLARE (pxa_clks,"marvell,pxa270-clocks" , pxa27x_dt_clocks_init);
drivers/clk/pxa/clk-pxa2xx.h new file +58 -0
58 lines not on this page · raw message
drivers/clk/pxa/clk-pxa3xx.c +100 -20
225 lines not on this page · raw message
include/linux/clk/pxa.h +7 -0
@@ -1,5 +1,12 @@/* SPDX-License-Identifier: GPL-2.0-only */ +#include <linux/compiler.h> +#include <linux/types.h> + +extern int pxa25x_clocks_init (void __iomem *regs); +extern int pxa27x_clocks_init (void __iomem *regs); +extern int pxa3xx_clocks_init (void __iomem *regs,void __iomem *oscc_reg); +#ifdef CONFIG_PXA3xxextern unsigned pxa3xx_get_clk_frequency_khz (int );extern void pxa3xx_clk_update_accr (u32 disable,u32 enable,u32 xclkcfg,u32 mask);
Signature · 1 line
2.29.2
PATCH v2 39/48 power: tosa: simplify probe function
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
We have three power supplies that need similar initialization. As a preparation for the gpio lookup table conversion, split out the initialization into a separate function.
--- drivers/power/supply/tosa_battery.c | 50 ++++++++++++++--------------- 1 file changed, 24 insertions(+), 26 deletions(-)
drivers/power/supply/tosa_battery.c +24 -26
@@ -343,12 +343,24 @@ static int tosa_bat_resume(struct platform_device *dev)#define tosa_bat_resume NULL#endif +static int tosa_power_supply_register (struct device *dev, +struct tosa_bat *bat, +const struct power_supply_desc *desc) +{ +struct power_supply_config cfg = { + .drv_data = bat, + }; + +mutex_init (&bat->work_lock); + bat->psy =power_supply_register (dev, desc, &cfg); + +return PTR_ERR_OR_ZERO (bat->psy); +} + +static int tosa_bat_probe (struct platform_device *dev) {int ret; -struct power_supply_config main_psy_cfg = {}, - jacket_psy_cfg = {}, - bu_psy_cfg = {};if (!machine_is_tosa ())return -ENODEV ;
@@ -357,36 +369,22 @@ static int tosa_bat_probe(struct platform_device *dev)if (ret)return ret; -mutex_init (&tosa_bat_main.work_lock); -mutex_init (&tosa_bat_jacket.work_lock); -INIT_WORK (&bat_work, tosa_bat_work); - main_psy_cfg.drv_data = &tosa_bat_main; - tosa_bat_main.psy =power_supply_register (&dev->dev, - &tosa_bat_main_desc, - &main_psy_cfg); -if (IS_ERR (tosa_bat_main.psy)) { - ret =PTR_ERR (tosa_bat_main.psy); + ret =tosa_power_supply_register (&dev->dev, &tosa_bat_main, + &tosa_bat_main_desc); +if (ret) goto err_psy_reg_main; - } - jacket_psy_cfg.drv_data = &tosa_bat_jacket; - tosa_bat_jacket.psy =power_supply_register (&dev->dev, - &tosa_bat_jacket_desc, - &jacket_psy_cfg); -if (IS_ERR (tosa_bat_jacket.psy)) { - ret =PTR_ERR (tosa_bat_jacket.psy); + ret =tosa_power_supply_register (&dev->dev, &tosa_bat_jacket, + &tosa_bat_jacket_desc); +if (ret) goto err_psy_reg_jacket; - } - bu_psy_cfg.drv_data = &tosa_bat_bu; - tosa_bat_bu.psy =power_supply_register (&dev->dev, &tosa_bat_bu_desc, - &bu_psy_cfg); -if (IS_ERR (tosa_bat_bu.psy)) { - ret =PTR_ERR (tosa_bat_bu.psy); + ret =tosa_power_supply_register (&dev->dev, &tosa_bat_bu, + &tosa_bat_bu_desc); +if (ret) goto err_psy_reg_bu; - } ret = request_irq(gpio_to_irq(TOSA_GPIO_BAT0_CRG), tosa_bat_gpio_isr,
Signature · 1 line
2.29.2
PATCH v2 40/48 ARM: pxa: tosa: use gpio lookup for battery
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
The battery driver uses a lot of GPIO lines, hardcoded from a machine header file.
Change it to use a gpiod lookup table instead.
--- arch/arm/mach-pxa/tosa.c | 23 +++++ drivers/power/supply/tosa_battery.c | 147 ++++++++++++++++------------ 2 files changed, 109 insertions(+), 61 deletions(-)
arch/arm/mach-pxa/tosa.c +23 -0
@@ -366,6 +366,28 @@ static struct pxaficp_platform_data tosa_ficp_platform_data = { .shutdown = tosa_irda_shutdown, }; +static struct gpiod_lookup_table tosa_battery_gpio_table = { + .dev_id ="wm97xx-battery" , + .table = { +GPIO_LOOKUP ("tc6393xb" ,TOSA_GPIO_CHARGE_OFF -TOSA_TC6393XB_GPIO_BASE ,"main charge off" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("tc6393xb" ,TOSA_GPIO_CHARGE_OFF_JC -TOSA_TC6393XB_GPIO_BASE ,"jacket charge off" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("tc6393xb" ,TOSA_GPIO_BAT_SW_ON -TOSA_TC6393XB_GPIO_BASE ,"battery switch" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("tc6393xb" ,TOSA_GPIO_BAT0_V_ON -TOSA_TC6393XB_GPIO_BASE ,"main battery" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("tc6393xb" ,TOSA_GPIO_BAT1_V_ON -TOSA_TC6393XB_GPIO_BASE ,"jacket battery" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("tc6393xb" ,TOSA_GPIO_BAT1_TH_ON -TOSA_TC6393XB_GPIO_BASE ,"main battery temp" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("tc6393xb" ,TOSA_GPIO_BAT0_TH_ON -TOSA_TC6393XB_GPIO_BASE ,"jacket battery temp" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("tc6393xb" ,TOSA_GPIO_BU_CHRG_ON -TOSA_TC6393XB_GPIO_BASE ,"backup battery" ,GPIO_ACTIVE_HIGH ), + +GPIO_LOOKUP ("gpio-pxa" ,TOSA_GPIO_BAT0_CRG ,"main battery full" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("gpio-pxa" ,TOSA_GPIO_BAT1_CRG ,"jacket battery full" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("gpio-pxa" ,TOSA_GPIO_BAT0_LOW ,"main battery low" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("gpio-pxa" ,TOSA_GPIO_BAT1_LOW ,"jacket battery low" ,GPIO_ACTIVE_HIGH ), +GPIO_LOOKUP ("gpio-pxa" ,TOSA_GPIO_JACKET_DETECT ,"jacket detect" ,GPIO_ACTIVE_HIGH ), + { }, + }, +}; + +/* * Tosa AC IN */
@@ -954,6 +976,7 @@ static void __init tosa_init(void)/* enable batt_fault */ PMCR =0x01 ; +gpiod_add_lookup_table (&tosa_battery_gpio_table);gpiod_add_lookup_table (&tosa_mci_gpio_table);gpiod_add_lookup_table (&tosa_audio_gpio_table);pxa_set_mci_info (&tosa_mci_platform_data);
drivers/power/supply/tosa_battery.c +86 -61
344 lines not on this page · raw message
Signature · 1 line
2.29.2
Sebastian Reichel
maintainerRe: [PATCH 40/48] ARM: pxa: tosa: use gpio lookup for battery
Hi,
Quoted 5 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The battery driver uses a lot of GPIO lines, hardcoded from a machine header file.
Quoted 7 lines
Change it to use a gpiod lookup table instead.
Reviewed-by Sebastian Reichel <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>---
That's the last power-supply driver not yet using descriptor based gpio API :)
drivers/power/supply/tosa_battery.c line 15
Quoted 7 lines
[...]
drivers/power/supply/tosa_battery.c +0
-0@@ -15,11 +15,16 @@#include <linux/gpio.h>
This should be <linux/gpio/consumer.h> now.
-- Sebastian
Quoted 359 lines
drivers/power/supply/tosa_battery.c +86
-61#include <asm/mach-types.h> -#include <mach/tosa.h> static DEFINE_MUTEX (bat_lock);/* protects gpio pins */ static struct work_struct bat_work; +struct tosa_gpio { +const char *con; +enum gpiod_flags flags; +struct gpio_desc *desc; +}; +struct tosa_bat {int status;struct power_supply *psy;@@ -28,38 +33,42 @@ struct tosa_bat {struct mutex work_lock;/* protects data */ bool (*is_present)(struct tosa_bat *bat); -int gpio_full; -int gpio_charge_off; +struct tosa_gpio gpio_full; +struct tosa_gpio gpio_charge_off;int technology; -int gpio_bat; +struct tosa_gpio gpio_bat;int adc_bat;int adc_bat_divider;int bat_max;int bat_min; -int gpio_temp; +struct tosa_gpio gpio_temp;int adc_temp;int adc_temp_divider; };static struct tosa_bat tosa_bat_main;static struct tosa_bat tosa_bat_jacket; +static struct tosa_gpio gpiod_jacket_det = {"jacket detect" ,GPIOD_IN }; +static struct tosa_gpio gpiod_battery_switch = {"battery switch" ,GPIOD_OUT_LOW }; +static struct tosa_gpio gpiod_main_battery_low = {"main battery low" ,GPIOD_IN }; +static struct tosa_gpio gpiod_jacket_battery_low = {"jacket battery low" ,GPIOD_IN };static unsigned long tosa_read_bat (struct tosa_bat *bat) {unsigned long value =0 ; -if (bat->gpio_bat <0 || bat->adc_bat <0 ) +if (!bat->gpio_bat.desc || bat->adc_bat <0 )return 0 ;mutex_lock (&bat_lock); -gpio_set_value (bat->gpio_bat,1 ); +gpiod_set_value (bat->gpio_bat.desc,1 );msleep (5 ); value =wm97xx_read_aux_adc (dev_get_drvdata (bat->psy->dev.parent), bat->adc_bat); -gpio_set_value (bat->gpio_bat,0 ); +gpiod_set_value (bat->gpio_bat.desc,0 );mutex_unlock (&bat_lock); value = value *1000000 / bat->adc_bat_divider;@@ -71,15 +80,15 @@ static unsigned long tosa_read_temp(struct tosa_bat *bat) {unsigned long value =0 ; -if (bat->gpio_temp <0 || bat->adc_temp <0 ) +if (!bat->gpio_temp.desc || bat->adc_temp <0 )return 0 ;mutex_lock (&bat_lock); -gpio_set_value (bat->gpio_temp,1 ); +gpiod_set_value (bat->gpio_temp.desc,1 );msleep (5 ); value =wm97xx_read_aux_adc (dev_get_drvdata (bat->psy->dev.parent), bat->adc_temp); -gpio_set_value (bat->gpio_temp,0 ); +gpiod_set_value (bat->gpio_temp.desc,0 );mutex_unlock (&bat_lock); value = value *10000 / bat->adc_temp_divider;@@ -136,7 +145,7 @@ static int tosa_bat_get_property(struct power_supply *psy,static bool tosa_jacket_bat_is_present (struct tosa_bat *bat) { -return gpio_get_value (TOSA_GPIO_JACKET_DETECT ) ==0 ; +return gpiod_get_value (gpiod_jacket_det.desc) ==0 ; }static void tosa_bat_external_power_changed (struct power_supply *psy)@@ -166,23 +175,23 @@ static void tosa_bat_update(struct tosa_bat *bat) bat->full_chrg =-1 ; }else if (power_supply_am_i_supplied (psy)) {if (bat->status ==POWER_SUPPLY_STATUS_DISCHARGING ) { -gpio_set_value (bat->gpio_charge_off,0 ); +gpiod_set_value (bat->gpio_charge_off.desc,0 );mdelay (15 ); } -if (gpio_get_value (bat->gpio_full)) { +if (gpiod_get_value (bat->gpio_full.desc)) {if (old ==POWER_SUPPLY_STATUS_CHARGING || bat->full_chrg ==-1 ) bat->full_chrg =tosa_read_bat (bat); -gpio_set_value (bat->gpio_charge_off,1 ); +gpiod_set_value (bat->gpio_charge_off.desc,1 ); bat->status =POWER_SUPPLY_STATUS_FULL ; }else { -gpio_set_value (bat->gpio_charge_off,0 ); +gpiod_set_value (bat->gpio_charge_off.desc,0 ); bat->status =POWER_SUPPLY_STATUS_CHARGING ; } }else { -gpio_set_value (bat->gpio_charge_off,1 ); +gpiod_set_value (bat->gpio_charge_off.desc,1 ); bat->status =POWER_SUPPLY_STATUS_DISCHARGING ; }@@ -251,18 +260,18 @@ static struct tosa_bat tosa_bat_main = { .full_chrg = -1, .psy = NULL, - .gpio_full = TOSA_GPIO_BAT0_CRG, - .gpio_charge_off = TOSA_GPIO_CHARGE_OFF, + .gpio_full = { "main battery full", GPIOD_IN }, + .gpio_charge_off = { "main charge off" , GPIOD_OUT_HIGH }, .technology = POWER_SUPPLY_TECHNOLOGY_LIPO, - .gpio_bat = TOSA_GPIO_BAT0_V_ON, + .gpio_bat = { "main battery", GPIOD_OUT_LOW }, .adc_bat = WM97XX_AUX_ID3, .adc_bat_divider = 414, .bat_max = 4310000, .bat_min = 1551 * 1000000 / 414, - .gpio_temp = TOSA_GPIO_BAT1_TH_ON, + .gpio_temp = { "main battery temp", GPIOD_OUT_LOW }, .adc_temp = WM97XX_AUX_ID2, .adc_temp_divider = 10000, };@@ -273,18 +282,18 @@ static struct tosa_bat tosa_bat_jacket = { .psy = NULL, .is_present = tosa_jacket_bat_is_present, - .gpio_full = TOSA_GPIO_BAT1_CRG, - .gpio_charge_off = TOSA_GPIO_CHARGE_OFF_JC, + .gpio_full = { "jacket battery full", GPIOD_IN }, + .gpio_charge_off = { "jacket charge off", GPIOD_OUT_HIGH }, .technology = POWER_SUPPLY_TECHNOLOGY_LIPO, - .gpio_bat = TOSA_GPIO_BAT1_V_ON, + .gpio_bat = { "jacket battery", GPIOD_OUT_LOW }, .adc_bat = WM97XX_AUX_ID3, .adc_bat_divider = 414, .bat_max = 4310000, .bat_min = 1551 * 1000000 / 414, - .gpio_temp = TOSA_GPIO_BAT0_TH_ON, + .gpio_temp = { "jacket battery temp", GPIOD_OUT_LOW }, .adc_temp = WM97XX_AUX_ID2, .adc_temp_divider = 10000, };@@ -294,36 +303,16 @@ static struct tosa_bat tosa_bat_bu = { .full_chrg = -1, .psy = NULL, - .gpio_full = -1, - .gpio_charge_off = -1, - .technology = POWER_SUPPLY_TECHNOLOGY_LiMn, - .gpio_bat = TOSA_GPIO_BU_CHRG_ON, + .gpio_bat = { "backup battery", GPIOD_OUT_LOW }, .adc_bat = WM97XX_AUX_ID4, .adc_bat_divider = 1266, - .gpio_temp = -1, .adc_temp = -1, .adc_temp_divider = -1, }; -static struct gpio tosa_bat_gpios[] = { - {TOSA_GPIO_CHARGE_OFF ,GPIOF_OUT_INIT_HIGH ,"main charge off" }, - {TOSA_GPIO_CHARGE_OFF_JC ,GPIOF_OUT_INIT_HIGH ,"jacket charge off" }, - {TOSA_GPIO_BAT_SW_ON ,GPIOF_OUT_INIT_LOW ,"battery switch" }, - {TOSA_GPIO_BAT0_V_ON ,GPIOF_OUT_INIT_LOW ,"main battery" }, - {TOSA_GPIO_BAT1_V_ON ,GPIOF_OUT_INIT_LOW ,"jacket battery" }, - {TOSA_GPIO_BAT1_TH_ON ,GPIOF_OUT_INIT_LOW ,"main battery temp" }, - {TOSA_GPIO_BAT0_TH_ON ,GPIOF_OUT_INIT_LOW ,"jacket battery temp" }, - {TOSA_GPIO_BU_CHRG_ON ,GPIOF_OUT_INIT_LOW ,"backup battery" }, - {TOSA_GPIO_BAT0_CRG ,GPIOF_IN ,"main battery full" }, - {TOSA_GPIO_BAT1_CRG ,GPIOF_IN ,"jacket battery full" }, - {TOSA_GPIO_BAT0_LOW ,GPIOF_IN ,"main battery low" }, - {TOSA_GPIO_BAT1_LOW ,GPIOF_IN ,"jacket battery low" }, - {TOSA_GPIO_JACKET_DETECT ,GPIOF_IN ,"jacket detect" }, -}; - #ifdef CONFIG_PM static int tosa_bat_suspend(struct platform_device *dev, pm_message_t state) {@@ -343,6 +332,21 @@ static int tosa_bat_resume(struct platform_device *dev)#define tosa_bat_resume NULL#endif +static int tosa_bat_gpio_get (struct device *dev,struct tosa_gpio *gpio) +{ +int ret; + +if (!gpio->con) +return 0 ; + + gpio->desc =devm_gpiod_get (dev, gpio->con, gpio->flags); + ret =PTR_ERR_OR_ZERO (gpio->desc); +if (ret) +dev_warn (dev,"failed to get gpio \"%s\"\n" , gpio->con); + +return ret; +} +static int tosa_power_supply_register (struct device *dev,struct tosa_bat *bat,const struct power_supply_desc *desc)@@ -350,6 +354,23 @@ static int tosa_power_supply_register(struct device *dev,struct power_supply_config cfg = { .drv_data = bat, }; +int ret; + + ret =tosa_bat_gpio_get (dev, &bat->gpio_full); +if (ret) +return ret; + + ret =tosa_bat_gpio_get (dev, &bat->gpio_charge_off); +if (ret) +return ret; + + ret =tosa_bat_gpio_get (dev, &bat->gpio_bat); +if (ret) +return ret; + + ret =tosa_bat_gpio_get (dev, &bat->gpio_temp); +if (ret) +return ret;mutex_init (&bat->work_lock); bat->psy =power_supply_register (dev, desc, &cfg);@@ -358,49 +379,55 @@ static int tosa_power_supply_register(struct device *dev, } -static int tosa_bat_probe (struct platform_device *dev) +static int tosa_bat_probe (struct platform_device *pdev) { +struct device *dev = &pdev->dev;int ret;if (!machine_is_tosa ())return -ENODEV ; - ret =gpio_request_array (tosa_bat_gpios,ARRAY_SIZE (tosa_bat_gpios)); + ret =tosa_bat_gpio_get (dev, &gpiod_jacket_det);if (ret)return ret; +/* these are not used anywhere, continue on failure */ +tosa_bat_gpio_get (dev, &gpiod_battery_switch); +tosa_bat_gpio_get (dev, &gpiod_main_battery_low); +tosa_bat_gpio_get (dev, &gpiod_jacket_battery_low); +INIT_WORK (&bat_work, tosa_bat_work); - ret =tosa_power_supply_register (&dev->dev, &tosa_bat_main, + ret =tosa_power_supply_register (dev, &tosa_bat_main, &tosa_bat_main_desc);if (ret) goto err_psy_reg_main; - ret =tosa_power_supply_register (&dev->dev, &tosa_bat_jacket, + ret =tosa_power_supply_register (dev, &tosa_bat_jacket, &tosa_bat_jacket_desc);if (ret) goto err_psy_reg_jacket; - ret =tosa_power_supply_register (&dev->dev, &tosa_bat_bu, + ret =tosa_power_supply_register (dev, &tosa_bat_bu, &tosa_bat_bu_desc);if (ret) goto err_psy_reg_bu; - ret =request_irq (gpio_to_irq (TOSA_GPIO_BAT0_CRG ), + ret =request_irq (gpiod_to_irq (tosa_bat_main.gpio_full.desc), tosa_bat_gpio_isr,IRQF_TRIGGER_RISING |IRQF_TRIGGER_FALLING ,"main full" , &tosa_bat_main);if (ret) goto err_req_main; - ret =request_irq (gpio_to_irq (TOSA_GPIO_BAT1_CRG ), + ret =request_irq (gpiod_to_irq (tosa_bat_jacket.gpio_full.desc), tosa_bat_gpio_isr,IRQF_TRIGGER_RISING |IRQF_TRIGGER_FALLING ,"jacket full" , &tosa_bat_jacket);if (ret) goto err_req_jacket; - ret =request_irq (gpio_to_irq (TOSA_GPIO_JACKET_DETECT ), + ret =request_irq (gpiod_to_irq (gpiod_jacket_det.desc), tosa_bat_gpio_isr,IRQF_TRIGGER_RISING |IRQF_TRIGGER_FALLING ,"jacket detect" , &tosa_bat_jacket);@@ -409,9 +436,9 @@ static int tosa_bat_probe(struct platform_device *dev)return 0 ; } -free_irq (gpio_to_irq (TOSA_GPIO_BAT1_CRG ), &tosa_bat_jacket); +free_irq (gpiod_to_irq (tosa_bat_jacket.gpio_full.desc), &tosa_bat_jacket); err_req_jacket: -free_irq (gpio_to_irq (TOSA_GPIO_BAT0_CRG ), &tosa_bat_main); +free_irq (gpiod_to_irq (tosa_bat_main.gpio_full.desc), &tosa_bat_main); err_req_main:power_supply_unregister (tosa_bat_bu.psy); err_psy_reg_bu:@@ -423,15 +450,14 @@ static int tosa_bat_probe(struct platform_device *dev)/* see comment in tosa_bat_remove */ cancel_work_sync (&bat_work); -gpio_free_array (tosa_bat_gpios,ARRAY_SIZE (tosa_bat_gpios));return ret; }static int tosa_bat_remove (struct platform_device *dev) { -free_irq (gpio_to_irq (TOSA_GPIO_JACKET_DETECT ), &tosa_bat_jacket); -free_irq (gpio_to_irq (TOSA_GPIO_BAT1_CRG ), &tosa_bat_jacket); -free_irq (gpio_to_irq (TOSA_GPIO_BAT0_CRG ), &tosa_bat_main); +free_irq (gpiod_to_irq (gpiod_jacket_det.desc), &tosa_bat_jacket); +free_irq (gpiod_to_irq (tosa_bat_jacket.gpio_full.desc), &tosa_bat_jacket); +free_irq (gpiod_to_irq (tosa_bat_main.gpio_full.desc), &tosa_bat_main);power_supply_unregister (tosa_bat_bu.psy);power_supply_unregister (tosa_bat_jacket.psy);@@ -443,7 +469,6 @@ static int tosa_bat_remove(struct platform_device *dev)* unregistered now. */ cancel_work_sync (&bat_work); -gpio_free_array (tosa_bat_gpios,ARRAY_SIZE (tosa_bat_gpios));return 0 ; }Signature · 1 line
2.29.2
Re: [PATCH 40/48] ARM: pxa: tosa: use gpio lookup for battery
Quoted 5 lines · Sebastian Reichel
drivers/power/supply/tosa_battery.c line 15
Quoted 2 lines
drivers/power/supply/tosa_battery.c +0
-0@@ -15,11 +15,16 @@#include <linux/gpio.h> This should be <
linux/gpio/consumer.h> now.
Fixed now, thanks!
Arnd
Re: [PATCH 40/48] ARM: pxa: tosa: use gpio lookup for battery
In reply to Arnd BergmannQuoted 11 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The battery driver uses a lot of GPIO lines, hardcoded from a machine header file.
Change it to use a gpiod lookup table instead.
Reviewed-by Sebastian Reichel <[email protected]>Signed-off-by Arnd Bergmann <[email protected]>
Oh, I've been iterating a patch for the Tosa charging code going down in MFD ans ASoC and all:
https://lore.kernel.org/linux-arm-kernel/[email protected]/
I just rebased this on v5.18-rc1 and resent with collected ACKs.
Please take a look at it, and see if you rather take that patch, at some point I realized I had to go pretty deep around the legacy code in different subsystems because the MFD device us spawning a GPIO chip...
Yours,
Linus Walleij
PATCH v2 41/48 ARM: pxa: remove unused mach/bitfield.h
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
The sa1111.h header defines some constants using the bitfield macros, but those are only used on sa1100, not on pxa, and the users include the bitfield header through mach/hardware.h.
--- arch/arm/include/asm/hardware/sa1111.h | 2 - arch/arm/mach-pxa/include/mach/bitfield.h | 114 ---------------------- 2 files changed, 116 deletions(-) delete mode 100644 arch/arm/mach-pxa/include/mach/bitfield.h
arch/arm/include/asm/hardware/sa1111.h +0 -2
@@ -13,8 +13,6 @@#ifndef _ASM_ARCH_SA1111#define _ASM_ARCH_SA1111 -#include <mach/bitfield.h> -/* * Don't ask the (SAC) DMA engines to move less than this amount. */
arch/arm/mach-pxa/include/mach/bitfield.h deleted +0 -114
114 lines not on this page · raw message
Signature · 1 line
2.29.2
PATCH v2 42/48 ARM: mmp: remove tavorevb board support
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
There are two tavorevb boards in the kernel, one using a PXA930 chip in mach-pxa, and one using the later PXA910 chip in mach-mmp. They use the same board number, which is generally a bad idea, and in a multiplatform kernel, we can end up with funny link errors like this one resulting from two boards gettting controlled by the same Kconfig symbol:
arch/arm/mach-mmp/tavorevb.o: In function `tavorevb_init':
tavorevb.c:(.init.text+0x4c): undefined reference to pxa910_device_uart1' tavorevb.c:(.init.text+0x50): undefined reference to pxa910_device_gpio' tavorevb.o:(.arch.info.init+0x54): undefined reference to pxa910_init_irq' tavorevb.o:(.arch.info.init+0x58): undefined reference to pxa910_timer_init'
The mach-pxa TavorEVB seems much more complete than the mach-mmp one that supports only uart, gpio and ethernet. Further, I could find no information about the board on the internet aside from references to the Linux kernel, so I assume this was never available outside of Marvell and can be removed entirely.
There is a third board named TavorEVB in the Kconfig description, but this refers to the "TTC_DKB" machine. The two are clearly related, so I change the Kconfig description to just list both names.
--- arch/arm/mach-mmp/Kconfig | 10 +--- arch/arm/mach-mmp/Makefile | 1 - arch/arm/mach-mmp/tavorevb.c | 113 ----------------------------------- 3 files changed, 1 insertion(+), 123 deletions(-) delete mode 100644 arch/arm/mach-mmp/tavorevb.c
arch/arm/mach-mmp/Kconfig +1 -9
@@ -39,16 +39,8 @@ config MACH_AVENGERS_LITE Say 'Y' here if you want to support the Marvell PXA168-based Avengers Lite Development Board. -config MACH_TAVOREVB - bool "Marvell's PXA910 TavorEVB Development Board" - depends on ARCH_MULTI_V5 - select CPU_PXA910 - help - Say 'Y' here if you want to support the Marvell PXA910-based - TavorEVB Development Board. - config MACH_TTC_DKB - bool "Marvell's PXA910 TavorEVB Development Board" + bool "Marvell's PXA910 TavorEVB/TTC_DKB Development Board" depends on ARCH_MULTI_V5 select CPU_PXA910 help
arch/arm/mach-mmp/Makefile +0 -1
@@ -24,7 +24,6 @@ endif obj-$(CONFIG_MACH_ASPENITE) += aspenite.o obj-$(CONFIG_MACH_ZYLONITE2) += aspenite.o obj-$(CONFIG_MACH_AVENGERS_LITE)+= avengers_lite.o -obj-$(CONFIG_MACH_TAVOREVB) += tavorevb.o obj-$(CONFIG_MACH_TTC_DKB) += ttc_dkb.o obj-$(CONFIG_MACH_BROWNSTONE) += brownstone.o obj-$(CONFIG_MACH_FLINT) += flint.o
arch/arm/mach-mmp/tavorevb.c deleted +0 -113
113 lines not on this page · raw message
Signature · 1 line
2.29.2
PATCH v2 43/48 ARM: mmp: rename pxa_register_device
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
In a multiplatform kernel that includes both pxa and mmp, we get a link failure from the clash of two pxa_register_device functions.
Rename the one in mach-mmp to mmp_register_device, along with with the rename of pxa_device_desc.
--- arch/arm/mach-mmp/devices.c | 2 +- arch/arm/mach-mmp/devices.h | 10 +++---- arch/arm/mach-mmp/mmp2.h | 48 ++++++++++++++--------------- arch/arm/mach-mmp/pxa168.h | 60 ++++++++++++++++++------------------- arch/arm/mach-mmp/pxa910.h | 38 +++++++++++------------ arch/arm/mach-mmp/ttc_dkb.c | 6 ++-- 6 files changed, 82 insertions(+), 82 deletions(-)
arch/arm/mach-mmp/devices.c +1 -1
@@ -14,7 +14,7 @@#include <linux/soc/mmp/cputype.h> #include "regs-usb.h" -int __init pxa_register_device (struct pxa_device_desc *desc, +int __init mmp_register_device (struct mmp_device_desc *desc,void *data,size_t size) {struct platform_device *pdev;
arch/arm/mach-mmp/devices.h +5 -5
@@ -7,7 +7,7 @@#define MAX_RESOURCE_DMA 2/* structure for describing the on-chip devices */ -struct pxa_device_desc { +struct mmp_device_desc {const char *dev_name;const char *drv_name;int id;
@@ -18,7 +18,7 @@ struct pxa_device_desc { }; #define PXA168_DEVICE(_name, _drv, _id, _irq, _start, _size, _dma...) \ -struct pxa_device_desc pxa168_device_##_name __initdata = { \ +struct mmp_device_desc pxa168_device_##_name __initdata = { \ .dev_name = "pxa168-" #_name, \ .drv_name = _drv, \ .id = _id, \
@@ -29,7 +29,7 @@ struct pxa_device_desc pxa168_device_##_name __initdata = { \ }; #define PXA910_DEVICE(_name, _drv, _id, _irq, _start, _size, _dma...) \ -struct pxa_device_desc pxa910_device_##_name __initdata = { \ +struct mmp_device_desc pxa910_device_##_name __initdata = { \ .dev_name = "pxa910-" #_name, \ .drv_name = _drv, \ .id = _id, \
@@ -40,7 +40,7 @@ struct pxa_device_desc pxa910_device_##_name __initdata = { \ }; #define MMP2_DEVICE(_name, _drv, _id, _irq, _start, _size, _dma...) \ -struct pxa_device_desc mmp2_device_##_name __initdata = { \ +struct mmp_device_desc mmp2_device_##_name __initdata = { \ .dev_name = "mmp2-" #_name, \ .drv_name = _drv, \ .id = _id, \
@@ -50,7 +50,7 @@ struct pxa_device_desc mmp2_device_##_name __initdata = { \ .dma = { _dma }, \ } -extern int pxa_register_device (struct pxa_device_desc *,void *,size_t ); +extern int mmp_register_device (struct mmp_device_desc *,void *,size_t );extern int pxa_usb_phy_init (void __iomem *phy_reg);extern void pxa_usb_phy_deinit (void __iomem *phy_reg);
arch/arm/mach-mmp/mmp2.h +24 -24
94 lines not on this page · raw message
arch/arm/mach-mmp/pxa168.h +30 -30
126 lines not on this page · raw message
arch/arm/mach-mmp/pxa910.h +19 -19
@@ -13,28 +13,28 @@ extern void __init pxa910_init_irq(void);#include "devices.h" -extern struct pxa_device_desc pxa910_device_uart1; -extern struct pxa_device_desc pxa910_device_uart2; -extern struct pxa_device_desc pxa910_device_twsi0; -extern struct pxa_device_desc pxa910_device_twsi1; -extern struct pxa_device_desc pxa910_device_pwm1; -extern struct pxa_device_desc pxa910_device_pwm2; -extern struct pxa_device_desc pxa910_device_pwm3; -extern struct pxa_device_desc pxa910_device_pwm4; -extern struct pxa_device_desc pxa910_device_nand; +extern struct mmp_device_desc pxa910_device_uart1; +extern struct mmp_device_desc pxa910_device_uart2; +extern struct mmp_device_desc pxa910_device_twsi0; +extern struct mmp_device_desc pxa910_device_twsi1; +extern struct mmp_device_desc pxa910_device_pwm1; +extern struct mmp_device_desc pxa910_device_pwm2; +extern struct mmp_device_desc pxa910_device_pwm3; +extern struct mmp_device_desc pxa910_device_pwm4; +extern struct mmp_device_desc pxa910_device_nand;extern struct platform_device pxa168_device_usb_phy;extern struct platform_device pxa168_device_u2o;extern struct platform_device pxa168_device_u2ootg;extern struct platform_device pxa168_device_u2oehci; -extern struct pxa_device_desc pxa910_device_disp; -extern struct pxa_device_desc pxa910_device_fb; -extern struct pxa_device_desc pxa910_device_panel; +extern struct mmp_device_desc pxa910_device_disp; +extern struct mmp_device_desc pxa910_device_fb; +extern struct mmp_device_desc pxa910_device_panel;extern struct platform_device pxa910_device_gpio;extern struct platform_device pxa910_device_rtc;static inline int pxa910_add_uart (int id) { -struct pxa_device_desc *d =NULL ; +struct mmp_device_desc *d =NULL ;switch (id) {case 1 : d = &pxa910_device_uart1;break ;
@@ -44,13 +44,13 @@ static inline int pxa910_add_uart(int id)if (d ==NULL )return -EINVAL ; -return pxa_register_device (d,NULL ,0 ); +return mmp_register_device (d,NULL ,0 ); }static inline int pxa910_add_twsi (int id,struct i2c_pxa_platform_data *data,struct i2c_board_info *info,unsigned size) { -struct pxa_device_desc *d =NULL ; +struct mmp_device_desc *d =NULL ;int ret;switch (id) {
@@ -64,12 +64,12 @@ static inline int pxa910_add_twsi(int id, struct i2c_pxa_platform_data *data,if (ret)return ret; -return pxa_register_device (d, data,sizeof (*data)); +return mmp_register_device (d, data,sizeof (*data)); }static inline int pxa910_add_pwm (int id) { -struct pxa_device_desc *d =NULL ; +struct mmp_device_desc *d =NULL ;switch (id) {case 1 : d = &pxa910_device_pwm1;break ;
@@ -80,11 +80,11 @@ static inline int pxa910_add_pwm(int id) return -EINVAL; } -return pxa_register_device (d,NULL ,0 ); +return mmp_register_device (d,NULL ,0 ); }static inline int pxa910_add_nand (struct pxa3xx_nand_platform_data *info) { -return pxa_register_device (&pxa910_device_nand, info,sizeof (*info)); +return mmp_register_device (&pxa910_device_nand, info,sizeof (*info)); }#endif /* __ASM_MACH_PXA910_H */
arch/arm/mach-mmp/ttc_dkb.c +3 -3
@@ -253,12 +253,12 @@ static struct spi_board_info spi_board_info[] __initdata = {static void __init add_disp (void ) { -pxa_register_device (&pxa910_device_disp, +mmp_register_device (&pxa910_device_disp, &dkb_disp_info,sizeof (dkb_disp_info));spi_register_board_info (spi_board_info,ARRAY_SIZE (spi_board_info)); -pxa_register_device (&pxa910_device_fb, +mmp_register_device (&pxa910_device_fb, &dkb_fb_info,sizeof (dkb_fb_info)); -pxa_register_device (&pxa910_device_panel, +mmp_register_device (&pxa910_device_panel, &dkb_tpo_panel_info,sizeof (dkb_tpo_panel_info)); }#endif
Signature · 1 line
2.29.2
PATCH v2 44/48 ARM: pxa: move plat-pxa to drivers/soc/
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
There are two drivers in arch/arm/plat-pxa: mfp and ssp. Both of them should ideally not be needed at all, as there are proper subsystems to replace them.
OTOH, they are self-contained and can simply be normal SoC drivers, so move them over there to eliminate one more of the plat-* directories.
---
arch/arm/Kconfig | 4 ----
arch/arm/Makefile | 1 -
arch/arm/mach-mmp/mfp.h | 2 +-
arch/arm/mach-pxa/include/mach/mfp.h | 2 +-
arch/arm/mach-pxa/mfp-pxa2xx.h | 2 +-
arch/arm/mach-pxa/mfp-pxa3xx.h | 2 +-
drivers/soc/Kconfig | 1 +
drivers/soc/Makefile | 1 +
{arch/arm/plat-pxa => drivers/soc/pxa}/Kconfig | 5 ++---
{arch/arm/plat-pxa => drivers/soc/pxa}/Makefile | 4 ----
{arch/arm/plat-pxa => drivers/soc/pxa}/mfp.c | 2 +-
{arch/arm/plat-pxa => drivers/soc/pxa}/ssp.c | 0
.../plat-pxa/include/plat => include/linux/soc/pxa}/mfp.h | 6 ++----
13 files changed, 11 insertions(+), 21 deletions(-)
rename {arch/arm/plat-pxa => drivers/soc/pxa}/Kconfig (83%)
rename {arch/arm/plat-pxa => drivers/soc/pxa}/Makefile (51%)
rename {arch/arm/plat-pxa => drivers/soc/pxa}/mfp.c (99%)
rename {arch/arm/plat-pxa => drivers/soc/pxa}/ssp.c (100%)
rename {arch/arm/plat-pxa/include/plat => include/linux/soc/pxa}/mfp.h (98%)arch/arm/Kconfig +0 -4
@@ -667,7 +667,6 @@ source "arch/arm/mach-orion5x/Kconfig" source "arch/arm/mach-oxnas/Kconfig" source "arch/arm/mach-pxa/Kconfig" -source "arch/arm/plat-pxa/Kconfig" source "arch/arm/mach-qcom/Kconfig"
@@ -753,9 +752,6 @@ config PLAT_ORION_LEGACY bool select PLAT_ORION -config PLAT_PXA - bool - config PLAT_VERSATILE bool
arch/arm/Makefile +0 -1
@@ -230,7 +230,6 @@ machine-$(CONFIG_PLAT_SPEAR) += spear # by CONFIG_* macro name. plat-$(CONFIG_ARCH_OMAP) += omap plat-$(CONFIG_PLAT_ORION) += orion -plat-$(CONFIG_PLAT_PXA) += pxa plat-$(CONFIG_PLAT_VERSATILE) += versatile # The byte offset of the kernel image in RAM from the start of RAM.
arch/arm/mach-mmp/mfp.h +1 -1
@@ -2,7 +2,7 @@#ifndef __ASM_MACH_MFP_H#define __ASM_MACH_MFP_H -#include <plat/mfp.h> +#include <linux/soc/pxa/mfp.h> /* * NOTE: the MFPR register bit definitions on PXA168 processor lines are a
arch/arm/mach-pxa/include/mach/mfp.h +1 -1
@@ -13,6 +13,6 @@#ifndef __ASM_ARCH_MFP_H#define __ASM_ARCH_MFP_H -#include <plat/mfp.h> +#include <linux/soc/pxa/mfp.h> #endif /* __ASM_ARCH_MFP_H */
arch/arm/mach-pxa/mfp-pxa2xx.h +1 -1
@@ -2,7 +2,7 @@#ifndef __ASM_ARCH_MFP_PXA2XX_H#define __ASM_ARCH_MFP_PXA2XX_H -#include <plat/mfp.h> +#include <linux/soc/pxa/mfp.h> /* * the following MFP_xxx bit definitions in mfp.h are re-used for pxa2xx:
arch/arm/mach-pxa/mfp-pxa3xx.h +1 -1
@@ -2,7 +2,7 @@#ifndef __ASM_ARCH_MFP_PXA3XX_H#define __ASM_ARCH_MFP_PXA3XX_H -#include <plat/mfp.h> +#include <linux/soc/pxa/mfp.h> #define MFPR_BASE (0x40e10000)
drivers/soc/Kconfig +1 -0
@@ -14,6 +14,7 @@ source "drivers/soc/ixp4xx/Kconfig" source "drivers/soc/litex/Kconfig" source "drivers/soc/mediatek/Kconfig" source "drivers/soc/microchip/Kconfig" +source "drivers/soc/pxa/Kconfig" source "drivers/soc/qcom/Kconfig" source "drivers/soc/renesas/Kconfig" source "drivers/soc/rockchip/Kconfig"
drivers/soc/Makefile +1 -0
@@ -19,6 +19,7 @@ obj-$(CONFIG_SOC_XWAY) += lantiq/ obj-$(CONFIG_LITEX_SOC_CONTROLLER) += litex/ obj-y += mediatek/ obj-y += microchip/ +obj-y += pxa/ obj-y += amlogic/ obj-y += qcom/ obj-y += renesas/
drivers/soc/pxa/Kconfig renamed from arch/arm/plat-pxa/Kconfig +2 -3
@@ -1,9 +1,8 @@ # SPDX-License-Identifier: GPL-2.0-only -if PLAT_PXA +config PLAT_PXA + bool config PXA_SSP tristate help Enable support for PXA2xx SSP ports - -endif
drivers/soc/pxa/Makefile renamed from arch/arm/plat-pxa/Makefile +0 -4
@@ -1,8 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only -# -# Makefile for code common across different PXA processor families -# -ccflags-$(CONFIG_ARCH_MMP) := -I$(srctree)/$(src)/include obj-$(CONFIG_PXA3xx) += mfp.o obj-$(CONFIG_ARCH_MMP) += mfp.o
drivers/soc/pxa/mfp.c renamed from arch/arm/plat-pxa/mfp.c +1 -1
@@ -15,7 +15,7 @@#include <linux/init.h> #include <linux/io.h> -#include <plat/mfp.h> +#include <linux/soc/pxa/mfp.h> #define MFPR_SIZE (PAGE_SIZE)
drivers/soc/pxa/ssp.c renamed from arch/arm/plat-pxa/ssp.c +0 -0
include/linux/soc/pxa/mfp.h renamed from arch/arm/plat-pxa/include/plat/mfp.h +2 -4
@@ -1,7 +1,5 @@/* SPDX-License-Identifier: GPL-2.0-only */ /* -* arch/arm/plat-pxa/include/plat/mfp.h -* * Common Multi-Function Pin Definitions * * Copyright (C) 2007 Marvell International Ltd.
@@ -453,8 +451,8 @@ struct mfp_addr_map {#define MFP_ADDR_END { MFP_PIN_INVALID, 0 } -void __init mfp_init_base (void __iomem *mfpr_base); -void __init mfp_init_addr (struct mfp_addr_map *map); +void mfp_init_base (void __iomem *mfpr_base); +void mfp_init_addr (struct mfp_addr_map *map);/* * mfp_{read, write}() - for direct read/write access to the MFPR register
Signature · 1 line
2.29.2
PATCH v2 45/48 ARM: PXA: fix multi-cpu build of xsc3
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
On a kernel that includes both ARMv4 and XScale support, the copypage function fails to build with invalid instructions.
Since these are only called on an actual XScale processor, annotate the assembly with the correct .arch directive.
--- arch/arm/mm/copypage-xsc3.c | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/mm/copypage-xsc3.c +2 -0
@@ -29,6 +29,7 @@ static void xsc3_mc_copy_user_page(void *kto, const void *kfrom)int tmp; asm volatile ("\ +.arch xscale \n\ pld [%1, #0] \n\ pld [%1, #32] \n\ 1: pld [%1, #64] \n\
@@ -80,6 +81,7 @@ void xsc3_mc_clear_user_highpage(struct page *page, unsigned long vaddr) {void *ptr, *kaddr =kmap_atomic (page); asm volatile ("\ +.arch xscale \n\ mov r1, %2 \n\ mov r2, #0 \n\ mov r3, #0 \n\
Signature · 1 line
2.29.2
PATCH v2 46/48 ARM: pxa: move mach/*.h to mach-pxa/
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
None of the headers are included from outside of the mach-pxa directory, so move them all in there.
---
arch/arm/mach-pxa/am300epd.c | 2 +-
arch/arm/mach-pxa/balloon3.h | 2 +-
arch/arm/mach-pxa/colibri-pxa3xx.c | 2 +-
arch/arm/mach-pxa/colibri.h | 2 +-
arch/arm/mach-pxa/corgi.h | 2 +-
arch/arm/mach-pxa/corgi_pm.c | 2 +-
arch/arm/mach-pxa/csb726.c | 2 +-
arch/arm/mach-pxa/csb726.h | 2 +-
arch/arm/mach-pxa/devices.c | 6 +--
arch/arm/mach-pxa/e740-pcmcia.c | 2 +-
.../{include/mach => }/eseries-gpio.h | 0
arch/arm/mach-pxa/eseries.c | 2 +-
arch/arm/mach-pxa/generic.c | 8 +--
arch/arm/mach-pxa/gumstix.h | 2 +-
arch/arm/mach-pxa/h5000.c | 2 +-
arch/arm/mach-pxa/hx4700.h | 2 +-
arch/arm/mach-pxa/idp.h | 2 +-
arch/arm/mach-pxa/include/mach/pxa-regs.h | 52 ------------------
arch/arm/mach-pxa/irq.c | 2 +-
arch/arm/mach-pxa/{include/mach => }/irqs.h | 0
arch/arm/mach-pxa/lpd270.c | 2 +-
arch/arm/mach-pxa/lubbock.c | 2 +-
arch/arm/mach-pxa/lubbock.h | 2 +-
arch/arm/mach-pxa/magician.c | 2 +-
.../mach-pxa/{include/mach => }/magician.h | 2 +-
arch/arm/mach-pxa/mainstone.c | 2 +-
arch/arm/mach-pxa/mainstone.h | 2 +-
arch/arm/mach-pxa/mfp-pxa2xx.c | 2 +-
arch/arm/mach-pxa/mfp-pxa3xx.c | 2 +-
arch/arm/mach-pxa/{include/mach => }/mfp.h | 0
arch/arm/mach-pxa/mioa701.c | 2 +-
arch/arm/mach-pxa/palmld.h | 2 +-
arch/arm/mach-pxa/palmt5.h | 2 +-
arch/arm/mach-pxa/palmtc.h | 2 +-
arch/arm/mach-pxa/palmtreo.c | 2 +-
arch/arm/mach-pxa/palmtx.h | 2 +-
arch/arm/mach-pxa/pcm027.h | 2 +-
arch/arm/mach-pxa/pcm990_baseboard.h | 2 +-
arch/arm/mach-pxa/poodle.h | 2 +-
arch/arm/mach-pxa/pxa-dt.c | 2 +-
arch/arm/mach-pxa/pxa-regs.h | 53 ++++++++++++++++++-
arch/arm/mach-pxa/pxa25x.c | 6 +--
arch/arm/mach-pxa/pxa25x.h | 4 +-
arch/arm/mach-pxa/pxa27x.c | 6 +--
arch/arm/mach-pxa/pxa27x.h | 4 +-
.../mach-pxa/{include/mach => }/pxa2xx-regs.h | 0
arch/arm/mach-pxa/pxa2xx.c | 6 +--
.../mach-pxa/{include/mach => }/pxa3xx-regs.h | 0
arch/arm/mach-pxa/pxa3xx.c | 8 +--
arch/arm/mach-pxa/pxa3xx.h | 4 +-
.../mach-pxa/{include/mach => }/regs-ost.h | 0
arch/arm/mach-pxa/reset.c | 6 +--
arch/arm/mach-pxa/{include/mach => }/reset.h | 0
arch/arm/mach-pxa/sharpsl_pm.c | 2 +-
arch/arm/mach-pxa/sleep.S | 4 +-
arch/arm/mach-pxa/smemc.c | 2 +-
arch/arm/mach-pxa/{include/mach => }/smemc.h | 0
arch/arm/mach-pxa/spitz.c | 4 +-
arch/arm/mach-pxa/spitz.h | 2 +-
arch/arm/mach-pxa/standby.S | 2 +-
arch/arm/mach-pxa/tosa.c | 6 +--
arch/arm/mach-pxa/{include/mach => }/tosa.h | 0
arch/arm/mach-pxa/trizeps4-pcmcia.c | 2 +-
arch/arm/mach-pxa/trizeps4.c | 2 +-
arch/arm/mach-pxa/trizeps4.h | 2 +-
arch/arm/mach-pxa/xcep.c | 2 +-
arch/arm/mach-pxa/z2.c | 2 +-
arch/arm/mach-pxa/{include/mach => }/z2.h | 0
arch/arm/mach-pxa/zeus.c | 2 +-
arch/arm/mach-pxa/zylonite.c | 2 +-
70 files changed, 133 insertions(+), 134 deletions(-)
rename arch/arm/mach-pxa/{include/mach => }/eseries-gpio.h (100%)
delete mode 100644 arch/arm/mach-pxa/include/mach/pxa-regs.h
rename arch/arm/mach-pxa/{include/mach => }/irqs.h (100%)
rename arch/arm/mach-pxa/{include/mach => }/magician.h (99%)
rename arch/arm/mach-pxa/{include/mach => }/mfp.h (100%)
rename arch/arm/mach-pxa/{include/mach => }/pxa2xx-regs.h (100%)
rename arch/arm/mach-pxa/{include/mach => }/pxa3xx-regs.h (100%)
rename arch/arm/mach-pxa/{include/mach => }/regs-ost.h (100%)
rename arch/arm/mach-pxa/{include/mach => }/reset.h (100%)
rename arch/arm/mach-pxa/{include/mach => }/smemc.h (100%)
rename arch/arm/mach-pxa/{include/mach => }/tosa.h (100%)
rename arch/arm/mach-pxa/{include/mach => }/z2.h (100%)arch/arm/mach-pxa/am300epd.c +1 -1
@@ -30,7 +30,7 @@#include "gumstix.h" #include "mfp-pxa25x.h" -#include <mach/irqs.h> +#include "irqs.h" #include <linux/platform_data/video-pxafb.h> #include "generic.h"
arch/arm/mach-pxa/balloon3.h +1 -1
@@ -11,7 +11,7 @@#ifndef ASM_ARCH_BALLOON3_H #define ASM_ARCH_BALLOON3_H -#include <mach/irqs.h> /* PXA_NR_BUILTIN_GPIO */ +#include "irqs.h" /* PXA_NR_BUILTIN_GPIO */ enum balloon3_features { BALLOON3_FEATURE_OHCI,
arch/arm/mach-pxa/colibri-pxa3xx.c +1 -1
@@ -17,7 +17,7 @@#include <asm/system_info.h> #include <asm/mach/arch.h> #include <asm/mach/irq.h> -#include <mach/pxa3xx-regs.h> +#include "pxa3xx-regs.h" #include "mfp-pxa300.h" #include "colibri.h" #include <linux/platform_data/mmc-pxamci.h>
arch/arm/mach-pxa/colibri.h +1 -1
@@ -3,7 +3,7 @@#define _COLIBRI_H_#include <net/ax88796.h> -#include <mach/mfp.h> +#include "mfp.h" /* * base board glue for PXA270 module
arch/arm/mach-pxa/corgi.h +1 -1
@@ -9,7 +9,7 @@#ifndef __ASM_ARCH_CORGI_H#define __ASM_ARCH_CORGI_H 1 -#include <mach/irqs.h> /* PXA_NR_BUILTIN_GPIO */ +#include "irqs.h" /* PXA_NR_BUILTIN_GPIO */ /* * Corgi (Non Standard) GPIO Definitions
arch/arm/mach-pxa/corgi_pm.c +1 -1
@@ -21,7 +21,7 @@#include <asm/mach-types.h> #include "corgi.h" -#include <mach/pxa2xx-regs.h> +#include "pxa2xx-regs.h" #include "sharpsl_pm.h" #include "generic.h"
arch/arm/mach-pxa/csb726.c +1 -1
@@ -23,7 +23,7 @@#include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/usb-ohci-pxa27x.h> #include <linux/platform_data/asoc-pxa.h> -#include <mach/smemc.h> +#include "smemc.h" #include "generic.h" #include "devices.h"
arch/arm/mach-pxa/csb726.h +1 -1
@@ -7,7 +7,7 @@#ifndef CSB726_H #define CSB726_H -#include <mach/irqs.h> /* PXA_GPIO_TO_IRQ */ +#include "irqs.h" /* PXA_GPIO_TO_IRQ */ #define CSB726_GPIO_IRQ_LAN 52#define CSB726_GPIO_IRQ_SM501 53
arch/arm/mach-pxa/devices.c +3 -3
@@ -16,7 +16,7 @@#include <linux/platform_data/video-pxafb.h> #include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/irda-pxaficp.h> -#include <mach/irqs.h> +#include "irqs.h" #include <linux/platform_data/usb-ohci-pxa27x.h> #include <linux/platform_data/keypad-pxa27x.h> #include <linux/platform_data/media/camera-pxa.h>
@@ -24,8 +24,8 @@#include <linux/platform_data/mmp_dma.h> #include <linux/platform_data/mtd-nand-pxa3xx.h> -#include <mach/regs-ost.h> -#include <mach/reset.h> +#include "regs-ost.h" +#include "reset.h" #include "devices.h" #include "generic.h"
arch/arm/mach-pxa/e740-pcmcia.c +1 -1
@@ -13,7 +13,7 @@#include <linux/interrupt.h> #include <linux/platform_device.h> -#include <mach/eseries-gpio.h> +#include "eseries-gpio.h" #include <asm/irq.h> #include <asm/mach-types.h>
arch/arm/mach-pxa/eseries-gpio.h renamed from arch/arm/mach-pxa/include/mach/eseries-gpio.h +0 -0
arch/arm/mach-pxa/eseries.c +1 -1
@@ -33,7 +33,7 @@#include <asm/mach-types.h> #include "pxa25x.h" -#include <mach/eseries-gpio.h> +#include "eseries-gpio.h" #include "eseries-irq.h" #include <linux/platform_data/asoc-pxa.h> #include <linux/platform_data/video-pxafb.h>
arch/arm/mach-pxa/generic.c +4 -4
@@ -25,10 +25,10 @@#include <asm/mach-types.h> #include "addr-map.h" -#include <mach/irqs.h> -#include <mach/reset.h> -#include <mach/smemc.h> -#include <mach/pxa3xx-regs.h> +#include "irqs.h" +#include "reset.h" +#include "smemc.h" +#include "pxa3xx-regs.h" #include "generic.h" #include <clocksource/pxa.h>
arch/arm/mach-pxa/gumstix.h +1 -1
@@ -3,7 +3,7 @@* arch/arm/mach-pxa/include/mach/gumstix.h */ -#include <mach/irqs.h> /* PXA_GPIO_TO_IRQ */ +#include "irqs.h" /* PXA_GPIO_TO_IRQ */ /* BTRESET - Reset line to Bluetooth module, active low signal. */ #define GPIO_GUMSTIX_BTRESET 7
arch/arm/mach-pxa/h5000.c +1 -1
@@ -29,7 +29,7 @@#include "pxa25x.h" #include "h5000.h" #include "udc.h" -#include <mach/smemc.h> +#include "smemc.h" #include "generic.h"
arch/arm/mach-pxa/hx4700.h +1 -1
@@ -10,7 +10,7 @@#include <linux/gpio.h> #include <linux/mfd/asic3.h> -#include <mach/irqs.h> /* PXA_NR_BUILTIN_GPIO */ +#include "irqs.h" /* PXA_NR_BUILTIN_GPIO */ #define HX4700_ASIC3_GPIO_BASE PXA_NR_BUILTIN_GPIO#define HX4700_EGPIO_BASE (HX4700_ASIC3_GPIO_BASE + ASIC3_NUM_GPIOS)
arch/arm/mach-pxa/idp.h +1 -1
@@ -20,7 +20,7 @@* IDP hardware. */ -#include <mach/irqs.h> /* PXA_GPIO_TO_IRQ */ +#include "irqs.h" /* PXA_GPIO_TO_IRQ */ #define IDP_FLASH_PHYS (PXA_CS0_PHYS)#define IDP_ALT_FLASH_PHYS (PXA_CS1_PHYS)
arch/arm/mach-pxa/include/mach/pxa-regs.h deleted +0 -52
52 lines not on this page · raw message
arch/arm/mach-pxa/irq.c +1 -1
@@ -21,7 +21,7 @@#include <asm/exception.h> -#include <mach/irqs.h> +#include "irqs.h" #include "generic.h" #include "pxa-regs.h"
arch/arm/mach-pxa/irqs.h renamed from arch/arm/mach-pxa/include/mach/irqs.h +0 -0
arch/arm/mach-pxa/lpd270.c +1 -1
@@ -44,7 +44,7 @@#include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/irda-pxaficp.h> #include <linux/platform_data/usb-ohci-pxa27x.h> -#include <mach/smemc.h> +#include "smemc.h" #include "generic.h" #include "devices.h"
arch/arm/mach-pxa/lubbock.c +1 -1
@@ -52,7 +52,7 @@#include <linux/platform_data/video-pxafb.h> #include <linux/platform_data/mmc-pxamci.h> #include "pm.h" -#include <mach/smemc.h> +#include "smemc.h" #include "generic.h" #include "devices.h"
arch/arm/mach-pxa/lubbock.h +1 -1
@@ -5,7 +5,7 @@* Copyright: MontaVista Software Inc. */ -#include <mach/irqs.h> +#include "irqs.h" #define LUBBOCK_ETH_PHYS PXA_CS3_PHYS
arch/arm/mach-pxa/magician.c +1 -1
@@ -35,7 +35,7 @@#include "pxa27x.h" #include "addr-map.h" -#include <mach/magician.h> +#include "magician.h" #include <linux/platform_data/video-pxafb.h> #include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/irda-pxaficp.h>
arch/arm/mach-pxa/magician.h renamed from arch/arm/mach-pxa/include/mach/magician.h +1 -1
@@ -9,7 +9,7 @@#define _MAGICIAN_H_#include <linux/gpio.h> -#include <mach/irqs.h> +#include "irqs.h" /* * PXA GPIOs
arch/arm/mach-pxa/mainstone.c +1 -1
@@ -52,7 +52,7 @@#include <linux/platform_data/usb-ohci-pxa27x.h> #include <linux/platform_data/keypad-pxa27x.h> #include "addr-map.h" -#include <mach/smemc.h> +#include "smemc.h" #include "generic.h" #include "devices.h"
arch/arm/mach-pxa/mainstone.h +1 -1
@@ -8,7 +8,7 @@#ifndef ASM_ARCH_MAINSTONE_H #define ASM_ARCH_MAINSTONE_H -#include <mach/irqs.h> +#include "irqs.h" #define MST_ETH_PHYS PXA_CS4_PHYS
arch/arm/mach-pxa/mfp-pxa2xx.c +1 -1
@@ -18,7 +18,7 @@#include <linux/syscore_ops.h> #include <linux/soc/pxa/cpu.h> -#include <mach/pxa2xx-regs.h> +#include "pxa2xx-regs.h" #include "mfp-pxa2xx.h" #include "generic.h"
arch/arm/mach-pxa/mfp-pxa3xx.c +1 -1
@@ -17,7 +17,7 @@#include <linux/syscore_ops.h> #include "mfp-pxa3xx.h" -#include <mach/pxa3xx-regs.h> +#include "pxa3xx-regs.h" #ifdef CONFIG_PM /*
arch/arm/mach-pxa/mfp.h renamed from arch/arm/mach-pxa/include/mach/mfp.h +0 -0
arch/arm/mach-pxa/mioa701.c +1 -1
@@ -42,7 +42,7 @@#include "pxa27x-udc.h" #include <linux/platform_data/media/camera-pxa.h> #include <linux/platform_data/asoc-pxa.h> -#include <mach/smemc.h> +#include "smemc.h" #include "mioa701.h"
arch/arm/mach-pxa/palmld.h +1 -1
@@ -9,7 +9,7 @@#ifndef _INCLUDE_PALMLD_H_#define _INCLUDE_PALMLD_H_ -#include <mach/irqs.h> /* PXA_GPIO_TO_IRQ */ +#include "irqs.h" /* PXA_GPIO_TO_IRQ */ /** HERE ARE GPIOs **/
arch/arm/mach-pxa/palmt5.h +1 -1
@@ -11,7 +11,7 @@#ifndef _INCLUDE_PALMT5_H_#define _INCLUDE_PALMT5_H_ -#include <mach/irqs.h> /* PXA_GPIO_TO_IRQ */ +#include "irqs.h" /* PXA_GPIO_TO_IRQ */ /** HERE ARE GPIOs **/
arch/arm/mach-pxa/palmtc.h +1 -1
@@ -12,7 +12,7 @@#ifndef _INCLUDE_PALMTC_H_#define _INCLUDE_PALMTC_H_ -#include <mach/irqs.h> /* PXA_GPIO_TO_IRQ */ +#include "irqs.h" /* PXA_GPIO_TO_IRQ */ /** HERE ARE GPIOs **/
arch/arm/mach-pxa/palmtreo.c +1 -1
@@ -37,7 +37,7 @@#include <linux/platform_data/keypad-pxa27x.h> #include "udc.h" #include <linux/platform_data/usb-ohci-pxa27x.h> -#include <mach/pxa2xx-regs.h> +#include "pxa2xx-regs.h" #include <linux/platform_data/asoc-palm27x.h> #include <linux/platform_data/media/camera-pxa.h> #include "palm27x.h"
arch/arm/mach-pxa/palmtx.h +1 -1
@@ -12,7 +12,7 @@#ifndef _INCLUDE_PALMTX_H_#define _INCLUDE_PALMTX_H_ -#include <mach/irqs.h> /* PXA_GPIO_TO_IRQ */ +#include "irqs.h" /* PXA_GPIO_TO_IRQ */ /** HERE ARE GPIOs **/
arch/arm/mach-pxa/pcm027.h +1 -1
@@ -10,7 +10,7 @@* Definitions of CPU card resources only */ -#include <mach/irqs.h> /* PXA_GPIO_TO_IRQ */ +#include "irqs.h" /* PXA_GPIO_TO_IRQ */ /* phyCORE-PXA270 (PCM027) Interrupts */ #define PCM027_IRQ (x) (IRQ_BOARD_START + (x))
arch/arm/mach-pxa/pcm990_baseboard.h +1 -1
@@ -7,7 +7,7 @@*/ #include "pcm027.h" -#include <mach/irqs.h> /* PXA_GPIO_TO_IRQ */ +#include "irqs.h" /* PXA_GPIO_TO_IRQ */ /* * definitions relevant only when the PCM-990
arch/arm/mach-pxa/poodle.h +1 -1
@@ -15,7 +15,7 @@#ifndef __ASM_ARCH_POODLE_H#define __ASM_ARCH_POODLE_H 1 -#include <mach/irqs.h> /* PXA_GPIO_TO_IRQ */ +#include "irqs.h" /* PXA_GPIO_TO_IRQ */ /* * GPIOs
arch/arm/mach-pxa/pxa-dt.c +1 -1
@@ -11,7 +11,7 @@#include <linux/of_platform.h> #include <asm/mach/arch.h> #include <asm/mach/time.h> -#include <mach/irqs.h> +#include "irqs.h" #include "generic.h"
arch/arm/mach-pxa/pxa-regs.h +52 -1
53 lines not on this page · raw message
arch/arm/mach-pxa/pxa25x.c +3 -3
@@ -30,12 +30,12 @@#include <asm/mach/map.h> #include <asm/suspend.h> -#include <mach/irqs.h> +#include "irqs.h" #include "pxa25x.h" -#include <mach/reset.h> +#include "reset.h" #include "pm.h" #include "addr-map.h" -#include <mach/smemc.h> +#include "smemc.h" #include "generic.h" #include "devices.h"
arch/arm/mach-pxa/pxa25x.h +2 -2
@@ -3,8 +3,8 @@#define __MACH_PXA25x_H#include "addr-map.h" -#include <mach/pxa2xx-regs.h> +#include "pxa2xx-regs.h" #include "mfp-pxa25x.h" -#include <mach/irqs.h> +#include "irqs.h" #endif /* __MACH_PXA25x_H */
arch/arm/mach-pxa/pxa27x.c +3 -3
@@ -28,13 +28,13 @@#include <asm/mach/map.h> #include <asm/irq.h> #include <asm/suspend.h> -#include <mach/irqs.h> +#include "irqs.h" #include "pxa27x.h" -#include <mach/reset.h> +#include "reset.h" #include <linux/platform_data/usb-ohci-pxa27x.h> #include "pm.h" #include "addr-map.h" -#include <mach/smemc.h> +#include "smemc.h" #include "generic.h" #include "devices.h"
arch/arm/mach-pxa/pxa27x.h +2 -2
@@ -4,9 +4,9 @@#include <linux/suspend.h> #include "addr-map.h" -#include <mach/pxa2xx-regs.h> +#include "pxa2xx-regs.h" #include "mfp-pxa27x.h" -#include <mach/irqs.h> +#include "irqs.h" #define ARB_CNTRL __REG(0x48000048)/* Arbiter Control Register */
arch/arm/mach-pxa/pxa2xx-regs.h renamed from arch/arm/mach-pxa/include/mach/pxa2xx-regs.h +0 -0
arch/arm/mach-pxa/pxa2xx.c +3 -3
@@ -12,10 +12,10 @@#include <linux/device.h> #include <linux/io.h> -#include <mach/pxa2xx-regs.h> +#include "pxa2xx-regs.h" #include "mfp-pxa25x.h" -#include <mach/reset.h> -#include <mach/smemc.h> +#include "reset.h" +#include "smemc.h" #include <linux/platform_data/irda-pxaficp.h> void pxa2xx_clear_reset_status (unsigned int mask)
arch/arm/mach-pxa/pxa3xx-regs.h renamed from arch/arm/mach-pxa/include/mach/pxa3xx-regs.h +0 -0
arch/arm/mach-pxa/pxa3xx.c +4 -4
@@ -29,13 +29,13 @@#include <asm/mach/map.h> #include <asm/suspend.h> -#include <mach/pxa3xx-regs.h> -#include <mach/reset.h> +#include "pxa3xx-regs.h" +#include "reset.h" #include <linux/platform_data/usb-ohci-pxa27x.h> #include "pm.h" #include "addr-map.h" -#include <mach/smemc.h> -#include <mach/irqs.h> +#include "smemc.h" +#include "irqs.h" #include "generic.h" #include "devices.h"
arch/arm/mach-pxa/pxa3xx.h +2 -2
@@ -3,7 +3,7 @@#define __MACH_PXA3XX_H#include "addr-map.h" -#include <mach/pxa3xx-regs.h> -#include <mach/irqs.h> +#include "pxa3xx-regs.h" +#include "irqs.h" #endif /* __MACH_PXA3XX_H */
arch/arm/mach-pxa/regs-ost.h renamed from arch/arm/mach-pxa/include/mach/regs-ost.h +0 -0
arch/arm/mach-pxa/reset.c +3 -3
@@ -7,9 +7,9 @@#include <asm/proc-fns.h> #include <asm/system_misc.h> -#include <mach/regs-ost.h> -#include <mach/reset.h> -#include <mach/smemc.h> +#include "regs-ost.h" +#include "reset.h" +#include "smemc.h" static void do_hw_reset (void );
arch/arm/mach-pxa/reset.h renamed from arch/arm/mach-pxa/include/mach/reset.h +0 -0
arch/arm/mach-pxa/sharpsl_pm.c +1 -1
@@ -24,7 +24,7 @@#include <asm/mach-types.h> #include "pm.h" -#include <mach/pxa2xx-regs.h> +#include "pxa2xx-regs.h" #include "regs-rtc.h" #include "sharpsl_pm.h"
arch/arm/mach-pxa/sleep.S +2 -2
@@ -13,8 +13,8 @@ #include <linux/linkage.h> #include <asm/assembler.h> -#include <mach/smemc.h> -#include <mach/pxa2xx-regs.h> +#include "smemc.h" +#include "pxa2xx-regs.h" #define MDREFR_KDIV 0x200a4000 // all banks #define CCCR_SLEEP 0x00000107 // L=7 2N=2 A=0 PPDIS=0 CPDIS=0
arch/arm/mach-pxa/smemc.c +1 -1
@@ -10,7 +10,7 @@#include <linux/syscore_ops.h> #include <linux/soc/pxa/cpu.h> -#include <mach/smemc.h> +#include "smemc.h" #ifdef CONFIG_PM static unsigned long msc[2 ];
arch/arm/mach-pxa/smemc.h renamed from arch/arm/mach-pxa/include/mach/smemc.h +0 -0
arch/arm/mach-pxa/spitz.c +2 -2
@@ -39,14 +39,14 @@#include "pxa27x.h" #include "pxa27x-udc.h" -#include <mach/reset.h> +#include "reset.h" #include <linux/platform_data/irda-pxaficp.h> #include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/usb-ohci-pxa27x.h> #include <linux/platform_data/video-pxafb.h> #include "spitz.h" #include "sharpsl_pm.h" -#include <mach/smemc.h> +#include "smemc.h" #include "generic.h" #include "devices.h"
arch/arm/mach-pxa/spitz.h +1 -1
@@ -11,7 +11,7 @@#define __ASM_ARCH_SPITZ_H 1#endif -#include <mach/irqs.h> /* PXA_NR_BUILTIN_GPIO, PXA_GPIO_TO_IRQ */ +#include "irqs.h" /* PXA_NR_BUILTIN_GPIO, PXA_GPIO_TO_IRQ */ #include <linux/fb.h> /* Spitz/Akita GPIOs */
arch/arm/mach-pxa/standby.S +1 -1
@@ -12,7 +12,7 @@ #include <linux/linkage.h> #include <asm/assembler.h> -#include <mach/pxa2xx-regs.h> +#include "pxa2xx-regs.h" .text
arch/arm/mach-pxa/tosa.c +3 -3
@@ -40,16 +40,16 @@#include <asm/mach-types.h> #include "pxa25x.h" -#include <mach/reset.h> +#include "reset.h" #include <linux/platform_data/irda-pxaficp.h> #include <linux/platform_data/mmc-pxamci.h> #include "udc.h" #include "tosa_bt.h" #include <linux/platform_data/asoc-pxa.h> -#include <mach/smemc.h> +#include "smemc.h" #include <asm/mach/arch.h> -#include <mach/tosa.h> +#include "tosa.h" #include <asm/hardware/scoop.h> #include <asm/mach/sharpsl_param.h>
arch/arm/mach-pxa/tosa.h renamed from arch/arm/mach-pxa/include/mach/tosa.h +0 -0
arch/arm/mach-pxa/trizeps4-pcmcia.c +1 -1
@@ -19,7 +19,7 @@#include <asm/mach-types.h> #include <asm/irq.h> -#include <mach/pxa2xx-regs.h> +#include "pxa2xx-regs.h" #include "trizeps4.h" #include <pcmcia/soc_common.h>
arch/arm/mach-pxa/trizeps4.c +1 -1
@@ -46,7 +46,7 @@#include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/irda-pxaficp.h> #include <linux/platform_data/usb-ohci-pxa27x.h> -#include <mach/smemc.h> +#include "smemc.h" #include "generic.h" #include "devices.h"
arch/arm/mach-pxa/trizeps4.h +1 -1
@@ -12,7 +12,7 @@#define _TRIPEPS4_H_#include "addr-map.h" -#include <mach/irqs.h> /* PXA_GPIO_TO_IRQ */ +#include "irqs.h" /* PXA_GPIO_TO_IRQ */ /* physical memory regions */ #define TRIZEPS4_FLASH_PHYS (PXA_CS0_PHYS)/* Flash region */
arch/arm/mach-pxa/xcep.c +1 -1
@@ -26,7 +26,7 @@#include "pxa25x.h" #include "addr-map.h" -#include <mach/smemc.h> +#include "smemc.h" #include "generic.h" #include "devices.h"
arch/arm/mach-pxa/z2.c +1 -1
@@ -34,7 +34,7 @@#include "pxa27x.h" #include "mfp-pxa27x.h" -#include <mach/z2.h> +#include "z2.h" #include <linux/platform_data/video-pxafb.h> #include <linux/platform_data/mmc-pxamci.h> #include <linux/platform_data/keypad-pxa27x.h>
arch/arm/mach-pxa/z2.h renamed from arch/arm/mach-pxa/include/mach/z2.h +0 -0
arch/arm/mach-pxa/zeus.c +1 -1
@@ -49,7 +49,7 @@#include <linux/platform_data/asoc-pxa.h> #include "viper-pcmcia.h" #include "zeus.h" -#include <mach/smemc.h> +#include "smemc.h" #include "generic.h"
arch/arm/mach-pxa/zylonite.c +1 -1
@@ -32,7 +32,7 @@#include <linux/platform_data/usb-ohci-pxa27x.h> #include <linux/platform_data/keypad-pxa27x.h> #include <linux/platform_data/mtd-nand-pxa3xx.h> -#include <mach/mfp.h> +#include "mfp.h" #include "devices.h" #include "generic.h"
Signature · 1 line
2.29.2
PATCH v2 47/48 ARM: pxa: remove support for MTD_XIP
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
Using MTD-XIP does not work on multiplatform kernels because it requires SoC specific register accesses to be done from low-level flash handling functions in RAM while the rest of the kernel sits in flash.
I found no evidence of anyone still actually using this feature, so remove it from PXA to avoid spending a lot of time on actually making it work.
--- arch/arm/Kconfig | 1 - arch/arm/mach-pxa/include/mach/mtd-xip.h | 36 ------------------------ 2 files changed, 37 deletions(-) delete mode 100644 arch/arm/mach-pxa/include/mach/mtd-xip.h
arch/arm/Kconfig +0 -1
@@ -413,7 +413,6 @@ config ARCH_DOVE config ARCH_PXA bool "PXA2xx/PXA3xx-based" - select ARCH_MTD_XIP select ARM_CPU_SUSPEND if PM select AUTO_ZRELADDR select COMMON_CLK
arch/arm/mach-pxa/include/mach/mtd-xip.h deleted +0 -36
@@ -1,36 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* -* MTD primitives for XIP support. Architecture specific functions -* -* Do not include this file directly. It's included from linux/mtd/xip.h -* -* Author: Nicolas Pitre -* Created: Nov 2, 2004 -* Copyright: (C) 2004 MontaVista Software, Inc. -*/ - -#ifndef __ARCH_PXA_MTD_XIP_H__ -#define __ARCH_PXA_MTD_XIP_H__ - -#include <mach/regs-ost.h> - -/* restored July 2017, this did not build since 2011! */ - -#define ICIP io_p2v(0x40d00000) -#define ICMR io_p2v(0x40d00004) -#define xip_irqpending () (readl(ICIP) & readl(ICMR)) - -/* we sample OSCR and convert desired delta to usec (1/4 ~= 1000000/3686400) */ -#define xip_currtime () readl(OSCR) -#define xip_elapsed_since (x) (signed)((readl(OSCR) - (x)) / 4) - -/* -* xip_cpu_idle() is used when waiting for a delay equal or larger than -* the system timer tick period. This should put the CPU into idle mode -* to save power and to be woken up only when some interrupts are pending. -* As above, this should not rely upon standard kernel code. -*/ - -#define xip_cpu_idle () asm volatile ("mcr p14, 0, %0, c7, c0, 0" :: "r" (1)) - -#endif /* __ARCH_PXA_MTD_XIP_H__ */
Signature · 1 line
2.29.2
PATCH v2 48/48 ARM: pxa: convert to multiplatform
In reply to Arnd BergmannFrom: Arnd Bergmann <[email protected]>
PXA is now ready to be built into a single kernel with all the other ARMv5 platforms, so change the Kconfig bit to finish it off. The mach/uncompress.h support is the last bit that goes away, getting replaced with the normal DEBUG_LL based approach.
--- arch/arm/Kconfig | 17 ----- arch/arm/configs/am200epdkit_defconfig | 1 + arch/arm/configs/cm_x300_defconfig | 1 + arch/arm/configs/colibri_pxa270_defconfig | 1 + arch/arm/configs/colibri_pxa300_defconfig | 1 + arch/arm/configs/corgi_defconfig | 1 + arch/arm/configs/eseries_pxa_defconfig | 1 + arch/arm/configs/ezx_defconfig | 1 + arch/arm/configs/h5000_defconfig | 1 + arch/arm/configs/imote2_defconfig | 1 + arch/arm/configs/lpd270_defconfig | 1 + arch/arm/configs/lubbock_defconfig | 1 + arch/arm/configs/magician_defconfig | 1 + arch/arm/configs/mainstone_defconfig | 1 + arch/arm/configs/palmz72_defconfig | 1 + arch/arm/configs/pcm027_defconfig | 1 + arch/arm/configs/pxa255-idp_defconfig | 1 + arch/arm/configs/pxa3xx_defconfig | 1 + arch/arm/configs/pxa_defconfig | 1 + arch/arm/configs/spitz_defconfig | 1 + arch/arm/configs/trizeps4_defconfig | 1 + arch/arm/configs/viper_defconfig | 1 + arch/arm/configs/xcep_defconfig | 1 + arch/arm/configs/zeus_defconfig | 1 + arch/arm/mach-pxa/Kconfig | 14 +++++ arch/arm/mach-pxa/Makefile.boot | 3 - arch/arm/mach-pxa/include/mach/uncompress.h | 70 --------------------- 27 files changed, 37 insertions(+), 90 deletions(-) delete mode 100644 arch/arm/mach-pxa/Makefile.boot delete mode 100644 arch/arm/mach-pxa/include/mach/uncompress.h
arch/arm/Kconfig +0 -17
@@ -411,23 +411,6 @@ config ARCH_DOVE help Support for the Marvell Dove SoC 88AP510 -config ARCH_PXA - bool "PXA2xx/PXA3xx-based" - select ARM_CPU_SUSPEND if PM - select AUTO_ZRELADDR - select COMMON_CLK - select CLKSRC_PXA - select CLKSRC_MMIO - select TIMER_OF - select CPU_XSCALE if !CPU_XSC3 - select GPIO_PXA - select GPIOLIB - select IRQ_DOMAIN - select PLAT_PXA - select SPARSE_IRQ - help - Support for Intel/Marvell's PXA2xx/PXA3xx processor line. - config ARCH_RPC bool "RiscPC" depends on !CC_IS_CLANG && GCC_VERSION < 90100 && GCC_VERSION >= 60000
arch/arm/configs/am200epdkit_defconfig +1 -0
@@ -10,6 +10,7 @@ CONFIG_SLAB=y CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y # CONFIG_BLK_DEV_BSG is not set +# CONFIG_ARCH_MULTI_V7 is not set CONFIG_ARCH_PXA=y CONFIG_ARCH_GUMSTIX=y CONFIG_PCCARD=y
arch/arm/configs/cm_x300_defconfig +1 -0
@@ -10,6 +10,7 @@ CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_FORCE_UNLOAD=y # CONFIG_BLK_DEV_BSG is not set +# CONFIG_ARCH_MULTI_V7 is not set CONFIG_ARCH_PXA=y CONFIG_GPIO_PCA953X=y CONFIG_MACH_CM_X300=y
arch/arm/configs/colibri_pxa270_defconfig +1 -0
@@ -16,6 +16,7 @@ CONFIG_MODULE_FORCE_UNLOAD=y CONFIG_MODVERSIONS=y CONFIG_MODULE_SRCVERSION_ALL=y # CONFIG_BLK_DEV_BSG is not set +# CONFIG_ARCH_MULTI_V7 is not set CONFIG_ARCH_PXA=y CONFIG_MACH_COLIBRI=y CONFIG_PREEMPT=y
arch/arm/configs/colibri_pxa300_defconfig +1 -0
@@ -1,6 +1,7 @@ CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y # CONFIG_BLK_DEV_BSG is not set +# CONFIG_ARCH_MULTI_V7 is not set CONFIG_ARCH_PXA=y CONFIG_MACH_COLIBRI300=y CONFIG_AEABI=y
arch/arm/configs/corgi_defconfig +1 -0
@@ -9,6 +9,7 @@ CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_FORCE_UNLOAD=y # CONFIG_BLK_DEV_BSG is not set +# CONFIG_ARCH_MULTI_V7 is not set CONFIG_ARCH_PXA=y CONFIG_PXA_SHARPSL=y CONFIG_MACH_POODLE=y
arch/arm/configs/eseries_pxa_defconfig +1 -0
@@ -9,6 +9,7 @@ CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_FORCE_UNLOAD=y # CONFIG_BLK_DEV_BSG is not set +# CONFIG_ARCH_MULTI_V7 is not set CONFIG_ARCH_PXA=y CONFIG_ARCH_PXA_ESERIES=y # CONFIG_ARM_THUMB is not set
arch/arm/configs/ezx_defconfig +1 -0
@@ -14,6 +14,7 @@ CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_FORCE_UNLOAD=y CONFIG_MODVERSIONS=y # CONFIG_BLK_DEV_BSG is not set +# CONFIG_ARCH_MULTI_V7 is not set CONFIG_ARCH_PXA=y CONFIG_PXA_EZX=y CONFIG_NO_HZ=y
arch/arm/configs/h5000_defconfig +1 -0
@@ -10,6 +10,7 @@ CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_FORCE_UNLOAD=y # CONFIG_BLK_DEV_BSG is not set +# CONFIG_ARCH_MULTI_V7 is not set CONFIG_ARCH_PXA=y CONFIG_MACH_H5000=y CONFIG_AEABI=y
arch/arm/configs/imote2_defconfig +1 -0
@@ -13,6 +13,7 @@ CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_FORCE_UNLOAD=y CONFIG_MODVERSIONS=y # CONFIG_BLK_DEV_BSG is not set +# CONFIG_ARCH_MULTI_V7 is not set CONFIG_ARCH_PXA=y CONFIG_MACH_INTELMOTE2=y CONFIG_NO_HZ=y
arch/arm/configs/lpd270_defconfig +1 -0
@@ -2,6 +2,7 @@ CONFIG_SYSVIPC=y CONFIG_LOG_BUF_SHIFT=14 CONFIG_SLAB=y CONFIG_MODULES=y +# CONFIG_ARCH_MULTI_V7 is not set CONFIG_ARCH_PXA=y CONFIG_MACH_LOGICPD_PXA270=y # CONFIG_ARM_THUMB is not set
arch/arm/configs/lubbock_defconfig +1 -0
@@ -1,6 +1,7 @@ CONFIG_SYSVIPC=y CONFIG_LOG_BUF_SHIFT=14 CONFIG_MODULES=y +# CONFIG_ARCH_MULTI_V7 is not set CONFIG_ARCH_PXA=y CONFIG_ARCH_LUBBOCK=y # CONFIG_ARM_THUMB is not set
arch/arm/configs/magician_defconfig +1 -0
@@ -9,6 +9,7 @@ CONFIG_SLAB=y CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y # CONFIG_BLK_DEV_BSG is not set +# CONFIG_ARCH_MULTI_V7 is not set CONFIG_ARCH_PXA=y CONFIG_MACH_H4700=y CONFIG_MACH_MAGICIAN=y
arch/arm/configs/mainstone_defconfig +1 -0
@@ -1,6 +1,7 @@ CONFIG_SYSVIPC=y CONFIG_LOG_BUF_SHIFT=14 CONFIG_MODULES=y +# CONFIG_ARCH_MULTI_V7 is not set CONFIG_ARCH_PXA=y CONFIG_MACH_MAINSTONE=y # CONFIG_ARM_THUMB is not set
arch/arm/configs/palmz72_defconfig +1 -0
@@ -7,6 +7,7 @@ CONFIG_SLAB=y CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y # CONFIG_BLK_DEV_BSG is not set +# CONFIG_ARCH_MULTI_V7 is not set CONFIG_ARCH_PXA=y CONFIG_ARCH_PXA_PALM=y # CONFIG_MACH_PALMTX is not set
arch/arm/configs/pcm027_defconfig +1 -0
@@ -13,6 +13,7 @@ CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_FORCE_UNLOAD=y # CONFIG_BLK_DEV_BSG is not set +# CONFIG_ARCH_MULTI_V7 is not set CONFIG_ARCH_PXA=y CONFIG_MACH_PCM027=y CONFIG_MACH_PCM990_BASEBOARD=y
arch/arm/configs/pxa255-idp_defconfig +1 -0
@@ -1,6 +1,7 @@ CONFIG_SYSVIPC=y CONFIG_LOG_BUF_SHIFT=14 CONFIG_MODULES=y +# CONFIG_ARCH_MULTI_V7 is not set CONFIG_ARCH_PXA=y CONFIG_ARCH_PXA_IDP=y # CONFIG_ARM_THUMB is not set
arch/arm/configs/pxa3xx_defconfig +1 -0
@@ -6,6 +6,7 @@ CONFIG_KALLSYMS_ALL=y CONFIG_SLAB=y CONFIG_MODULES=y # CONFIG_BLK_DEV_BSG is not set +# CONFIG_ARCH_MULTI_V7 is not set CONFIG_ARCH_PXA=y CONFIG_MACH_LITTLETON=y CONFIG_MACH_TAVOREVB=y
arch/arm/configs/pxa_defconfig +1 -0
@@ -23,6 +23,7 @@ CONFIG_MODULE_SRCVERSION_ALL=y CONFIG_PARTITION_ADVANCED=y CONFIG_LDM_PARTITION=y CONFIG_CMDLINE_PARTITION=y +# CONFIG_ARCH_MULTI_V7 is not set CONFIG_ARCH_PXA=y CONFIG_ARCH_LUBBOCK=y CONFIG_MACH_MAINSTONE=y
arch/arm/configs/spitz_defconfig +1 -0
@@ -9,6 +9,7 @@ CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_FORCE_UNLOAD=y # CONFIG_BLK_DEV_BSG is not set +# CONFIG_ARCH_MULTI_V7 is not set CONFIG_ARCH_PXA=y CONFIG_PXA_SHARPSL=y CONFIG_MACH_AKITA=y
arch/arm/configs/trizeps4_defconfig +1 -0
@@ -14,6 +14,7 @@ CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_FORCE_UNLOAD=y CONFIG_MODVERSIONS=y CONFIG_MODULE_SRCVERSION_ALL=y +# CONFIG_ARCH_MULTI_V7 is not set CONFIG_ARCH_PXA=y CONFIG_TRIZEPS_PXA=y CONFIG_MACH_TRIZEPS4=y
arch/arm/configs/viper_defconfig +1 -0
@@ -9,6 +9,7 @@ CONFIG_SLAB=y CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y # CONFIG_BLK_DEV_BSG is not set +# CONFIG_ARCH_MULTI_V7 is not set CONFIG_ARCH_PXA=y CONFIG_ARCH_VIPER=y CONFIG_IWMMXT=y
arch/arm/configs/xcep_defconfig +1 -0
@@ -19,6 +19,7 @@ CONFIG_MODULE_UNLOAD=y CONFIG_MODVERSIONS=y CONFIG_MODULE_SRCVERSION_ALL=y # CONFIG_BLOCK is not set +# CONFIG_ARCH_MULTI_V7 is not set CONFIG_ARCH_PXA=y CONFIG_MACH_XCEP=y CONFIG_IWMMXT=y
arch/arm/configs/zeus_defconfig +1 -0
@@ -4,6 +4,7 @@ CONFIG_LOG_BUF_SHIFT=13 CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y # CONFIG_BLK_DEV_BSG is not set +# CONFIG_ARCH_MULTI_V7 is not set CONFIG_ARCH_PXA=y CONFIG_MACH_ARCOM_ZEUS=y CONFIG_PCCARD=m
arch/arm/mach-pxa/Kconfig +14 -0
@@ -1,4 +1,18 @@ # SPDX-License-Identifier: GPL-2.0-only +menuconfig ARCH_PXA + bool "PXA2xx/PXA3xx-based" + depends on ARCH_MULTI_V5 + select ARM_CPU_SUSPEND if PM + select CLKSRC_PXA + select CLKSRC_MMIO + select TIMER_OF + select CPU_XSCALE if !CPU_XSC3 + select GPIO_PXA + select GPIOLIB + select PLAT_PXA + help + Support for Intel/Marvell's PXA2xx/PXA3xx processor line. + if ARCH_PXA menu "Intel PXA2xx/PXA3xx Implementations"
arch/arm/mach-pxa/Makefile.boot deleted +0 -3
@@ -1,3 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only - zreladdr-y += 0xa0008000 -
arch/arm/mach-pxa/include/mach/uncompress.h deleted +0 -70
70 lines not on this page · raw message
Signature · 1 line
2.29.2
Quoted 16 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
This revisits a series I sent a few years ago:
https://lore.kernel.org/lkml/[email protected]/
All the other ARMv5 conversions are under way now, with OMAP1 being the only one still not in linux-next yet, and PXA completing the set.
Most of the patches are unchanged from before, furtunately the PXA code is fairly stable. I addressed Robert's comments, pulled in two patches from Dmitry, and added the last a the final four patches to finish off the multiplatform conversion.
Quoted 5 lines
I hope someone is left to test these on PXA: if this works, I'd like to merge it for 5.19. A git tree with these is available for testing at
https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git/log/?h=pxa-multiplatform-5.18
I have updated the branch based on the feedback I got, and done a preliminary merge into the for-next branch, so this work should show up in linux-next. I expect to rebase this particular branch before the merge window, to add further Acks or fix regressions in place. (I don't do this for the other branches).
Let me know if there are any show-stoppers or patches that need more work. I realize that this is a lot to review and that there is limited reviewer bandwidth as most of the original developers have moved on from PXA a long time ago.
Arnd
Guenter Roeck
maintainerQuoted 15 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
This revisits a series I sent a few years ago:
https://lore.kernel.org/lkml/[email protected]/
All the other ARMv5 conversions are under way now, with OMAP1 being the only one still not in linux-next yet, and PXA completing the set.
Most of the patches are unchanged from before, furtunately the PXA code is fairly stable. I addressed Robert's comments, pulled in two patches from Dmitry, and added the last a the final four patches to finish off the multiplatform conversion.
Quoted 6 lines
I hope someone is left to test these on PXA: if this works, I'd like to merge it for 5.19. A git tree with these is avaialable for testing at
https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git/log/?h=pxa-multiplatform-5.18
Unfortunately that crashes for me when trying to boot from ide. Bisect points to the last patch of the series.
Guenter
---
[ 1.403715] 8<--- cut here --- [ 1.403848] Unable to handle kernel paging request at virtual address feeb000e [ 1.404097] [feeb000e] *pgd=00000000 [ 1.404400] Internal error: Oops: 805 [#1] PREEMPT ARM [ 1.404648] Modules linked in: [ 1.404890] CPU: 0 PID: 22 Comm: pccardd Not tainted 5.18.0-rc3-next-20220422 #1 [ 1.405159] Hardware name: SHARP Borzoi [ 1.405319] PC is at pcmcia_init_one+0xf8/0x27c [ 1.405476] LR is at devres_add+0x40/0x6c [ 1.405611] pc : [<c04bdea0>] lr : [<c044d808>] psr: a0000113 [ 1.405846] sp : c48a5d00 ip : c15f4220 fp : 60000113 [ 1.406026] r10: 00000000 r9 : c48b000e r8 : c48b0000 [ 1.406195] r7 : feeb0000 r6 : feeb000e r5 : c15ec090 r4 : c15ec020 [ 1.406395] r3 : 00000002 r2 : 00000000 r1 : c15f4200 r0 : feeb000e [ 1.406615] Flags: NzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none [ 1.406847] Control: 00007977 Table: a0004000 DAC: 00000071 [ 1.407042] Register r0 information: 0-page vmalloc region starting at 0xfee00000 allocated at pci_reserve_io+0x0/0x38 [ 1.407453] Register r1 information: slab [ 1.407721] Register r2 information: NULL pointer [ 1.407885] Register r3 information: non-paged memory [ 1.408047] Register r4 information: slab [ 1.408179] Register r5 information: slab [ 1.408310] Register r6 information: 0-page vmalloc region starting at 0xfee00000 allocated at pci_reserve_io+0x0/0x38 [ 1.408622] Register r7 information: 0-page vmalloc region starting at 0xfee00000 allocated at pci_reserve_io+0x0/0x38 [ 1.408941] Register r8 information: 0-page vmalloc region starting at 0xc48b0000 allocated at soc_pcmcia_add_one+0xf0/0x370 [ 1.409291] Register r9 information: 0-page vmalloc region starting at 0xc48b0000 allocated at soc_pcmcia_add_one+0xf0/0x370 [ 1.409617] Register r10 information: NULL pointer [ 1.409768] Register r11 information: non-paged memory [ 1.409924] Register r12 information: slab [ 1.410066] Process pccardd (pid: 22, stack limit = 0x(ptrval)) [ 1.410268] Stack: (0xc48a5d00 to 0xc48a6000) [ 1.410448] 5d00: c15ebb78 00000000 0000001a 00000110 00000000 c0ad702c ff00051a c15ec090 [ 1.410694] 5d20: c0b713ec c0b713ec c12f6048 c0b644fc 00000000 00000000 60000113 c053f6bc [ 1.410938] 5d40: c16b3bf0 c15efa88 c09d4e48 00000001 00000007 00000200 0000000f 00000000 [ 1.411174] 5d60: 00000000 00000000 c0b71300 c0ad702c c0b644fc 00000000 c15ec090 c0b713ec [ 1.411410] 5d80: c0b9f980 c04491a8 c15ec090 00000000 60000113 c15ec090 c0b713ec c15ec090 [ 1.411644] 5da0: 00000003 c0449530 c078a988 c0399c90 ffffff08 c0be4d7c c0b713ec c15ec090 [ 1.411882] 5dc0: 00000003 c0b644fc 00000000 00000000 60000113 c04496e0 00000001 c0b713ec [ 1.412117] 5de0: c48a5e2c c15ec090 c0b644fc c0449aa0 00000000 c48a5e2c c04499fc c0be4d50 [ 1.412352] 5e00: c0b644fc c044702c 00000000 c12f407c c16b3bd4 c0ad702c c15ec090 00000001 [ 1.412587] 5e20: c15ec0d4 c0449030 c15ec090 c15ec090 00000001 c0ad702c c15ec090 c15ec090 [ 1.412827] 5e40: c0b77a9c c0448044 c15ec090 00000000 c12f5030 c04458bc 00000001 c009c720 [ 1.413065] 5e60: c15ec090 c04590e4 c15ec090 00000002 c12f6048 c12f6150 c15ec088 c0ad702c [ 1.413307] 5e80: c15ec090 c15ec020 c12f6150 c12f6048 c12f6150 c15ec088 c15ec090 c12f6160 [ 1.413551] 5ea0: 60000113 c0540820 00000000 c12f6048 c12f6150 ffffffe4 c12f6178 c12f6900 [ 1.413804] 5ec0: c0bb6828 c05409e8 00000000 00000011 c12f6048 00000000 c12f6150 c0ba35c8 [ 1.414050] 5ee0: c12f6178 c12f6900 c0bb6828 c074c3a8 c48a5f04 c0ad702c c48a5f10 c074c44c [ 1.414294] 5f00: c098de10 c09acdc0 c12f4fa0 c48a5f1c 000031d0 c0ad702c c12f6048 c12f6048 [ 1.414538] 5f20: 00000000 c12f6150 c0ba35c8 c0540af8 c12f6048 00000000 c12f6150 c053dcd4 [ 1.414791] 5f40: c12f6048 00000000 00000080 c12f6144 c12f6900 c053e704 00000000 c12f6178 [ 1.415037] 5f60: 000030d0 c0ad702c c12f6900 c12f4fe0 c12f21a0 c053e36c c12f6048 c12f6900 [ 1.415282] 5f80: c4809cc0 00000000 00000000 c004d67c c12f4fe0 c004d5a0 00000000 00000000 [ 1.415531] 5fa0: 00000000 00000000 00000000 c0008368 00000000 00000000 00000000 00000000 [ 1.415780] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 1.416025] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000 [ 1.416643] pcmcia_init_one from pcmcia_device_probe+0xe4/0x2a0 [ 1.416882] pcmcia_device_probe from really_probe+0xc8/0x3b4 [ 1.417070] really_probe from __driver_probe_device+0x9c/0x214 [ 1.417255] __driver_probe_device from driver_probe_device+0x38/0xe0 [ 1.417454] driver_probe_device from __device_attach_driver+0xa4/0x11c [ 1.417657] __device_attach_driver from bus_for_each_drv+0x88/0xd8 [ 1.417864] bus_for_each_drv from __device_attach+0xf4/0x194 [ 1.418047] __device_attach from bus_probe_device+0x8c/0x94 [ 1.418224] bus_probe_device from device_add+0x3d0/0x894 [ 1.418395] device_add from pcmcia_device_add+0x2ec/0x3e0 [ 1.418568] pcmcia_device_add from pcmcia_card_add+0xd4/0x1a0 [ 1.418756] pcmcia_card_add from pcmcia_bus_add+0x44/0x4c [ 1.418930] pcmcia_bus_add from socket_insert+0x12c/0x150 [ 1.419103] socket_insert from pccardd+0x398/0x44c [ 1.419257] pccardd from kthread+0xdc/0x114 [ 1.419400] kthread from ret_from_fork+0x14/0x2c [ 1.419569] Exception stack(0xc48a5fb0 to 0xc48a5ff8) [ 1.419735] 5fa0: 00000000 00000000 00000000 00000000 [ 1.419979] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 1.420222] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000 [ 1.420501] Code: 13570000 e1a06000 0a000043 e3a03002 (e5c03000) [ 1.420874] ---[ end trace 0000000000000000 ]---
---
# bad: [7643a9ca9f8e08f71e15f89dd74863635e981e03] ARM: pxa: convert to multiplatform
# good: [3123109284176b1532874591f7c81f3837bbdc17] Linux 5.18-rc1
git bisect start 'HEAD' 'v5.18-rc1'
# good: [9b03d7f95bd4d97101ecb8ea1e822103b81fdb2d] ARM: pxa: mainstone-wm97xx: use gpio lookup table git bisect good 9b03d7f95bd4d97101ecb8ea1e822103b81fdb2d
# good: [764063eee7620ea9abb940068a7ad0e7f9efa1b6] cpufreq: pxa3: move clk register access to clk driver git bisect good 764063eee7620ea9abb940068a7ad0e7f9efa1b6
# good: [5153474f0a4388b7ddb59add4be73bfb42b2007f] ARM: mmp: remove tavorevb board support git bisect good 5153474f0a4388b7ddb59add4be73bfb42b2007f
# good: [2746f7c78b428c8b01b691a29a972c08101ae343] ARM: PXA: fix multi-cpu build of xsc3 git bisect good 2746f7c78b428c8b01b691a29a972c08101ae343
# good: [73d5106e9489464eac84362705e93bcf3b376123] ARM: pxa: remove support for MTD_XIP git bisect good 73d5106e9489464eac84362705e93bcf3b376123
# first bad commit: [7643a9ca9f8e08f71e15f89dd74863635e981e03] ARM: pxa: convert to multiplatform
Quoted 21 lines · Guenter Roeck
Quoted 19 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
This revisits a series I sent a few years ago:
https://lore.kernel.org/lkml/[email protected]/
All the other ARMv5 conversions are under way now, with OMAP1 being the only one still not in linux-next yet, and PXA completing the set.
Most of the patches are unchanged from before, furtunately the PXA code is fairly stable. I addressed Robert's comments, pulled in two patches from Dmitry, and added the last a the final four patches to finish off the multiplatform conversion.
I hope someone is left to test these on PXA: if this works, I'd like to merge it for 5.19. A git tree with these is avaialable for testing at
Quoted 5 lines
Quoted 2 lines
https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git/log/?h=pxa-multiplatform-5.18
Unfortunately that crashes for me when trying to boot from ide. Bisect points to the last patch of the series.
Thanks a lot for testing and the perfect bug report!
Quoted 3 lines
[ 1.403715] 8<--- cut here --- [ 1.403848] Unable to handle kernel paging request at virtual address feeb000e [ 1.404097] [feeb000e] *pgd=00000000
Ok, this is the PCI I/O space area, which starts at 0xfee00000, clearly the way I/O space
gets mapped changed here. I don't yet see what happened, but it should be straightforward
to find from here.
Quoted 37 lines
[ 1.416643] pcmcia_init_one from pcmcia_device_probe+0xe4/0x2a0 [ 1.416882] pcmcia_device_probe from really_probe+0xc8/0x3b4 [ 1.417070] really_probe from __driver_probe_device+0x9c/0x214 [ 1.417255] __driver_probe_device from driver_probe_device+0x38/0xe0 [ 1.417454] driver_probe_device from __device_attach_driver+0xa4/0x11c [ 1.417657] __device_attach_driver from bus_for_each_drv+0x88/0xd8 [ 1.417864] bus_for_each_drv from __device_attach+0xf4/0x194 [ 1.418047] __device_attach from bus_probe_device+0x8c/0x94 [ 1.418224] bus_probe_device from device_add+0x3d0/0x894 [ 1.418395] device_add from pcmcia_device_add+0x2ec/0x3e0 [ 1.418568] pcmcia_device_add from pcmcia_card_add+0xd4/0x1a0 [ 1.418756] pcmcia_card_add from pcmcia_bus_add+0x44/0x4c [ 1.418930] pcmcia_bus_add from socket_insert+0x12c/0x150 [ 1.419103] socket_insert from pccardd+0x398/0x44c [ 1.419257] pccardd from kthread+0xdc/0x114 [ 1.419400] kthread from ret_from_fork+0x14/0x2c [ 1.419569] Exception stack(0xc48a5fb0 to 0xc48a5ff8) [ 1.419735] 5fa0: 00000000 00000000 00000000 00000000 [ 1.419979] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 1.420222] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000 [ 1.420501] Code: 13570000 e1a06000 0a000043 e3a03002 (e5c03000) [ 1.420874] ---[ end trace 0000000000000000 ]------
# bad: [7643a9ca9f8e08f71e15f89dd74863635e981e03] ARM: pxa: convert to multiplatform
# good: [3123109284176b1532874591f7c81f3837bbdc17] Linux 5.18-rc1
git bisect start 'HEAD' 'v5.18-rc1'
# good: [9b03d7f95bd4d97101ecb8ea1e822103b81fdb2d] ARM: pxa: mainstone-wm97xx: use gpio lookup table git bisect good9b03d7f95bd4d97101ecb8ea1e822103b81fdb2d
# good: [764063eee7620ea9abb940068a7ad0e7f9efa1b6] cpufreq: pxa3: move clk register access to clk driver git bisect good764063eee7620ea9abb940068a7ad0e7f9efa1b6
# good: [5153474f0a4388b7ddb59add4be73bfb42b2007f] ARM: mmp: remove tavorevb board support git bisect good5153474f0a4388b7ddb59add4be73bfb42b2007f
# good: [2746f7c78b428c8b01b691a29a972c08101ae343] ARM: PXA: fix multi-cpu build of xsc3 git bisect good2746f7c78b428c8b01b691a29a972c08101ae343
# good: [73d5106e9489464eac84362705e93bcf3b376123] ARM: pxa: remove support forMTD_XIPgit bisect good73d5106e9489464eac84362705e93bcf3b376123
Quoted 1 line
# first bad commit: [7643a9ca9f8e08f71e15f89dd74863635e981e03] ARM: pxa: convert to multiplatform
I'll back out this patch for now while investigating further.
Which machine did you hit this on? Is this on hardware or in qemu?
Arnd
Guenter Roeck
maintainerQuoted 79 lines · Arnd Bergmann
Quoted 21 lines · Guenter Roeck
Quoted 19 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
This revisits a series I sent a few years ago:
https://lore.kernel.org/lkml/[email protected]/
All the other ARMv5 conversions are under way now, with OMAP1 being the only one still not in linux-next yet, and PXA completing the set.
Most of the patches are unchanged from before, furtunately the PXA code is fairly stable. I addressed Robert's comments, pulled in two patches from Dmitry, and added the last a the final four patches to finish off the multiplatform conversion.
I hope someone is left to test these on PXA: if this works, I'd like to merge it for 5.19. A git tree with these is avaialable for testing at
Quoted 5 lines
Quoted 2 lines
https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git/log/?h=pxa-multiplatform-5.18
Unfortunately that crashes for me when trying to boot from ide. Bisect points to the last patch of the series.
Thanks a lot for testing and the perfect bug report!
Quoted 3 lines
[ 1.403715] 8<--- cut here --- [ 1.403848] Unable to handle kernel paging request at virtual address feeb000e [ 1.404097] [feeb000e] *pgd=00000000Ok, this is the PCI I/O space area, which starts at
0xfee00000, clearly the way I/O space
gets mapped changed here. I don't yet see what happened, but it should be straightforward
to find from here.Quoted 37 lines
[ 1.416643] pcmcia_init_one from pcmcia_device_probe+0xe4/0x2a0 [ 1.416882] pcmcia_device_probe from really_probe+0xc8/0x3b4 [ 1.417070] really_probe from __driver_probe_device+0x9c/0x214 [ 1.417255] __driver_probe_device from driver_probe_device+0x38/0xe0 [ 1.417454] driver_probe_device from __device_attach_driver+0xa4/0x11c [ 1.417657] __device_attach_driver from bus_for_each_drv+0x88/0xd8 [ 1.417864] bus_for_each_drv from __device_attach+0xf4/0x194 [ 1.418047] __device_attach from bus_probe_device+0x8c/0x94 [ 1.418224] bus_probe_device from device_add+0x3d0/0x894 [ 1.418395] device_add from pcmcia_device_add+0x2ec/0x3e0 [ 1.418568] pcmcia_device_add from pcmcia_card_add+0xd4/0x1a0 [ 1.418756] pcmcia_card_add from pcmcia_bus_add+0x44/0x4c [ 1.418930] pcmcia_bus_add from socket_insert+0x12c/0x150 [ 1.419103] socket_insert from pccardd+0x398/0x44c [ 1.419257] pccardd from kthread+0xdc/0x114 [ 1.419400] kthread from ret_from_fork+0x14/0x2c [ 1.419569] Exception stack(0xc48a5fb0 to 0xc48a5ff8) [ 1.419735] 5fa0: 00000000 00000000 00000000 00000000 [ 1.419979] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 1.420222] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000 [ 1.420501] Code: 13570000 e1a06000 0a000043 e3a03002 (e5c03000) [ 1.420874] ---[ end trace 0000000000000000 ]------
# bad: [7643a9ca9f8e08f71e15f89dd74863635e981e03] ARM: pxa: convert to multiplatform
# good: [3123109284176b1532874591f7c81f3837bbdc17] Linux 5.18-rc1
git bisect start 'HEAD' 'v5.18-rc1'
# good: [9b03d7f95bd4d97101ecb8ea1e822103b81fdb2d] ARM: pxa: mainstone-wm97xx: use gpio lookup table git bisect good9b03d7f95bd4d97101ecb8ea1e822103b81fdb2d
# good: [764063eee7620ea9abb940068a7ad0e7f9efa1b6] cpufreq: pxa3: move clk register access to clk driver git bisect good764063eee7620ea9abb940068a7ad0e7f9efa1b6
# good: [5153474f0a4388b7ddb59add4be73bfb42b2007f] ARM: mmp: remove tavorevb board support git bisect good5153474f0a4388b7ddb59add4be73bfb42b2007f
# good: [2746f7c78b428c8b01b691a29a972c08101ae343] ARM: PXA: fix multi-cpu build of xsc3 git bisect good2746f7c78b428c8b01b691a29a972c08101ae343
# good: [73d5106e9489464eac84362705e93bcf3b376123] ARM: pxa: remove support forMTD_XIPgit bisect good73d5106e9489464eac84362705e93bcf3b376123Quoted 1 line
# first bad commit: [7643a9ca9f8e08f71e15f89dd74863635e981e03] ARM: pxa: convert to multiplatform
Quoted 4 lines
I'll back out this patch for now while investigating further.
Which machine did you hit this on? Is this on hardware or in qemu?
qemu, as always. borzoi, spitz, terrier, tosa, z2, and sx1 fail. Also, I just noticed that the failure is not always the same. z2 fails to boot from initrd, and sx1 fails to boot completely. I'll do another round of bisects.
Guenter
Quoted 1 line
Arnd
Quoted 8 lines · Guenter Roeck
Quoted 4 lines · Arnd Bergmann
On Fri, Apr 22, 2022 at 7:05 PM Guenter Roeck <[email protected]> wrote:
Which machine did you hit this on? Is this on hardware or in qemu?
qemu, as always. borzoi, spitz, terrier, tosa, z2, and sx1 fail. Also, I just noticed that the failure is not always the same. z2 fails to boot from initrd, and sx1 fails to boot completely.
That's a lot of machines failing, I hope at least we got the same bugs more than once here.
For the I/O space, I found now that PXA was not using the standard virtual I/O address yet, but instead used a NULL-based offset.
I'm not entirely happy with this patch, but this is an outline of what I think we need to fix that: https://pastebin.com/3nVgQsEw
This one is probably incomplete, at least it breaks sa1100 for now, and it adds a bogus CONFIG_PCI dependency. I'm also not sure in what way the last patch in the series triggers it, rather than the one that removed mach/io.h.
I had sx1 booting in qemu at least, with the omap1 multiplatform series only. If you have a custom config for this one, make sure you get the right DEBUG_LL address.
Quoted 1 line
I'll do another round of bisects.
Thanks!
Arnd
Guenter Roeck
maintainerQuoted 23 lines · Arnd Bergmann
Quoted 8 lines · Guenter Roeck
Quoted 4 lines · Arnd Bergmann
On Fri, Apr 22, 2022 at 7:05 PM Guenter Roeck <[email protected]> wrote:
Which machine did you hit this on? Is this on hardware or in qemu?
qemu, as always. borzoi, spitz, terrier, tosa, z2, and sx1 fail. Also, I just noticed that the failure is not always the same. z2 fails to boot from initrd, and sx1 fails to boot completely.
That's a lot of machines failing, I hope at least we got the same bugs more than once here.
For the I/O space, I found now that PXA was not using the standard virtual I/O address yet, but instead used a NULL-based offset.
I'm not entirely happy with this patch, but this is an outline of what I think we need to fix that: https://pastebin.com/3nVgQsEw
This one is probably incomplete, at least it breaks sa1100 for now, and it adds a bogusCONFIG_PCIdependency. I'm also not sure in what way the last patch in the series triggers it, rather than the one that removedmach/io.h.
Quoted 6 lines
I had sx1 booting in qemu at least, with the omap1 multiplatform series only. If you have a custom config for this one, make sure you get the right
DEBUG_LLaddress.Quoted 1 line
I'll do another round of bisects.
So ... z2 bisect points to the same patch, but the error is different. As mentioned, it does not recognize the initrd. Oddly enough, booting from initrd works for the other platforms.
The sx1 boot failure seems to be unrelated to your patch series. It boots fine if built from the tip of your branch, but fails to boot in -next. That will require a bisect from -next.
Guenter
Guenter Roeck
maintainerQuoted 23 lines · Arnd Bergmann
Quoted 8 lines · Guenter Roeck
Quoted 4 lines · Arnd Bergmann
On Fri, Apr 22, 2022 at 7:05 PM Guenter Roeck <[email protected]> wrote:
Which machine did you hit this on? Is this on hardware or in qemu?
qemu, as always. borzoi, spitz, terrier, tosa, z2, and sx1 fail. Also, I just noticed that the failure is not always the same. z2 fails to boot from initrd, and sx1 fails to boot completely.
That's a lot of machines failing, I hope at least we got the same bugs more than once here.
For the I/O space, I found now that PXA was not using the standard virtual I/O address yet, but instead used a NULL-based offset.
I'm not entirely happy with this patch, but this is an outline of what I think we need to fix that: https://pastebin.com/3nVgQsEw
This one is probably incomplete, at least it breaks sa1100 for now, and it adds a bogusCONFIG_PCIdependency. I'm also not sure in what way the last patch in the series triggers it, rather than the one that removedmach/io.h.
Quoted 6 lines
I had sx1 booting in qemu at least, with the omap1 multiplatform series only. If you have a custom config for this one, make sure you get the right
DEBUG_LLaddress.Quoted 1 line
I'll do another round of bisects.
Here is the bisect for the sx1 boot failure.
Guenter
---
# bad: [e7d6987e09a328d4a949701db40ef63fbb970670] Add linux-next specific files for 20220422
# good: [b2d229d4ddb17db541098b83524d901257e93845] Linux 5.18-rc3
git bisect start 'HEAD' 'v5.18-rc3'
# bad: [479506a21bd2df998017a00f4fe0ea893039d9d0] Merge branch 'drm-next' of git://git.freedesktop.org/git/drm/drm.git
git bisect bad 479506a21bd2df998017a00f4fe0ea893039d9d0
# bad: [84fdc506ff63f3f8eb7feaac87821c39bf1dbdfd] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git
git bisect bad 84fdc506ff63f3f8eb7feaac87821c39bf1dbdfd
# bad: [0318e72d28be01b99056a7e66572423682eae2bb] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git
git bisect bad 0318e72d28be01b99056a7e66572423682eae2bb
# good: [813d98e2e26d3f418d925263a82d72d1454b326e] Merge branch 'zstd-linus' of https://github.com/terrelln/linux.git
git bisect good 813d98e2e26d3f418d925263a82d72d1454b326e
# bad: [5e87f91cfe6e938eccb88a992687e2ac52eec2a7] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git
git bisect bad 5e87f91cfe6e938eccb88a992687e2ac52eec2a7
# bad: [ac4b03d5ad6b887558eb94943f0f2834661dee45] Merge branch 'pxa-multiplatform-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc into arm/multiplatform-late git bisect bad ac4b03d5ad6b887558eb94943f0f2834661dee45
# good: [6eab9bfd712f63c0977f2d38a45f321816030707] Merge branch 'omap1/multiplatform-prep' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc into arm/multiplatform git bisect good 6eab9bfd712f63c0977f2d38a45f321816030707
# good: [ac571609a9fab9b94bbd8e634ba20e2ab672e32d] input: touchscreen: mainstone: sync with zylonite driver
git bisect good ac571609a9fab9b94bbd8e634ba20e2ab672e32d
# good: [77b9aeb6e3cd4de6b320d3a9be5d692594159f9e] ARM: pxa: remove unused mach/bitfield.h
git bisect good 77b9aeb6e3cd4de6b320d3a9be5d692594159f9e
# good: [7643a9ca9f8e08f71e15f89dd74863635e981e03] ARM: pxa: convert to multiplatform
git bisect good 7643a9ca9f8e08f71e15f89dd74863635e981e03
# good: [bdfb692acfa98c3e8135ab44bc8366636443590a] [MERGED] ASoC: ti: osk5912: Make it CCF clk API compatible
git bisect good bdfb692acfa98c3e8135ab44bc8366636443590a
# bad: [b59e8a5fd321fe44bdabd38908b4f899f933cf0f] [TO BE REBASED] ARM: omap1: enable multiplatform
git bisect bad b59e8a5fd321fe44bdabd38908b4f899f933cf0f
# good: [4c4467ac74299b14b8cf74406722af8090aa7766] [TO BE REBASED] ARM: OMAP1: clock: Convert to CCF
git bisect good 4c4467ac74299b14b8cf74406722af8090aa7766
# first bad commit: [b59e8a5fd321fe44bdabd38908b4f899f933cf0f] [TO BE REBASED] ARM: omap1: enable multiplatform
Quoted 25 lines · Guenter Roeck
Quoted 23 lines · Arnd Bergmann
Quoted 8 lines · Guenter Roeck
Quoted 4 lines · Arnd Bergmann
On Fri, Apr 22, 2022 at 7:05 PM Guenter Roeck <[email protected]> wrote:
Which machine did you hit this on? Is this on hardware or in qemu?
qemu, as always. borzoi, spitz, terrier, tosa, z2, and sx1 fail. Also, I just noticed that the failure is not always the same. z2 fails to boot from initrd, and sx1 fails to boot completely.
That's a lot of machines failing, I hope at least we got the same bugs more than once here.
For the I/O space, I found now that PXA was not using the standard virtual I/O address yet, but instead used a NULL-based offset.
I'm not entirely happy with this patch, but this is an outline of what I think we need to fix that: https://pastebin.com/3nVgQsEw
This one is probably incomplete, at least it breaks sa1100 for now, and it adds a bogusCONFIG_PCIdependency. I'm also not sure in what way the last patch in the series triggers it, rather than the one that removedmach/io.h.
Quoted 8 lines
Quoted 6 lines
I had sx1 booting in qemu at least, with the omap1 multiplatform series only. If you have a custom config for this one, make sure you get the right
DEBUG_LLaddress.Quoted 1 line
I'll do another round of bisects.
Here is the bisect for the sx1 boot failure.
Odd, I can't reproduce this at all. Do you get any console output at all for this?
Is this the plain omap1_defconfig, or something else?
One thing I keep having to apply myself is this snippet:
arch/arm/mm/proc-arm925.S +0 -0
@@ -441,7 +441,6 @@ __arm925_setup: #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH mov r0, #4 @ disable write-back
on caches explicitly
- mcr p15, 7, r0, c15, c0, 0
#endif
adr r5, arm925_crval
I don't remember what the story is behind this, but I can't actually manage to boot omap1_defconfig on qemu with the instruction intact.
Arnd
Guenter Roeck
maintainerQuoted 33 lines · Arnd Bergmann
Quoted 32 lines · Guenter Roeck
Quoted 29 lines · Arnd Bergmann
Quoted 8 lines · Guenter Roeck
Quoted 4 lines · Arnd Bergmann
On Fri, Apr 22, 2022 at 7:05 PM Guenter Roeck <[email protected]> wrote:
Which machine did you hit this on? Is this on hardware or in qemu?
qemu, as always. borzoi, spitz, terrier, tosa, z2, and sx1 fail. Also, I just noticed that the failure is not always the same. z2 fails to boot from initrd, and sx1 fails to boot completely.
That's a lot of machines failing, I hope at least we got the same bugs more than once here.
For the I/O space, I found now that PXA was not using the standard virtual I/O address yet, but instead used a NULL-based offset.
I'm not entirely happy with this patch, but this is an outline of what I think we need to fix that: https://pastebin.com/3nVgQsEw
This one is probably incomplete, at least it breaks sa1100 for now, and it adds a bogusCONFIG_PCIdependency. I'm also not sure in what way the last patch in the series triggers it, rather than the one that removedmach/io.h.I had sx1 booting in qemu at least, with the omap1 multiplatform series only. If you have a custom config for this one, make sure you get the right
DEBUG_LLaddress.Quoted 1 line
I'll do another round of bisects.
Quoted 7 lines
Quoted 1 line
Here is the bisect for the sx1 boot failure.
Odd, I can't reproduce this at all. Do you get any console output at all for this?
Is this the plain
omap1_defconfig, or something else?
No, it is my own sx1 specific configuration.
https://github.com/groeck/linux-build-test/blob/master/rootfs/arm/qemu_sx1_defconfig
I don't recall where I got it from but ...
Quoted 10 lines
One thing I keep having to apply myself is this snippet:
arch/arm/mm/proc-arm925.S +0
-0@@ -441,7 +441,6 @@ __arm925_setup: #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH mov r0, #4 @ disable write-back
Quoted 3 lines
on caches explicitly
- mcr p15, 7, r0, c15, c0, 0
#endif
it does not have CONFIG_CPU_DCACHE_WRITETHROUGH enabled.
Guenter
Quoted 7 lines
adr r5,
arm925_crvalI don't remember what the story is behind this, but I can't actually manage to boot
omap1_defconfigon qemu with the instruction intact.Arnd
Quoted 7 lines · Guenter Roeck
Quoted 6 lines · Arnd Bergmann
Quoted 1 line · Guenter Roeck
On Sat, Apr 23, 2022 at 12:04:31AM +0200, Arnd Bergmann wrote:
Odd, I can't reproduce this at all. Do you get any console output at all for this?
Quoted 8 lines
Quoted 2 lines
Is this the plain
omap1_defconfig, or something else?No, it is my own sx1 specific configuration.
https://github.com/groeck/linux-build-test/blob/master/rootfs/arm/qemu_sx1_defconfig
I don't recall where I got it from but ...
Ok, that explains it, thanks!
I fixed all the defconfig files that come with the kernel, but for your own ones you have to add
# CONFIG_ARCH_MULTI_V7 is not set
into the defconfig file, otherwise the multiplatform target defaults to an ARMv7 instead of ARMv5 build. For an OMAP15xx as in the SX1, you also need to enable CONFIG_ARCH_MULTI_V4T.
This is slightly unfortunate, but I don't see any way to avoid it, and the modified defconfig will still work fine with older kernel trees.
Quoted 8 lines
Quoted 8 lines
One thing I keep having to apply myself is this snippet:
arch/arm/mm/proc-arm925.S +0
-0@@ -441,7 +441,6 @@ __arm925_setup:
Quoted 7 lines
Quoted 5 lines
arch/arm/mm/proc-arm925.S +0
-0#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH mov r0, #4 @ disable write-backon caches explicitly
- mcr p15, 7, r0, c15, c0, 0
#endifit does not have
CONFIG_CPU_DCACHE_WRITETHROUGHenabled.
Maybe it was disabled explicitly for the sx1_defconfig because of this bug. I would think that this is required for actual sx1 hardware because the option is default-enabled for ARM925T, and that CPU core is exclusively used in OMAP15xx.
Arnd
Guenter Roeck
maintainerQuoted 22 lines · Arnd Bergmann
Quoted 7 lines · Guenter Roeck
Quoted 6 lines · Arnd Bergmann
Quoted 1 line · Guenter Roeck
On Sat, Apr 23, 2022 at 12:04:31AM +0200, Arnd Bergmann wrote:
Odd, I can't reproduce this at all. Do you get any console output at all for this?
Quoted 8 lines
Quoted 2 lines
Is this the plain
omap1_defconfig, or something else?No, it is my own sx1 specific configuration.
https://github.com/groeck/linux-build-test/blob/master/rootfs/arm/qemu_sx1_defconfig
I don't recall where I got it from but ...
Ok, that explains it, thanks!
I fixed all the defconfig files that come with the kernel, but for your own ones you have to add
Quoted 9 lines
#
CONFIG_ARCH_MULTI_V7is not setinto the defconfig file, otherwise the multiplatform target defaults to an ARMv7 instead of ARMv5 build. For an OMAP15xx as in the SX1, you also need to enable
CONFIG_ARCH_MULTI_V4T.This is slightly unfortunate, but I don't see any way to avoid it, and the modified defconfig will still work fine with older kernel trees.
Yes, that works. I changed it in my configuration.
Quoted 16 lines
Quoted 8 lines
Quoted 8 lines
One thing I keep having to apply myself is this snippet:
arch/arm/mm/proc-arm925.S +0
-0@@ -441,7 +441,6 @@ __arm925_setup:Quoted 7 lines
Quoted 5 lines
arch/arm/mm/proc-arm925.S +0
-0#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH mov r0, #4 @ disable write-backon caches explicitly
- mcr p15, 7, r0, c15, c0, 0
#endifit does not have
CONFIG_CPU_DCACHE_WRITETHROUGHenabled.
Quoted 5 lines
Maybe it was disabled explicitly for the
sx1_defconfigbecause of this bug. I would think that this is required for actual sx1 hardware because the option is default-enabled for ARM925T, and that CPU core is exclusively used in OMAP15xx.
That looks like a bug in qemu. ARM925T instruction support is limited to V4T instructions. qemu doesn't have explicit 5T support. It is either V4T or V5.
Guenter
Quoted 11 lines · Guenter Roeck
Quoted 8 lines · Arnd Bergmann
On Sun, Apr 24, 2022 at 4:09 AM Guenter Roeck <[email protected]> wrote:
into the defconfig file, otherwise the multiplatform target defaults to an ARMv7 instead of ARMv5 build. For an OMAP15xx as in the SX1, you also need to enableCONFIG_ARCH_MULTI_V4T.This is slightly unfortunate, but I don't see any way to avoid it, and the modified defconfig will still work fine with older kernel trees.
Yes, that works. I changed it in my configuration.
Ok, great!. I managed to boot the z2 machine with PCMCIA support and it gets around the issue with my patch, correctly detecting the CF card.
Quoted 22 lines
Quoted 16 lines
Quoted 8 lines
Quoted 8 lines
One thing I keep having to apply myself is this snippet:
arch/arm/mm/proc-arm925.S +0
-0@@ -441,7 +441,6 @@ __arm925_setup:Quoted 7 lines
Quoted 5 lines
arch/arm/mm/proc-arm925.S +0
-0#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH mov r0, #4 @ disable write-backon caches explicitly
- mcr p15, 7, r0, c15, c0, 0
#endifit does not have
CONFIG_CPU_DCACHE_WRITETHROUGHenabled.Quoted 5 lines
Maybe it was disabled explicitly for the
sx1_defconfigbecause of this bug. I would think that this is required for actual sx1 hardware because the option is default-enabled for ARM925T, and that CPU core is exclusively used in OMAP15xx.
Quoted 3 lines
That looks like a bug in qemu. ARM925T instruction support is limited to V4T instructions. qemu doesn't have explicit 5T support. It is either V4T or V5.
I'm not entirely sure what instructions the CPU supports, but Linux treats it as ARMv4T as well, and qemu supports some of the 925t specific instructions as "ti925t" in target/arm/cpu_tcg.c, it just seems it's missing some others.
Arnd
Quoted 11 lines · Arnd Bergmann
Quoted 10 lines · Guenter Roeck
Quoted 8 lines · Arnd Bergmann
On Sun, Apr 24, 2022 at 4:09 AM Guenter Roeck <[email protected]> wrote:
into the defconfig file, otherwise the multiplatform target defaults to an ARMv7 instead of ARMv5 build. For an OMAP15xx as in the SX1, you also need to enableCONFIG_ARCH_MULTI_V4T.This is slightly unfortunate, but I don't see any way to avoid it, and the modified defconfig will still work fine with older kernel trees.
Quoted 5 lines
Quoted 1 line
Yes, that works. I changed it in my configuration.
Ok, great!. I managed to boot the z2 machine with PCMCIA support and it gets around the issue with my patch, correctly detecting the CF card.
Hi Guenter,
I have now sent out a fix that I'm happy with, and applied it to the pxa-multiplatform-5.18 branch of the soc tree as well as the combined arm/multiplatform tree.
I have not merged this new version into the for-next branch since I would like to see if there are any other regressions first.
Can you run your boot tests on the arm/multiplatform branch and let me know if that fixes everything you found? If that takes a lot of manual steps on your side, I'd just wait for the build bots and merge it after all there are no new compile-time issues.
Arnd
Guenter Roeck
maintainerQuoted 24 lines · Arnd Bergmann
Quoted 11 lines · Arnd Bergmann
Quoted 10 lines · Guenter Roeck
Quoted 8 lines · Arnd Bergmann
On Sun, Apr 24, 2022 at 4:09 AM Guenter Roeck <[email protected]> wrote:
into the defconfig file, otherwise the multiplatform target defaults to an ARMv7 instead of ARMv5 build. For an OMAP15xx as in the SX1, you also need to enableCONFIG_ARCH_MULTI_V4T.This is slightly unfortunate, but I don't see any way to avoid it, and the modified defconfig will still work fine with older kernel trees.
Quoted 5 lines
Quoted 1 line
Yes, that works. I changed it in my configuration.
Ok, great!. I managed to boot the z2 machine with PCMCIA support and it gets around the issue with my patch, correctly detecting the CF card.
Hi Guenter,
I have now sent out a fix that I'm happy with, and applied it to the pxa-multiplatform-5.18 branch of the soc tree as well as the combined arm/multiplatform tree.
Quoted 9 lines
I have not merged this new version into the for-next branch since I would like to see if there are any other regressions first.
Can you run your boot tests on the arm/multiplatform branch and let me know if that fixes everything you found? If that takes a lot of manual steps on your side, I'd just wait for the build bots and merge it after all there are no new compile-time issues.
-next is pretty badly broken right now due to a series of less than perfect mm patches, so testing there won't do any good.
I'll see if I can dig up the multiplatform branch and push it into my 'testing' branch.
Guenter
Guenter Roeck
maintainerQuoted 24 lines · Arnd Bergmann
Quoted 11 lines · Arnd Bergmann
Quoted 10 lines · Guenter Roeck
Quoted 8 lines · Arnd Bergmann
On Sun, Apr 24, 2022 at 4:09 AM Guenter Roeck <[email protected]> wrote:
into the defconfig file, otherwise the multiplatform target defaults to an ARMv7 instead of ARMv5 build. For an OMAP15xx as in the SX1, you also need to enableCONFIG_ARCH_MULTI_V4T.This is slightly unfortunate, but I don't see any way to avoid it, and the modified defconfig will still work fine with older kernel trees.
Quoted 5 lines
Quoted 1 line
Yes, that works. I changed it in my configuration.
Ok, great!. I managed to boot the z2 machine with PCMCIA support and it gets around the issue with my patch, correctly detecting the CF card.
Hi Guenter,
I have now sent out a fix that I'm happy with, and applied it to the pxa-multiplatform-5.18 branch of the soc tree as well as the combined arm/multiplatform tree.
Quoted 9 lines
I have not merged this new version into the for-next branch since I would like to see if there are any other regressions first.
Can you run your boot tests on the arm/multiplatform branch and let me know if that fixes everything you found? If that takes a lot of manual steps on your side, I'd just wait for the build bots and merge it after all there are no new compile-time issues.
I tried the pxa-multiplatform-5.18 branch. Its failures match those in v5.18-rc1.
Should I try soc/arm/multiplatform as well ?
Guenter