diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-10-22 07:56:27 -1000 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-10-22 07:56:27 -1000 |
| commit | aad73b807cd1a5bff9c5277e8a42e75bbdc8adab (patch) | |
| tree | 8c1f0864efd1be92f97e2d804a7bf619173922db | |
| parent | 4e092c2be4320f06dde1206652746ce0d83540b7 (diff) | |
| parent | cfe69169c03e71e2a22870317ef4cffb51f6f06d (diff) | |
Merge tag 'soc-arm-7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
Pull ARM SoC board file updates from Arnd Bergmann:
"These are mostly smaller cleanups for the remaining platform code in
arch/arm/, the most notable one being the conversion of the
s3c/crag6410 board to use software nodes for GPIO references in place
of plain GPIO numbers.
The earlier plan was to drop the deprecated (since 7.3) board files
here, which would have been a much larger set of changes, but that is
now deferred to 7.5"
* tag 'soc-arm-7.4' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc:
MAINTAINERS: Drop arm64 dts/intel path from ARM/SOCFPGA ARCHITECTURE
ARM: tegra: Fix Trun -> Turn typo
ARM: vexpress: fix device_node refcount leak in vexpress_smp_dt_prepare_cpus()
ARM: vexpress: fix device_node refcount leak in vexpress_flags_set()
MAINTAINERS: Change ARM Visconti5 architecture maintenance status to Odd Fixes
ARM: mvebu: fix Cortex-A9 errata selection for Armada 38x
ARM: OMAP2+: remove unused ctrl_module_wkup_44xx.h header
ARM: EXYNOS: Replace __ASSEMBLY__ with __ASSEMBLER__
ARM: s3c: crag6410: use software nodes/properties to set up GPIO keys
Input: samsung-keypad - remove support for platform data
ARM: s3c: crag6410: switch keypad device to software properties
ARM: s3c: register and attach software nodes for Samsung gpio_chips
Input: samsung-keypad - handle compact binding
dt-bindings: input: samsung,s3c6410-keypad: introduce compact binding
ARM: imx6q: remove KSZ9021 PHY fixup
ARM: imx: Fix suspend/resume crash with Clang CFI
ARM: OMAP2+: Replace __ASSEMBLY__ with __ASSEMBLER__
soc: imx: Replace __ASSEMBLY__ with __ASSEMBLER__ in header file
ARM: imx: Replace __ASSEMBLY__ with __ASSEMBLER__
MAINTAINERS: Add git tree for TI K3 ARCHITECTURE
32 files changed, 376 insertions, 448 deletions
diff --git a/Documentation/devicetree/bindings/input/samsung,s3c6410-keypad.yaml b/Documentation/devicetree/bindings/input/samsung,s3c6410-keypad.yaml index a53569aa0ee7..2498c62444a1 100644 --- a/Documentation/devicetree/bindings/input/samsung,s3c6410-keypad.yaml +++ b/Documentation/devicetree/bindings/input/samsung,s3c6410-keypad.yaml @@ -37,6 +37,10 @@ properties: wakeup-source: true + keypad,num-columns: true + keypad,num-rows: true + linux,keymap: true + linux,input-no-autorepeat: type: boolean description: @@ -81,12 +85,33 @@ patternProperties: - keypad,row - linux,code +dependencies: + linux,keymap: [ "keypad,num-columns", "keypad,num-rows" ] + required: - compatible - reg - interrupts - - samsung,keypad-num-columns - - samsung,keypad-num-rows + +allOf: + - $ref: input.yaml# + - $ref: matrix-keymap.yaml# + - if: + required: + - linux,keymap + then: + properties: + samsung,keypad-num-columns: false + samsung,keypad-num-rows: false + patternProperties: + '^key-[0-9a-z]+$': false + else: + properties: + keypad,num-columns: false + keypad,num-rows: false + required: + - samsung,keypad-num-columns + - samsung,keypad-num-rows additionalProperties: false @@ -94,8 +119,9 @@ examples: - | #include <dt-bindings/clock/exynos4.h> #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/input/input.h> - keypad@100a0000 { + keypad1@100a0000 { compatible = "samsung,s5pv210-keypad"; reg = <0x100a0000 0x100>; interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>; @@ -119,3 +145,24 @@ examples: linux,code = <3>; }; }; + - | + #include <dt-bindings/clock/exynos4.h> + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/input/input.h> + + keypad2@100a0000 { + compatible = "samsung,s5pv210-keypad"; + reg = <0x100a0000 0x100>; + interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clock CLK_KEYIF>; + clock-names = "keypad"; + + keypad,num-rows = <2>; + keypad,num-columns = <8>; + linux,keymap = < + MATRIX_KEY(0, 3, 2) + MATRIX_KEY(0, 4, 3) + >; + linux,input-no-autorepeat; + wakeup-source; + }; diff --git a/MAINTAINERS b/MAINTAINERS index 763442505f5e..b4bfb698fd1e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3639,7 +3639,6 @@ F: arch/arm/boot/dts/intel/socfpga/ F: arch/arm/configs/socfpga_defconfig F: arch/arm/mach-socfpga/ F: arch/arm64/boot/dts/altera/ -F: arch/arm64/boot/dts/intel/ ARM/SOCFPGA CLOCK FRAMEWORK SUPPORT M: Dinh Nguyen <dinguyen@kernel.org> @@ -3802,6 +3801,7 @@ M: Vignesh Raghavendra <vigneshr@ti.com> M: Tero Kristo <kristo@kernel.org> L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) S: Supported +T: git git://git.kernel.org/pub/scm/linux/kernel/git/ti/linux.git F: Documentation/devicetree/bindings/arm/ti/k3.yaml F: Documentation/devicetree/bindings/hwinfo/ti,k3-socinfo.yaml F: arch/arm64/boot/dts/ti/Makefile @@ -3819,7 +3819,7 @@ F: arch/arm/boot/dts/nspire/ ARM/TOSHIBA VISCONTI ARCHITECTURE M: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.x90@mail.toshiba> L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) -S: Supported +S: Odd Fixes T: git git://git.kernel.org/pub/scm/linux/kernel/git/iwamatsu/linux-visconti.git F: Documentation/devicetree/bindings/arm/toshiba.yaml F: Documentation/devicetree/bindings/clock/toshiba,tmpv770x-pipllct.yaml diff --git a/arch/arm/include/asm/linkage.h b/arch/arm/include/asm/linkage.h index c4670694ada7..bba992f5d7a8 100644 --- a/arch/arm/include/asm/linkage.h +++ b/arch/arm/include/asm/linkage.h @@ -9,4 +9,33 @@ .type name, %function; \ END(name) +#ifdef __ASSEMBLY__ + +/* + * Variants of SYM_TYPED_START/SYM_TYPED_FUNC_START that align the + * function entry itself instead of the kCFI type hash preceding it, + * for functions whose entry point must meet an alignment requirement, + * such as the 8-byte alignment fncpy() demands of its source. + */ +#ifdef CONFIG_CFI + +#define SYM_TYPED_START_ALIGNED(name, linkage, align) \ + linkage(name) ASM_NL \ + .balign align ASM_NL \ + .fill (align) - 4, 1, 0 ASM_NL \ + __CFI_TYPE(name) ASM_NL \ + name: + +#else /* CONFIG_CFI */ + +#define SYM_TYPED_START_ALIGNED(name, linkage, align) \ + SYM_START(name, linkage, .balign align) + +#endif /* CONFIG_CFI */ + +#define SYM_TYPED_FUNC_START_ALIGNED(name, align) \ + SYM_TYPED_START_ALIGNED(name, SYM_L_GLOBAL, align) + +#endif /* __ASSEMBLY__ */ + #endif diff --git a/arch/arm/mach-exynos/smc.h b/arch/arm/mach-exynos/smc.h index 5c30feb8f07d..5c7730f6259f 100644 --- a/arch/arm/mach-exynos/smc.h +++ b/arch/arm/mach-exynos/smc.h @@ -32,11 +32,11 @@ #define SMC_REG_CLASS_SFR_W (0x1 << 30) #define SMC_REG_ID_SFR_W(addr) (SMC_REG_CLASS_SFR_W | ((addr) >> 2)) -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__ extern void exynos_smc(u32 cmd, u32 arg1, u32 arg2, u32 arg3); -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ /* op type for SMC_CMD_SAVE and SMC_CMD_SHUTDOWN */ #define OP_TYPE_CORE 0x0 diff --git a/arch/arm/mach-imx/hardware.h b/arch/arm/mach-imx/hardware.h index 0760fff39a0b..71f09648c777 100644 --- a/arch/arm/mach-imx/hardware.h +++ b/arch/arm/mach-imx/hardware.h @@ -7,7 +7,7 @@ #ifndef __ASM_ARCH_MXC_HARDWARE_H__ #define __ASM_ARCH_MXC_HARDWARE_H__ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__ #include <asm/io.h> #include <soc/imx/revision.h> #endif diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index 7f6200925752..58f53fba202f 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c @@ -20,26 +20,6 @@ #include "cpuidle.h" #include "hardware.h" -/* For imx6q sabrelite board: set KSZ9021RN RGMII pad skew */ -static int ksz9021rn_phy_fixup(struct phy_device *phydev) -{ - if (IS_BUILTIN(CONFIG_PHYLIB)) { - /* min rx data delay */ - phy_write(phydev, MICREL_KSZ9021_EXTREG_CTRL, - 0x8000 | MICREL_KSZ9021_RGMII_RX_DATA_PAD_SCEW); - phy_write(phydev, MICREL_KSZ9021_EXTREG_DATA_WRITE, 0x0000); - - /* max rx/tx clock delay, min rx/tx control delay */ - phy_write(phydev, MICREL_KSZ9021_EXTREG_CTRL, - 0x8000 | MICREL_KSZ9021_RGMII_CLK_CTRL_PAD_SCEW); - phy_write(phydev, MICREL_KSZ9021_EXTREG_DATA_WRITE, 0xf0f0); - phy_write(phydev, MICREL_KSZ9021_EXTREG_CTRL, - MICREL_KSZ9021_RGMII_CLK_CTRL_PAD_SCEW); - } - - return 0; -} - /* * fixup for PLX PEX8909 bridge to configure GPIO1-7 as output High * as they are used for slots1-7 PERST# @@ -68,14 +48,6 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8609, ventana_pciesw_early_fixup); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8606, ventana_pciesw_early_fixup); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8604, ventana_pciesw_early_fixup); -static void __init imx6q_enet_phy_init(void) -{ - if (IS_BUILTIN(CONFIG_PHYLIB)) { - phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK, - ksz9021rn_phy_fixup); - } -} - static void __init imx6q_1588_init(void) { struct device_node *np; @@ -179,8 +151,6 @@ static void __init imx6q_init_machine(void) imx_print_silicon_rev(cpu_is_imx6dl() ? "i.MX6DL" : "i.MX6Q", imx_get_soc_revision()); - imx6q_enet_phy_init(); - of_platform_default_populate(NULL, NULL, NULL); imx_anatop_init(); diff --git a/arch/arm/mach-imx/mxc.h b/arch/arm/mach-imx/mxc.h index fe2d0f5abfcc..1d13e3959159 100644 --- a/arch/arm/mach-imx/mxc.h +++ b/arch/arm/mach-imx/mxc.h @@ -16,7 +16,7 @@ #define IMX_DDR_TYPE_LPDDR2 1 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__ #ifdef CONFIG_SOC_IMX6SL static inline bool cpu_is_imx6sl(void) diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c index a671ca498f88..3c73e2cdb8ce 100644 --- a/arch/arm/mach-imx/pm-imx6.c +++ b/arch/arm/mach-imx/pm-imx6.c @@ -4,6 +4,8 @@ * Copyright 2011 Linaro Ltd. */ +#include <linux/build_bug.h> +#include <linux/cfi.h> #include <linux/clk/imx.h> #include <linux/delay.h> #include <linux/init.h> @@ -18,6 +20,7 @@ #include <linux/of_platform.h> #include <linux/platform_device.h> #include <linux/regmap.h> +#include <linux/stddef.h> #include <linux/suspend.h> #include <asm/cacheflush.h> #include <asm/fncpy.h> @@ -61,9 +64,9 @@ #define MX6Q_SUSPEND_OCRAM_SIZE 0x1000 #define MX6_MAX_MMDC_IO_NUM 33 -static void __iomem *ccm_base; -static void __iomem *suspend_ocram_base; -static void (*imx6_suspend_in_ocram_fn)(void __iomem *ocram_vbase); +static void __iomem *ccm_base __ro_after_init; +static void __iomem *suspend_ocram_base __ro_after_init; +static void (*imx6_suspend_in_ocram_fn)(void __iomem *ocram_vbase) __ro_after_init; /* * suspend ocram space layout: @@ -229,8 +232,18 @@ struct imx6_cpu_pm_info { struct imx6_pm_base l2_base; u32 mmdc_io_num; /* Number of MMDC IOs which need saved/restored. */ u32 mmdc_io_val[MX6_MAX_MMDC_IO_NUM][2]; /* To save offset and value */ + u32 cfi_type; /* kCFI type hash of imx6_suspend() */ } __aligned(8); +/* + * The ocram copy of imx6_suspend() starts right after struct imx6_cpu_pm_info, + * and the CFI check on the indirect call reads the kCFI type hash from the + * four bytes preceding the function entry, so cfi_type must occupy the last + * four bytes of the struct, i.e. fit into its tail padding. + */ +static_assert(offsetofend(struct imx6_cpu_pm_info, cfi_type) == + sizeof(struct imx6_cpu_pm_info)); + void imx6_set_int_mem_clk_lpm(bool enable) { u32 val = readl_relaxed(ccm_base + CGPR); @@ -568,6 +581,13 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata) mmdc_offset_array[i]); } + /* + * Mask out the Thumb bit, as cfi_get_func_hash() expects the + * function's actual start address. Returns 0 if CONFIG_CFI=n. + */ + pm_info->cfi_type = + cfi_get_func_hash((void *)((uintptr_t)&imx6_suspend & ~1UL)); + imx6_suspend_in_ocram_fn = fncpy( suspend_ocram_base + sizeof(*pm_info), &imx6_suspend, diff --git a/arch/arm/mach-imx/suspend-imx6.S b/arch/arm/mach-imx/suspend-imx6.S index 63ccc2d0e920..95d5f723ea0e 100644 --- a/arch/arm/mach-imx/suspend-imx6.S +++ b/arch/arm/mach-imx/suspend-imx6.S @@ -3,6 +3,7 @@ * Copyright 2014 Freescale Semiconductor, Inc. */ +#include <linux/cfi_types.h> #include <linux/linkage.h> #include <asm/assembler.h> #include <asm/asm-offsets.h> @@ -148,7 +149,8 @@ .endm -ENTRY(imx6_suspend) +/* fncpy() requires an 8-byte-aligned entry; see arch/arm/include/asm/fncpy.h */ +SYM_TYPED_FUNC_START_ALIGNED(imx6_suspend, 8) ldr r1, [r0, #PM_INFO_PBASE_OFFSET] ldr r2, [r0, #PM_INFO_RESUME_ADDR_OFFSET] ldr r3, [r0, #PM_INFO_DDR_TYPE_OFFSET] @@ -329,4 +331,4 @@ resume: resume_mmdc ret lr -ENDPROC(imx6_suspend) +SYM_FUNC_END(imx6_suspend) diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig index 9f60a6fe0eaf..5203b5cfa457 100644 --- a/arch/arm/mach-mvebu/Kconfig +++ b/arch/arm/mach-mvebu/Kconfig @@ -55,7 +55,9 @@ config MACH_ARMADA_375 config MACH_ARMADA_38X bool "Marvell Armada 380/385 boards" depends on ARCH_MULTI_V7 - select ARM_ERRATA_720789 + select ARM_ERRATA_754322 + select ARM_ERRATA_764319 + select ARM_ERRATA_764369 if SMP select PL310_ERRATA_753970 select ARM_GIC select ARM_GLOBAL_TIMER diff --git a/arch/arm/mach-omap2/control.h b/arch/arm/mach-omap2/control.h index 7e7440533bf9..e4f4b1695808 100644 --- a/arch/arm/mach-omap2/control.h +++ b/arch/arm/mach-omap2/control.h @@ -18,7 +18,7 @@ #include "am33xx.h" -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__ #define OMAP242X_CTRL_REGADDR(reg) \ OMAP2_L4_IO_ADDRESS(OMAP242X_CTRL_BASE + (reg)) #define OMAP243X_CTRL_REGADDR(reg) \ @@ -36,7 +36,7 @@ OMAP2_L4_IO_ADDRESS(OMAP343X_CTRL_BASE + (reg)) #define AM33XX_CTRL_REGADDR(reg) \ AM33XX_L4_WK_IO_ADDRESS(AM33XX_SCM_BASE + (reg)) -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ /* * As elsewhere, the "OMAP2_" prefix indicates that the macro is valid for @@ -503,7 +503,7 @@ #define FEAT_NEON_NONE 1 -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__ #ifdef CONFIG_ARCH_OMAP2PLUS extern u8 omap_ctrl_readb(u16 offset); extern u16 omap_ctrl_readw(u16 offset); @@ -534,7 +534,7 @@ int omap_control_init(void); #define omap_ctrl_writel(x, y) WARN_ON(1) #define omap4_ctrl_pad_writel(x, y) WARN_ON(1) #endif -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ #endif /* __ARCH_ARM_MACH_OMAP2_CONTROL_H */ diff --git a/arch/arm/mach-omap2/ctrl_module_wkup_44xx.h b/arch/arm/mach-omap2/ctrl_module_wkup_44xx.h deleted file mode 100644 index 414f14d1e0a0..000000000000 --- a/arch/arm/mach-omap2/ctrl_module_wkup_44xx.h +++ /dev/null @@ -1,89 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* - * OMAP44xx CTRL_MODULE_WKUP registers and bitfields - * - * Copyright (C) 2009-2010 Texas Instruments, Inc. - * - * Benoit Cousson (b-cousson@ti.com) - * Santosh Shilimkar (santosh.shilimkar@ti.com) - * - * This file is automatically generated from the OMAP hardware databases. - * We respectfully ask that any modifications to this file be coordinated - * with the public linux-omap@vger.kernel.org mailing list and the - * authors above to ensure that the autogeneration scripts are kept - * up-to-date with the file contents. - */ - -#ifndef __ARCH_ARM_MACH_OMAP2_CTRL_MODULE_WKUP_44XX_H -#define __ARCH_ARM_MACH_OMAP2_CTRL_MODULE_WKUP_44XX_H - - -/* Base address */ -#define OMAP4_CTRL_MODULE_WKUP 0x4a30c000 - -/* Registers offset */ -#define OMAP4_CTRL_MODULE_WKUP_IP_REVISION 0x0000 -#define OMAP4_CTRL_MODULE_WKUP_IP_HWINFO 0x0004 -#define OMAP4_CTRL_MODULE_WKUP_IP_SYSCONFIG 0x0010 -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_0 0x0460 -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_1 0x0464 -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_2 0x0468 -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_3 0x046c -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_4 0x0470 -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_5 0x0474 -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_6 0x0478 -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_7 0x047c -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_8 0x0480 -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_9 0x0484 -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_10 0x0488 -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_11 0x048c -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_12 0x0490 -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_13 0x0494 -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_14 0x0498 -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_15 0x049c -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_16 0x04a0 -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_17 0x04a4 -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_18 0x04a8 -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_19 0x04ac -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_20 0x04b0 -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_21 0x04b4 -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_22 0x04b8 -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_23 0x04bc -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_24 0x04c0 -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_25 0x04c4 -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_26 0x04c8 -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_27 0x04cc -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_28 0x04d0 -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_29 0x04d4 -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_30 0x04d8 -#define OMAP4_CTRL_MODULE_WKUP_CONF_DEBUG_SEL_TST_31 0x04dc - -/* Registers shifts and masks */ - -/* IP_REVISION */ -#define OMAP4_IP_REV_SCHEME_SHIFT 30 -#define OMAP4_IP_REV_SCHEME_MASK (0x3 << 30) -#define OMAP4_IP_REV_FUNC_SHIFT 16 -#define OMAP4_IP_REV_FUNC_MASK (0xfff << 16) -#define OMAP4_IP_REV_RTL_SHIFT 11 -#define OMAP4_IP_REV_RTL_MASK (0x1f << 11) -#define OMAP4_IP_REV_MAJOR_SHIFT 8 -#define OMAP4_IP_REV_MAJOR_MASK (0x7 << 8) -#define OMAP4_IP_REV_CUSTOM_SHIFT 6 -#define OMAP4_IP_REV_CUSTOM_MASK (0x3 << 6) -#define OMAP4_IP_REV_MINOR_SHIFT 0 -#define OMAP4_IP_REV_MINOR_MASK (0x3f << 0) - -/* IP_HWINFO */ -#define OMAP4_IP_HWINFO_SHIFT 0 -#define OMAP4_IP_HWINFO_MASK (0xffffffff << 0) - -/* IP_SYSCONFIG */ -#define OMAP4_IP_SYSCONFIG_IDLEMODE_SHIFT 2 -#define OMAP4_IP_SYSCONFIG_IDLEMODE_MASK (0x3 << 2) - -/* CONF_DEBUG_SEL_TST_0 */ -#define OMAP4_WKUP_MODE_SHIFT 0 -#define OMAP4_WKUP_MODE_MASK (1 << 0) - -#endif diff --git a/arch/arm/mach-omap2/soc.h b/arch/arm/mach-omap2/soc.h index 9e3dbb743e5c..b3949559edad 100644 --- a/arch/arm/mach-omap2/soc.h +++ b/arch/arm/mach-omap2/soc.h @@ -19,7 +19,7 @@ #include "am33xx.h" #include "omap54xx.h" -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__ #include <linux/bitops.h> #include <linux/of.h> @@ -501,4 +501,4 @@ level(__##fn); #define cpu_is_ti816x() soc_is_ti816x() #define cpu_is_ti81xx() soc_is_ti81xx() -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ diff --git a/arch/arm/mach-omap2/sram.h b/arch/arm/mach-omap2/sram.h index 030cabc39821..a1d72e014e62 100644 --- a/arch/arm/mach-omap2/sram.h +++ b/arch/arm/mach-omap2/sram.h @@ -3,7 +3,7 @@ * Interface for functions that need to be run in internal SRAM */ -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__ extern void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl, u32 base_cs, u32 force_unlock); @@ -48,7 +48,7 @@ extern void omap_push_sram_idle(void); static inline void omap_push_sram_idle(void) {} #endif /* CONFIG_PM */ -#endif /* __ASSEMBLY__ */ +#endif /* __ASSEMBLER__ */ /* * OMAP2+: define the SRAM PA addresses. diff --git a/arch/arm/mach-s3c/Kconfig b/arch/arm/mach-s3c/Kconfig index b3656109f1f7..2e77bb4f3a8c 100644 --- a/arch/arm/mach-s3c/Kconfig +++ b/arch/arm/mach-s3c/Kconfig @@ -111,11 +111,6 @@ config S3C64XX_DEV_SPI0 Compile in platform device definitions for S3C64XX's type SPI controller 0 -config SAMSUNG_DEV_KEYPAD - bool - help - Compile in platform device definitions for keypad - config SAMSUNG_DEV_PWM bool help diff --git a/arch/arm/mach-s3c/Kconfig.s3c64xx b/arch/arm/mach-s3c/Kconfig.s3c64xx index cf59147dc9ca..145d04effdfd 100644 --- a/arch/arm/mach-s3c/Kconfig.s3c64xx +++ b/arch/arm/mach-s3c/Kconfig.s3c64xx @@ -81,11 +81,6 @@ config S3C64XX_SETUP_FB_24BPP help Common setup code for S3C64XX with an 24bpp RGB display helper. -config S3C64XX_SETUP_KEYPAD - bool - help - Common setup code for S3C64XX KEYPAD GPIO configurations - config S3C64XX_SETUP_SDHCI_GPIO bool help @@ -113,7 +108,6 @@ config MACH_WLF_CRAGG_6410 select S3C64XX_DEV_SPI0 select S3C64XX_SETUP_FB_24BPP select S3C64XX_SETUP_I2C1 - select S3C64XX_SETUP_KEYPAD select S3C64XX_SETUP_SDHCI select S3C64XX_SETUP_SPI select S3C64XX_SETUP_USB_PHY @@ -124,7 +118,6 @@ config MACH_WLF_CRAGG_6410 select S3C_DEV_I2C1 select S3C_DEV_USB_HOST select S3C_DEV_USB_HSOTG - select SAMSUNG_DEV_KEYPAD select SAMSUNG_DEV_PWM help Machine support for the Wolfson Cragganmore S3C6410 variant. diff --git a/arch/arm/mach-s3c/Makefile.s3c64xx b/arch/arm/mach-s3c/Makefile.s3c64xx index 61287ad2ea42..1686b1f344f8 100644 --- a/arch/arm/mach-s3c/Makefile.s3c64xx +++ b/arch/arm/mach-s3c/Makefile.s3c64xx @@ -32,7 +32,6 @@ obj-y += dev-audio-s3c64xx.o obj-$(CONFIG_S3C64XX_SETUP_FB_24BPP) += setup-fb-24bpp-s3c64xx.o obj-$(CONFIG_S3C64XX_SETUP_I2C0) += setup-i2c0-s3c64xx.o obj-$(CONFIG_S3C64XX_SETUP_I2C1) += setup-i2c1-s3c64xx.o -obj-$(CONFIG_S3C64XX_SETUP_KEYPAD) += setup-keypad-s3c64xx.o obj-$(CONFIG_S3C64XX_SETUP_SDHCI_GPIO) += setup-sdhci-gpio-s3c64xx.o obj-$(CONFIG_S3C64XX_SETUP_SPI) += setup-spi-s3c64xx.o obj-$(CONFIG_S3C64XX_SETUP_USB_PHY) += setup-usb-phy-s3c64xx.o diff --git a/arch/arm/mach-s3c/devs.c b/arch/arm/mach-s3c/devs.c index 572b156644bd..35b98a9a9237 100644 --- a/arch/arm/mach-s3c/devs.c +++ b/arch/arm/mach-s3c/devs.c @@ -39,7 +39,6 @@ #include "devs.h" #include "fb.h" #include <linux/platform_data/i2c-s3c2410.h> -#include "keypad.h" #include "pwm-core.h" #include "sdhci.h" #include "usb-phy.h" @@ -265,32 +264,6 @@ void __init s3c_i2c1_set_platdata(struct s3c2410_platform_i2c *pd) } #endif /* CONFIG_S3C_DEV_I2C1 */ -/* KEYPAD */ - -#ifdef CONFIG_SAMSUNG_DEV_KEYPAD -static struct resource samsung_keypad_resources[] = { - [0] = DEFINE_RES_MEM(SAMSUNG_PA_KEYPAD, SZ_32), - [1] = DEFINE_RES_IRQ(IRQ_KEYPAD), -}; - -struct platform_device samsung_device_keypad = { - .name = "samsung-keypad", - .id = -1, - .num_resources = ARRAY_SIZE(samsung_keypad_resources), - .resource = samsung_keypad_resources, -}; - -void __init samsung_keypad_set_platdata(struct samsung_keypad_platdata *pd) -{ - struct samsung_keypad_platdata *npd; - - npd = s3c_set_platdata(pd, sizeof(*npd), &samsung_device_keypad); - - if (!npd->cfg_gpio) - npd->cfg_gpio = samsung_keypad_cfg_gpio; -} -#endif /* CONFIG_SAMSUNG_DEV_KEYPAD */ - /* PWM Timer */ #ifdef CONFIG_SAMSUNG_DEV_PWM diff --git a/arch/arm/mach-s3c/devs.h b/arch/arm/mach-s3c/devs.h index 21c00786c264..2737990063b1 100644 --- a/arch/arm/mach-s3c/devs.h +++ b/arch/arm/mach-s3c/devs.h @@ -39,7 +39,6 @@ extern struct platform_device s3c_device_i2c1; extern struct platform_device s3c_device_ohci; extern struct platform_device s3c_device_usb_hsotg; -extern struct platform_device samsung_device_keypad; extern struct platform_device samsung_device_pwm; /** diff --git a/arch/arm/mach-s3c/gpio-core.h b/arch/arm/mach-s3c/gpio-core.h index 6801c85fb9da..464b0d02f102 100644 --- a/arch/arm/mach-s3c/gpio-core.h +++ b/arch/arm/mach-s3c/gpio-core.h @@ -14,6 +14,8 @@ #include "gpio-samsung.h" #include <linux/gpio/driver.h> +struct software_node; + #define GPIOCON_OFF (0x00) #define GPIODAT_OFF (0x04) @@ -66,6 +68,7 @@ struct samsung_gpio_cfg; */ struct samsung_gpio_chip { struct gpio_chip chip; + const struct software_node *swnode; struct samsung_gpio_cfg *config; struct samsung_gpio_pm *pm; void __iomem *base; diff --git a/arch/arm/mach-s3c/gpio-samsung-s3c64xx.h b/arch/arm/mach-s3c/gpio-samsung-s3c64xx.h index 8ed144a0d474..fc21d3f50ce9 100644 --- a/arch/arm/mach-s3c/gpio-samsung-s3c64xx.h +++ b/arch/arm/mach-s3c/gpio-samsung-s3c64xx.h @@ -13,6 +13,8 @@ #ifdef CONFIG_GPIO_SAMSUNG +#include <linux/property.h> + /* GPIO bank sizes */ #define S3C64XX_GPIO_A_NR (8) #define S3C64XX_GPIO_B_NR (7) @@ -89,6 +91,9 @@ enum s3c_gpio_number { /* define the number of gpios we need to the one after the GPQ() range */ #define GPIO_BOARD_START (S3C64XX_GPQ(S3C64XX_GPIO_Q_NR) + 1) +extern const struct software_node samsung_gpiochip_nodes[]; +#define SAMSUNG_GPIO_NODE(node) (&samsung_gpiochip_nodes[(node) - 'A']) + #endif /* GPIO_SAMSUNG */ #endif /* GPIO_SAMSUNG_S3C64XX_H */ diff --git a/arch/arm/mach-s3c/gpio-samsung.c b/arch/arm/mach-s3c/gpio-samsung.c index 81e198e5a6d3..b35cf62a9157 100644 --- a/arch/arm/mach-s3c/gpio-samsung.c +++ b/arch/arm/mach-s3c/gpio-samsung.c @@ -37,6 +37,28 @@ #include "gpio-cfg-helpers.h" #include "pm.h" +const struct software_node samsung_gpiochip_nodes[] = { + SOFTWARE_NODE("GPA", NULL, NULL), + SOFTWARE_NODE("GPB", NULL, NULL), + SOFTWARE_NODE("GPC", NULL, NULL), + SOFTWARE_NODE("GPD", NULL, NULL), + SOFTWARE_NODE("GPE", NULL, NULL), + SOFTWARE_NODE("GPF", NULL, NULL), + SOFTWARE_NODE("GPG", NULL, NULL), + SOFTWARE_NODE("GPH", NULL, NULL), + SOFTWARE_NODE("GPI", NULL, NULL), + SOFTWARE_NODE("GPJ", NULL, NULL), + SOFTWARE_NODE("GPK", NULL, NULL), + SOFTWARE_NODE("GPL", NULL, NULL), + SOFTWARE_NODE("GPM", NULL, NULL), + SOFTWARE_NODE("GPN", NULL, NULL), + SOFTWARE_NODE("GPO", NULL, NULL), + SOFTWARE_NODE("GPP", NULL, NULL), + SOFTWARE_NODE("GPQ", NULL, NULL), +}; + +#define NUM_SAMSUNG_GPIOCHIPS ARRAY_SIZE(samsung_gpiochip_nodes) + static int samsung_gpio_setpull_updown(struct samsung_gpio_chip *chip, unsigned int off, samsung_gpio_pull_t pull) { @@ -491,6 +513,16 @@ static __init void s3c_gpiolib_track(struct samsung_gpio_chip *chip) } #endif /* CONFIG_S3C_GPIO_TRACK */ +static void __init samsung_setup_gpiochip_nodes(void) +{ + const struct software_node *group[NUM_SAMSUNG_GPIOCHIPS + 1] = { 0 }; + + for (unsigned int i = 0; i < NUM_SAMSUNG_GPIOCHIPS; i++) + group[i] = &samsung_gpiochip_nodes[i]; + + software_node_register_node_group(group); +} + /* * samsung_gpiolib_add() - add the Samsung gpio_chip. * @chip: The chip to register @@ -506,12 +538,16 @@ static void __init samsung_gpiolib_add(struct samsung_gpio_chip *chip) struct gpio_chip *gc = &chip->chip; int ret; + gc->label = chip->swnode->name; + BUG_ON(!chip->base); BUG_ON(!gc->label); BUG_ON(!gc->ngpio); spin_lock_init(&chip->lock); + gc->fwnode = software_node_fwnode(chip->swnode); + if (!gc->direction_input) gc->direction_input = samsung_gpiolib_2bit_input; if (!gc->direction_output) @@ -659,49 +695,49 @@ static struct samsung_gpio_chip s3c64xx_gpios_4bit[] = { .chip = { .base = S3C64XX_GPA(0), .ngpio = S3C64XX_GPIO_A_NR, - .label = "GPA", }, + .swnode = SAMSUNG_GPIO_NODE('A'), }, { .chip = { .base = S3C64XX_GPB(0), .ngpio = S3C64XX_GPIO_B_NR, - .label = "GPB", }, + .swnode = SAMSUNG_GPIO_NODE('B'), }, { .chip = { .base = S3C64XX_GPC(0), .ngpio = S3C64XX_GPIO_C_NR, - .label = "GPC", }, + .swnode = SAMSUNG_GPIO_NODE('C'), }, { .chip = { .base = S3C64XX_GPD(0), .ngpio = S3C64XX_GPIO_D_NR, - .label = "GPD", }, + .swnode = SAMSUNG_GPIO_NODE('D'), }, { .config = &samsung_gpio_cfgs[0], .chip = { .base = S3C64XX_GPE(0), .ngpio = S3C64XX_GPIO_E_NR, - .label = "GPE", }, + .swnode = SAMSUNG_GPIO_NODE('E'), }, { .base = S3C64XX_GPG_BASE, .chip = { .base = S3C64XX_GPG(0), .ngpio = S3C64XX_GPIO_G_NR, - .label = "GPG", }, + .swnode = SAMSUNG_GPIO_NODE('G'), }, { .base = S3C64XX_GPM_BASE, .config = &samsung_gpio_cfgs[1], .chip = { .base = S3C64XX_GPM(0), .ngpio = S3C64XX_GPIO_M_NR, - .label = "GPM", .to_irq = s3c64xx_gpiolib_mbank_to_irq, }, + .swnode = SAMSUNG_GPIO_NODE('M'), }, }; @@ -711,25 +747,25 @@ static struct samsung_gpio_chip s3c64xx_gpios_4bit2[] = { .chip = { .base = S3C64XX_GPH(0), .ngpio = S3C64XX_GPIO_H_NR, - .label = "GPH", }, + .swnode = SAMSUNG_GPIO_NODE('H'), }, { .base = S3C64XX_GPK_BASE + 0x4, .config = &samsung_gpio_cfgs[0], .chip = { .base = S3C64XX_GPK(0), .ngpio = S3C64XX_GPIO_K_NR, - .label = "GPK", }, + .swnode = SAMSUNG_GPIO_NODE('K'), }, { .base = S3C64XX_GPL_BASE + 0x4, .config = &samsung_gpio_cfgs[1], .chip = { .base = S3C64XX_GPL(0), .ngpio = S3C64XX_GPIO_L_NR, - .label = "GPL", .to_irq = s3c64xx_gpiolib_lbank_to_irq, }, + .swnode = SAMSUNG_GPIO_NODE('L'), }, }; @@ -740,43 +776,43 @@ static struct samsung_gpio_chip s3c64xx_gpios_2bit[] = { .chip = { .base = S3C64XX_GPF(0), .ngpio = S3C64XX_GPIO_F_NR, - .label = "GPF", }, + .swnode = SAMSUNG_GPIO_NODE('F'), }, { .config = &samsung_gpio_cfgs[7], .chip = { .base = S3C64XX_GPI(0), .ngpio = S3C64XX_GPIO_I_NR, - .label = "GPI", }, + .swnode = SAMSUNG_GPIO_NODE('I'), }, { .config = &samsung_gpio_cfgs[7], .chip = { .base = S3C64XX_GPJ(0), .ngpio = S3C64XX_GPIO_J_NR, - .label = "GPJ", }, + .swnode = SAMSUNG_GPIO_NODE('J'), }, { .config = &samsung_gpio_cfgs[6], .chip = { .base = S3C64XX_GPO(0), .ngpio = S3C64XX_GPIO_O_NR, - .label = "GPO", }, + .swnode = SAMSUNG_GPIO_NODE('O'), }, { .config = &samsung_gpio_cfgs[6], .chip = { .base = S3C64XX_GPP(0), .ngpio = S3C64XX_GPIO_P_NR, - .label = "GPP", }, + .swnode = SAMSUNG_GPIO_NODE('P'), }, { .config = &samsung_gpio_cfgs[6], .chip = { .base = S3C64XX_GPQ(0), .ngpio = S3C64XX_GPIO_Q_NR, - .label = "GPQ", }, + .swnode = SAMSUNG_GPIO_NODE('Q'), }, { .base = S3C64XX_GPN_BASE, .irq_base = IRQ_EINT(0), @@ -784,9 +820,9 @@ static struct samsung_gpio_chip s3c64xx_gpios_2bit[] = { .chip = { .base = S3C64XX_GPN(0), .ngpio = S3C64XX_GPIO_N_NR, - .label = "GPN", .to_irq = samsung_gpiolib_to_irq, }, + .swnode = SAMSUNG_GPIO_NODE('N'), }, }; @@ -803,6 +839,8 @@ static __init int samsung_gpiolib_init(void) return 0; if (soc_is_s3c64xx()) { + samsung_setup_gpiochip_nodes(); + samsung_gpiolib_set_cfg(samsung_gpio_cfgs, ARRAY_SIZE(samsung_gpio_cfgs)); samsung_gpiolib_add_2bit_chips(s3c64xx_gpios_2bit, diff --git a/arch/arm/mach-s3c/keypad.h b/arch/arm/mach-s3c/keypad.h deleted file mode 100644 index 9754b9a29945..000000000000 --- a/arch/arm/mach-s3c/keypad.h +++ /dev/null @@ -1,27 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* - * Samsung Platform - Keypad platform data definitions - * - * Copyright (C) 2010 Samsung Electronics Co.Ltd - * Author: Joonyoung Shim <jy0922.shim@samsung.com> - */ - -#ifndef __PLAT_SAMSUNG_KEYPAD_H -#define __PLAT_SAMSUNG_KEYPAD_H - -#include <linux/input/samsung-keypad.h> - -/** - * samsung_keypad_set_platdata - Set platform data for Samsung Keypad device. - * @pd: Platform data to register to device. - * - * Register the given platform data for use with Samsung Keypad device. - * The call will copy the platform data, so the board definitions can - * make the structure itself __initdata. - */ -extern void samsung_keypad_set_platdata(struct samsung_keypad_platdata *pd); - -/* defined by architecture to configure gpio. */ -extern void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols); - -#endif /* __PLAT_SAMSUNG_KEYPAD_H */ diff --git a/arch/arm/mach-s3c/mach-crag6410.c b/arch/arm/mach-s3c/mach-crag6410.c index 57176719d8a6..2264beef6dda 100644 --- a/arch/arm/mach-s3c/mach-crag6410.c +++ b/arch/arm/mach-s3c/mach-crag6410.c @@ -15,13 +15,16 @@ #include <linux/io.h> #include <linux/init.h> #include <linux/input-event-codes.h> +#include <linux/input/matrix_keypad.h> #include <linux/gpio/legacy.h> #include <linux/gpio/machine.h> +#include <linux/gpio/property.h> #include <linux/leds.h> #include <linux/delay.h> #include <linux/mmc/host.h> #include <linux/regulator/machine.h> #include <linux/regulator/fixed.h> +#include <linux/property.h> #include <linux/pwm.h> #include <linux/pwm_backlight.h> #include <linux/dm9000.h> @@ -53,7 +56,6 @@ #include "gpio-cfg.h" #include <linux/platform_data/spi-s3c64xx.h> -#include "keypad.h" #include "devs.h" #include "cpu.h" #include <linux/platform_data/i2c-s3c2410.h> @@ -176,7 +178,7 @@ static struct s3c_fb_platdata crag6410_lcd_pdata = { /* 2x6 keypad */ -static uint32_t crag6410_keymap[] = { +static const u32 crag6410_keymap[] __initconst = { /* KEY(row, col, keycode) */ KEY(0, 0, KEY_VOLUMEUP), KEY(0, 1, KEY_HOME), @@ -192,43 +194,103 @@ static uint32_t crag6410_keymap[] = { KEY(1, 5, KEY_CAMERA), }; -static struct matrix_keymap_data crag6410_keymap_data = { - .keymap = crag6410_keymap, - .keymap_size = ARRAY_SIZE(crag6410_keymap), +static const struct property_entry crag6410_keypad_props[] __initconst = { + PROPERTY_ENTRY_U32("keypad,num-columns", 6), + PROPERTY_ENTRY_U32("keypad,num-rows", 2), + PROPERTY_ENTRY_U32_ARRAY("linux,keymap", crag6410_keymap), + { } }; -static struct samsung_keypad_platdata crag6410_keypad_data = { - .keymap_data = &crag6410_keymap_data, - .rows = 2, - .cols = 6, +static const struct resource crag6410_keypad_resources[] __initconst = { + [0] = DEFINE_RES_MEM(SAMSUNG_PA_KEYPAD, SZ_32), + [1] = DEFINE_RES_IRQ(IRQ_KEYPAD), }; -static struct gpio_keys_button crag6410_gpio_keys[] = { - [0] = { - .code = KEY_SUSPEND, - .gpio = S3C64XX_GPL(10), /* EINT 18 */ - .type = EV_KEY, - .wakeup = 1, - .active_low = 1, - }, - [1] = { - .code = SW_FRONT_PROXIMITY, - .gpio = S3C64XX_GPN(11), /* EINT 11 */ - .type = EV_SW, - }, +static const struct platform_device_info crag6410_keypad_info __initconst = { + .name = "samsung-keypad", + .id = PLATFORM_DEVID_NONE, + .res = crag6410_keypad_resources, + .num_res = ARRAY_SIZE(crag6410_keypad_resources), + .properties = crag6410_keypad_props, +}; + +static void __init crag6410_setup_keypad(void) +{ + struct platform_device *pd; + + /* Set all the necessary GPK pins to special-function 3: KP_ROW[x] */ + s3c_gpio_cfgrange_nopull(S3C64XX_GPK(8), 2, S3C_GPIO_SFN(3)); + + /* Set all the necessary GPL pins to special-function 3: KP_COL[x] */ + s3c_gpio_cfgrange_nopull(S3C64XX_GPL(0), 6, S3C_GPIO_SFN(3)); + + pd = platform_device_register_full(&crag6410_keypad_info); + if (IS_ERR(pd)) + pr_err("failed to instantiate keypad device\n"); +} + +static const struct software_node crag6410_gpio_keys_node = { + .name = "crag6410-gpio-keys", }; -static struct gpio_keys_platform_data crag6410_gpio_keydata = { - .buttons = crag6410_gpio_keys, - .nbuttons = ARRAY_SIZE(crag6410_gpio_keys), +static const struct property_entry crag6410_suspend_key_props[] = { + PROPERTY_ENTRY_U32("linux,code", KEY_SUSPEND), + PROPERTY_ENTRY_GPIO("gpios", + SAMSUNG_GPIO_NODE('L'), 10, /* EINT 18 */ + GPIO_ACTIVE_LOW), + PROPERTY_ENTRY_BOOL("wakeup-source"), + { } }; -static struct platform_device crag6410_gpio_keydev = { - .name = "gpio-keys", - .id = 0, - .dev.platform_data = &crag6410_gpio_keydata, +static const struct software_node crag6410_suspend_key_node = { + .parent = &crag6410_gpio_keys_node, + .properties = crag6410_suspend_key_props, +}; + +static const struct property_entry crag6410_prox_sw_props[] = { + PROPERTY_ENTRY_U32("linux,input-type", EV_SW), + PROPERTY_ENTRY_U32("linux,code", SW_FRONT_PROXIMITY), + PROPERTY_ENTRY_GPIO("gpios", + SAMSUNG_GPIO_NODE('N'), 11, /* EINT 11 */ + GPIO_ACTIVE_HIGH), + { } +}; + +static const struct software_node crag6410_prox_sw_node = { + .parent = &crag6410_gpio_keys_node, + .properties = crag6410_prox_sw_props, }; +static const struct software_node *crag6410_gpio_keys_swnodes[] = { + &crag6410_gpio_keys_node, + &crag6410_suspend_key_node, + &crag6410_prox_sw_node, + NULL +}; + +static void __init crag6410_setup_gpio_keys(void) +{ + struct platform_device_info keys_info = { + .name = "gpio-keys", + .id = 0, + }; + struct platform_device *pd; + int err; + + err = software_node_register_node_group(crag6410_gpio_keys_swnodes); + if (err) { + pr_err("failed to register gpio-keys software nodes: %d\n", err); + return; + } + + keys_info.fwnode = software_node_fwnode(&crag6410_gpio_keys_node); + + pd = platform_device_register_full(&keys_info); + err = PTR_ERR_OR_ZERO(pd); + if (err) + pr_err("failed to create gpio-keys device: %d\n", err); +} + static struct resource crag6410_dm9k_resource[] = { [0] = DEFINE_RES_MEM(S3C64XX_PA_XM0CSN5, 2), [1] = DEFINE_RES_MEM(S3C64XX_PA_XM0CSN5 + (1 << 8), 2), @@ -361,7 +423,7 @@ static struct platform_device wallvdd_device = { }, }; -static struct platform_device *crag6410_devices[] __initdata = { +static struct platform_device *crag6410_devs0[] __initdata = { &s3c_device_hsmmc0, &s3c_device_hsmmc2, &s3c_device_i2c0, @@ -372,8 +434,9 @@ static struct platform_device *crag6410_devices[] __initdata = { &samsung_device_pwm, &s3c64xx_device_iis0, &s3c64xx_device_iis1, - &samsung_device_keypad, - &crag6410_gpio_keydev, +}; + +static struct platform_device *crag6410_devs1[] __initdata = { &crag6410_dm9k_device, &s3c64xx_device_spi0, &crag6410_lcd_powerdev, @@ -873,16 +936,18 @@ static void __init crag6410_machine_init(void) gpiod_add_lookup_table(&crag_wm1250_ev1_gpiod_table); i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1)); - samsung_keypad_set_platdata(&crag6410_keypad_data); - gpiod_add_lookup_table(&crag_spi0_gpiod_table); s3c64xx_spi0_set_platdata(0, 2); pwm_add_table(crag6410_pwm_lookup, ARRAY_SIZE(crag6410_pwm_lookup)); - platform_add_devices(crag6410_devices, ARRAY_SIZE(crag6410_devices)); + platform_add_devices(crag6410_devs0, ARRAY_SIZE(crag6410_devs0)); platform_device_register_full(&crag6410_mmgpio_devinfo); gpiod_add_lookup_table(&crag_leds_table); + crag6410_setup_keypad(); + crag6410_setup_gpio_keys(); + + platform_add_devices(crag6410_devs1, ARRAY_SIZE(crag6410_devs1)); gpio_led_register_device(-1, &gpio_leds_pdata); regulator_has_full_constraints(); diff --git a/arch/arm/mach-s3c/setup-keypad-s3c64xx.c b/arch/arm/mach-s3c/setup-keypad-s3c64xx.c deleted file mode 100644 index 2e1367878fb1..000000000000 --- a/arch/arm/mach-s3c/setup-keypad-s3c64xx.c +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -// -// Copyright (c) 2010 Samsung Electronics Co., Ltd. -// http://www.samsung.com/ -// -// GPIO configuration for S3C64XX KeyPad device - -#include <linux/gpio/consumer.h> -#include "gpio-cfg.h" -#include "keypad.h" -#include "gpio-samsung.h" - -void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols) -{ - /* Set all the necessary GPK pins to special-function 3: KP_ROW[x] */ - s3c_gpio_cfgrange_nopull(S3C64XX_GPK(8), rows, S3C_GPIO_SFN(3)); - - /* Set all the necessary GPL pins to special-function 3: KP_COL[x] */ - s3c_gpio_cfgrange_nopull(S3C64XX_GPL(0), cols, S3C_GPIO_SFN(3)); -} diff --git a/arch/arm/mach-tegra/sleep.S b/arch/arm/mach-tegra/sleep.S index 945f2c1474f7..751cc71dce7f 100644 --- a/arch/arm/mach-tegra/sleep.S +++ b/arch/arm/mach-tegra/sleep.S @@ -48,7 +48,7 @@ ENTRY(tegra_disable_clean_inv_dcache) blne v7_flush_dcache_louis bleq v7_flush_dcache_all - /* Trun off coherency */ + /* Turn off coherency */ exit_smp r4, r5 ldmfd sp!, {r0, r4-r5, r7, r9-r11, pc} diff --git a/arch/arm/mach-versatile/platsmp-vexpress.c b/arch/arm/mach-versatile/platsmp-vexpress.c index 1ee3c45e71c9..b810ad50b98c 100644 --- a/arch/arm/mach-versatile/platsmp-vexpress.c +++ b/arch/arm/mach-versatile/platsmp-vexpress.c @@ -61,8 +61,8 @@ static const struct of_device_id vexpress_smp_dt_scu_match[] __initconst = { static void __init vexpress_smp_dt_prepare_cpus(unsigned int max_cpus) { - struct device_node *scu = of_find_matching_node(NULL, - vexpress_smp_dt_scu_match); + struct device_node *scu __free(device_node) = + of_find_matching_node(NULL, vexpress_smp_dt_scu_match); if (scu) scu_enable(of_iomap(scu, 0)); diff --git a/arch/arm/mach-versatile/v2m.c b/arch/arm/mach-versatile/v2m.c index 79afdf2a90b6..c86b38386cf7 100644 --- a/arch/arm/mach-versatile/v2m.c +++ b/arch/arm/mach-versatile/v2m.c @@ -13,8 +13,8 @@ void vexpress_flags_set(u32 data) static void __iomem *base; if (!base) { - struct device_node *node = of_find_compatible_node(NULL, NULL, - "arm,vexpress-sysreg"); + struct device_node *node __free(device_node) = + of_find_compatible_node(NULL, NULL, "arm,vexpress-sysreg"); base = of_iomap(node, 0); } diff --git a/drivers/input/keyboard/samsung-keypad.c b/drivers/input/keyboard/samsung-keypad.c index deffa98749c0..f56c5249401d 100644 --- a/drivers/input/keyboard/samsung-keypad.c +++ b/drivers/input/keyboard/samsung-keypad.c @@ -12,6 +12,7 @@ #include <linux/delay.h> #include <linux/err.h> #include <linux/input.h> +#include <linux/input/matrix_keypad.h> #include <linux/interrupt.h> #include <linux/io.h> #include <linux/module.h> @@ -21,7 +22,9 @@ #include <linux/slab.h> #include <linux/of.h> #include <linux/sched.h> -#include <linux/input/samsung-keypad.h> + +#define SAMSUNG_MAX_ROWS 8 +#define SAMSUNG_MAX_COLS 8 #define SAMSUNG_KEYIFCON 0x00 #define SAMSUNG_KEYIFSTSCLR 0x04 @@ -221,145 +224,92 @@ static void samsung_keypad_close(struct input_dev *input_dev) samsung_keypad_stop(keypad); } -#ifdef CONFIG_OF -static struct samsung_keypad_platdata * -samsung_keypad_parse_dt(struct device *dev) +static int samsung_parse_verbose_keymap(struct samsung_keypad *keypad) { - struct samsung_keypad_platdata *pdata; - struct matrix_keymap_data *keymap_data; - uint32_t *keymap, num_rows = 0, num_cols = 0; - struct device_node *np = dev->of_node, *key_np; - unsigned int key_count; - - if (!np) { - dev_err(dev, "missing device tree data\n"); - return ERR_PTR(-EINVAL); - } - - pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); - if (!pdata) { - dev_err(dev, "could not allocate memory for platform data\n"); - return ERR_PTR(-ENOMEM); - } + struct matrix_keymap_data keymap_data = { 0 }; + struct device *dev = &keypad->pdev->dev; + struct fwnode_handle *child; + unsigned int key_count = device_get_child_node_count(dev); + unsigned int i; + + u32 *keymap __free(kfree) = kcalloc(key_count, sizeof(*keymap), GFP_KERNEL); + if (!keymap) + return -ENOMEM; - of_property_read_u32(np, "samsung,keypad-num-rows", &num_rows); - of_property_read_u32(np, "samsung,keypad-num-columns", &num_cols); - if (!num_rows || !num_cols) { - dev_err(dev, "number of keypad rows/columns not specified\n"); - return ERR_PTR(-EINVAL); - } - pdata->rows = num_rows; - pdata->cols = num_cols; + keymap_data.keymap_size = key_count; + keymap_data.keymap = keymap; - keymap_data = devm_kzalloc(dev, sizeof(*keymap_data), GFP_KERNEL); - if (!keymap_data) { - dev_err(dev, "could not allocate memory for keymap data\n"); - return ERR_PTR(-ENOMEM); - } - pdata->keymap_data = keymap_data; - - key_count = of_get_child_count(np); - keymap_data->keymap_size = key_count; - keymap = devm_kcalloc(dev, key_count, sizeof(uint32_t), GFP_KERNEL); - if (!keymap) { - dev_err(dev, "could not allocate memory for keymap\n"); - return ERR_PTR(-ENOMEM); - } - keymap_data->keymap = keymap; - - for_each_child_of_node(np, key_np) { + i = 0; + device_for_each_child_node(dev, child) { u32 row, col, key_code; - of_property_read_u32(key_np, "keypad,row", &row); - of_property_read_u32(key_np, "keypad,column", &col); - of_property_read_u32(key_np, "linux,code", &key_code); - *keymap++ = KEY(row, col, key_code); - } - pdata->no_autorepeat = of_property_read_bool(np, "linux,input-no-autorepeat"); - - pdata->wakeup = of_property_read_bool(np, "wakeup-source") || - /* legacy name */ - of_property_read_bool(np, "linux,input-wakeup"); + fwnode_property_read_u32(child, "keypad,row", &row); + fwnode_property_read_u32(child, "keypad,column", &col); + fwnode_property_read_u32(child, "linux,code", &key_code); + keymap[i++] = KEY(row, col, key_code); + } - return pdata; + return matrix_keypad_build_keymap(&keymap_data, NULL, + keypad->rows, keypad->cols, + keypad->keycodes, + keypad->input_dev); } -#else -static struct samsung_keypad_platdata * -samsung_keypad_parse_dt(struct device *dev) + +static int samsung_keypad_parse_keymap(struct samsung_keypad *keypad) { - dev_err(dev, "no platform data defined\n"); + struct device *dev = &keypad->pdev->dev; + + if (device_property_present(dev, "linux,keymap")) + return matrix_keypad_build_keymap(NULL, NULL, + keypad->rows, keypad->cols, + keypad->keycodes, + keypad->input_dev); - return ERR_PTR(-EINVAL); + return samsung_parse_verbose_keymap(keypad); } -#endif static int samsung_keypad_probe(struct platform_device *pdev) { - const struct samsung_keypad_platdata *pdata; - const struct matrix_keymap_data *keymap_data; const struct platform_device_id *id; + struct device *dev = &pdev->dev; struct samsung_keypad *keypad; struct resource *res; struct input_dev *input_dev; unsigned int row_shift; + u32 num_rows = 0, num_cols = 0; + bool wakeup; int error; - pdata = dev_get_platdata(&pdev->dev); - if (!pdata) { - pdata = samsung_keypad_parse_dt(&pdev->dev); - if (IS_ERR(pdata)) - return PTR_ERR(pdata); - } - - keymap_data = pdata->keymap_data; - if (!keymap_data) { - dev_err(&pdev->dev, "no keymap data defined\n"); - return -EINVAL; + if (device_property_present(dev, "linux,keymap")) { + error = matrix_keypad_parse_properties(dev, &num_rows, &num_cols); + if (error) + return error; + } else { + device_property_read_u32(dev, "samsung,keypad-num-rows", &num_rows); + device_property_read_u32(dev, "samsung,keypad-num-columns", &num_cols); + if (!num_rows || !num_cols) { + dev_err(dev, "number of keypad rows/columns not specified\n"); + return -EINVAL; + } } - if (!pdata->rows || pdata->rows > SAMSUNG_MAX_ROWS) + if (num_rows > SAMSUNG_MAX_ROWS || num_cols > SAMSUNG_MAX_COLS) return -EINVAL; - if (!pdata->cols || pdata->cols > SAMSUNG_MAX_COLS) - return -EINVAL; - - /* initialize the gpio */ - if (pdata->cfg_gpio) - pdata->cfg_gpio(pdata->rows, pdata->cols); - - row_shift = get_count_order(pdata->cols); + row_shift = get_count_order(num_cols); keypad = devm_kzalloc(&pdev->dev, struct_size(keypad, keycodes, - pdata->rows << row_shift), + num_rows << row_shift), GFP_KERNEL); if (!keypad) return -ENOMEM; - input_dev = devm_input_allocate_device(&pdev->dev); - if (!input_dev) - return -ENOMEM; - - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -ENODEV; - - keypad->base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); - if (!keypad->base) - return -EBUSY; - - keypad->clk = devm_clk_get_prepared(&pdev->dev, "keypad"); - if (IS_ERR(keypad->clk)) { - dev_err(&pdev->dev, "failed to get keypad clk\n"); - return PTR_ERR(keypad->clk); - } - - keypad->input_dev = input_dev; keypad->pdev = pdev; keypad->row_shift = row_shift; - keypad->rows = pdata->rows; - keypad->cols = pdata->cols; + keypad->rows = num_rows; + keypad->cols = num_cols; keypad->stopped = true; init_waitqueue_head(&keypad->wait); @@ -375,26 +325,45 @@ static int samsung_keypad_probe(struct platform_device *pdev) return -EINVAL; } + input_dev = devm_input_allocate_device(&pdev->dev); + if (!input_dev) + return -ENOMEM; + + keypad->input_dev = input_dev; + input_dev->name = pdev->name; input_dev->id.bustype = BUS_HOST; input_dev->open = samsung_keypad_open; input_dev->close = samsung_keypad_close; - error = matrix_keypad_build_keymap(keymap_data, NULL, - pdata->rows, pdata->cols, - keypad->keycodes, input_dev); + error = samsung_keypad_parse_keymap(keypad); if (error) { dev_err(&pdev->dev, "failed to build keymap\n"); return error; } input_set_capability(input_dev, EV_MSC, MSC_SCAN); - if (!pdata->no_autorepeat) + + if (!device_property_read_bool(&pdev->dev, "linux,input-no-autorepeat")) __set_bit(EV_REP, input_dev->evbit); input_set_drvdata(input_dev, keypad); + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!res) + return -ENODEV; + + keypad->base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); + if (!keypad->base) + return -EBUSY; + + keypad->clk = devm_clk_get_prepared(&pdev->dev, "keypad"); + if (IS_ERR(keypad->clk)) { + dev_err(&pdev->dev, "failed to get keypad clk\n"); + return PTR_ERR(keypad->clk); + } + keypad->irq = platform_get_irq(pdev, 0); if (keypad->irq < 0) { error = keypad->irq; @@ -410,7 +379,11 @@ static int samsung_keypad_probe(struct platform_device *pdev) return error; } - device_init_wakeup(&pdev->dev, pdata->wakeup); + wakeup = device_property_read_bool(dev, "wakeup-source") || + /* legacy name */ + device_property_read_bool(dev, "linux,input-wakeup"); + device_init_wakeup(&pdev->dev, wakeup); + platform_set_drvdata(pdev, keypad); error = devm_pm_runtime_enable(&pdev->dev); @@ -421,11 +394,6 @@ static int samsung_keypad_probe(struct platform_device *pdev) if (error) return error; - if (pdev->dev.of_node) { - devm_kfree(&pdev->dev, (void *)pdata->keymap_data->keymap); - devm_kfree(&pdev->dev, (void *)pdata->keymap_data); - devm_kfree(&pdev->dev, (void *)pdata); - } return 0; } diff --git a/include/linux/input/samsung-keypad.h b/include/linux/input/samsung-keypad.h deleted file mode 100644 index ab6b97114c08..000000000000 --- a/include/linux/input/samsung-keypad.h +++ /dev/null @@ -1,39 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* - * Samsung Keypad platform data definitions - * - * Copyright (C) 2010 Samsung Electronics Co.Ltd - * Author: Joonyoung Shim <jy0922.shim@samsung.com> - */ - -#ifndef __SAMSUNG_KEYPAD_H -#define __SAMSUNG_KEYPAD_H - -#include <linux/input/matrix_keypad.h> - -#define SAMSUNG_MAX_ROWS 8 -#define SAMSUNG_MAX_COLS 8 - -/** - * struct samsung_keypad_platdata - Platform device data for Samsung Keypad. - * @keymap_data: pointer to &matrix_keymap_data. - * @rows: number of keypad row supported. - * @cols: number of keypad col supported. - * @no_autorepeat: disable key autorepeat. - * @wakeup: controls whether the device should be set up as wakeup source. - * @cfg_gpio: configure the GPIO. - * - * Initialisation data specific to either the machine or the platform - * for the device driver to use or call-back when configuring gpio. - */ -struct samsung_keypad_platdata { - const struct matrix_keymap_data *keymap_data; - unsigned int rows; - unsigned int cols; - bool no_autorepeat; - bool wakeup; - - void (*cfg_gpio)(unsigned int rows, unsigned int cols); -}; - -#endif /* __SAMSUNG_KEYPAD_H */ diff --git a/include/linux/micrel_phy.h b/include/linux/micrel_phy.h index 9c6f9817383f..bb71b2510c2c 100644 --- a/include/linux/micrel_phy.h +++ b/include/linux/micrel_phy.h @@ -47,11 +47,6 @@ #define MICREL_PHY_FXEN BIT(1) #define MICREL_KSZ8_P1_ERRATA BIT(2) -#define MICREL_KSZ9021_EXTREG_CTRL 0xB -#define MICREL_KSZ9021_EXTREG_DATA_WRITE 0xC -#define MICREL_KSZ9021_RGMII_CLK_CTRL_PAD_SCEW 0x104 -#define MICREL_KSZ9021_RGMII_RX_DATA_PAD_SCEW 0x105 - /* Device specific MII_BMCR (Reg 0) bits */ /* 1 = HP Auto MDI/MDI-X mode, 0 = Microchip Auto MDI/MDI-X mode */ #define KSZ886X_BMCR_HP_MDIX BIT(5) diff --git a/include/soc/imx/cpu.h b/include/soc/imx/cpu.h index 0bf610acafd0..8c53150acd76 100644 --- a/include/soc/imx/cpu.h +++ b/include/soc/imx/cpu.h @@ -30,7 +30,7 @@ #define MXC_CPU_VF600 0x600 #define MXC_CPU_VF610 (MXC_CPU_VF600 | MXC_CPU_VFx10) -#ifndef __ASSEMBLY__ +#ifndef __ASSEMBLER__ extern unsigned int __mxc_cpu_type; #endif |
