aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpio
AgeCommit message (Collapse)AuthorFilesLines
2018-11-14gpio: pca953x_gpio: fix DT GPIO flags translationAnatolij Gustschin1-1/+1
Commit fb01e07a95 accidentally broke initialisation of GPIO descriptor flags from device tree: currently the active low flag from gpio-specifier is always ignored. Fix it. Signed-off-by: Anatolij Gustschin <agust@denx.de> Cc: Mario Six <mario.six@gdsys.cc>
2018-10-25Merge tag 'u-boot-imx-20181025' of git://git.denx.de/u-boot-imxTom Rini1-9/+21
Merged imx8 architecture, fix build for imx8 + warnings
2018-10-22gpio: mxc_gpio: add support for i.MX8Peng Fan1-9/+21
Add i.MX8 support, there are 8 GPIO banks. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Anatolij Gustschin <agust@denx.de> Cc: Stefano Babic <sbabic@denx.de>
2018-10-10gpio: da8xx: Push generic defines of gpio.h out of mach-davinciKeerthy2-2/+46
Push generic defines of gpio.h out of mach-davinci to drivers/gpio now that non-davinci architectures are beginning to use this IP. Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> [trini: Fix calimain build] Signed-off-by: Tom Rini <trini@konsulko.com>
2018-10-10gpio: da8xx: Add k2g compatibleKeerthy1-0/+1
Add k2g compatible so that k3 SoCs can be supported Signed-off-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2018-10-03gpio: dwapb_gpio: Change to use devm_kcalloc()Ley Foon Tan1-9/+2
Change to use managed resource function devm_kcalloc(), so it will auto free memory when driver is removed. Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
2018-09-15gpio: dwapb_gpio: Change to use dev_read_addr()Ley Foon Tan1-1/+1
This changes the driver to use dev_read_addr() which is safe both for flat trees and live trees. Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
2018-09-15gpio: dwapb_gpio: Add reset ctrl to driverLey Foon Tan1-2/+49
Add code to reset all reset signals as in gpio DT node. A reset property is an optional feature, so only print out a warning and do not fail if a reset property is not present. If a reset property is discovered, then use it to deassert, thus bringing the IP out of reset. Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
2018-09-15gpio: dwapb_gpio: Enable get_function supportLey Foon Tan1-0/+14
Enabled get_function support for dwapb where the function will return the state of GPIO port. Signed-off-by: Chin Liang See <chin.liang.see@intel.com> Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
2018-09-11DM: omap_gpio: Reduce overhead when used with OF_PLATDATAAdam Ford1-3/+4
Platforms with limited resources in SPL may enable OF_PLATDATA, this limits some of the library functions and cannot extract data from the device tree. This patch adds additional wrappers around these functions to only allow them when OF_CONTROL is enabled and OF_PLATDATA is not. Signed-off-by: Adam Ford <aford173@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-09-11GPIO: omap_gpio: Fix gpio name names with device treeAdam Ford1-3/+1
The GPIO bank numbers do not appear in the device tree, so this patch makes the gpio name based on the address (ie gpio@49054000_31 vs gpio4_31) adam Signed-off-by: Adam Ford <aford173@gmail.com> Tested-by: Derald D. Woods <woods.technical@gmail.com>
2018-09-11dm: gpio: da8xx_gpio: Add support for GPIO_ACTIVE_LOW/HIGHAdam Ford1-0/+13
With DM and device tree support, let's use the GPIO_ACTIVE_HIGH and GPIO_ACTIVE_LOW from the device tree as they are intended. Signed-off-by: Adam Ford <aford173@gmail.com>
2018-09-11DM: GPIO: Fix da8xx GPIO indexing over GPIO 32Adam Ford1-7/+15
The GPIO banks are broken up into two 16-bit registers for each bank set. Unfortunately, the math that determines how to shift blindly shifted by the number of the gpio. This worked for gpio numbers under 32, but higher gpio's are broken. This fixes the gpio index, so the bank is passed and the shift amount within the register is passed now instead of the gpio number. Fixes: 8e51c0f25406("dm: gpio: Add DM compatibility to GPIO driver for Davinci") Signed-off-by: Adam Ford <aford173@gmail.com>
2018-09-10gpio: stm32f7: replace ODR update by BSRR writePatrice Chotard1-6/+5
Replace clrsetbits on ODR register (2 operations: one read + one write) by writing on the correct bit (SET or RESET) of the BSRR register (only 1 write operation). Moreover this register if safe for simultaneous access by 2 master on the bus. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
2018-08-07gpio: xilinx: Add support for using label propertyMichal Simek2-2/+18
Add support for reading label property from DT and set up bank name based on that. If label property is not present full device node name is used. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
2018-08-07gpio: xilinx: Return 0 from xilinx_gpio_set_valueMichal Simek1-1/+1
.set_value functions have no specified return value and gpio_uclass is not working with it too. But this patch is returning 0 to be in sync with others DM gpio drivers. Reported-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
2018-08-07gpio: xilinx: Not read output values via regsMichal Simek1-4/+32
Reading registers for finding out output value is not working because input value is read instead in case of tristate. Reported-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
2018-08-07gpio: xilinx: Simplify logic in xilinx_gpio_set_valueMichal Simek1-7/+6
There is no reason to do read/write for if/else separately. Reported-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
2018-08-07gpio: xilinx: Set value before changing directionMichal Simek1-2/+2
Set a value before changing gpio direction. This will ensure that the old value is not propagated when direction has changed but new value is not written yet. Reported-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
2018-08-07gpio: xilinx: Remove !DM driverMichal Simek1-336/+2
There is no user for !DM driver that's why remove it. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-08-07gpio: xilinx: Find out bank before use in xilinx_gpio_get_function()Michal Simek1-4/+4
Call xilinx_gpio_get_bank_pin() before use. Reported-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
2018-08-06gpio: zynq: Used platdata structure for storing static data instead of privVipul Kumar1-33/+34
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 Paltsev1-22/+81
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 Ford1-0/+5
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 Simek1-0/+1
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 Simek1-1/+264
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 Simek1-0/+2
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 Simek1-27/+2
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 Simek1-0/+35
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 Simek1-1/+1
Just fix error message. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2018-07-19gpio: zynq: Use live-tree functionMichal Simek1-1/+1
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 Ford1-1/+24
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 Rini1-1/+1
2018-06-18gpio: omap_gpio: Name GPIO's by bank and index with DM_GPIOAdam Ford1-2/+8
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 Ford1-24/+169
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 Schmelzer1-1/+1
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 Simek1-4/+4
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 Simek1-1/+1
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 Rini1-0/+1
2018-06-01gpio: bcm6345: convert to use live dtÁlvaro Fernández Rojas1-13/+5
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 Vasut1-0/+1
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 Desroches1-18/+18
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 Rini48-94/+48
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 Rini9-18/+0
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 Six1-1/+1
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 Rini1-0/+3
Signed-off-by: Tom Rini <trini@konsulko.com>
2018-04-04sunxi: gpio: add missing compatible stringsAndre Przywara1-0/+3
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 Abbas1-0/+1
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 Delaunay1-1/+1
- 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 Delaunay1-1/+2
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>