Private
Public Access
2
0
Commit Graph

1690 Commits

Author SHA1 Message Date
Mihai Tudor Panu
b06172b05a aiotdevkit: add readme and link to it
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2018-06-11 22:47:39 -07:00
Mihai Tudor Panu
8a22f18152 aiotdevkit: fix pinmap and add uart names
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2018-06-06 16:28:29 -07:00
Mihai Tudor Panu
9c5f940dad aiotdevkit: add support for IEI Tank platforms
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2018-05-31 21:21:53 -07:00
Noel Eck
7d58d4c6d0 ftdi_4222: Memleak fixes
Fixes for assortment of memory leaks.  Updated i2c_read/write_internal
methods to get the controller status ONLY when a read/write fails.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-05-30 13:53:45 -07:00
Noel Eck
0712b9ea63 ftdi_4222: Cleanup warning messages from compile
* Fixed broken switch statement - missing 'case' in front of labels
    * Added default case to switch statement
    * Removed unused variable
    * Removed unused static functions
    * Attempted to fix cases where functions are returning/not returning
      data incorrectly.
    * Attempted to fix i2c read which was returning an
    * uninitialized/unused variable.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-05-30 11:30:49 -07:00
Noel Eck
ed79502efc ftdi_4222: Fix mode check in FTDI4222
If numDevs is not == 2, the previous code would fail.  If numDevs > 2
(example 1 ft2xx device connected and 1 ft4222 device in mode 3) then
the code would not initialize the FT4222 and give an error that the mode
must be 0 or 3.

Updated source to find the first index of a ft4222 device.  Initialize
it as I2C.  If another device of the same id exists, then initialize it
as GPIO.

Added more syslog messages for debugging.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-05-30 11:02:04 -07:00
Manivannan Sadhasivam
46b3a3ef88 arm: 96boards: Move pin capabilities property inside is_gpio condition
Declare the GPIO pins capabilities under is_gpio condition instead of
under sysfs_pin.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: malikabhi05 <abhishek.malik@intel.com>
2018-05-03 14:17:55 -04:00
Manivannan Sadhasivam
3fa1237255 arm: 96boards: Add support for Hikey960
Add support for Hikey960 board from HiSilicon based on their Kirin960 SoC.

Peripherals supported:

1. GPIO
2. UART
3. I2C

For GPIO only Chardev interface has been added since this board only supports
>=4.15 kernel and using legacy sysfs interface is highly discouraged.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: malikabhi05 <abhishek.malik@intel.com>
2018-05-03 14:17:38 -04:00
Manivannan Sadhasivam
5faa2b93ca 96boards: db820c: Fix chardev mapping
Fix chardev mapping for GPIO-C and GPIO-F.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: malikabhi05 <abhishek.malik@intel.com>
2018-05-02 17:09:13 -04:00
Manivannan Sadhasivam
b04e728957 gpio: chardev: fix leaking of gpiochip file descriptors
The following APIs are only used for getting the line information from
kernel by opening the gpiochip independently and they fails to close
the file descriptor when done:

1. mraa_get_line_info_by_chip_number()
2. mraa_get_line_info_by_chip_name()
3. mraa_get_line_info_by_chip_label()

This will create issue if these API consumers like mraa_gpio_read_dir(),
mraa_gpio_mode(), mraa_gpio_chardev_dir() gets called in a loop. The
system will run out of file descriptor after some time.

Fix this issue by closing the opened file descriptors before freeing
the cinfo struct.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: malikabhi05 <abhishek.malik@intel.com>
2018-05-02 11:38:12 -04:00
Mihai Tudor Panu
b59fc8f076 docs: updated readme and build instructions for node.js and ubuntu
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Signed-off-by: malikabhi05 <abhishek.malik@intel.com>
2018-04-19 13:35:06 -04:00
Mihai Tudor Panu
bdd00e10ed minnowboard: add chardev support
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
Signed-off-by: malikabhi05 <abhishek.malik@intel.com>
2018-04-19 13:35:06 -04:00
Brendan Le Foll
72f1ffca31 cmake: force c99 to be set in the compiler
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Signed-off-by: malikabhi05 <abhishek.malik@intel.com>
2018-04-19 12:00:02 -04:00
Manivannan Sadhasivam
6258bd5fdd 96boards: chardev: Move chardev enablement inside platform check
Move the chardev enablement inside the platform check.
Some boards might not have the chardev mapping yet.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: malikabhi05 <abhishek.malik@intel.com>
2018-04-19 11:42:24 -04:00
IvanFarkas
284d882b9d Added Qualcomm DragonBoard 820c support.
GPIO ports from DragonBoard 820c Hardware Manual (p16) at
https://github.com/sdrobertw/dragonboard820c/blob/master/hardware-docs/files/db820c-user-guide.docx

Add Chardev support for DragonBoard 820c

Signed-off-by: Ivan Farkas <Ivan.Farkas@TeleCuris.com>
Signed-off-by: malikabhi05 <abhishek.malik@intel.com>
2018-04-10 16:49:38 -04:00
Manivannan Sadhasivam
7ea32cf1ec arm: 96boards: Add Chardev support for relevant boards
As of now both Dragonboard410c and Hikey boards run latest LTS kernel.
Hence, adding chardev support for those.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Ivan Farkas <Ivan.Farkas@TeleCuris.com>
Signed-off-by: malikabhi05 <abhishek.malik@intel.com>
2018-04-10 16:49:18 -04:00
Manivannan Sadhasivam
b48baf01bc gpio: chardev: Fix flag for checking kernel owned & open source gpio line
The flag used for checking the kernel owned gpio line is GPIOLINE_FLAG_KERNEL.
Hence use that instead of GPIOLINE_FLAG_IS_OUT.

Flag used for checking the open source gpio line is GPIOLINE_FLAG_OPEN_SOURCE.
Hence use that instead of GPIOHANDLE_REQUEST_OPEN_SOURCE, which should be
only used when requesting lines.

Reported-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: malikabhi05 <abhishek.malik@intel.com>
2018-04-06 15:47:06 -04:00
Manivannan Sadhasivam
be9cd0138a arm: 96boards: Run clang-format on source code
Run clan-format on the source code for better code visibility.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: malikabhi05 <abhishek.malik@intel.com>
2018-04-06 15:20:13 -04:00
Manivannan Sadhasivam
dee7b80f06 arm: 96boards: Add Chardev support for relevant boards
As of now both Dragonboard410c and Hikey boards run latest LTS kernel.
Hence, adding chardev support for those.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: malikabhi05 <abhishek.malik@intel.com>
2018-04-06 15:19:25 -04:00
Abhishek Malik
cfda9c99d7 UART: Fixing UART issues on UP2
Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
2018-03-14 16:21:42 -07:00
Mihai Tudor Panu
acff725d93 gpio: minor change to resource cleanup code
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2018-03-22 17:52:55 -07:00
mihais
ac58754756 gpio: resource cleanup fix for chardev changes
Signed-off-by: Mihai Stefanescu <mihai.t.gh.stefanescu@gmail.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2018-03-22 17:45:34 -07:00
Mihai Tudor Panu
bbcdb1e087 up2: adding platform examples for built-in user leds
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2018-03-22 15:29:01 -07:00
Mihai Tudor Panu
d9c54e1d31 up2: added chardev map to platform
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2018-03-14 16:10:03 -07:00
Mihai Tudor Panu
cf2e69a8ea chardev: boards need to specify chardev support explicitly before runtime check is performed
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2018-03-14 14:39:42 -07:00
Noel Eck
7021096fd7 common.hpp: Handle const char* nullptrs
Fixes for possible NULL pointer dereferencing by C++ header methods.
Updated string methods to return an empty string.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-03-14 10:54:10 -07:00
Noel Eck
fa40262d89 api: Fixes for missing mraa methods.
This commit includes a set of small fixes flushed out from the google
unit tests.

    * Fixed missing implementations of mraa_get_*_count methods.
    * Fix for NULL string
    * Fix for MOCK platform C++ define.
    * Switched (void) -> () function definitions for consistency.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-03-13 16:24:04 -07:00
Noel Eck
467cf5132d gtest: Added Google Test
Added Google Test for unit testing.  Currently NOT required by
MRAA CMake.

    * Added a test fixture for mraa common C header methods.
    * Added a test fixture for mraa common C++ header methods.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-03-13 16:16:49 -07:00
Noel Eck
76c8b9a76e travis-ci: Added minimal travis job
Added an additional job to the CI matrix which does a minimal mraa build
(only C) which can run and pass/fail quickly.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-03-13 12:10:34 -07:00
Mihai Tudor Panu
4be5d915af spi.c: fix warning on syslog string format
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2018-03-12 16:23:47 -07:00
Brendan Le Foll
ea6d771c2b gpio.h: Add gpio_event doc
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2018-03-05 13:42:02 +01:00
mihais
2b98fc7869 gpio: chardev interface / multiple gpio support for sysfs
Signed-off-by: Mihai Stefanescu <mihai.t.gh.stefanescu@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2018-03-05 13:42:02 +01:00
Brendan Le Foll
fbc2ad6045 chardev: split up helper functions in gpio_chardev
Remove some _multiple functions and replace with generic function that
does both. Some general cleanup and will move more interrnal mraa
functions to use the _mraa prefix

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2018-03-05 13:42:02 +01:00
Brendan Le Foll
32ab283c2b firmata_mraa.c: Fix warnings in firmata code due to incorrect code
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2018-03-05 13:42:02 +01:00
Mihai Stefanescu
9f7caf1561 Joule: Add gpiod mapping for Joule
Signed-off-by: Mihai Stefanescu <mihai.t.gh.stefanescu@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2018-03-05 13:42:02 +01:00
Brendan Le Foll
12c1904fba gpio.h: Add stripped kernel header
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2018-03-05 13:42:02 +01:00
Mihai Stefanescu
1665e09928 gpio: Add gpio chardev interface
Signed-off-by: Mihai Stefanescu <mihai.t.gh.stefanescu@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2018-03-05 13:42:02 +01:00
Brendan Le Foll
aa7006cce9 travis: Remove IPK & RPM builds
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2018-03-05 13:40:00 +01:00
Brendan Le Foll
9bc3ffe815 raspberry_pi.c: Removing spi_frequency_replace as that has become default behaviour
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2018-03-05 13:34:40 +01:00
Brendan Le Foll
7840710d1b spi.c: Stop trusting SPI_IOC_RD_MAX_SPEED_HZ from the kernel and trust our users
SPI_IOC_RD_MAX_SPEED_HZ is often incorrect and too low (RPI, UP2, galileo g1 at
least). Likely this is because driver writers are too concious of possible
issues or because they don't have the final hardware. Because of this we now
will only LOG_NOTICE on exceeding SPI_IOC_RD_MAX_SPEED_HZ and try keep going
anyways. This effectively will put the burden of not exceeding
SPI_IOC_RD_MAX_SPEED_HZ on our users.

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2018-03-05 13:34:40 +01:00
Brendan Le Foll
ae2371c804 cmake: Remove all cpack options including IPK generation
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2018-03-05 11:45:39 +01:00
Alex Tereschenko
2deaa73ebf static code analysis: correct SonarCloud URL
According to SonarCloud's email notification,
they're dropping sonarqube.com in favor of sonarcloud.io.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2018-03-02 20:27:15 +01:00
Mihai Tudor Panu
fbb7d92320 mraa: Update to v1.9.0
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2018-02-15 15:08:49 -08:00
Alex Tereschenko
2d210621cc mraa.c: make mraa_gpio_lookup() return proper pin index
Pinmap field value is an OS pin number, not mraa pin index,
so make the function return the proper one.

Fixes #817.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
2018-02-07 17:28:58 +01:00
Brendan Le Foll
568c077061 building.md: Add note for static builds and bindings
Closes #864

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2018-02-07 09:42:34 +01:00
Mihai Tudor Panu
616ffc0b94 cmake: fix indentation on some messages for consistency
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2018-02-06 20:48:32 -05:00
Mihai Tudor Panu
60b77d5da9 FindNodejs: extend search path to detect ubuntu provided nodejs
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2018-02-06 20:29:37 -05:00
Noel Eck
cb03cab04a FindNodejs: Updated to find node<version>
Updates to the FindNodejs.cmake module to find newer installs of nodejs
across other distros.  For example openSUSE: /usr/include/node6/node.h

    * Added PATH_SUFFIX to find_path for node.h.
    * Standardized usage of message() (added STATUS)
    * Call find_package_handle_standard_args with version
    * Reformatted to look uniform.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-02-06 10:05:39 -08:00
Khem Raj
c9566bdc6f examples: include endian.h for be16toh and le16toh declarations
this gets exposed on musl, on glibc endian.h gets pulled in indirectly

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2018-02-06 13:34:28 +01:00
Manivannan Sadhasivam
eda9d03547 examples: Cleanup Python examples
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
2018-02-06 13:31:19 +01:00