aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpio
AgeCommit message (Collapse)AuthorFilesLines
2019-03-26gpio: 74x164: Remove linux/init.h and sort headersAndy Shevchenko1-5/+4
There is no need to include linux/init.h when at the same time we include linux/module.h. Remove redundant inclusion. While here, sort header block alphabetically for easy maintenance. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-03-26gpio: 74x164: Make use of device propertiesAndy Shevchenko1-4/+4
ACPI-enabled platforms can use this device via unified device properties API. Convert driver to support this. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-03-25gpio: aspeed: fix a potential NULL pointer dereferenceKangjie Lu1-0/+2
In case devm_kzalloc, the patch returns ENOMEM to avoid potential NULL pointer dereference. Signed-off-by: Kangjie Lu <[email protected]> Reviewed-by: Andrew Jeffery <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-03-24gpiolib: export devprop_gpiochip_set_names()Jan Kundrát2-3/+2
This function is needed in mcp23s08. That driver is a special snowflake because it supports several hardware chips as a single "GPIO chip" under Linux. Signed-off-by: Jan Kundrát <[email protected]> Cc: Linus Walleij <[email protected]> Cc: Phil Reid <[email protected]> Acked-by: Mika Westerberg <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-03-22gpio: mockup: move the driver out of the IOMEM drivers sectionBartosz Golaszewski1-12/+12
The testing driver doesn't really depend on HAS_IOMEM. We may want to build it for testing purposes on architectures not supporting IOMEM, for example: on user-mode linux. Move it out of the "Memory Mapped GPIO drivers" section. Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-03-22gpio: mockup: drop unneeded dependencies from KconfigBartosz Golaszewski1-3/+1
The testing module doesn't need GPIO irqchip nor does it depend on sysfs. Remove unnecessary dependencies from Kconfig. Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-03-22gpio: adnp: Fix testing wrong value in adnp_gpio_direction_inputAxel Lin1-2/+4
Current code test wrong value so it does not verify if the written data is correctly read back. Fix it. Also make it return -EPERM if read value does not match written bit, just like it done for adnp_gpio_direction_output(). Fixes: 5e969a401a01 ("gpio: Add Avionic Design N-bit GPIO expander support") Cc: <[email protected]> Signed-off-by: Axel Lin <[email protected]> Reviewed-by: Thierry Reding <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-03-22gpio: exar: add a check for the return value of ida_simple_get failsKangjie Lu1-0/+2
ida_simple_get may fail and return a negative error number. The fix checks its return value; if it fails, go to err_destroy. Cc: <[email protected]> Signed-off-by: Kangjie Lu <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-03-22gpio: pca953x: Add support for CAT9554Geert Uytterhoeven1-0/+1
The ON Semiconductor CAT9554 is a variant of the PCA953x GPIO expander, with 8 GPIOs and interrupt functionality. Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-03-18gpio: vf610: Don't use explicit &pdev->dev in vf610_gpio_probe()Andrey Smirnov1-3/+3
The code already defines "dev" variable to help with that, so make sure all of the code uses it. Signed-off-by: Andrey Smirnov <[email protected]> Cc: Linus Walleij <[email protected]> Cc: Bartosz Golaszewski <[email protected]> Cc: Chris Healy <[email protected]> Cc: Andrew Lunn <[email protected]> Cc: Heiner Kallweit <[email protected]> Cc: Fabio Estevam <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-03-18gpio: vf610: Use devres to remove gpiochipAndrey Smirnov1-14/+1
Now that the driver's custom remove hook contains only a single action, replace it by converting the code to use devm_gpiochip_add_data() to simplify things. Signed-off-by: Andrey Smirnov <[email protected]> Cc: Linus Walleij <[email protected]> Cc: Bartosz Golaszewski <[email protected]> Cc: Chris Healy <[email protected]> Cc: Andrew Lunn <[email protected]> Cc: Heiner Kallweit <[email protected]> Cc: Fabio Estevam <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-03-18gpio: vf610: Use devres to disable clk_gpioAndrey Smirnov1-2/+4
Clk_gpio should be disabled in all error paths in the code that follws, including the case when either gpiochip_add_data() or gpiochip_irqchip_add() fail. To simplify things fix this by using devm_add_action() to disable corresponding clock in case of any erros as well as driver/device removal. Signed-off-by: Andrey Smirnov <[email protected]> Cc: Linus Walleij <[email protected]> Cc: Bartosz Golaszewski <[email protected]> Cc: Chris Healy <[email protected]> Cc: Andrew Lunn <[email protected]> Cc: Heiner Kallweit <[email protected]> Cc: Fabio Estevam <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-03-18gpio: vf610: Use devres to disable clk_portAndrey Smirnov1-6/+10
Clk_port should be disabled in all error paths in the code that follws, including the case when either gpiochip_add_data() or gpiochip_irqchip_add() fail. To simplify things fix this by using devm_add_action_or_reset() to disable corresponding clock in case of any erros as well as driver/device removal. Signed-off-by: Andrey Smirnov <[email protected]> Cc: Linus Walleij <[email protected]> Cc: Bartosz Golaszewski <[email protected]> Cc: Chris Healy <[email protected]> Cc: Andrew Lunn <[email protected]> Cc: Heiner Kallweit <[email protected]> Cc: Fabio Estevam <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-03-18gpio: vf610: Simplify vf610_gpio_get()Andrey Smirnov1-7/+5
Both branches of the if statement do exactly the same thing, just at different offsets. Simplify the code a bit by moving shared action code outside of the if statement. No functional change intended. Signed-off-by: Andrey Smirnov <[email protected]> Cc: Linus Walleij <[email protected]> Cc: Bartosz Golaszewski <[email protected]> Cc: Chris Healy <[email protected]> Cc: Andrew Lunn <[email protected]> Cc: Heiner Kallweit <[email protected]> Cc: Fabio Estevam <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-03-18gpio: vf610: Simplify vf610_gpio_set()Andrey Smirnov1-4/+2
The only difference between two codepaths is register offset used. Simplify the code a bit by replacing explicit calls with a single call with a variable offset. No functional change intended. Signed-off-by: Andrey Smirnov <[email protected]> Cc: Linus Walleij <[email protected]> Cc: Bartosz Golaszewski <[email protected]> Cc: Chris Healy <[email protected]> Cc: Andrew Lunn <[email protected]> Cc: Heiner Kallweit <[email protected]> Cc: Fabio Estevam <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-03-18gpio: vf610: Do not share irq_chipAndrey Smirnov1-14/+12
Fix the warning produced by gpiochip_set_irq_hooks() by allocating a dedicated IRQ chip per GPIO chip/port. Signed-off-by: Andrey Smirnov <[email protected]> Cc: Linus Walleij <[email protected]> Cc: Bartosz Golaszewski <[email protected]> Cc: Chris Healy <[email protected]> Cc: Andrew Lunn <[email protected]> Cc: Heiner Kallweit <[email protected]> Cc: Fabio Estevam <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-03-09Merge tag 'pci-v5.1-changes' of ↵Linus Torvalds2-3/+0
git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull PCI updates from Bjorn Helgaas: - Use match_string() instead of reimplementing it (Andy Shevchenko) - Enable SERR# forwarding for all bridges (Bharat Kumar Gogada) - Use Latency Tolerance Reporting if already enabled by platform (Bjorn Helgaas) - Save/restore LTR info for suspend/resume (Bjorn Helgaas) - Fix DPC use of uninitialized data (Dongdong Liu) - Probe bridge window attributes only once at enumeration-time to fix device accesses during rescan (Bjorn Helgaas) - Return BAR size (not "size -1 ") from pci_size() to simplify code (Du Changbin) - Use config header type (not class code) identify bridges more reliably (Honghui Zhang) - Work around Intel Denverton incorrect Trace Hub BAR size reporting (Alexander Shishkin) - Reorder pciehp cached state/hardware state updates to avoid missed interrupts (Mika Westerberg) - Turn ibmphp semaphores into completions or mutexes (Arnd Bergmann) - Mark expected switch fall-through (Mathieu Malaterre) - Use of_node_name_eq() for node name comparisons (Rob Herring) - Add ACS and pciehp quirks for HXT SD4800 (Shunyong Yang) - Consolidate Rohm Vendor ID definitions (Andy Shevchenko) - Use u32 (not __u32) for things not exposed to userspace (Logan Gunthorpe) - Fix locking semantics of bus and slot reset interfaces (Alex Williamson) - Update PCIEPORTBUS Kconfig help text (Hou Zhiqiang) - Allow portdrv to claim subtractive decode Ports so PCIe services will work for them (Honghui Zhang) - Report PCIe links that become degraded at run-time (Alexandru Gagniuc) - Blacklist Gigabyte X299 Root Port power management to fix Thunderbolt hotplug (Mika Westerberg) - Revert runtime PM suspend/resume callbacks that broke PME on network cable plug (Mika Westerberg) - Disable Data Link State Changed interrupts to prevent wakeup immediately after suspend (Mika Westerberg) - Extend altera to support Stratix 10 (Ley Foon Tan) - Allow building altera driver on ARM64 (Ley Foon Tan) - Replace Douglas with Tom Joseph as Cadence PCI host/endpoint maintainer (Lorenzo Pieralisi) - Add DT support for R-Car RZ/G2E (R8A774C0) (Fabrizio Castro) - Add dra72x/dra74x/dra76x SoC compatible strings (Kishon Vijay Abraham I) - Enable x2 mode support for dra72x/dra74x/dra76x SoC (Kishon Vijay Abraham I) - Configure dra7xx PHY to PCIe mode (Kishon Vijay Abraham I) - Simplify dwc (remove unnecessary header includes, name variables consistently, reduce inverted logic, etc) (Gustavo Pimentel) - Add i.MX8MQ support (Andrey Smirnov) - Add message to help debug dwc MSI-X mask bit errors (Gustavo Pimentel) - Work around imx7d PCIe PLL erratum (Trent Piepho) - Don't assert qcom reset GPIO during probe (Bjorn Andersson) - Skip dwc MSI init if MSIs have been disabled (Lucas Stach) - Use memcpy_fromio()/memcpy_toio() instead of plain memcpy() in PCI endpoint framework (Wen Yang) - Add interface to discover supported endpoint features to replace a bitfield that wasn't flexible enough (Kishon Vijay Abraham I) - Implement the new supported-feature interface for designware-plat, dra7xx, rockchip, cadence (Kishon Vijay Abraham I) - Fix issues with 64-bit BAR in endpoints (Kishon Vijay Abraham I) - Add layerscape endpoint mode support (Xiaowei Bao) - Remove duplicate struct hv_vp_set in favor of struct hv_vpset (Maya Nakamura) - Rework hv_irq_unmask() to use cpumask_to_vpset() instead of open-coded reimplementation (Maya Nakamura) - Align Hyper-V struct retarget_msi_interrupt arguments (Maya Nakamura) - Fix mediatek MMIO size computation to enable full size of available MMIO space (Honghui Zhang) - Fix mediatek DMA window size computation to allow endpoint DMA access to full DRAM address range (Honghui Zhang) - Fix mvebu prefetchable BAR regression caused by common bridge emulation that assumed all bridges had prefetchable windows (Thomas Petazzoni) - Make advk_pci_bridge_emul_ops static (Wei Yongjun) - Configure MPS settings for VMD root ports (Jon Derrick) * tag 'pci-v5.1-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (92 commits) PCI: Update PCIEPORTBUS Kconfig help text PCI: Fix "try" semantics of bus and slot reset PCI/LINK: Report degraded links via link bandwidth notification dt-bindings: PCI: altera: Add altr,pcie-root-port-2.0 PCI: altera: Enable driver on ARM64 PCI: altera: Add Stratix 10 PCIe support PCI/PME: Fix possible use-after-free on remove PCI: aardvark: Make symbol 'advk_pci_bridge_emul_ops' static PCI: dwc: skip MSI init if MSIs have been explicitly disabled PCI: hv: Refactor hv_irq_unmask() to use cpumask_to_vpset() PCI: hv: Replace hv_vp_set with hv_vpset PCI: hv: Add __aligned(8) to struct retarget_msi_interrupt PCI: mediatek: Enlarge PCIe2AHB window size to support 4GB DRAM PCI: mediatek: Fix memory mapped IO range size computation PCI: dwc: Remove superfluous shifting in definitions PCI: dwc: Make use of GENMASK/FIELD_PREP PCI: dwc: Make use of BIT() in constant definitions PCI: dwc: Share code for dw_pcie_rd/wr_other_conf() PCI: dwc: Make use of IS_ALIGNED() PCI: imx6: Add code to request/control "pcie_aux" clock for i.MX8MQ ...
2019-03-08Merge tag 'gpio-v5.1-1' of ↵Linus Torvalds33-405/+1559
git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio Pull GPIO updates from Linus Walleij: "This is the bulk of GPIO changes for the v5.1 cycle: Core changes: - The big change this time around is the irqchip handling in the qualcomm pin controllers, closely coupled with the gpiochip. This rework, in a classic fall-between-the-chairs fashion has been sidestepped for too long. The Qualcomm IRQchips using the SPMI and SSBI transport mechanisms have been rewritten to use hierarchical irqchip. This creates the base from which I intend to gradually pull support for hierarchical irqchips into the gpiolib irqchip helpers to cut down on duplicate code. We have too many hacks in the kernel because people have been working around the missing hierarchical irqchip for years, and once it was there, noone understood it for a while. We are now slowly adapting to using it. This is why this pull requests include changes to MFD, SPMI, IRQchip core and some ARM Device Trees pertaining to the Qualcomm chip family. Since Qualcomm have so many chips and such large deployments it is paramount that this platform gets this right, and now it (hopefully) does. - Core support for pull-up and pull-down configuration, also from the device tree. When a simple GPIO chip supports an "off or on" pull-up or pull-down resistor, we provide a way to set this up using machine descriptors or device tree. If more elaborate control of pull up/down (such as resistance shunt setting) is required, drivers should be phased over to use pin control. We do not yet provide a userspace ABI for this pull up-down setting but I suspect the makers are going to ask for it soon enough. PCA953x is the first user of this new API. - The GPIO mockup driver has been revamped after some discussion improving the IRQ simulator in the process. The idea is to make it possible to use the mockup for both testing and virtual prototyping, e.g. when you do not yet have a GPIO expander to play with but really want to get something to develop code around before hardware is available. It's neat. The blackbox testing usecase is currently making its way into kernelci. - ACPI GPIO core preserves non direction flags when updating flags. - A new device core helper for devm_platform_ioremap_resource() is funneled through the GPIO tree with Greg's ACK. New drivers: - TQ-Systems QTMX86 GPIO controllers (using port-mapped I/O) - Gateworks PLD GPIO driver (vaccumed up from OpenWrt) - AMD G-Series PCH (Platform Controller Hub) GPIO driver. - Fintek F81804 & F81966 subvariants. - PCA953x now supports NXP PCAL6416. Driver improvements: - IRQ support on the Nintendo Wii (Hollywood) GPIO. - get_direction() support for the MVEBU driver. - Set the right output level on SAMA5D2. - Drop the unused irq trigger setting on the Spreadtrum driver. - Wakeup support for PCA953x. - A slew of cleanups in the various Intel drivers" * tag 'gpio-v5.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (110 commits) gpio: gpio-omap: fix level interrupt idling gpio: amd-fch: Set proper output level for direction_output x86: apuv2: remove unused variable gpio: pca953x: Use PCA_LATCH_INT platform/x86: fix PCENGINES_APU2 Kconfig warning gpio: pca953x: Fix dereference of irq data in shutdown gpio: amd-fch: Fix type error found by sparse gpio: amd-fch: Drop const from resource gpio: mxc: add check to return defer probe if clock tree NOT ready gpio: ftgpio: Register per-instance irqchip gpio: ixp4xx: Add DT bindings x86: pcengines apuv2 gpio/leds/keys platform driver gpio: AMD G-Series PCH gpio driver drivers: depend on HAS_IOMEM for devm_platform_ioremap_resource() gpio: tqmx86: Set proper output level for direction_output gpio: sprd: Change to use SoC compatible string gpio: sprd: Use SoC compatible string instead of wildcard string gpio: of: Handle both enable-gpio{,s} gpio: of: Restrict enable-gpio quirk to regulator-gpio gpio: davinci: use devm_platform_ioremap_resource() ...
2019-03-08gpio: gpio-omap: fix level interrupt idlingRussell King1-6/+8
Tony notes that the GPIO module does not idle when level interrupts are in use, as the wakeup appears to get stuck. After extensive investigation, it appears that the wakeup will only be cleared if the interrupt status register is cleared while the interrupt is enabled. However, we are currently clearing it with the interrupt disabled for level-based interrupts. It is acknowledged that this observed behaviour conflicts with a statement in the TRM: CAUTION After servicing the interrupt, the status bit in the interrupt status register (GPIOi.GPIO_IRQSTATUS_0 or GPIOi.GPIO_IRQSTATUS_1) must be reset and the interrupt line released (by setting the corresponding bit of the interrupt status register to 1) before enabling an interrupt for the GPIO channel in the interrupt-enable register (GPIOi.GPIO_IRQSTATUS_SET_0 or GPIOi.GPIO_IRQSTATUS_SET_1) to prevent the occurrence of unexpected interrupts when enabling an interrupt for the GPIO channel. However, this does not appear to be a practical problem. Further, as reported by Grygorii Strashko <[email protected]>, the TI Android kernel tree has an earlier similar patch as "GPIO: OMAP: Fix the sequence to clear the IRQ status" saying: if the status is cleared after disabling the IRQ then sWAKEUP will not be cleared and gates the module transition When we unmask the level interrupt after the interrupt has been handled, enable the interrupt and only then clear the interrupt. If the interrupt is still pending, the hardware will re-assert the interrupt status. Should the caution note in the TRM prove to be a problem, we could use a clear-enable-clear sequence instead. Cc: Aaro Koskinen <[email protected]> Cc: Keerthy <[email protected]> Cc: Peter Ujfalusi <[email protected]> Signed-off-by: Russell King <[email protected]> [[email protected]: updated comments based on an earlier TI patch] Signed-off-by: Tony Lindgren <[email protected]> Acked-by: Grygorii Strashko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-03-08gpio: amd-fch: Set proper output level for direction_outputAxel Lin1-1/+10
Current amd_fch_gpio_direction_output implementation ignores the value argument, fix it so direction_output will set proper output level. Signed-off-by: Axel Lin <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Enrico Weigelt <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-03-08gpio: pca953x: Use PCA_LATCH_INTAndy Shevchenko1-5/+5
The commit 0cdf21b34e30 ("gpio: pca953x: set the PCA_PCAL flag also when matching by DT") introduces a helper macro which tells that chip supports latched interrupts, but the macro was never used for ACPI or legacy enumeration. So, make use of it for legacy and ACPI enumeration. Cc: H. Nikolaus Schaller <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-03-06Merge tag 'sound-5.1-rc1' of ↵Linus Torvalds1-4/+11
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound updates from Takashi Iwai: "We had again a busy development cycle with many new drivers as well as lots of core improvements / cleanups. Let's go for highlights: ALSA core: - PCM locking scheme was refactored for reducing a global rwlock - PCM suspend is handled in the device type PM ops now; lots of explicit calls were reduced by this action - Cleanups about PCM buffer preallocation calls - Kill NULL device object in memory allocations - Lots of procfs API cleanups ASoC core: - Support for only powering up channels that are actively being used - Cleanups / fixes of topology API ASoC drivers: - MediaTek BTCVSD for a Bluetooth radio chip, which is the first such driver we've had upstream! - Quite a few improvements to simplify the generic card drivers, especially the merge of the SCU cards into the main generic drivers - Lots of fixes for probing on Intel systems to follow more standard styles - A big refresh and cleanup of the Samsung drivers - New drivers: Asahi Kasei Microdevices AK4497, Cirrus Logic CS4341 and CS35L26, Google ChromeOS embedded controllers, Ingenic JZ4725B, MediaTek BTCVSD, MT8183 and MT6358, NXP MICFIL, Rockchip RK3328, Spreadtrum DMA controllers, Qualcomm WCD9335, Xilinx S/PDIF and PCM formatters ALSA drivers: - Improvements of Tegra HD-audio controller driver for supporting new chips - HD-audio codec quirks for ALC294 S4 resume, ASUS laptop, Chrome headset button support and Dell workstations - Improved DSD support on USB-audio - Quirk for MOTU MicroBook II USB-audio - Support for Fireface UCX support and Solid State Logic Duende Classic/Mini" * tag 'sound-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (461 commits) ALSA: usb-audio: Add quirk for MOTU MicroBook II ASoC: stm32: i2s: skip useless write in slave mode ASoC: stm32: i2s: fix race condition in irq handler ASoC: stm32: i2s: remove useless callback ASoC: stm32: i2s: fix dma configuration ASoC: stm32: i2s: fix stream count management ASoC: stm32: i2s: fix 16 bit format support ASoC: stm32: i2s: fix IRQ clearing ASoC: qcom: Kconfig: fix dependency for sdm845 ASoC: Intel: Boards: Add Maxim98373 support ASoC: rsnd: gen: fix SSI9 4/5/6/7 busif related register address ALSA: firewire-motu: fix construction of PCM frame for capture direction ALSA: bebob: use more identical mod_alias for Saffire Pro 10 I/O against Liquid Saffire 56 ALSA: hda: Extend i915 component bind timeout ASoC: wm_adsp: Improve logging messages ASoC: wm_adsp: Add support for multiple compressed buffers ASoC: wm_adsp: Refactor compress stream initialisation ASoC: wm_adsp: Reorder some functions for improved clarity ASoC: wm_adsp: Factor out stripping padding from ADSP data ASoC: cs35l36: Fix an IS_ERR() vs NULL checking bug ...
2019-03-06Merge tag 'acpi-5.1-rc1' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI updates from Rafael Wysocki: "These are ACPICA updates including ACPI 6.3 support among other things, APEI updates including the ARM Software Delegated Exception Interface (SDEI) support, ACPI EC driver fixes and cleanups and other assorted improvements. Specifics: - Update the ACPICA code in the kernel to upstream revision 20190215 including ACPI 6.3 support and more: * New predefined methods: _NBS, _NCH, _NIC, _NIH, and _NIG (Erik Schmauss). * Update of the PCC Identifier structure in PDTT (Erik Schmauss). * Support for new Generic Affinity Structure subtable in SRAT (Erik Schmauss). * New PCC operation region support (Erik Schmauss). * Support for GICC statistical profiling for MADT (Erik Schmauss). * New Error Disconnect Recover notification support (Erik Schmauss). * New PPTT Processor Structure Flags fields support (Erik Schmauss). * ACPI 6.3 HMAT updates (Erik Schmauss). * GTDT Revision 3 support (Erik Schmauss). * Legacy module-level code (MLC) support removal (Erik Schmauss). * Update/clarification of messages for control method failures (Bob Moore). * Warning on creation of a zero-length opregion (Bob Moore). * acpiexec option to dump extra info for memory leaks (Bob Moore). * More ACPI error to firmware error conversions (Bob Moore). * Debugger fix (Bob Moore). * Copyrights update (Bob Moore) - Clean up sleep states support code in ACPICA (Christoph Hellwig) - Rework in_nmi() handling in the APEI code and add suppor for the ARM Software Delegated Exception Interface (SDEI) to it (James Morse) - Fix possible out-of-bounds accesses in BERT-related core (Ross Lagerwall) - Fix the APEI code parsing HEST that includes a Deferred Machine Check subtable (Yazen Ghannam) - Use DEFINE_DEBUGFS_ATTRIBUTE for APEI-related debugfs files (YueHaibing) - Switch the APEI ERST code to the new generic UUID API (Andy Shevchenko) - Update the MAINTAINERS entry for APEI (Borislav Petkov) - Fix and clean up the ACPI EC driver (Rafael Wysocki, Zhang Rui) - Fix DMI checks handling in the ACPI backlight driver and add the "Lunch Box" chassis-type check to it (Hans de Goede) - Add support for using ACPI table overrides included in built-in initrd images (Shunyong Yang) - Update ACPI device enumeration to treat the PWM2 device as "always present" on Lenovo Yoga Book (Yauhen Kharuzhy) - Fix up the enumeration of device objects with the PRP0001 device ID (Andy Shevchenko) - Clean up PPTT parsing error messages (John Garry) - Clean up debugfs files creation handling (Greg Kroah-Hartman, Rafael Wysocki) - Clean up the ACPI DPTF Makefile (Masahiro Yamada)" * tag 'acpi-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (65 commits) ACPI / bus: Respect PRP0001 when retrieving device match data ACPICA: Update version to 20190215 ACPI/ACPICA: Trivial: fix spelling mistakes and fix whitespace formatting ACPICA: ACPI 6.3: add GTDT Revision 3 support ACPICA: ACPI 6.3: HMAT updates ACPICA: ACPI 6.3: PPTT add additional fields in Processor Structure Flags ACPICA: ACPI 6.3: add Error Disconnect Recover Notification value ACPICA: ACPI 6.3: MADT: add support for statistical profiling in GICC ACPICA: ACPI 6.3: add PCC operation region support for AML interpreter efi: cper: Fix possible out-of-bounds access ACPI: APEI: Fix possible out-of-bounds access to BERT region ACPICA: ACPI 6.3: SRAT: add Generic Affinity Structure subtable ACPICA: ACPI 6.3: Add Trigger order to PCC Identifier structure in PDTT ACPICA: ACPI 6.3: Adding predefined methods _NBS, _NCH, _NIC, _NIH, and _NIG ACPICA: Update/clarify messages for control method failures ACPICA: Debugger: Fix possible fault with the "test objects" command ACPICA: Interpreter: Emit warning for creation of a zero-length op region ACPICA: Remove legacy module-level code support ACPI / x86: Make PWM2 device always present at Lenovo Yoga Book ACPI / video: Extend chassis-type detection with a "Lunch Box" check ..
2019-03-04Merge branch 'spi-5.1' into spi-nextMark Brown1-1/+1
2019-03-04Merge branch 'acpica'Rafael J. Wysocki1-1/+1
* acpica: ACPICA: Update version to 20190215 ACPI/ACPICA: Trivial: fix spelling mistakes and fix whitespace formatting ACPICA: ACPI 6.3: add GTDT Revision 3 support ACPICA: ACPI 6.3: HMAT updates ACPICA: ACPI 6.3: PPTT add additional fields in Processor Structure Flags ACPICA: ACPI 6.3: add Error Disconnect Recover Notification value ACPICA: ACPI 6.3: MADT: add support for statistical profiling in GICC ACPICA: ACPI 6.3: add PCC operation region support for AML interpreter ACPICA: ACPI 6.3: SRAT: add Generic Affinity Structure subtable ACPICA: ACPI 6.3: Add Trigger order to PCC Identifier structure in PDTT ACPICA: ACPI 6.3: Adding predefined methods _NBS, _NCH, _NIC, _NIH, and _NIG ACPICA: Update/clarify messages for control method failures ACPICA: Debugger: Fix possible fault with the "test objects" command ACPICA: Interpreter: Emit warning for creation of a zero-length op region ACPICA: Remove legacy module-level code support ACPICA: Get rid of acpi_sleep_dispatch() ACPICA: Update version to 20190108 ACPICA: All acpica: Update copyrights to 2019 ACPICA: acpiexec: Add option to dump extra info for memory leaks ACPICA: Convert more ACPI errors to firmware errors
2019-03-01gpio: pca953x: Fix dereference of irq data in shutdownMark Walton1-1/+2
If a PCA953x gpio was used as an interrupt and then released, the shutdown function was trying to extract the pca953x_chip pointer directly from the irq_data, but in reality was getting the gpio_chip structure. The net effect was that the subsequent writes to the data structure corrupted data in the gpio_chip structure, which wasn't immediately obvious until attempting to use the GPIO again in the future, at which point the kernel panics. This fix correctly extracts the pca953x_chip structure via the gpio_chip structure, as is correctly done in the other irq functions. Fixes: 0a70fe00efea ("gpio: pca953x: Clear irq trigger type on irq shutdown") Cc: [email protected] Signed-off-by: Mark Walton <[email protected]> Reviewed-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-03-01gpio: amd-fch: Fix type error found by sparseLinus Walleij1-7/+7
Sparse complains: gpio-amd-fch.c:45:27: sparse: expected void * gpio-amd-fch.c:45:27: sparse: got void [noderef] <asn:2> * gpio-amd-fch.c:45:27: sparse: warning: incorrect type in return expression (different address spaces) gpio-amd-fch.c:56:9: sparse: expected void const volatile [noderef] <asn:2> *addr gpio-amd-fch.c:56:9: sparse: expected void volatile [noderef] <asn:2> *addr gpio-amd-fch.c:56:9: sparse: got void *ptr gpio-amd-fch.c:56:9: sparse: warning: incorrect type in argument 1 (different address spaces) I think it is because void * is returned rather than void __iomem *, so fix it up. Cc: Enrico Weigelt <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-02-26Merge branch 'asoc-5.1' into asoc-nextMark Brown1-4/+11
2019-02-25gpio: amd-fch: Drop const from resourceLinus Walleij1-1/+1
The build servers and linux-next are complaining like this: drivers/gpio/gpio-amd-fch.c: In function 'amd_fch_gpio_probe': drivers/gpio/gpio-amd-fch.c:164:49: warning: passing argument 2 of 'devm_ioremap_resource' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] priv->base = devm_ioremap_resource(&pdev->dev, &amd_fch_gpio_iores); ^~~~~~~~~~~~~~~~~~~ In file included from include/linux/platform_device.h:14, from drivers/gpio/gpio-amd-fch.c:15: include/linux/device.h:709:15: note: expected 'struct resource *' but argument is of type 'const struct resource *' void __iomem *devm_ioremap_resource(struct device *dev,struct resource *res); ^~~~~~~~~~~~~~~~~~~~~ Let's just remove "const" for now. It is possible that devm_ioremap_resource() should rather be constified so we can pass const resources as arguments. But right now I just want to get rid of this build warning. Fixes: e09d168f13f0 ("gpio: AMD G-Series PCH gpio driver") Reported-by: Stephen Rothwell <[email protected]> Reported-by: kbuild test robot <[email protected]> Reported-by: Anders Roxell <[email protected]> Cc: Enrico Weigelt <[email protected]> Tested-by: Anders Roxell <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-02-25gpio: mxc: add check to return defer probe if clock tree NOT readyAnson Huang1-1/+4
On i.MX8MQ platform, clock driver uses platform driver model and it is probed after GPIO driver, so when GPIO driver fails to get clock, it should check the error type to decide whether to return defer probe or just ignore the clock operation. Fixes: 2808801aab8a ("gpio: mxc: add clock operation") Signed-off-by: Anson Huang <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-02-25gpio: ftgpio: Register per-instance irqchipLinus Walleij1-10/+10
This augments the FTGPIO010 to register one irqchip per instance instead of using a static definition. Signed-off-by: Linus Walleij <[email protected]>
2019-02-24ACPI/ACPICA: Trivial: fix spelling mistakes and fix whitespace formattingErik Schmauss1-1/+1
Signed-off-by: Erik Schmauss <[email protected]> Signed-off-by: Bob Moore <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2019-02-22gpio: AMD G-Series PCH gpio driverEnrico Weigelt, metux IT consult3-0/+195
GPIO platform driver for the AMD G-series PCH (eg. on GX-412TC) This driver doesn't registers itself automatically, as it needs to be provided with platform specific configuration, provided by some board driver setup code. Didn't implement oftree probing yet, as it's rarely found on x86. Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Enrico Weigelt, metux IT consult <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-02-21gpio: tqmx86: Set proper output level for direction_outputAxel Lin1-2/+3
For output-only gpios, direction_output should set proper output level. Signed-off-by: Axel Lin <[email protected]> Fixes: b868db94a6a7 ("gpio: tqmx86: Add GPIO from for this IO controller") Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-02-21gpio: sprd: Change to use SoC compatible stringBaolin Wang1-1/+1
Change to use SoC compatible string instead of wildcard string. The Spreadtrum SC9860 platform device trees and drivers' development are still in progress, and now we will always recompile and ship device trees at the same time as we will compile and ship the kernel, so we do not need care about the backwards compatibility. Signed-off-by: Baolin Wang <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-02-21gpio: of: Handle both enable-gpio{,s}Marek Vasut1-1/+2
Handle both enable-gpio and enable-gpios properties of the GPIO regulator in the quirk. The later is the preferred modern name of the property. Signed-off-by: Marek Vasut <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Jan Kotas <[email protected]> Cc: Linus Walleij <[email protected]> Cc: Mark Brown <[email protected]> Cc: Thierry Reding <[email protected]> Cc: Wolfram Sang <[email protected]> Cc: [email protected] To: [email protected] Signed-off-by: Linus Walleij <[email protected]>
2019-02-21gpio: of: Restrict enable-gpio quirk to regulator-gpioThierry Reding1-2/+2
Commit 0e7d6f940164 ("gpio: of: Apply regulator-gpio quirk only to enable-gpios") breaks the device tree ABI specified in the device tree bindings for fixed regulators (compatible "regulator-fixed"). According to these bindings the polarity of the GPIO is exclusively controlled by the presence or absence of the enable-active-high property. As such the polarity quirk implemented in of_gpio_flags_quirks() must be applied to the GPIO specified for fixed regulators. However, commit 0e7d6f940164 ("gpio: of: Apply regulator-gpio quirk only to enable-gpios") restricted the quirk to the enable-gpios property for fixed regulators as well, whereas according to the commit message itself it should only apply to "regulator-gpio" compatible device tree nodes. Fix this by actually implementing what the offending commit intended, which is to ensure that the quirk is applied to the GPIO specified by the "enable-gpio" property for the "regulator-gpio" bindings only. This fixes a regression on Jetson TX1 where the fixed regulator for the HDMI +5V pin relies on the flags quirk for the proper polarity. Fixes: 0e7d6f940164 ("gpio: of: Apply regulator-gpio quirk only to enable-gpios") Signed-off-by: Thierry Reding <[email protected]> Tested-by: Marek Vasut <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-02-21gpio: davinci: use devm_platform_ioremap_resource()Bartosz Golaszewski1-3/+1
Use the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-02-20gpio: pca953x: Add wake-up supportGeert Uytterhoeven1-0/+9
Implement the irq_set_wake() method in the (optional) irq_chip of the GPIO expander, and propagate wake-up settings to the upstream interrupt controller. This allows GPIOs connected to a PCA953X GPIO expander to serve as wake-up sources. Signed-off-by: Geert Uytterhoeven <[email protected]> Reviewed-by: Niklas Söderlund <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-02-20Merge tag 'gpio-v5.1-updates-for-linus-part-2' of ↵Linus Walleij1-27/+162
git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into devel gpio: updates for v5.1 - part 2 - gpio-mockup updates improving the user-space testing interface and adding line state tracking for correct edge interrupts - interrupt simulator patch exposing the irq type configuration to users
2019-02-19gpio: tegra: Fix offset of pinctrl callsLinus Walleij1-4/+21
This patch hunk is a lightly modified version of a diff found in a Tegra code dump from a product tree. It makes a lot of sense because this is what most drivers do. Cc: Thierry Reding <[email protected]> Cc: Stefan Agner <[email protected]> Cc: Dmitry Osipenko <[email protected]> Cc: Jon Hunter <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2019-02-19gpio: mockup: rework debugfs interfaceBartosz Golaszewski1-14/+103
Modify the way the debugfs interface works in gpio-mockup. Introduce the concept of dummy pull config which will keep the mockup lines in known state. The pull values can be modified by writing to the debugfs files corresponding to lines. Lines in input mode always report the current pull value, lines in output mode change the line value but it will revert back to the one specified by current pull when released. Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-02-19gpio: mockup: change the signature of unlocked get/set helpersBartosz Golaszewski1-11/+8
The unlocked variants only get called from places where we already have the pointer to the underlying gpio_mockup_chip structure, so take it as parameter instead of struct gpio_chip. Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-02-19gpio: mockup: change the type of 'offset' to unsigned intBartosz Golaszewski1-1/+1
This field can never be negative. Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-02-19gpio: mockup: don't create the debugfs link named after the labelBartosz Golaszewski1-5/+1
User-space tests no longer use it and we're breaking the interface anyway. Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-02-19gpio: mockup: implement get_multiple()Bartosz Golaszewski1-0/+17
We already support set_multiple(). Implement get_multiple() as well. Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-02-19gpio: mockup: add lockingBartosz Golaszewski1-7/+43
While no user reported any race condition problems with gpio-mockup, let's be on the safe side and use a mutex when performing any changes on the dummy chip structures. Suggested-by: Uwe Kleine-König <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-02-17gpio: of: Apply regulator-gpio quirk only to enable-gpiosMarek Vasut1-0/+1
Since commit d6cd33ad7102 ("regulator: gpio: Convert to use descriptors") the GPIO regulator had inverted the polarity of the control GPIO. This problem manifested itself on systems with DT containing the following description (snippet from salvator-common.dtsi): gpios = <&gpio5 1 GPIO_ACTIVE_HIGH>; gpios-states = <1>; states = <3300000 1 1800000 0>; Prior to the aforementioned commit, the gpio-regulator code used gpio_request_array() to claim the GPIO(s) specified in the "gpios" DT node, while the commit changed that to devm_gpiod_get_index(). The legacy gpio_request_array() calls gpio_request_one() and then gpiod_request(), which parses the DT flags of the "gpios" node and populates the GPIO descriptor flags field accordingly. The new devm_gpiod_get_index() calls gpiod_get_index(), then of_find_gpio(), of_get_named_gpiod_flags() with flags != NULL, and then of_gpio_flags_quirks(). Since commit a603a2b8d86e ("gpio: of: Add special quirk to parse regulator flags"), of_gpio_flags_quirks() contains a quirk for regulator-gpio which was never triggered by the legacy gpio_request_array() code path, but is triggered by devm_gpiod_get_index() code path. This quirk checks whether a GPIO is associated with a fixed or gpio-regulator and if so, checks two additional conditions. First, whether such GPIO is active-low, and if so, ignores the active-low flag. Second, whether the regulator DT node does have an "enable-active-high" property and if the property is NOT present, sets the GPIO flags as active-low. The second check triggers a problem, since it is applied to all GPIOs associated with a gpio-regulator, rather than only on the "enable" GPIOs, as the old code did. This changes the way the gpio-regulator interprets the DT description of the control GPIOs. The old code using gpio_request_array() explicitly parsed the "enable-active-high" DT property and only applied it to the GPIOs described in the "enable-gpios" DT node, and only if those were present. This patch fixes the quirk code by only applying the quirk to "enable-gpios", thus restoring the old behavior. Signed-off-by: Marek Vasut <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Jan Kotas <[email protected]> Cc: Linus Walleij <[email protected]> Cc: Mark Brown <[email protected]> Cc: Wolfram Sang <[email protected]> Cc: [email protected] To: [email protected] Signed-off-by: Linus Walleij <[email protected]>
2019-02-17Merge tag 'intel-gpio-v5.1-1' of ↵Linus Walleij3-64/+29
git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel into devel intel-gpio for v5.1-1 Small clean up for Intel PMIC GPIO drivers, includes: - optimizing IRQ handlers by usage of for_each_set_bit() - sorting headers alphabetically for better maintenance - conversion to SPDX identifier The following is an automated git shortlog grouped by driver: crystalcove: - Convert to use SPDX identifier - Sort headers alphabetically - Use for_each_set_bit() in IRQ handler msic: - Convert to use SPDX identifier - Sort headers alphabetically - Remove duplicate check in IRQ handler wcove: - Convert to use SPDX identifier - Fix indentation - Sort headers alphabetically - Allow return negative error code from to_reg()
2019-02-17Merge tag 'gpio-v5.1-updates-for-linus' of ↵Linus Walleij9-65/+86
git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into devel gpio updates for v5.1 - support for a new variant of pca953x - documentation fix from Wolfram - some tegra186 name changes - two minor fixes for madera and altera-a10sr