The following commit has been merged in the master branch: commit 96479c09803b21d195c95fd4b145cd3a5a591ba0 Merge: 58f9d52ff689a262bec7f5713c07f5a79e115168 3d76c9f5e0ee842ad42e482669d7fd63d4b67867 Author: Linus Torvalds torvalds@linux-foundation.org Date: Thu Jun 2 15:23:54 2022 -0700
Merge tag 'arm-multiplatform-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
Pull more ARM multiplatform updates from Arnd Bergmann: "The second part of the multiplatform changes now converts the Intel/Marvell PXA platform along with the rest. The patches went through several rebases before the merge window as bugs were found, so they remained separate.
This has to touch a lot of drivers, in particular the touchscreen, pcmcia, sound and clk bits, to detach the driver files from the platform and board specific header files"
* tag 'arm-multiplatform-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (48 commits) ARM: pxa/mmp: remove traces of plat-pxa ARM: pxa: convert to multiplatform ARM: pxa/sa1100: move I/O space to PCI_IOBASE ARM: pxa: remove support for MTD_XIP ARM: pxa: move mach/*.h to mach-pxa/ ARM: PXA: fix multi-cpu build of xsc3 ARM: pxa: move plat-pxa to drivers/soc/ ARM: mmp: rename pxa_register_device ARM: mmp: remove tavorevb board support ARM: pxa: remove unused mach/bitfield.h ARM: pxa: move clk register definitions to driver ARM: pxa: move smemc register access from clk to platform cpufreq: pxa3: move clk register access to clk driver ARM: pxa: remove get_clk_frequency_khz() ARM: pxa: pcmcia: move smemc configuration back to arch ASoC: pxa: i2s: use normal MMIO accessors ASoC: pxa: ac97: use normal MMIO accessors ASoC: pxa: use pdev resource for FIFO regs Input: wm97xx - get rid of irq_enable method in wm97xx_mach_ops Input: wm97xx - switch to using threaded IRQ ...
diff --combined arch/arm/Kconfig index 903165a400a7,001f77e0058c..41b8b28b7a2d --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@@ -347,9 -347,22 +347,9 @@@ config ARCH_MULTIPLATFOR select SPARSE_IRQ select USE_OF
-config ARCH_EP93XX - bool "EP93xx-based" - select ARCH_SPARSEMEM_ENABLE - select ARM_AMBA - imply ARM_PATCH_PHYS_VIRT - select ARM_VIC - select AUTO_ZRELADDR - select CLKSRC_MMIO - select CPU_ARM920T - select GPIOLIB - select COMMON_CLK - help - This enables support for the Cirrus EP93xx series of CPUs. - config ARCH_FOOTBRIDGE bool "FootBridge" + depends on CPU_LITTLE_ENDIAN select CPU_SA110 select FOOTBRIDGE select NEED_MACH_MEMORY_H @@@ -357,29 -370,50 +357,10 @@@ Support for systems based on the DC21285 companion chip ("FootBridge"), such as the Simtec CATS and the Rebel NetWinder.
- config ARCH_PXA - bool "PXA2xx/PXA3xx-based" - depends on CPU_LITTLE_ENDIAN - select ARCH_MTD_XIP - 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 -config ARCH_IOP32X - bool "IOP32x-based" - select CPU_XSCALE - select GPIO_IOP -- select GPIOLIB - select IRQ_DOMAIN - select PLAT_PXA - select FORCE_PCI - select PLAT_IOP - help - Support for Intel's 80219 and IOP32X (XScale) family of - processors. - -config ARCH_IXP4XX - bool "IXP4xx-based" - select ARCH_SUPPORTS_BIG_ENDIAN - select ARM_PATCH_PHYS_VIRT - select CPU_XSCALE - select GPIO_IXP4XX - select GPIOLIB - select HAVE_PCI - select IXP4XX_IRQ - select IXP4XX_TIMER -- select SPARSE_IRQ - select USB_EHCI_BIG_ENDIAN_DESC - select USB_EHCI_BIG_ENDIAN_MMIO -- help - Support for Intel/Marvell's PXA2xx/PXA3xx processor line. - Support for Intel's IXP4XX (XScale) family of processors. - -config ARCH_DOVE - bool "Marvell Dove" - select CPU_PJ4 - select GPIOLIB - select HAVE_PCI - select MVEBU_MBUS - select PINCTRL - select PINCTRL_DOVE - select PLAT_ORION_LEGACY - select SPARSE_IRQ - select PM_GENERIC_DOMAINS if PM - help - Support for the Marvell Dove SoC 88AP510 -- config ARCH_RPC bool "RiscPC" depends on !CC_IS_CLANG && GCC_VERSION < 90100 && GCC_VERSION >= 60000 + depends on CPU_LITTLE_ENDIAN select ARCH_ACORN select ARCH_MAY_HAVE_PC_FDC select ARCH_SPARSEMEM_ENABLE @@@ -398,7 -432,6 +379,7 @@@
config ARCH_SA1100 bool "SA1100-based" + depends on CPU_LITTLE_ENDIAN select ARCH_MTD_XIP select ARCH_SPARSEMEM_ENABLE select CLKSRC_MMIO @@@ -415,15 -448,33 +396,15 @@@ help Support for StrongARM 11x0 based boards.
-config ARCH_S3C24XX - bool "Samsung S3C24XX SoCs" - select ATAGS - select CLKSRC_SAMSUNG_PWM - select GPIO_SAMSUNG - select GPIOLIB - select NEED_MACH_IO_H - select S3C2410_WATCHDOG - select SAMSUNG_ATAGS - select USE_OF - select WATCHDOG - help - Samsung S3C2410, S3C2412, S3C2413, S3C2416, S3C2440, S3C2442, S3C2443 - and S3C2450 SoCs based systems, such as the Simtec Electronics BAST - (http://www.simtec.co.uk/products/EB110ITX/), the IPAQ 1940 or the - Samsung SMDK2410 development board (and derivatives). - config ARCH_OMAP1 bool "TI OMAP1" - select ARCH_OMAP + depends on CPU_LITTLE_ENDIAN select CLKSRC_MMIO + select FORCE_PCI if PCCARD select GENERIC_IRQ_CHIP select GPIOLIB select HAVE_LEGACY_CLK select IRQ_DOMAIN - select NEED_MACH_IO_H if PCCARD - select NEED_MACH_MEMORY_H select SPARSE_IRQ help Support for older TI OMAP1 (omap7xx, omap15xx or omap16xx) @@@ -492,6 -543,7 +473,6 @@@ config ARCH_VIR select ARM_GIC_V3_ITS if PCI select ARM_PSCI select HAVE_ARM_ARCH_TIMER - select ARCH_SUPPORTS_BIG_ENDIAN
config ARCH_AIROHA bool "Airoha SoC Support" @@@ -552,6 -604,8 +533,6 @@@ source "arch/arm/mach-hisi/Kconfig
source "arch/arm/mach-imx/Kconfig"
-source "arch/arm/mach-integrator/Kconfig" - source "arch/arm/mach-iop32x/Kconfig"
source "arch/arm/mach-ixp4xx/Kconfig" @@@ -584,6 -638,8 +565,6 @@@ source "arch/arm/mach-npcm/Kconfig
source "arch/arm/mach-nspire/Kconfig"
-source "arch/arm/plat-omap/Kconfig" - source "arch/arm/mach-omap1/Kconfig"
source "arch/arm/mach-omap2/Kconfig" @@@ -593,7 -649,6 +574,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"
@@@ -601,6 -656,8 +581,6 @@@ source "arch/arm/mach-rda/Kconfig
source "arch/arm/mach-realtek/Kconfig"
-source "arch/arm/mach-realview/Kconfig" - source "arch/arm/mach-rockchip/Kconfig"
source "arch/arm/mach-s3c/Kconfig" @@@ -629,6 -686,8 +609,6 @@@ source "arch/arm/mach-ux500/Kconfig
source "arch/arm/mach-versatile/Kconfig"
-source "arch/arm/mach-vexpress/Kconfig" - source "arch/arm/mach-vt8500/Kconfig"
source "arch/arm/mach-zynq/Kconfig" @@@ -661,6 -720,9 +641,6 @@@ config ARCH_MPS config ARCH_ACORN bool
-config PLAT_IOP - bool - config PLAT_ORION bool select CLKSRC_MMIO @@@ -672,9 -734,6 +652,6 @@@ config PLAT_ORION_LEGAC bool select PLAT_ORION
- config PLAT_PXA - bool - config PLAT_VERSATILE bool
@@@ -891,17 -950,6 +868,17 @@@ config ARM_ERRATA_76436 relevant cache maintenance functions and sets a specific bit in the diagnostic control register of the SCU.
+config ARM_ERRATA_764319 + bool "ARM errata: Read to DBGPRSR and DBGOSLSR may generate Undefined instruction" + depends on CPU_V7 + help + This option enables the workaround for the 764319 Cortex A-9 erratum. + CP14 read accesses to the DBGPRSR and DBGOSLSR registers generate an + unexpected Undefined Instruction exception when the DBGSWENABLE + external pin is set to 0, even when the CP14 accesses are performed + from a privileged mode. This work around catches the exception in a + way the kernel does not stop execution. + config ARM_ERRATA_775420 bool "ARM errata: A data cache maintenance operation which aborts, might lead to deadlock" depends on CPU_V7 diff --combined arch/arm/Makefile index 954ec707d182,206a900fc87c..20242acb3f12 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@@ -179,6 -179,7 +179,6 @@@ machine-$(CONFIG_ARCH_FOOTBRIDGE) += fo machine-$(CONFIG_ARCH_GEMINI) += gemini machine-$(CONFIG_ARCH_HIGHBANK) += highbank machine-$(CONFIG_ARCH_HISI) += hisi -machine-$(CONFIG_ARCH_INTEGRATOR) += integrator machine-$(CONFIG_ARCH_IOP32X) += iop32x machine-$(CONFIG_ARCH_IXP4XX) += ixp4xx machine-$(CONFIG_ARCH_KEYSTONE) += keystone @@@ -186,6 -187,7 +186,6 @@@ machine-$(CONFIG_ARCH_LPC18XX) += lpc1 machine-$(CONFIG_ARCH_LPC32XX) += lpc32xx machine-$(CONFIG_ARCH_MESON) += meson machine-$(CONFIG_ARCH_MMP) += mmp -machine-$(CONFIG_ARCH_MPS2) += vexpress machine-$(CONFIG_ARCH_MOXART) += moxart machine-$(CONFIG_ARCH_MV78XX0) += mv78xx0 machine-$(CONFIG_ARCH_MVEBU) += mvebu @@@ -205,6 -207,7 +205,6 @@@ machine-$(CONFIG_ARCH_PXA) += px machine-$(CONFIG_ARCH_QCOM) += qcom machine-$(CONFIG_ARCH_RDA) += rda machine-$(CONFIG_ARCH_REALTEK) += realtek -machine-$(CONFIG_ARCH_REALVIEW) += realview machine-$(CONFIG_ARCH_ROCKCHIP) += rockchip machine-$(CONFIG_ARCH_RPC) += rpc machine-$(CONFIG_PLAT_SAMSUNG) += s3c @@@ -217,15 -220,17 +217,14 @@@ machine-$(CONFIG_ARCH_STM32) += stm3 machine-$(CONFIG_ARCH_SUNXI) += sunxi machine-$(CONFIG_ARCH_TEGRA) += tegra machine-$(CONFIG_ARCH_U8500) += ux500 -machine-$(CONFIG_ARCH_VERSATILE) += versatile -machine-$(CONFIG_ARCH_VEXPRESS) += vexpress machine-$(CONFIG_ARCH_VT8500) += vt8500 machine-$(CONFIG_ARCH_ZYNQ) += zynq +machine-$(CONFIG_PLAT_VERSATILE) += versatile machine-$(CONFIG_PLAT_SPEAR) += spear
# Platform directory name. This list is sorted alphanumerically # 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. TEXT_OFFSET := $(textofs-y) @@@ -312,9 -317,9 +311,9 @@@ $(BOOT_TARGETS): vmlinu $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@ @$(kecho) ' Kernel: $(boot)/$@ is ready'
+$(INSTALL_TARGETS): KBUILD_IMAGE = $(boot)/$(patsubst %install,%Image,$@) $(INSTALL_TARGETS): - $(CONFIG_SHELL) $(srctree)/$(boot)/install.sh "$(KERNELRELEASE)" \ - $(boot)/$(patsubst %install,%Image,$@) System.map "$(INSTALL_PATH)" + $(call cmd,install)
PHONY += vdso_install vdso_install: diff --combined arch/arm/include/asm/io.h index 2a0739a2350b,f36ca0da8427..eba7cbc93b86 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h @@@ -174,7 -174,7 +174,7 @@@ static inline void __iomem *__typesafe_ #define PCI_IO_VIRT_BASE 0xfee00000 #define PCI_IOBASE ((void __iomem *)PCI_IO_VIRT_BASE)
- #if defined(CONFIG_PCI) + #if defined(CONFIG_PCI) || IS_ENABLED(CONFIG_PCMCIA) void pci_ioremap_set_mem_type(int mem_type); #else static inline void pci_ioremap_set_mem_type(int mem_type) {} @@@ -200,32 -200,13 +200,13 @@@ void __iomem *pci_remap_cfgspace(resour */ #ifdef CONFIG_NEED_MACH_IO_H #include <mach/io.h> - #elif defined(CONFIG_PCI) - #define IO_SPACE_LIMIT ((resource_size_t)0xfffff) - #define __io(a) __typesafe_io(PCI_IO_VIRT_BASE + ((a) & IO_SPACE_LIMIT)) #else - #define __io(a) __typesafe_io((a) & IO_SPACE_LIMIT) - #endif - - /* - * This is the limit of PC card/PCI/ISA IO space, which is by default - * 64K if we have PC card, PCI or ISA support. Otherwise, default to - * zero to prevent ISA/PCI drivers claiming IO space (and potentially - * oopsing.) - * - * Only set this larger if you really need inb() et.al. to operate over - * a larger address space. Note that SOC_COMMON ioremaps each sockets - * IO space area, and so inb() et.al. must be defined to operate as per - * readb() et.al. on such platforms. - */ - #ifndef IO_SPACE_LIMIT - #if defined(CONFIG_PCMCIA_SOC_COMMON) || defined(CONFIG_PCMCIA_SOC_COMMON_MODULE) - #define IO_SPACE_LIMIT ((resource_size_t)0xffffffff) - #elif defined(CONFIG_PCI) || defined(CONFIG_ISA) || defined(CONFIG_PCCARD) - #define IO_SPACE_LIMIT ((resource_size_t)0xffff) + #if IS_ENABLED(CONFIG_PCMCIA) || defined(CONFIG_PCI) + #define IO_SPACE_LIMIT ((resource_size_t)0xfffff) #else #define IO_SPACE_LIMIT ((resource_size_t)0) #endif + #define __io(a) __typesafe_io(PCI_IO_VIRT_BASE + ((a) & IO_SPACE_LIMIT)) #endif
/* @@@ -440,9 -421,6 +421,9 @@@ extern void pci_iounmap(struct pci_dev #define ARCH_HAS_VALID_PHYS_ADDR_RANGE extern int valid_phys_addr_range(phys_addr_t addr, size_t size); extern int valid_mmap_phys_addr_range(unsigned long pfn, size_t size); +extern bool arch_memremap_can_ram_remap(resource_size_t offset, size_t size, + unsigned long flags); +#define arch_memremap_can_ram_remap arch_memremap_can_ram_remap #endif
/* diff --combined arch/arm/mach-mmp/Kconfig index 9642e6663a52,92a730a573b9..333229c65b28 --- a/arch/arm/mach-mmp/Kconfig +++ b/arch/arm/mach-mmp/Kconfig @@@ -1,7 -1,7 +1,7 @@@ # SPDX-License-Identifier: GPL-2.0-only menuconfig ARCH_MMP bool "Marvell PXA168/910/MMP2/MMP3" - depends on ARCH_MULTI_V5 || ARCH_MULTI_V7 + depends on (CPU_LITTLE_ENDIAN && ARCH_MULTI_V5) || ARCH_MULTI_V7 select GPIO_PXA select GPIOLIB select PINCTRL @@@ -39,16 -39,8 +39,8 @@@ config MACH_AVENGERS_LIT 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 diff --combined arch/arm/mach-pxa/Kconfig index 57f0be4065c1,d2cea239fe13..a5df1d9f3360 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig @@@ -1,4 -1,18 +1,19 @@@ # SPDX-License-Identifier: GPL-2.0-only + menuconfig ARCH_PXA + bool "PXA2xx/PXA3xx-based" + depends on ARCH_MULTI_V5 ++ depends on CPU_LITTLE_ENDIAN + 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" diff --combined arch/arm/mm/ioremap.c index 290702328a33,aec5347db265..576c0e6c92fc --- a/arch/arm/mm/ioremap.c +++ b/arch/arm/mm/ioremap.c @@@ -455,7 -455,7 +455,7 @@@ void iounmap(volatile void __iomem *coo } EXPORT_SYMBOL(iounmap);
- #ifdef CONFIG_PCI + #if defined(CONFIG_PCI) || IS_ENABLED(CONFIG_PCMCIA) static int pci_ioremap_mem_type = MT_DEVICE;
void pci_ioremap_set_mem_type(int mem_type) @@@ -493,11 -493,3 +493,11 @@@ void __init early_ioremap_init(void { early_ioremap_setup(); } + +bool arch_memremap_can_ram_remap(resource_size_t offset, size_t size, + unsigned long flags) +{ + unsigned long pfn = PHYS_PFN(offset); + + return memblock_is_map_memory(pfn); +} diff --combined drivers/soc/Makefile index e8228c4e5d18,fd7717d597fc..919716e0e700 --- a/drivers/soc/Makefile +++ b/drivers/soc/Makefile @@@ -4,7 -4,7 +4,7 @@@ #
obj-$(CONFIG_ARCH_ACTIONS) += actions/ -obj-$(CONFIG_ARCH_APPLE) += apple/ +obj-y += apple/ obj-y += aspeed/ obj-$(CONFIG_ARCH_AT91) += atmel/ obj-y += bcm/ @@@ -19,10 -19,11 +19,11 @@@ 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/ -obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip/ +obj-y += rockchip/ obj-$(CONFIG_SOC_SAMSUNG) += samsung/ obj-$(CONFIG_SOC_SIFIVE) += sifive/ obj-y += sunxi/ diff --combined drivers/video/fbdev/pxafb.c index 8ad91c251fe6,ab5bc8272d8e..66cfc3e9d3cf --- a/drivers/video/fbdev/pxafb.c +++ b/drivers/video/fbdev/pxafb.c @@@ -57,14 -57,13 +57,13 @@@ #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> - #include <mach/bitfield.h> #include <linux/platform_data/video-pxafb.h>
/* @@@ -73,6 -72,7 +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 |\ @@@ -2256,10 -2256,10 +2256,10 @@@ static int pxafb_probe(struct platform_ goto failed; for (i = 0; i < inf->num_modes; i++) inf->modes[i] = pdata->modes[i]; + } else { + inf = of_pxafb_of_mach_info(&dev->dev); }
- if (!pdata) - inf = of_pxafb_of_mach_info(&dev->dev); if (IS_ERR_OR_NULL(inf)) goto failed;
diff --combined sound/soc/pxa/hx4700.c index 9a816156f012,e6473c50e512..a323ddb8fc3e --- a/sound/soc/pxa/hx4700.c +++ b/sound/soc/pxa/hx4700.c @@@ -10,7 -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 +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 +29,18 @@@ static struct snd_soc_jack_pin hs_jack_ { .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 +79,14 @@@ static const struct snd_soc_ops hx4700_ 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; }
@@@ -122,9 -120,9 +120,9 @@@ static int hx4700_ak4641_init(struct sn int err;
/* Jack detection API stuff */ - err = snd_soc_card_jack_new(rtd->card, "Headphone Jack", - SND_JACK_HEADPHONE, &hs_jack, hs_jack_pin, - ARRAY_SIZE(hs_jack_pin)); + err = snd_soc_card_jack_new_pins(rtd->card, "Headphone Jack", + SND_JACK_HEADPHONE, &hs_jack, + hs_jack_pin, ARRAY_SIZE(hs_jack_pin)); if (err) return err;
@@@ -162,11 -160,6 +160,6 @@@ static struct snd_soc_card snd_soc_card .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 +167,26 @@@ 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; }
diff --combined sound/soc/pxa/palm27x.c index 65257f7fe4c4,275c86379e88..a2321c01c160 --- a/sound/soc/pxa/palm27x.c +++ b/sound/soc/pxa/palm27x.c @@@ -20,7 -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; @@@ -71,10 -71,9 +71,10 @@@ static int palm27x_ac97_init(struct snd int err;
/* Jack detection API stuff */ - err = snd_soc_card_jack_new(rtd->card, "Headphone Jack", - SND_JACK_HEADPHONE, &hs_jack, hs_jack_pins, - ARRAY_SIZE(hs_jack_pins)); + err = snd_soc_card_jack_new_pins(rtd->card, "Headphone Jack", + SND_JACK_HEADPHONE, &hs_jack, + hs_jack_pins, + ARRAY_SIZE(hs_jack_pins)); if (err) return err;
diff --combined sound/soc/pxa/z2.c index f4a7cfe22115,7f1c6bc69510..020dcce1df1f --- a/sound/soc/pxa/z2.c +++ b/sound/soc/pxa/z2.c @@@ -13,7 -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> @@@ -21,9 -21,7 +21,7 @@@ #include <sound/jack.h>
#include <asm/mach-types.h> - #include <mach/hardware.h> - #include <mach/audio.h> - #include <mach/z2.h> + #include <linux/platform_data/asoc-pxa.h>
#include "../codecs/wm8750.h" #include "pxa2xx-i2s.h" @@@ -90,7 -88,6 +88,6 @@@ static struct snd_soc_jack_pin hs_jack_ /* 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, @@@ -132,10 -129,9 +129,10 @@@ static int z2_wm8750_init(struct snd_so int ret;
/* Jack detection API stuff */ - ret = snd_soc_card_jack_new(rtd->card, "Headset Jack", SND_JACK_HEADSET, - &hs_jack, hs_jack_pins, - ARRAY_SIZE(hs_jack_pins)); + ret = snd_soc_card_jack_new_pins(rtd->card, "Headset Jack", + SND_JACK_HEADSET, &hs_jack, + hs_jack_pins, + ARRAY_SIZE(hs_jack_pins)); if (ret) goto err;
@@@ -197,6 -193,7 +194,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);
linux-merge@lists.open-mesh.org