Refactored of I/O expander support to simplify addition of new devices.
This had added ISR support for PCA9555.
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
GPIO expander ISRs were dropping interrupts as each pin had its own
thread which cleared the INT signal when reading the GPIO register.
Thus pending interrupts for GPIO on threads waiting to be scheduled
were dropped. Now a single thread polls the GPIO register when INT goes
low and sets interrupt flags for each GPIO line. The threads created
by mraa_gpio_isr() now poll the appropriate interrupt flag.
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Synchronization must be done at "context" level so that i2c bus
cannot be unexpectedly changed by a different thread.
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
The commit which added support for UP Board didn't touch Android.mk.
Add up.c to LOCAL_SRC_FILES.
Signed-off-by: Constantin Musca <constantin.musca@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Every 96Boards baseboard uses the same expansion connector, but the
current 96Boards initialization code assigns the SoC specific GPIO
numbers instead of being consistent across all boards. Change the code
to assign 96Boards GPIO-A through GPIO-L to MRAA GPIOs 23-34.
v2: Create info for all the LS connector pins, not just the GPIO pins.
This gives us room to describe other pins in the future.
Signed-off-by: Grant Likely <grant.likely@linaro.org>
Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Adding cmake option to build for UP platform only:
-DMRAAPLATFORMFORCE=MRAA_UP
Signed-off-by: Dan O'Donovan <dan@emutex.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Add support for UP board (www.up-board.org), scoping
the following functions available via 40-pin header:
* GPIO (via sysfs)
* UART
* I2C
* SPI
* PWM
Validated on UP board v0.2, running ubilinux 3.0
Signed-off-by: Dan O'Donovan <dan@emutex.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Instead of using my email address to send patches, you can now send patches to
our ML. Noice!
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
- FT4222 GPIO ISR implementation was specific to C/C++ and ignored
language binding support. This is now fixed via adv_func updates.
- GPIO ISR code has been refactored to reduce i2c traffic when using
I/O expanders
- Added support for built-in FT4222 GPIO interrupts
Signed-off-by: Henry Bruce <henry.bruce@intel.com>
This fix only affects USBPLAT=ON which would cause mraa_init to return
uninitialised if we had detected a platform. Whilst the initialisation had
actually been done correctly the results would be that platform_name was
unfilled and no iio initialisation was done
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Somewhere between kernel v3.18 and v4.4 the output of /proc/cpuinfo
stopped showing the board model. This confused MRAA when running on
HiKey. Eventually we want to do a better job of getting the kernel to
express hardware information to userspace, but in the mean time fix the
test so that MRAA will work on HiKey.
Signed-off-by: Grant Likely <grant.likely@linaro.org>
Cc: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Brendan Le Foll <brendan.le.foll@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
mraa_intel_edison_misc_spi is specific to the Arduino board.
Call it only when miniboard is not 1.
Signed-off-by: Constantin Musca <constantin.musca@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Move mraa_intel_edison_misc_spi to mraa_intel_edison_spi_init_pre.
There is no point in initializing SPI if it's not used.
Set the direction of GPIO 214 (TRI_STATE_ALL) only if it's not set
to *out*.
Signed-off-by: Constantin Musca <constantin.musca@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Add support for reading the direction of a GPIO
and expose it through mraa_gpio_read_dir.
Signed-off-by: Constantin Musca <constantin.musca@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>