summaryrefslogtreecommitdiffstats
path: root/drivers/gpio
Commit message (Collapse)AuthorAgeFilesLines
* kconfig: add blank Kconfig filesMasahiro Yamada2014-09-241-0/+0
| | | | | | | | This would be useful to start moving various config options. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* tegra: Convert tegra GPIO driver to use driver modelSimon Glass2014-09-101-55/+272
| | | | | | | | | | | | | | | | This is an implementation of GPIOs for Tegra that uses driver model. It has been tested on trimslice and also using the new iotrace feature. The implementation uses a top-level GPIO device (which has no actual GPIOS). Under this all the banks are created as separate GPIO devices. The GPIOs are named as per the Tegra datasheet/header files: A0..A7, B0..B7, ..., Z0..Z7, AA0..AA7, etc. Since driver model is not yet available before relocation, or in SPL, a special function is provided for seaboard's SPL code. Signed-off-by: Simon Glass <sjg@chromium.org>
* Merge branch 'u-boot-sunxi/master' into 'u-boot-arm/master'Albert ARIBAUD2014-07-282-0/+103
|\
| * sunxi: add gpio driverIan Campbell2014-07-182-0/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch enables CONFIG_CMD_GPIO for the Allwinner (sunxi) platform as well as providing the common gpio API (gpio_request/free, direction in/out, get/set etc). Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Ma Haijun <mahaijuns@gmail.com> Signed-off-by: Oliver Schinagl <oliver@schinagl.nl> Signed-off-by: Ian Campbell <ijc@hellion.org.uk> Cc: Henrik Nordström <henrik@henriknordstrom.net> Cc: Tom Cubie <Mr.hipboi@gmail.com> Acked-by: Hans de Goede <hdegoede@redhat.com>
* | dm: gpio: Don't use the driver model uclass for SPLSimon Glass2014-07-231-0/+2
|/ | | | | | | Driver model does not support SPL yet, so we should not use the GPIO uclass for SPL. Signed-off-by: Simon Glass <sjg@chromium.org>
* gpio: spear_gpio: Fix gpio_set_value() implementationAxel Lin2014-07-041-1/+4
| | | | | | | | | | | | | | | | In current gpio_set_value() implementation, it always sets the gpio control bit no matter the value argument is 0 or 1. Thus the GPIOs never set to low. This patch fixes this bug. The address bus is used as a mask on read/write operations, so that independent software drivers can set their GPIO bits without affecting any other pins in a single write operation. Thus we don't need a read-modify-write to update the register. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Stefan Roese <sr@denx.de> Reviewed-by: Vipin Kumar <vipin.kumar@st.com> Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
* dm: Use case-insensitive comparison for GPIO banksSimon Glass2014-06-201-1/+1
| | | | | | | We want 'N0' and 'n0' to mean the same thing, so ensure that case is not considered when naming GPIO banks. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Rename struct device_id to udevice_idSimon Glass2014-06-201-1/+1
| | | | | | | It is best to avoid having any occurence of 'struct device' in driver model, so rename to achieve this. Signed-off-by: Simon Glass <sjg@chromium.org>
* Merge branch 'master' of git://git.denx.de/u-boot-armTom Rini2014-05-301-1/+2
|\
| * gpio: at91: add sanity check for the NULL pointerWu, Josh2014-05-271-1/+2
| | | | | | | | | | | | | | | | | | | | We need check the NULL pointer as at91_pio_get_port() may return NULL. Also print a error message when at91_pio_get_port() failed otherwise we cannot notice the failure. Signed-off-by: Josh Wu <josh.wu@atmel.com> Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
* | dm: rename device struct to udeviceHeiko Schocher2014-05-272-31/+31
|/ | | | | | | | | | | | using UBI and DM together leads in compiler error, as both define a "struct device", so rename "struct device" in include/dm/device.h to "struct udevice", as we use linux code (MTD/UBI/UBIFS some USB code,...) and cannot change the linux "struct device" Signed-off-by: Heiko Schocher <hs@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Marek Vasut <marex@denx.de>
* Merge branch 'u-boot-tegra/master' into 'u-boot-arm/master'Albert ARIBAUD2014-05-151-0/+20
|\
| * ARM: tegra: add GPIO initialization table functionStephen Warren2014-05-131-0/+20
| | | | | | | | | | | | | | | | | | | | | | The HW-defined procedure for booting Tegra requires that some pins be set up as GPIOs immediately at boot in order to avoid glitches on those pins, when the pinmux is programmed. Add a feature to the GPIO driver which executes a GPIO configuration table. Board files will use this to implement the correct HW initialization procedure. Signed-off-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Tom Warren <twarren@nvidia.com>
* | S5P: Exynos: Add GPIO pin numbering and rename definitionsAkshay Saraswat2014-05-131-33/+171
|/ | | | | | | | | | | | | | | | | | | | | | | This patch includes following changes : * Adds gpio pin numbering support for EXYNOS SOCs. To have consistent 0..n-1 GPIO numbering the banks are divided into different parts where ever they have holes in them. * Rename GPIO definitions from GPIO_... to S5P_GPIO_... These changes were done to enable cmd_gpio for EXYNOS and cmd_gpio has GPIO_INPUT same as s5p_gpio driver and hence getting a error during compilation. * Adds support for name to gpio conversion in s5p_gpio to enable gpio command EXYNOS SoCs. Function has been added to asm/gpio.h to decode the input gpio name to gpio number. Example: SMDK5420 # gpio set gpa00 Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com> Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com> Signed-off-by: Akshay Saraswat <akshay.s@samsung.com> Acked-by: Przemyslaw Marczak <p.marczak@samsung.com> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
* sandbox: Convert GPIOs to use driver modelSimon Glass2014-03-041-78/+139
| | | | | | Convert sandbox over to use driver model GPIOs. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: Add GPIO support and testsSimon Glass2014-03-042-0/+268
| | | | | | | | | | | | | | | | | | | | | | | | | | Add driver model support for GPIOs. Since existing GPIO drivers do not use driver model, this feature must be enabled by CONFIG_DM_GPIO. After all GPO drivers are converted over we can perhaps remove this config. Tests are provided for the sandbox implementation, and are a sufficient sanity check for basic operation. The GPIO uclass understands the concept of named banks of GPIOs, with each GPIO device providing a single bank. Within each bank the GPIOs are numbered using an offset from 0 to n-1. For example a bank named 'b' with 20 offsets will provide GPIOs named b0 to b19. Anonymous GPIO banks are also supported, and are just numbered without any prefix. Each time a GPIO driver is added to the uclass, the GPIOs are renumbered accordinging, so there is always a global GPIO numbering order. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com> Signed-off-by: Viktor Křivák <viktor.krivak@gmail.com> Signed-off-by: Tomas Hlavacek <tmshlvck@gmail.com>
* sizes.h - consolidate for all architecturesAlexey Brodkin2014-03-041-1/+1
| | | | | | | | | | | | | | | | Copied from Linux sources "include/linux/sizes.h" commit 413541dd66d51f791a0b169d9b9014e4f56be13c Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Vineet Gupta <vgupta@synopsys.com> Cc: Tom Rini <trini@ti.com> Cc: Stefan Roese <sr@denx.de> Cc: Albert Aribaud <albert.u.boot@aribaud.net> Acked-by: Tom Rini <trini@ti.com> Acked-by: Stefan Roese <sr@denx.de> [trini: Add bcm Kona platforms to the patch] Signed-off-by: Tom Rini <trini@ti.com>
* gpio: kona: Add Kona gpio driverDarwin Rambo2014-02-222-0/+142
| | | | | | | | | Add support for the Kona GPIO controller found on Broadcom mobile SoCs. Signed-off-by: Darwin Rambo <drambo@broadcom.com> Reviewed-by: Steve Rae <srae@broadcom.com> Reviewed-by: Markus Mayer <markus.mayer@linaro.org> Reviewed-by: Tim Kryger <tkryger@linaro.org>
* s5p: gpio: change gpio coding method for s5p gpio.Przemyslaw Marczak2014-02-031-6/+9
| | | | | | | | | | | | | Old s5p gpio coding method was not clean and was not working properly for all parts and banks. New method is clean and easy to extend. Gpio coding mask: 0x000000ff - pin number 0x00ffff00 - bank offset 0xff000000 - part number Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
* Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'Albert ARIBAUD2014-01-061-2/+2
|\ | | | | | | | | | | | | | | Conflicts: include/micrel.h The conflict above was trivial, caused by four lines being added in both branches with different whitepace.
| * mxs_gpio: fix the handling in gpio_direction_output()Michael Heimpold2013-11-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Setting the direction and an output value should be done by 1) set the desired output value, 2) switch to output. If this is done in the inverse order, there can be a glitch on the GPIO line. This patch fixes this by using the order as described above. Signed-off-by: Michael Heimpold <mhei@heimpold.de> Acked-by: Stefano Babic <sbabic@denx.de>
* | at91: add new gpio pin definitionsAndreas Bießmann2013-12-091-3/+1
|/ | | | | | | | This patch define new names for GPIO pins on at91 devices. Follow up patches will convert the whole infrastructure to use these new definitions. Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> Tested-by: Bo Shen <voice.shen@atmel.com>
* Add support for SX151x SPI GPIO ExpandersViktar Palstsiuk2013-11-082-0/+243
| | | | Signed-off-by: Viktar Palstsiuk <viktar.palstsiuk@promwad.com>
* Merge branch 'master' of git://git.denx.de/u-boot-blackfinTom Rini2013-11-041-17/+0
|\ | | | | | | | | | | | | | | | | Easy to resolve conflict on the GPIO change. Conflicts: arch/blackfin/cpu/Makefile Signed-off-by: Tom Rini <trini@ti.com>
| * blackfin: Move machine specific gpio_port_t structure back to blackfin arch ↵Steven Miao2013-11-041-17/+0
| | | | | | | | | | | | | | | | | | folder. The gpio register mappings are different among blackfin processors. Signed-off-by: Steven Miao <realmz6@gmail.com> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
* | drivers: convert makefiles to Kbuild styleMasahiro Yamada2013-10-311-48/+25
|/ | | | Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
* Merge branch 'u-boot-atmel/master' into 'u-boot-arm/master'Albert ARIBAUD2013-09-041-113/+182
|\
| * gpio: atmel: add copyright and remove error header infoBo Shen2013-08-221-1/+1
| | | | | | | | | | | | Signed-off-by: Bo Shen <voice.shen@atmel.com> Acked-by: Jens Scharsig <js_at_ng@scharsoft.de> Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
| * gpio: atmel: add gpio common API supportBo Shen2013-08-221-0/+43
| | | | | | | | | | | | | | | | add gpio common API support for gpio command Signed-off-by: Bo Shen <voice.shen@atmel.com> [fix unnecessary cast] Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
| * gpio: atmel: fix code to use pointer for pio portBo Shen2013-08-221-112/+138
| | | | | | | | | | | | | | | | fix code to use pointer for pio port as the warning message suggested remove the warning message Signed-off-by: Bo Shen <voice.shen@atmel.com> Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
* | SPDX-License-Identifier: fixing some problematic GPL-2.0 filesWolfgang Denk2013-08-191-18/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlike the other patches in this series so far, this commit fixes a ambiguity in the license terms for some OMAP files: the code was originally derived from the Linux kernel sources, where it was clearly marked as GPL-2.0 (i. e. without the "or later" part), but the U-Boot version had a GPL-2.0+ file header added, apparently without permission / relicensing from the original authors of the code. Insert a GPL-2.0 SPDX-License-Identifier to fix this. Signed-off-by: Wolfgang Denk <wd@denx.de> cc: Tom Rix <Tom.Rix@windriver.com> Cc: Tom Rini <trini@ti.com> Cc: Albert Aribaud <albert.u.boot@aribaud.net> Acked-by: Tom Rini <trini@ti.com>
* | Merge branch 'master' of git://88.191.163.10/u-boot-armTom Rini2013-08-183-2/+336
|\ \ | |/ | | | | | | | | | | | | | | | | Fixup an easy conflict over adding the clk_get prototype and USB_OTG defines for am33xx having moved. Conflicts: arch/arm/include/asm/arch-am33xx/hardware.h Signed-off-by: Tom Rini <trini@ti.com>
| * Merge git://git.denx.de/u-boot-armStefano Babic2013-07-3121-326/+354
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: board/freescale/mx6qsabrelite/Makefile board/freescale/mx6qsabrelite/mx6qsabrelite.c include/configs/mx6qsabrelite.h Signed-off-by: Stefano Babic <sbabic@denx.de>
| | * gpio: tca642x: Add the tca642x gpio expander driverDan Murphy2013-07-302-0/+334
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add the tca642x gpio expander driver Datasheet: http://www.ti.com/product/tca6424a Signed-off-by: Dan Murphy <dmurphy@ti.com>
| * | mxc_gpio: Correct the GPIO handling in gpio_direction_output()Dirk Behme2013-07-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Setting the direction and an output value should be done by First, set the desired output value. Then, switch to output. If this is done in the inverse order, like at the moment, there can be a glitch on the GPIO line while switching first the old output value and aftwards the new one. Fix this by inverting the order of the direction/set_value calls. Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com> Acked-by: Stefano Babic <sbabic@denx.de>
* | | gpio: pca953x: Use ARRAY_SIZE instead of reinventing itAxel Lin2013-08-161-4/+1
| | | | | | | | | | | | | | | | | | Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-by: Thierry Reding <thierry.reding@gmail.com> Acked-by: Marek Vasut <marex@denx.de>
* | | gpio: adi_gpio2: Unreserve gpio in special_gpio_free()Axel Lin2013-07-311-2/+2
| |/ |/| | | | | | | | | | | In special_gpio_free(), call unreserve() rather than reserve() to release gpio. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
* | Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk2013-07-2420-326/+20
|/ | | | | | Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
* Merge branch 'u-boot-samsung/master' into 'u-boot-arm/master'Albert ARIBAUD2013-07-102-11/+4
|\
| * gpio: s5p_gpio: Call s5p_gpio_set_value() instead of open-codeAxel Lin2013-06-251-8/+1
| | | | | | | | | | | | | | Call s5p_gpio_set_value() to avoid code duplication. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
| * gpio: s3c2440_gpio: Fix wrong writel argumentsAxel Lin2013-06-251-3/+3
| | | | | | | | | | | | | | | | Current code had writel arguments the wrong way around, fix it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-by: Marek Vasut <marex@denx.de> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
* | ARM: OMAP: GPIO: Fix valid range and enable usage of all GPIOs on OMAP5Axel Lin2013-07-021-1/+1
|/ | | | | | | | | | | | | | | | The omap_gpio driver is used by AM33XX, OMAP3/4, OMAP54XX and DRA7XX SoCs. These SoCs have different gpio count but currently omap_gpio driver uses hard coded 192 which is wrong. This patch fixes this issue by: 1. Move define of OMAP_MAX_GPIO to all arch/arm/include/asm/arch-omap*/gpio.h. 2. Update gpio bank settings and enable GPIO modules 7 & 8 clocks for OMAP5. Thanks for Lubomir Popov to provide valuable comments to fix this issue. Signed-off-by: Axel Lin <axel.lin@ingics.com> Tested-by: Lubomir Popov <lpopov@mm-sol.com> Acked-by: Heiko Schocher <hs@denx.de>
* bfin: Move gpio support for bf54x and bf60x into the generic driver folder.Sonic Zhang2013-05-132-0/+441
| | | | | | | | | | | | | | | The gpio spec for bf54x and bf60x differ a lot from the old gpio driver for bf5xx. A lot of machine macros are used to accomodate both code in one gpio driver. This patch split the old gpio driver and move new gpio2 support to the generic gpio driver folder. - To enable gpio2 driver, macro CONFIG_ADI_GPIO2 should be defined in the board's config header file. - The gpio2 driver supports bf54x, bf60x and future ADI processors, while the older gpio driver supports bf50x, bf51x, bf52x, bf53x and bf561. - All blackfin specific gpio function names are replaced by the generic gpio APIs. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
* gpio: Add support for microblaze xilinx GPIOMichal Simek2013-05-092-0/+365
| | | | | | | | | | | | | | | | | | | | | | | | Microblaze uses gpio which is connected to the system reset. Currently gpio subsystem wasn't used for it. Add gpio driver and change Microblaze reset logic to be done via gpio subsystem. There are various configurations which Microblaze can have that's why gpio_alloc/gpio_alloc_dual(for dual channel) function has been introduced and gpio can be allocated dynamically. Adding several gpios IP is also possible and supported. For listing gpio configuration please use "gpio status" command This patch also remove one compilation warning: microblaze-generic.c: In function 'do_reset': microblaze-generic.c:38:47: warning: operation on '*1073741824u' may be undefined [-Wsequence-point] Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* Merge u-boot/master into u-boot-ti/masterTom Rini2013-03-112-2/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | In master we had already taken a patch to fix the davinci GPIO code for CONFIG_SOC_DM646X and in u-boot-ti we have additional patches to support DA830 (which is CONFIG_SOC_DA8XX && !CONFIG_SOC_DA850). Resolve these conflicts manually and comment the #else/#endif lines for clarity. Conflicts: arch/arm/include/asm/arch-davinci/gpio.h drivers/gpio/da8xx_gpio.c Signed-off-by: Tom Rini <trini@ti.com>
| * gpio: Build the da8xx_gpio code for the davinci644x deviceHolger Hans Peter Freyther2013-02-202-0/+5
| | | | | | | | | | | | | | The differences include the number of GPIOs and that one is not required to set the pinmux on request. Signed-off-by: Holger Hans Peter Freyther <holger@freyther.de>
* | da8xx: Add the missing pinmux for da830 to the gpio driverTomas Novotny2013-02-181-0/+133
|/ | | | | | | | | The pinmux was generated from linux/arch/arm/mach-davinci/da830.c as of kernel version 3.7.5. If the driver is used for the da850, then SoC variant must be specified by CONFIG_SOC_DA850. Signed-off-by: Tomas Novotny <tomas@novotny.cz> Cc: Tom Rini <trini@ti.com>
* Merge branch 'u-boot-ti/master' into 'u-boot-arm/master'Albert ARIBAUD2013-01-081-7/+3
|\ | | | | | | | | This required manual merging drivers/mtd/nand/Makefile and adding am335x_evm support for CONFIG_SPL_NAND_DRIVERS
| * gpio: add gpio_is_valid() to omap_gpio APINikita Kiryanov2012-12-101-7/+3
| | | | | | | | | | | | | | Add gpio_is_valid() to omap_gpio API Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
* | Merge branch 'master' of git://git.denx.de/u-boot into resolveMinkyu Kang2012-12-102-0/+291
|\ \ | |/ |/| | | | | | | | | | | | | | | | | Conflicts: README board/samsung/universal_c210/universal.c drivers/misc/Makefile drivers/power/power_fsl.c include/configs/mx35pdk.h include/configs/mx53loco.h include/configs/seaboard.h
OpenPOWER on IntegriCloud