summaryrefslogtreecommitdiffstats
path: root/libopenbmc_intf/gpio.c
Commit message (Collapse)AuthorAgeFilesLines
* skeleton: Use ioctl gpio handlingAnthony Wilson2019-04-101-192/+57
| | | | | | | | | | | | | Now that chassiskill is a standalone app and is using ioctl gpio handling (through the gpioplus library), the gpio libraries here need to use ioctl as well for chassiskill to be compatible. Tested: Verified chassiskill works as intended and checked that nothing else broke. Change-Id: I67c431027d31e87c332c3e1771fc2d3423f56652 Signed-off-by: Anthony Wilson <wilsonan@us.ibm.com>
* Remove unnecessary args from GPIO functionsMatt Spinler2018-08-141-1/+1
| | | | | | | | Now that gpio_init() and read_gpios() doesn't use D-Bus, they don't need the D-Bus connection parameter. Change-Id: Id7f3ee6547bed7c0c0eed5d75cba2d6ff239d0fa Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Fill in the function that finds the GPIO baseMatt Spinler2018-08-141-2/+90
| | | | | | | | | | | Finds the GPIO base value to use in the GPIO number calculation. This is most likely specific to ASPEED BMCs, though as with the calling code additional support can be added in the future if required. Change-Id: Ie0d2b87286ab4bf6b05b61245bd821ab2a9d602a Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Fill in function to convert GPIO pin to a numberMatt Spinler2018-08-141-1/+60
| | | | | | | | | | | | Convert the pin, like "A7" to the number that identifies that GPIO in /sys/class/gpio/. This most likely only supports ASPEED BMCs, though of course support can be added for others if the need arises and this code is still in use. Change-Id: I404716652ffc29c27933ed13225bc074341fa473 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Use cJSON to get the GPIO definitionsMatt Spinler2018-08-141-30/+109
| | | | | | | | | | | | In gpio_init, read the GPIO definitions out of the JSON instead of D-Bus. As many applications configure several GPIOs at once, the cJSON structure for the GPIOs stays loaded in memory until explicitly freed by calling gpio_inits_done(). Change-Id: I3ba216545a4a367744ce1fac09ca19c4d8d9d302 Signed-off-by: Matt Spinler <spinler@us.ibm.com>
* Add lseek to support GPIO read/writeYong Li2017-12-041-0/+17
| | | | | | | | | GPIO api does not support repeat read(read multi times after one open). A workaround is close and reopen the device before the second read. The root cause is that the file descriptor is not moved to beginning of the file, this patch can fix this issue Change-Id: I40e5602669c9ab6f0dddf5aa77040466cbfa3738 Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
* gpio: Avoid glitching 'out'-direction GPIOsPatrick Williams2016-08-241-3/+21
| | | | | Change-Id: I42dafd3235d13ec57f7b15e043bc3fe82fdb4665 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* gpio: Fix sprintf to uninitialized pointerPatrick Williams2016-08-241-1/+3
| | | | | Change-Id: Ife1759b1533b37e0a8c94748334ea2c5f02ba873 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* gpio: Clean trailing whitespacePatrick Williams2016-08-241-6/+6
| | | | | Change-Id: I359e5bab739e3b029a3331b0acfbf54e8db1120c Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
* libopenbmc_intf include path updateBrad Bishop2016-06-271-1/+1
| | | | | | | | | Remove the interfaces prefix from applications including openbmc_intf.h. Use brackets rather than quotes in prep for a libopenbmc_intf SDK package. Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
* Reorganize directory structureBrad Bishop2016-06-101-0/+232
Moving to directory per-application layout. This facilitates building single applications which is useful in the Yocto build environment since different applications satisfy different OpenBMC build requirements. A number of issues are also addressed: - All applications were pulling in libsystemd and the gdbus libs irrespective of whether or not they were needed. - gpio.o duplicated in every application - moved to libopenbmc_intf - Added install target Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
OpenPOWER on IntegriCloud