summaryrefslogtreecommitdiff
path: root/drivers/gpio
AgeCommit message (Collapse)Author
2018-08-06gpio: zynq: Used platdata structure for storing static data instead of privVipul Kumar
This patch used platdata structure instead of priv for storing static information read from DT. Signed-off-by: Vipul Kumar <vipul.kumar@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-07-31GPIO: CREG: improve flexibility of hsdk-creg-gpio driverEugeniy Paltsev
CREG GPIO is a driver for weird soc-specific output ports, which are controlled by some fields in memory mapped register. Example: 31 9 7 5 0 < bit number | | | | | [ not used | gpio-1 | gpio-0 | <-shift-> ] < 32 bit register ^ ^ | | write 0x2 == set output to "1" (activate) write 0x3 == set output to "0" (deactivate) As of tooday we only support fixed (hardcoded) bit per gpio line, activate / deactivatei and shift values. Fix that by read them from device tree to be able to use this driver for other boards. Remove "hsdk" prefix from compatible string as this driver can be used with different boards like HSDK, AXS101, AXS103, etc. Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2018-07-23Convert CONFIG_DA8XX_GPIO to KconfigAdam Ford
This converts the following to Kconfig: CONFIG_DA8XX_GPIO Signed-off-by: Adam Ford <aford173@gmail.com>
2018-07-19microblaze: Convert generic platform to DM gpioMichal Simek
Converting GPIO to DM requires to do changes in reset subsystem that's why support for Microblaze soft reset via sysreset and GPIO sysreset support was added. These two patches enables enabling GPIO DM. Microblaze soft reset is bind at last reset method. GPIO reset is handled via sysreset with adding this fragment to DT. gpio-restart { compatible = "gpio-restart"; gpios = <&reset_gpio 0 0 0>; /* 3rd cell ACTIVE_HIGH = 0, ACTIVE_LOW = 1 */ }; hard-reset-gpio property is not documented and also handled. Conversion is required. Unfortunately do_reset is required for SPL that's why use only soft microblaze reset for now. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-07-19gpio: xilinx: Convert driver to DMMichal Simek
This patch is enabling GPIO_DM support to have an option to use this driver together with zynq gpio driver. !DM part is kept there till Microblaze is cleanup which will be done hopefully soon. Just a note: There is no reason to initialize uc-priv->name because it is completely unused. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-07-19gpio: zynq: Setup bank_name to dev->nameMichal Simek
There should be proper bank name setup to distinguish between different gpio drivers. Use dev->name for it. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-07-19gpio: zynq: Read of mach data in platdata with dev_get_driver_dataMichal Simek
Remove bogus zynq_gpio_getplat_data() and read driver data directly. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-07-19gpio: dm: Support manual relocation for gpioMichal Simek
Relocate gpio ops as was done by: "dm: Add support for all targets which requires MANUAL_RELOC" (sha1: 484fdf5ba058b07be5ca82763aa2b72063540ef3) Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-07-19gpio: zynq: Fix typo in one error messageMichal Simek
Just fix error message. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-07-19gpio: zynq: Use live-tree functionMichal Simek
Use live-tree function. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-07-10gpio: omap_gpio: Convert to auto-alloc feature when DT is supportedAdam Ford
The omap_gpio driver has a TODO that says when every board is converted to DM and DT, the omap_gpio_bind can stop using calloc and switch to auto-alloc. This patch converts this driver to auto-calloc when DT is enabled. Signed-off-by: Adam Ford <aford173@gmail.com>
2018-06-27Merge git://git.denx.de/u-boot-imxTom Rini
2018-06-18gpio: omap_gpio: Name GPIO's by bank and index with DM_GPIOAdam Ford
There are multiple GPIO banks with up to 32 pins / bank. When using 'gpio status -a' to read the pins, this patch displays both GPIO<bank>_<index> similar to how the device trees display in addition to displaying gpio_# Signed-off-by: Adam Ford <aford173@gmail.com>
2018-06-18dm: gpio: Add DM compatibility to GPIO driver for DavinciAdam Ford
This adds DM_GPIO support for the davinici GPIO driver with DT support. Signed-off-by: Adam Ford <aford173@gmail.com>
2018-06-18drivers/gpio/mxc: fix MXC GPIO name in KConfigHannes Schmelzer
The naming with "UART" is obviously wrong, we fix this here. Signed-off-by: Hannes Schmelzer <oe5hpm@oevsv.at> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
2018-06-15gpio: zynq_gpio: bank description should use unsigned typeMichal Simek
Use u32 instead of int for max_bank, bank_min and bank_max. These values can't be negative that's why no reason to use signed type. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-06-15gpio: zynq: Do not check unsigned type that is >= 0Michal Simek
There is no reason to check that unsigned type that is >= 0. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-06-02Merge branch 'master' of git://git.denx.de/u-boot-shTom Rini
2018-06-01gpio: bcm6345: convert to use live dtÁlvaro Fernández Rojas
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2018-06-01gpio: rmobile: Add R8A77990 E3 compatibleMarek Vasut
Add new compatible to the GPIO driver for R8A77990 E3 SoC. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2018-05-08gpio: atmel_pio4: give a full configuration when muxing pinsLudovic Desroches
When a pin is muxed to a peripheral or as a GPIO, the only configuration that can be set is the pullup. It is too restrictive so this patch allows to give a full configuration. Signed-off-by: Ludovic Desroches <ludovic.desroches@microchip.com>
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-04-27Remove unnecessary instances of DECLARE_GLOBAL_DATA_PTRTom Rini
We have a large number of places where while we historically referenced gd in the code we no longer do, as well as cases where the code added that line "just in case" during development and never dropped it. Signed-off-by: Tom Rini <trini@konsulko.com>
2018-04-06gpio: uclass: Fix debug stringMario Six
A debug string still has the old name of a function being called; update it. Signed-off-by: Mario Six <mario.six@gdsys.cc> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-04-04Merge git://git.denx.de/u-boot-sunxiTom Rini
Signed-off-by: Tom Rini <trini@konsulko.com>
2018-04-04sunxi: gpio: add missing compatible stringsAndre Przywara
The sunxi GPIO driver is missing some compatible strings for recent SoCs. While most of the sunxi GPIO code seems to not rely on this (and so works anyway), the sunxi_name_to_gpio() function does and fails at the moment (for instance when resolving the MMC CD pin name). Add the compatible strings for the A64 and V3s, which were missing from the list. This now covers all pinctrl nodes in our own DTs. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
2018-03-22gpio: omap_gpio: Add DM_FLAG_PRE_RELOC flagFaiz Abbas
With DM enabled in SPL, DM_FLAG_PRE_RELOC is required for the omap_gpio driver to be bound to the gpio devices. Therefore, add DM_FLAG_PRE_RELOC flag to the omap_gpio driver. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-03-19arm: stm32: add new architecture for STM32MP familyPatrick Delaunay
- add new arch stm32mp for STM32 MPU/Soc based on Cortex A - support for stm32mp157 SOC - SPL is used as first boot stage loader - using driver model for all the drivers, even in SPL - all security feature are deactivated (ETZC and TZC) - reused STM32 MCU drivers when it is possible Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2018-03-19gpio: stm32f7_gpio: handle node ngpiosPatrick Delaunay
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2018-03-19dm: gpio: Convert stm32f7 driver to livetreePatrick Delaunay
Update the GPIO driver to support a live device tree. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
2018-03-09treewide: Fix gdsys mail addressesMario Six
The @gdsys.cc addresses are supposed to be used for mailing lists. Switch all occurrences of @gdsys.de mail addresses to their @gdsys.cc equivalent. Also, Dirk's address was wrong in one place; fix that as well. Signed-off-by: Mario Six <six@gdsys.cc>
2018-03-05Merge git://git.denx.de/u-boot-shTom Rini
2018-03-05gpio: pca953x_gpio: Support label setting from DTMario Six
The PCA953x driver uses "gpio@%x_" as the GPIO bank name, where "%x" is instantiated with the I2C address of the chip. While this works, it becomes very confusing if a board has multiple PCAs with the same address on different I2C busses, and it also becomes an issue when a GPIO's value is to be set via the 'gpio' command, because this command only ever sets the value of the first device it encounters, leaving the other devices inaccessible to the command. As to not break boards that rely on this naming scheme, we introduce a new device tree string property "label" for the driver. If it exists, it is used to build a bank name of the form "%s@%x_" (where %x is still instantiated with the I2C address). If it does not exist, the legacy labeling scheme is used. Signed-off-by: Mario Six <mario.six@gdsys.cc>
2018-03-05gpio: rcar: Add R8A77965 M3N entriesMarek Vasut
Add entries for the R8A77965 M3N SoC. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2018-03-01microblaze: Added Kconfig support for CONFIG_XILINX_GPIOVipul Kumar
This patch added Kconfig support for CONFIG_XILINX_GPIO and enabled it in respective defconfig. Signed-off-by: Vipul Kumar <vipulk@xilinx.com> Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-02-18sandbox: Rename 'num-gpios' property to avoid dtc warningSimon Glass
At present dtc produces these warnings when compiling sandbox: arch/sandbox/dts/test.dtb: Warning (gpios_property): Could not get phandle node for /base-gpios:num-gpios(cell 0) arch/sandbox/dts/test.dtb: Warning (gpios_property): Missing property '#gpio-cells' in node /reset-ctl or bad phandle (referred from /extra-gpios:num-gpios[0]) Both are due to it assuming that the 'num-gpios' property holds a phandle pointing to a GPIO node. To avoid these warnings, rename the sandbox property so that it does not include the string 'gpios'. Signed-off-by: Simon Glass <sjg@chromium.org>
2018-02-13rockchip: gpio: remove dead codeHeinrich Schuchardt
In the following statements if (a) return a; if (a) return c; the second return can never be executed. Identified by cppcheck. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2018-02-08Convert CONFIG_MXC_GPIO to KconfigAdam Ford
This converts the following to Kconfig: CONFIG_MXC_GPIO Signed-off-by: Adam Ford <aford173@gmail.com>
2018-02-04gpio: mxc: add i.MX8M supportPeng Fan
Add i.MX8M GPIO support. There are 4 GPIO banks on i.MX8M. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com> Cc: Stefano Babic <sbabic@denx.de> Reviewed-by: Stefano Babic <sbabic@denx.de>
2018-01-28bcm283x: Add pinctrl driverAlexander Graf
The bcm283x family of SoCs have a GPIO controller that also acts as pinctrl controller. This patch introduces a new pinctrl driver that can actually properly mux devices into their device tree defined pin states and is now the primary owner of the gpio device. The previous GPIO driver gets moved into a subdevice of the pinctrl driver, bound to the same OF node. That way whenever a device asks for pinctrl support, it gets it automatically from the pinctrl driver and GPIO support is still available in the normal command line phase. Signed-off-by: Alexander Graf <agraf@suse.de>
2018-01-28gpio: mpc8xxx: Make live-tree compatibleMario Six
Make the MPC8xxx GPIO driver compatible with a live device tree. Signed-off-by: Mario Six <mario.six@gdsys.cc>
2018-01-28gpio: mpc8xxx: Make compatible with more SoCsMario Six
Finally, make the mpc8xxx driver capable of handling more GPIO devices; this entails adding a special case for the MPC5121 SoC, and adding a set of new compatible strings. Signed-off-by: Mario Six <mario.six@gdsys.cc>
2018-01-28gpio: mpc8xxx: Rename Kconfig option, structures, and functionsMario Six
Rename the Kconfig option, structures (and their members), as well as functions of the mpc85xx driver to include mpc8xxx to reflect the more generic usage. Signed-off-by: Mario Six <mario.six@gdsys.cc>
2018-01-28gpio: mpc85xx: Rename driver file to mpc8xxxMario Six
In preparation to making the MPC85xx GPIO driver useable for a broader range of SoCs, rename the driver file. Signed-off-by: Mario Six <mario.six@gdsys.cc>
2018-01-28gpio: mpc85xx_gpio: Fix style violationsMario Six
Fix some style violations in the MPC85XX GPIO driver. Signed-off-by: Mario Six <mario.six@gdsys.cc>
2018-01-28gpio: pca953x_gpio: Make live-tree compatibleMario Six
Make the pca953x_gpio driver compatible with a live device tree. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mario Six <mario.six@gdsys.cc>
2018-01-28gpio: pca953x_gpio: Fix style violationsMario Six
Fix some style violations in the pca953x_gpio driver. Signed-off-by: Mario Six <mario.six@gdsys.cc>
2018-01-27Merge branch 'rmobile-mx' of git://git.denx.de/u-boot-shTom Rini
2018-01-27gpio: rmobile: Add RCar Gen2 compatible stringMarek Vasut
Add DT compatible string for RCar Gen2. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
2018-01-26gpio: sunxi: Add compatible string for H5 PIOChris Blake
Add allwinner,sun50i-h5-pinctrl compatible for H5 boards. Signed-off-by: Chris Blake <chrisrblake93@gmail.com> Reviewed-by: Jagan Teki <jagan@openedev.com> [jagan: remove external link and format commit message] Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>