Commit Graph

160 Commits

Author SHA1 Message Date
raiden00pl b565e28da3 Kconfigs: rename {Rpmsg|rpmsg} to RPMGS 2023-10-28 13:58:56 +08:00
Daniel P. Carvalho 024bdcbca0 Fixes compilation warnings. 2023-09-29 12:57:58 +08:00
Xiang Xiao a37759a6a9 drivers/ioexpander: Add const to the value array of multiwritepin
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-28 10:09:51 +08:00
Xiang Xiao e499c6c1c7 drivers/ioexpander: Add const to the pin array
forget in patch: https://github.com/apache/nuttx/pull/9529

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-28 10:09:51 +08:00
Alan Carvalho de Assis 4b67e23049 mcp23008 Initial support 2023-09-08 01:33:12 +08:00
chao an 664927c86e mm/alloc: remove all unnecessary cast for alloc
Fix the minor style issue and remove unnecessary cast

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-30 14:34:20 +08:00
Michal Lenc f9d4a47889 pcf8575: fix compilation warnings
Just few compile warning fixes in case CONFIG_IOEXPANDER_MULTIPIN is
selected.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-08-29 20:34:12 +08:00
Michal Lenc b005f844f5 ioexpander: add support for ISO1I813T expander
This commit adds basic support for electrically isolated 8 bit expander.
The expander communicates with the MCU via SPI interface. Both single
and multiple pin read are supported.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-08-29 17:35:59 +08:00
Michal Lenc fa63ef69c9 ioexpander: add support for ISO1H812G expander
This commit adds support for galvanic isolated ISO1H812G SPI expander.
Both single pin and multiple pin writes are supported.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-08-29 10:31:40 +08:00
chao an 7aa45305b7 fs/inode: remove all unnecessary check for filep/inode
Since VFS layer already contains sanity checks, so remove unnecessary lower half checks

Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-29 09:47:11 +08:00
xuxin19 f2f0d7fbad cmake:fix drivers build block during cmake reforming
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2023-08-16 22:38:52 +08:00
Michal Lenc 0f6a5e50c4 ioexpander: add option to register GPIO by name for IOexpander
Function gpio_lower_half_byname() was added to support registration of
GPIO pin by name as supported for IOexpander. Some of the code is wrapped
in new static function gpio_lower_half_internal() to avoid code
duplication.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-08-03 07:02:12 -07:00
Michal Lenc bf90361895 ioexpander: add support for pcf8575 expander
This adds support for 16 bit io expander pcf8575. The driver is basically
the same as for pcf8574 however it is for 16 bits instead of 8 bits. Since
pcf8575 and pcf8574 can be both used on the same i2c bus the driver for
pcf8575 is implemented in a different file to reduce the code size
and complexity and to have less if statements in the driver.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-08-03 06:52:27 -07:00
Michal Lenc 888b8e59dd pcf8574: fix incorrect function comment
Comment for pcf8574_register_update() function was incorrect as it was
probably copied from different driver function.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-08-01 20:36:54 +02:00
chao an 6ee9ec7656 build: add initial cmake build system
1. Update all CMakeLists.txt to adapt to new layout
2. Fix cmake build break
3. Update all new file license
4. Fully compatible with current compilation environment(use configure.sh or cmake as you choose)

------------------

How to test

From within nuttx/. Configure:

cmake -B build -DBOARD_CONFIG=sim/nsh -GNinja
cmake -B build -DBOARD_CONFIG=sim:nsh -GNinja
cmake -B build -DBOARD_CONFIG=sabre-6quad/smp -GNinja
cmake -B build -DBOARD_CONFIG=lm3s6965-ek/qemu-flat -GNinja

(or full path in custom board) :
cmake -B build -DBOARD_CONFIG=$PWD/boards/sim/sim/sim/configs/nsh -GNinja

This uses ninja generator (install with sudo apt install ninja-build). To build:

$ cmake --build build

menuconfig:

$ cmake --build build -t menuconfig

--------------------------

2. cmake/build: reformat the cmake style by cmake-format

https://github.com/cheshirekow/cmake_format

$ pip install cmakelang

$ for i in `find -name CMakeLists.txt`;do cmake-format $i -o $i;done
$ for i in `find -name *\.cmake`;do cmake-format $i -o $i;done

Co-authored-by: Matias N <matias@protobits.dev>
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-08 13:50:48 +08:00
raiden00pl dc608de144 drivers/ioexpander: add support for SX1509
SX1509 from Semtech is GPIO expander with LED driver and keypad engine.
For now, the keypad engine is not supported.
2023-06-27 14:44:00 -03:00
Sebastien Lorquet 43fec5dd53 pca9555: fix const correctness of pin set parameters 2023-06-13 16:10:52 -03:00
jturnsek 97b4900c59 Bug fixes and improved interrupt support for mcp23x17 driver 2023-03-06 08:40:33 +08:00
Xiang Xiao a2190aeb35 Fix error: '%s' directive output may be truncated
writing up to 31 bytes into a region of size 27 [-Werror=format-truncation=]

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-03 04:08:22 -08:00
David Sidrane ac50b3a473 ioexpander/gpio:Add gpio_pin_register_byname 2023-02-11 18:31:40 +08:00
chao an 3a0fdb019d nuttx: replace all ARRAY_SIZE()/ARRAYSIZE() to nitems()
Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-09 20:05:44 +08:00
chao an 4c8d244fae sched/getpid: replace syscall getpid/tid/ppid() to kernel version
NuttX kernel should not use the syscall functions, especially after
enabling CONFIG_SCHED_INSTRUMENTATION_SYSCALL, all system functions
will be traced to backend, which will impact system performance.

Signed-off-by: chao an <anchao@xiaomi.com>
2023-02-02 10:33:01 +08:00
Gustavo Henrique Nihei e6b204f438 nuttx: Use MIN/MAX definitions from "sys/param.h"
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-02-01 23:47:44 +08:00
Xiang Xiao 779a610ca3 Remove the unnecessary NULL fields in global instance definition of file_operations
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-01-04 00:32:13 +02:00
chao an 07604b3220 drivers/rpmsg/clk/ioe: destroy nxsem properly
Signed-off-by: chao an <anchao@xiaomi.com>
2022-11-21 01:15:48 +08:00
yinshengkai 85f727f232 tools: replace INCDIR to Makefile variable
In the past, header file paths were generated by the incdir command
Now they are generated by concatenating environment variables

In this way, when executing makefile, no shell command will be executed,
it will improve the speed of executing makfile
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-11-03 19:59:55 +08:00
anjiahao 5724c6b2e4 sem:remove sem default protocl
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-10-22 14:50:48 +08:00
anjiahao d1d46335df Replace nxsem API when used as a lock with nxmutex API
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-10-17 15:59:46 +09:00
Xiang Xiao bdeaea3742 Remove the unnessary empty line after label
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-09-30 17:54:56 +02:00
Nathan Hartman 9d5a91c41a ioexpander: Honor C89 standard 2022-08-15 10:24:39 +08:00
Nathan Hartman 20bdd44e7b Remove executable permission from source and build files. 2022-08-04 12:48:18 -03:00
ligd 8a3683fb9f rptun: add ns_match callback to resolve rptun deadlock
thread A: accept -> net_lock -> socket_rpmsg_accept
          -> rpmsg_register_callabck -> rptun_lock
thread B: ns_bind -> rpmsg_socket_ns_bind -> get_tx_payload_buffer
          -> rptun_wait_tx -> usrsock_rpmsg_ept_cb -> usrsockdev_write
          -> net_lock -> deadlock

fix:
add ns_match callback

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-27 20:36:51 +08:00
Jiuzhu Dong 40e86501f1 driver/ioe_rpmsg: split server and client ept_cb to simplify code
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-22 14:44:44 +08:00
Nathan Hartman 849f760b77 Fix various typos 2022-07-08 02:15:54 +08:00
Jiuzhu Dong 54b770d46a driver/ioexpander: remove response about irq_handler
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-04-27 17:27:24 +08:00
Petro Karashchenko 09b3fb25ab drivers: remove unimplemented open/close/ioctl interfaces
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-04-15 16:56:25 +08:00
Xiang Xiao 9785d6606c openamp: Change the dependence from OPENAMP to RPTUN
since all rpmsg driver need the extension api exposed by rptun driver

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-05 10:05:41 +03:00
ligd 8db038c18a ioe_rpmsg: use rptun_wait/post to resolve deadlock with usrsock
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-03-31 01:37:49 +08:00
Petro Karashchenko 041f25fe72 drivers/ioexpander: fix output inversion for ioe_dummy
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-04 21:17:16 +08:00
Petro Karashchenko 9c7eea7949 drivers/ioexpander: Fix invert option value usage
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-02 01:54:31 +08:00
Petro Karashchenko 27d75e7552 drivers/ioexpander: minor initialize and styling fixes
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-02-18 16:44:40 +08:00
Xiang Xiao e1b5e87ff3 Fix ioexpander/gpio_lower_half.c:359:23: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-09 11:06:06 +08:00
Xiang Xiao bbf5511e3a arch/sim: Move the dummy ioe driver to drivers/ioexpender
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-09 11:06:06 +08:00
chao.an 3fceaf10a9 drivers/ioexpander: fix the kconfig warning
drivers/ioexpander/Kconfig:28:

warning:
config symbol 'IOEXPANDER_RPMSG_INT_NCALLBACKS' uses select, but is not boolean or tristate

Signed-off-by: chao.an <anchao@xiaomi.com>
2022-01-07 09:37:07 +01:00
Xiang Xiao 8dc2ce7995 ioexpander/rpmsg: Select IOEXPANDER_INT_ENABLE instead depend on it
follow other similiar drivers

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-01-06 22:20:38 +01:00
Xiang Xiao ab0f5f607d Fix ioexpander/gpio_lower_half.c:302:23: warning: too many arguments for format
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-12-27 11:04:11 -06:00
zhuyanlin 5df041ca55 ioe-rpmsg: bind server to diffent ept struture
N/A

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2021-12-16 01:29:24 -06:00
zhuyanlin e75bcde0d6 driver:ioe_rpmsg: set_option add regval parameter
Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2021-12-16 01:29:24 -06:00
zhuyanlin e43e1423d6 driver/ioexpander: add ioe_rpmsg server and client
N/A

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2021-12-16 01:29:24 -06:00
Jari van Ewijk 2e47ef32cf GPIO driver: register all pintypes as generic /dev/gpioN 2021-12-09 23:55:12 -06:00