| #
3669e0e7 |
| 06-Jan-2015 |
Simon Glass <sjg@chromium.org> |
dm: gpio: Add better functions to request GPIOs
At present U-Boot sort-of supports the standard way of reading GPIOs from device tree nodes, but the support is incomplete, a bit clunky and only work
dm: gpio: Add better functions to request GPIOs
At present U-Boot sort-of supports the standard way of reading GPIOs from device tree nodes, but the support is incomplete, a bit clunky and only works for GPIO bindings where #gpio-cells is 2.
Add new functions to request GPIOs, taking full account of the device tree binding. These permit requesting a GPIO with a simple call like:
gpio_request_by_name(dev, "cd-gpios", 0, &desc, GPIOD_IS_IN);
This will request the GPIO, looking at the device's node which might be this, for example:
cd-gpios = <&gpio TEGRA_GPIO(B, 3) GPIO_ACTIVE_LOW>;
The GPIO will be set to input mode in this case and polarity will be honoured by the GPIO calls.
It is also possible to request and free a list of GPIOs.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
0dac4d51 |
| 06-Jan-2015 |
Simon Glass <sjg@chromium.org> |
dm: gpio: Add a driver GPIO translation method
Only the GPIO driver knows about the full GPIO device tree binding used by a device. Add a method to allow the driver to provide this information to th
dm: gpio: Add a driver GPIO translation method
Only the GPIO driver knows about the full GPIO device tree binding used by a device. Add a method to allow the driver to provide this information to the uclass, including the GPIO offset within the device and flags such as the polarity.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
ae7123f8 |
| 06-Jan-2015 |
Simon Glass <sjg@chromium.org> |
dm: gpio: Add a native driver model API
So far driver model's GPIO uclass just implements the existing GPIO API. This has some limitations:
- it requires manual device tree munging to support GPIOs
dm: gpio: Add a native driver model API
So far driver model's GPIO uclass just implements the existing GPIO API. This has some limitations:
- it requires manual device tree munging to support GPIOs in device tree (fdtdec_get_gpio() and friends) - it does not understand polarity - it is somewhat slower since we must scan for the GPIO device each time - Global GPIO numbering can change if other GPIO drivers are probed - it requires extra steps to set the GPIO direction and value
The new functions have a dm_ prefix where necessary to avoid name conflicts but we can remove that when it is no-longer needed. The new struct gpio_desc holds all required information about the GPIO. For now this is intended to be stored by the client requesting the GPIO, but in future it might be brought into the uclass in some way.
With these changes the old GPIO API still works, and uses the driver model API underneath.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
746667f1 |
| 24-Nov-2014 |
Tom Rini <trini@ti.com> |
Merge git://git.denx.de/u-boot-x86
Conflicts: arch/x86/cpu/Makefile
Signed-off-by: Tom Rini <trini@ti.com>
|
| #
e5901c94 |
| 11-Nov-2014 |
Simon Glass <sjg@chromium.org> |
dm: gpio: Add a function to read an ID from a list of GPIOs
For board IDs a common approach is to set aside several GPIOs for use in determining the board ID. This can provide information about boar
dm: gpio: Add a function to read an ID from a list of GPIOs
For board IDs a common approach is to set aside several GPIOs for use in determining the board ID. This can provide information about board features and the revision.
Add a function that turns a list of GPIOs into an integer by assigning each GPIO to a single bit.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
84a6df09 |
| 26-Oct-2014 |
Tom Rini <trini@ti.com> |
Merge git://git.denx.de/u-boot-dm
Fix a trivial conflict over adding <dm.h>
Conflicts: arch/arm/cpu/armv7/omap3/board.c
Signed-off-by: Tom Rini <trini@ti.com>
|
| #
5b5ac645 |
| 08-Oct-2014 |
Jeroen Hofstee <jeroen@myspectrum.nl> |
gpio: add protype for name_to_gpio
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
|
| #
85bfe6e4 |
| 04-Oct-2014 |
Simon Glass <sjg@chromium.org> |
dm: gpio: Remove unused get_state() uclass method
This is no longer used so drop it.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
| #
d44f597b |
| 04-Oct-2014 |
Simon Glass <sjg@chromium.org> |
dm: gpio: Add gpio_requestf() helper for printf() strings
Add a helper which permits a printf()-style format string for the requester string.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
| #
0757535a |
| 04-Oct-2014 |
Simon Glass <sjg@chromium.org> |
dm: Move the function for getting GPIO status into the uclass
This function can be more easily tested if it is in the uclass.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
| #
6449a506 |
| 04-Oct-2014 |
Simon Glass <sjg@chromium.org> |
dm: gpio: Add gpio_get_function() and friends
Add helpers to the uclass to allow finding out the pin function.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
| #
b892d127 |
| 04-Oct-2014 |
Simon Glass <sjg@chromium.org> |
dm: gpio: Implement GPIO reservation in the uclass
We have several GPIO drivers now and all are doing similar things to record which GPIOs are reserved.
Move this logic into the uclass to make the
dm: gpio: Implement GPIO reservation in the uclass
We have several GPIO drivers now and all are doing similar things to record which GPIOs are reserved.
Move this logic into the uclass to make the drivers similar.
We retain the request()/free() methods since currently one driver does use these for setting up the pin.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
03a3536c |
| 23-Oct-2014 |
Tom Rini <trini@ti.com> |
Merge branch 'master' of git://git.denx.de/u-boot-tegra
|
| #
25ca385d |
| 10-Oct-2014 |
Marcel Ziswiler <marcel@ziswiler.com> |
gpio: header file comment spelling fixes
Signed-off-by: Marcel Ziswiler <marcel@ziswiler.com> Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
|
| #
141e1fae |
| 02-Sep-2014 |
Tom Rini <trini@ti.com> |
Merge git://git.denx.de/u-boot-dm
|
| #
89e64054 |
| 11-Aug-2014 |
Simon Glass <sjg@chromium.org> |
dm: gpio: Enhance gpio command to show only active GPIOs
The GPIO list is very long in many cases and most of them are not used. By default, show only the GPIOs that are in use, and provide a flag t
dm: gpio: Enhance gpio command to show only active GPIOs
The GPIO list is very long in many cases and most of them are not used. By default, show only the GPIOs that are in use, and provide a flag to show all of them. This makes the 'gpio status' command much more pleasant.
In order to do this, driver model now exposes a method for obtaining the 'function' of a GPIO, which describes whether it is an input or output, for example. Implementation of this method is optional.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
dab5e346 |
| 16-Jul-2014 |
Stefano Babic <sbabic@denx.de> |
Merge branch 'master' of git://git.denx.de/u-boot
Signed-off-by: Stefano Babic <sbabic@denx.de>
Conflicts: boards.cfg
|
| #
ed1d98d8 |
| 25-Jun-2014 |
Albert ARIBAUD <albert.u.boot@aribaud.net> |
Merge branch 'u-boot/master' into 'u-boot-arm/master'
|
| #
54c5d08a |
| 22-May-2014 |
Heiko Schocher <hs@denx.de> |
dm: rename device struct to udevice
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 u
dm: rename device struct to udevice
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>
show more ...
|
| #
1cad23c5 |
| 04-Apr-2014 |
Stefano Babic <sbabic@denx.de> |
Merge branch 'master' of git://git.denx.de/u-boot-arm into master
Conflicts: arch/arm/cpu/arm926ejs/mxs/mxsimage.mx23.cfg arch/arm/cpu/arm926ejs/mxs/mxsimage.mx28.cfg
Signed-off-by: Stefano Babic
Merge branch 'master' of git://git.denx.de/u-boot-arm into master
Conflicts: arch/arm/cpu/arm926ejs/mxs/mxsimage.mx23.cfg arch/arm/cpu/arm926ejs/mxs/mxsimage.mx28.cfg
Signed-off-by: Stefano Babic <sbabic@denx.de>
show more ...
|
| #
96495d90 |
| 26-Feb-2014 |
Simon Glass <sjg@chromium.org> |
dm: Add GPIO support and tests
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 conv
dm: Add GPIO support and tests
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>
show more ...
|
| #
326ea986 |
| 31-Jul-2013 |
Stefano Babic <sbabic@denx.de> |
Merge git://git.denx.de/u-boot-arm
Conflicts: board/freescale/mx6qsabrelite/Makefile board/freescale/mx6qsabrelite/mx6qsabrelite.c include/configs/mx6qsabrelite.h
Signed-off-by: Stefano Babic <s
Merge git://git.denx.de/u-boot-arm
Conflicts: board/freescale/mx6qsabrelite/Makefile board/freescale/mx6qsabrelite/mx6qsabrelite.c include/configs/mx6qsabrelite.h
Signed-off-by: Stefano Babic <sbabic@denx.de>
show more ...
|
| #
8b485ba1 |
| 25-Jul-2013 |
Albert ARIBAUD <albert.u.boot@aribaud.net> |
Merge branch 'u-boot/master' into u-boot-arm/master
|
| #
1a459660 |
| 08-Jul-2013 |
Wolfgang Denk <wd@denx.de> |
Add GPL-2.0+ SPDX-License-Identifier to source files
Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
|
| #
96764df1 |
| 22-Dec-2012 |
Albert ARIBAUD <albert.u.boot@aribaud.net> |
Merge samsung, imx, tegra into u-boot-arm/master
This commit merges branches from samsung, imx and tegra meant to fix merge issues between u-boot/master and u-boot-arm/master, as well as a few manua
Merge samsung, imx, tegra into u-boot-arm/master
This commit merges branches from samsung, imx and tegra meant to fix merge issues between u-boot/master and u-boot-arm/master, as well as a few manual merge fixes.
show more ...
|