summaryrefslogtreecommitdiff
path: root/drivers/gpio
Commit message (Collapse)AuthorAgeFilesLines
* gpiolib: fix gpio label generation with gpiod_getAhmad Fatoum2023-04-111-1/+1
| | | | | | | | | | | Current mistaken use of con_id instead of _con_id, can lead to labels being called regulator.of-<NULL>. Fix this, so the label becomes regulator.of instead. Fixes: 9fb2fa240d58 ("gpiolib: implement dev_gpiod_get_index") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230411071436.1630752-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc' into nextSascha Hauer2023-03-162-2/+34
|\
| * gpio: pca953x: add optional support for regulator and reset GPIOAhmad Fatoum2023-03-091-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | Traditionally, pca953x have a Power-On Reset mechanism that activates once supply voltage rises over threshold. Newer chips additionally feature a reset input. Add support for both. To not break existing boards, we will ignore failure to claim GPIO or regulator, even if it's just probe deferral. Boards wanting to make use of the newly parsed DT properties should enable deep probe. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230307102320.2084684-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * gpio: pca953x: sync DT compatibles with LinuxAhmad Fatoum2023-03-091-0/+19
| | | | | | | | | | | | | | | | | | There are a lot of pca953x compatible chips. Import the current list of compatibles from Linux. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230307102320.2084684-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * gpio: gpioinfo: use dev_name to get device nameAhmad Fatoum2023-03-091-1/+1
| | | | | | | | | | | | | | | | Otherwise, we don't correctly number devices with dynamic ID. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230307102320.2084684-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: bcm283x: Move mach header files to include/mach/bcm283xSascha Hauer2023-03-061-1/+1
| | | | | | | | | | | | | | | | | | | | Currently arch specific headers can be included with longer possible as there won't be a single mach anymore. Move all bcm283x specific header files to include/mach/bcm283x/ to prepare for multi-arch support. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | gio: add support for PCAL6408 chip to the pca953x driverMichael Kopfensteiner2023-02-271-0/+6
|/ | | | | | | | | | | The PCAL6408 chip similar enough to the PCA95xx chip series such that it can be handled by the pca953x driver as well. This solution is copied from the linux kernel's pca953x driver. Signed-off-by: Michael Kopfensteiner <michael.kopfensteiner@vahle.com> Link: https://lore.barebox.org/20230223153601.59357-1-michael.kopfensteiner@vahle.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: Fix unused variable warningSascha Hauer2023-01-251-1/+1
| | | | | | | | gpio_suffixes is only used inside #ifdef CONFIG_OFDEVICE, so put it into this ifdef as well. Fixes: 9fb2fa240d58 ("gpiolib: implement dev_gpiod_get_index") Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpiolib: implement dev_gpiod_get_indexAhmad Fatoum2023-01-101-9/+14
| | | | | | | | | | | Linux devm_gpiod_get_index is a superset of devm_gpiod_get. We already support gpiod_get to simplify kernel code porting, so reimplement it in terms of a new dev_gpiod_get_index to simplify porting kernel code using that as well. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230109155836.2220277-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Rename struct driver_d to driverSascha Hauer2023-01-1027-27/+27
| | | | | | | | | | | The '_d' suffix was originally meant to distinguish barebox struct names from Linux struct names. struct driver doesn't exist in Linux, so we can rename it and remove the meaningless suffix. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-4-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Rename struct device_d to deviceSascha Hauer2023-01-1028-38/+39
| | | | | | | | | | | | | The '_d' suffix was originally introduced in case we want to import Linux struct device as a separate struct into barebox. Over time it became clear that this won't happen, instead barebox struct device_d is basically the same as Linux struct device. Rename the struct name accordingly to make porting Linux code easier. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-3-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Rename device_d::device_node to device_d::of_nodeSascha Hauer2023-01-1018-34/+35
| | | | | | | | | | | | | | | | | | | | Linux struct device has the member of_node for the device_node pointer. Rename this in barebox accordingly to minimize the necessary changes when porting Linux code. This was done with the semantic patch: @@ struct device_d E; @@ - E.device_node + E.of_node @@ struct device_d *E; @@ - E->device_node + E->of_node Plus some manual adjustments. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-2-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: Add gpio latch driverSascha Hauer2022-11-083-0/+202
| | | | | | | | | | | | | This driver implements a GPIO multiplexer based on latches connected to other GPIOs. A set of data GPIOs is connected to the data input of multiple latches. The clock input of each latch is driven by another set of GPIOs. With two 8-bit latches 10 GPIOs can be multiplexed into 16 GPIOs. GPOs might be a better term as in fact the multiplexed pins are output only. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20221107144524.489471-5-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpiolib: Fix gpioinfo without argsSascha Hauer2022-09-281-1/+1
| | | | | | | | | | Since a30ae2921a the gpioinfo command crashes when called without arguments. Fix it by using argv[1] when it actually exists, not when it doesn't exist. Fixes: a30ae2921a ("gpiolib: gpioinfo: add optional CONTROLLER command line argument") Reported-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpiolib: gpioinfo: add optional CONTROLLER command line argumentAhmad Fatoum2022-09-131-5/+26
| | | | | | | | | | | Like done with gpio setter/getter functions in the previous commit, extend the gpioinfo command to accept an optional argument that restricts output to the supplied gpio controller instead of printing all GPIOs at once. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220905103546.1476277-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpiolib: implement gpio_get_chip_by_dev()Ahmad Fatoum2022-09-131-9/+19
| | | | | | | | | | | gpio_of_xlate() already needs the ability to find a struct gpio_chip * via a struct device_d. Exporting this functionality to elsewhere in the code will allow restricting commands to manipulate only a single GPIO bank. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220905103546.1476277-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpiolib: Add of_xlate supportJules Maselbas2022-08-081-28/+32
| | | | | | | | | | | | | | | | | | The of_xlate callback is used to tanslate a device-tree GPIO specifier into a chip relative GPIO number and flags. This callback needs to be implemented by GPIO controller driver which doesn't uses the "classic" device-tree description, which is: gpio = <&gpio-phandle gpio_num gpio_flags>; But uses something else, like this (but not limited to): gpio = <&gpio-phandle gpio_bank gpio_num gpio_flags>; Currently no GPIO driver require this of_xlate callback, but this will be used for sunxi's GPIO support. Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu> Link: https://lore.barebox.org/20220805135928.32725-1-jmaselbas@kalray.eu Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers: gpio: pcf857x: Remove redundant assignmentAlexander Shiyan2022-06-301-5/+1
| | | | | | Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com> Link: https://lore.barebox.org/20220629063024.3945-5-eagle.alexander923@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: clps711x: Switch to devicetree usageAlexander Shiyan2022-06-101-5/+2
| | | | | | | | | | This is a complex patch that switches the ARM CLPS711X architecture to work with the device tree. Includes changes to board initialization and any architecture drivers used. Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com> Link: https://lore.barebox.org/20220524060411.7754-1-eagle.alexander923@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpiolib: fix allocating dynamic gpio numbers.Sascha Hauer2022-05-191-1/+1
| | | | | | | | | | Since f349b66267 the loop in gpiochip_find_base() counts downwards, hence we must decrease i by the number of GPIOs in the current chip, not increase them. Fixes: f349b66267 ("gpio: allocate dynamic gpio numbers top down") Reported-by: Alexander Shiyan <eagle.alexander923@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpiolib: remove declaration of now unused variableAhmad Fatoum2022-04-291-1/+1
| | | | | | | | | Since commit f349b662674e ("gpio: allocate dynamic gpio numbers top down"), the variable is now unused and warned about, so remove it. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20220426064619.422478-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* GPIO: clps711x: Simplify initializationAlexander Shiyan2022-04-201-6/+4
| | | | | | Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com> Link: https://lore.barebox.org/20220419093606.59318-1-eagle.alexander923@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: allocate dynamic gpio numbers top downSascha Hauer2022-04-011-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | For GPIO controllers with dynamic GPIO number bases a free base is searched for bottom up. This means that GPIO controllers with fixed GPIO numbers must be registered before any controller with dynamic GPIO number base is registered, because otherwise the GPIO controllers with fixed GPIO numbers find their range occupied and can't be registered anymore. The probe order normally makes sure the SoC internal GPIO controllers with fixed numbers are registered first. With deep probe enabled we can't rely on the probe order anymore, so we need another solution. With this patch a free GPIO number range is searched for top down intead of bottom up, so as long as we have enough space in the ARCH_NR_GPIOS range the SoC internal GPIO controllers find their base unoccupied. GPIO controllers with dynamic GPIO numbers will change their numbers with this patch, but code shouldn't rely on these numbers anyway. Reported-by: Andrej Picej <andrej.picej@norik.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Tested-by: Andrej Picej <andrej.picej@norik.com>
* drivers: migrate "GPL-2.0+" license identifiers to SPDX 2.0Roland Hieber2021-11-222-2/+2
| | | | | | | | | "GPL-2.0-or-later" was introduced in SPDX 2.0, and the old identifier "GPL-2.0+" is now deprecated; see <https://spdx.org/licenses>. Signed-off-by: Roland Hieber <rhi@pengutronix.de> Link: https://lore.barebox.org/20211117113851.2022669-3-rhi@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers: migrate "GPL-2.0" license identifiers to SPDX 2.0Roland Hieber2021-11-225-5/+5
| | | | | | | | | | "GPL-2.0-only" was introduced in SPDX 2.0, and the old identifier "GPL-2.0" is now considered deprecated; see <https://spdx.org/licenses>. Fixes: 28f4a6a4df76f0f1581d (2021-10-30, "drivers: add missing SPDX-License-Identifier") Signed-off-by: Roland Hieber <rhi@pengutronix.de> Link: https://lore.barebox.org/20211117113851.2022669-2-rhi@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/spdx'Sascha Hauer2021-11-153-0/+3
|\
| * drivers: add missing SPDX-License-IdentifierAhmad Fatoum2021-11-013-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the suitable SPDX-License-Identifier to all files in drivers/ that previously lacked one. To aid manual inspection, following heuristics can be used: * No changes outside of comments/whitespace: git show -U0 HEAD | rg -v '^(@@|diff|index)|[-+]([-+]|//|#|[\s/]\*)' * -or-later come in pairs: git show --inter-hunk-context=19 HEAD | \ perl -0777 -F'/^@/gm' -ne 'for (@F) { @m = /later/g; print if @m & 1 }' Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211030175632.2276077-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | include: add dedicated header for printf/printkAhmad Fatoum2021-11-012-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Including <stdio.h> for printf is a bit problematic, because it pulls in other headers for <console.h>, which includes quite a few more headers as well. To make it easier to share code between barebox and host tools make <printk.h> the new minimal header for printf and move the extra logging stuff into <linux/printk.h>. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211030141739.2207431-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | gpio: add driver for xilinx zynq and zynqmpThomas Haemmerle2021-10-143-0/+444
|/ | | | | | | | | | | Port the driver for the Xilinx Zynq/Zynq UltraScale+ MPSoC architecture to barebox (based on the Linux driver). Signed-off-by: Thomas Haemmerle <thomas.haemmerle@wolfvision.net> [apply format fixes, revise probe function, revise Kconfig] Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net> Link: https://lore.barebox.org/20211013112247.3065-2-michael.riesch@wolfvision.net Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: add driver for 74xx-ICs with MMIO accessAntony Pavlov2021-10-043-0/+180
| | | | | | | | | | | | | | | | | | | This patch adds driver to support GPIO functionality for 74xx-compatible ICs with MMIO access. Compatible models include: 1 bit: 741G125 (Input), 741G74 (Output) 2 bits: 742G125 (Input), 7474 (Output) 4 bits: 74125 (Input), 74175 (Output) 6 bits: 74365 (Input), 74174 (Output) 8 bits: 74244 (Input), 74273 (Output) 16 bits: 741624 (Input), 7416374 (Output) Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Cc: Alexander Shiyan <shc_work@mail.ru> Acked-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210817101104.114945-5-antonynpavlov@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: add support for StarFive GPIO controllerAhmad Fatoum2021-06-243-0/+186
| | | | | | | | | This imports support for the StarFive GPIO controller from the vendor's kernel tree. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210619045055.779-28-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/net'Sascha Hauer2021-06-161-9/+21
|\
| * gpio: allow -gpio suffix for gpio property namesSascha Hauer2021-06-091-9/+21
| | | | | | | | | | | | | | | | | | GPIO properties in the device tree can have a -gpios suffix or a -gpio suffix. The latter was not handled, this patch changes that. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20210608093635.5749-2-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | include: <io.h>: define (read|write)[bwlq]_relaxedAhmad Fatoum2021-06-111-3/+0
|/ | | | | | | | | | | | | | For Linux, It's always correct to substitute any of the read or write _relaxed functions with their non relaxed counterpart. Define functions that do this. Unlike with Linux, they doesn't per se affect performance: barebox writel doesn't imply memory barriers, instead it depends on the architecture support to map IO memory regions as non-bufferable. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20210611080155.3555976-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: generic: fixup syncing with upstream Linux gpio-mmio driverAhmad Fatoum2021-05-311-1/+1
| | | | | | | | | | | | | Commit inadvertently brcm,bcm6345-gpio, wd,mbl-gpio, and ni,169445-nand-gpio, because "dat" was now requested twice. Fix this up. Tested on Erizo. Fixes: 8f9ef2d9ab ("gpio: generic: sync with upstream Linux gpio-mmio driver") Reported-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210531065924.18966-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: add SiFive GPIO controller supportAhmad Fatoum2021-05-103-0/+95
| | | | | | | | | | | | | The SiFive GPIO controller is a straight forward generic gpio-mmio controller. Only difference is that the number of GPIOs is described by the number of interrupts in the device tree. Import the Linux v5.12 driver to support it. Tested with gpio-restart on qemu-system-riscv64 -M sifive_u. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210427202309.32077-10-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: generic: sync with upstream Linux gpio-mmio driverAhmad Fatoum2021-05-102-113/+324
| | | | | | | | | | | | | | | | | | | | The gpio-mmio driver in Linux v5.12 has evolved quite a bit since the last sync. It now supports big endian byte order, 64-bit registers as well as controllers that have both a dirin and dirout register. The latter is particularly interesting, because it's required for the SiFive GPIO controller ported in a later patch. This commit also touches gpio-mpc8xxx used on the LS1046A. Because bit and byte endianness can now be configured separately, the driver needs adjustment. We don't seem to support any boards that have the peripheral as little-endian, but this is fixed by this commit. Comparing other bgpio_init users with Linux shows no need for further fixups. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210427202309.32077-9-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: gpio-generic-platform: remove unused non-DT supportAhmad Fatoum2021-05-101-21/+1
| | | | | | | | | | We have nothing in-tree matching against either "basic-mmio-gpio" or "basic-mmio-gpio-be" and none should be added, because new platforms should probe from device tree. Remove the unused the non-DT support. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210427202309.32077-8-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: pl061: implement gpio_ops::get_directionAhmad Fatoum2021-04-131-0/+11
| | | | | | | | This makes gpioinfo on board that incorporate it more useful. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.pengutronix.de/20210410105110.2080785-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpiolib: add Linux-like gpiod_get() helperAhmad Fatoum2021-04-131-0/+43
| | | | | | | | | | | | | | Many Linux drivers use [devm_]gpiod_get to get appropriately configured GPIO descriptors out with little code. Make porting such Linux code easier by providing a semi-compatible gpiod_get function. Main differences: - It returns a gpio index, so it can be passed to any gpio_ function - It's device-tree only, so it should only be used from drivers that themselves probe from device tree. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.pengutronix.de/20210410103511.2073504-1-ahmad@a3f.at
* Merge branch 'for-next/spdx'Sascha Hauer2021-03-2321-256/+76
|\
| * gpio: Replace license and copyright boilerplate by SPDX identifiersUwe Kleine-König2021-03-0421-256/+76
| | | | | | | | | | | | | | | | | | Converts the files that licensecheck can determine to be licensed under GPL-2.0-only or GPL-2.0-or-later and also convert the copyright statements to SPDX. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | gpio: pl061: Fix driver registrationSascha Hauer2021-03-221-1/+5
|/ | | | | | | | | 77e74ddca1 changes drivers to use coredevice_platform_driver() instead of open coded initcall/driver registration. This is wrong for the pl061 driver as this is an amba driver. Revert 77e74ddca1 for this file. Fixes: 77e74ddca1 ("treewide: Use driver macro") Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpio: orion: Do not overwrite device idSascha Hauer2021-02-041-5/+7
| | | | | | | The driver has no busyness manipulating the id field in the given device struct. Leave it untouched. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Use driver macroSascha Hauer2020-09-2915-77/+15
| | | | | | | We have several macros for a oneline driver registration. Add some missing and use them consistently where possible througout the tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gpiolib: add gpio_array_to_id helper to get ID out of GPIO arrayOleksij Rempel2020-08-241-0/+31
| | | | | | | | | | | | | Some boards provide a board version and/or ID coded by pull-up/down resistors connected to the gpio pins (or pins which can be multiplexed at some point as gpio). In this case every one implements own gpio id reader function. To avoid it, provide the common helper function to extract a value out of provided gpio array. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc' into masterSascha Hauer2020-08-181-1/+0
|\
| * treewide: remove stale instances of struct deviceAhmad Fatoum2020-08-031-1/+0
| | | | | | | | | | | | | | | | We call it struct device_d, any instances of struct device are likely left-over code after porting from Linux. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | gpio: get function returns masked register valueRenaud Barbier2020-08-031-1/+1
|/ | | | | | | | | | Unlike Linux the generic driver get function returns the masked register content and not the 0 or 1 value. The consequence is that gpio_get_value returns for instance 0x10 for bit 4 instead of 1. Use the Linux normalized form instead. Signed-off-by: Renaud Barbier <renaud.barbier@abaco.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2020-05-142-2/+0
|\