Commit Graph

5488 Commits

Author SHA1 Message Date
chao an ee6e2ce149 arch/perf: add ARCH_HAVE_PERF_EVENTS to support hardware perf events
The implementation of up_perf_*() is in a different static library in nuttx:

Hardware: libarch.a
Software: libdrivers.a (weak function)

Since functions with weak attributes cannot be correctly replaced in multiple static libraries,
this PR will use macros to replace whether the arch supports hardware perf events

Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-21 20:43:30 +08:00
Zhihong Chen 3d8324962a drivers: usbhost_hub: usb communication memory should use DRVR_ALLOC
- usb communication memory should use DRVR_ALLOC

Signed-off-by: Zhihong Chen <zhihong.chen@hpmicro.com>
2023-07-19 13:38:36 +08:00
mks2183 f9386282dc driver/audio: low level reset must always succeed
- considering simplicity and design assumption, the reset function must work without flaw.
  If it fails, there is no way to recover but to reset again. so checking return status does not
  bring additional benefit

- There is unnecessary switch inside switch which is making code not too readable

Signed-off-by: mks2183 <manishsharma3134@gmail.com>
2023-07-18 10:14:24 -03:00
Xiang Xiao abfe082a6f Kconfig: Simplify the conditional default statement
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-16 14:39:20 -03:00
Xiang Xiao e031a73aef Kconfig: Change some "default y" to "default !DEFAULT_SMALL"
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-16 14:39:20 -03:00
Xiang Xiao bcaa52e0f1 driver/segger: Simplify serial driver configuation
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-16 14:37:21 +03:00
xiajizhong 7160849f63 new feature on trace dump support segger-rtt
Signed-off-by: xiajizhong <xiajizhong@xiaomi.com>
2023-07-16 14:37:21 +03:00
Manish Kumar Sharma 6a1abbcf56 driver/audio: remove unnecessary switch in switch
- There is unnecessary switch inside switch which is making code not too readable

Signed-off-by: Manish Kumar Sharma <manishsharma3134@gmail.com>
2023-07-16 16:40:34 +08:00
Xiang Xiao dbd13c2aca drivers/segger: Rename serial device from /dev/rttx to /dev/ttyRx
follow the serial driver naming convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-15 18:38:08 -03:00
chao an f10b54a081 cmake: fix CMake build break
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-15 23:32:36 +08:00
chao an f49ee08ab4 drivers/sensors: fix build warning on GCC-12
nuttx/drivers/sensors/wtgahrs2.c: In function ‘wtgahrs2_initialize’:
nuttx/drivers/sensors/wtgahrs2.c:545:22: warning: ‘%lx’ directive output may be truncated writing between 1 and 16 bytes into a region of size 14 [-Wformat-truncation=]
  545 |   snprintf(arg1, 16, "0x%" PRIxPTR, (uintptr_t)rtdata);
      |                      ^~~~~
nuttx/drivers/sensors/wtgahrs2.c:545:25: note: format string is defined here
  545 |   snprintf(arg1, 16, "0x%" PRIxPTR, (uintptr_t)rtdata);
nuttx/drivers/sensors/wtgahrs2.c:545:22: note: directive argument in the range [1, 18446744073709551615]
  545 |   snprintf(arg1, 16, "0x%" PRIxPTR, (uintptr_t)rtdata);
      |                      ^~~~~
nuttx/drivers/sensors/wtgahrs2.c:545:3: note: ‘snprintf’ output between 4 and 19 bytes into a destination of size 16
  545 |   snprintf(arg1, 16, "0x%" PRIxPTR, (uintptr_t)rtdata);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-15 23:32:36 +08:00
Michal Lenc 548f4b652c st7789: add support for 3 wire interface
3 wire interface for ST7789 LCD controller does not use  CMD/DATA pin to
specify whether data  or command is send but uses 9th bit of SPI transfer.

This commit adds support for 3 wire interface to ST7789 controller.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-07-15 00:08:43 +08:00
liaoao e8c6eb0aba rpmsg: use workqueue for rpmsgdev poll notify
use workqueue for rpmsgdev poll notify to prevent
calling rpmsgdev_poll_cb in interrupt context which
will try to hold mutex in rpmsg_send

Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-07-14 19:18:36 +08:00
chao an 0b69731a97 netdev/upperhalf: fix visual studio Compiler Error C2059
D:\archer\code\nuttx\drivers\net\netdev_upperhalf.c(557,5): error C2059: syntax error : '{'

Compiler error C2059:
The token caused a syntax error.

Reference:
https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/compiler-error-c2059?view=msvc-170
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-14 07:52:34 +02:00
liaoao 2ebc8aff16 rpmsgblk: get return value from header
cookie->result as the return value of rpmsg operations,
it should get from remote response.

Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-07-14 13:34:53 +08:00
yinshengkai 6a0ffa5c52 syslog: replace lib_sprintf to lib_sprintf_internal
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-07-14 00:22:11 +03:00
yinshengkai 0052ff2bd8 syslog: replace %pV with lib_sprintf
%pV will increase the stack size

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-07-14 00:22:11 +03:00
simbit18 b0965ab963 Fix nuttx coding style
Remove TABs
Fix indentation
Fix Multi-line comments
Fix Comments to the Right of Statements.
2023-07-14 01:16:06 +08:00
simbit18 1b1ac6f3b7 Fix nuttx coding style
Remove TABs
Fix indentation
Fix Multi-line comments
Fix Comments to the Right of Statements.

Fix nuttx coding style

Fix Comments to the Right of Statements.
2023-07-13 19:30:56 +08:00
yinshengkai 043d5922e4 drivers: add ascii drvier, returns a printable string of 0x21-0x7f
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-07-12 11:13:37 -06:00
yinshengkai ce98f186c0 syslog: add syslog channel filtering function
support to control the opening or closing of the specified channel through the syslogmask command at runtime

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-07-13 01:04:07 +08:00
rongyichang 6902ed9516 drivers/lcd: add area alignment ioctl for lcd driver
Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-07-13 01:03:18 +08:00
dulibo1 062e08ea3a serial:fix driver/serial/serial.c logic error
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2023-07-12 11:28:54 -03:00
dulibo1 7ccdb2cfa8 battery:fix poll return type
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2023-07-12 11:06:47 -03:00
yinshengkai 9c6f48e57b drivers/segger: add RTT serial support
usage:
  1. Connect Jlink, start JLinkGDBServer
     JLinkGDBServer -if SWD -device stm32h743zi -speed 16000
  2. Listen to the RTT port data and forward it to the virtual serial port
     sudo socat -d -d PTY,link=/dev/ttyRTT0,raw,ignoreeof TCP:127.0.0.1:19021,reuseaddr
  3. Read serial data
     minicom -D /dev/ttyRTT0

Performance:(STM32H743, 400MHZ)
time "dd if=/dev/zero of=/dev/console bs=512 count=2048"
6.67 sec  157KB/s

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-07-12 09:54:50 +08:00
yinshengkai e1553e8407 drivers/rtt: check whether Jlink is connected
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-07-12 09:54:50 +08:00
Zhe Weng c253bb91a2 drivers/net: Add wireless ops in upper-half driver
Take the idea from Linux's iw_handler array and esp32c3_wlan's wlan_ops_s, and make it a common logic of upper-half driver.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-07-12 03:32:02 +08:00
lile7 a3db142fbf drivers/video: use kmm_free(buff) to free memory instead of realloc(buff, 0) which is abandoned
ref: 89d61f4eb4

Signed-off-by: lile7 <lile7@xiaomi.com>
2023-07-12 02:33:17 +08:00
rongyichang 5d7864fbcb drivers/spi: add support for qspi hwfeatures
add QSPI_BITORDER and QSPI_WORD_REVERSE hwfeatures

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-07-12 01:42:25 +08:00
simbit18 9681c52517 Fix nuttx coding style
Remove TABs
Fix indentation
2023-07-11 23:32:17 +08:00
yinshengkai 81553deb53 time: add up_perf_init weak_function
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-07-11 10:09:25 -03:00
liuzhao 899471c6bd add support for YT8512 phy 2023-07-11 03:40:53 +08: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
Petro Karashchenko 2ca40e14e9 drivers/syslog: remove redundant 'int' cast
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-07-07 17:39:39 -03:00
SPRESENSE 4eb6da33c2 cxd56/alt1250: Change power on sequence
Change the power on sequence according to ALT1250 modem spec.
2023-07-06 13:18:57 +08:00
Xiang Xiao 015e30a866 drivers/net: Remove HAVE_ATOMICS and use CONFIG_HAVE_ATOMICS directly
since OpenAMP never support to compile in c89 only mode

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-05 13:43:17 +03:00
simonatoaca fd4dd59c3c Made the PWM frequency of the RGB driver configurable from the menu.
Signed-off-by: simonatoaca <simona.alexandra2000@gmail.com>
2023-07-05 00:49:44 +08:00
Beat Küng cbbeec3183 ramtron.c: add FM25V02A-DGQ 2023-07-04 08:19:56 +08:00
simbit18 79db26bda3 drivers/sensors/apds9960.c: Fix mistakes in comments snerr
Fix mistakes in comments snerr
APDS9960_GCONFIG3 -> APDS9960_GCONFIG4
2023-07-03 23:05:36 +03:00
Nicolas Caramelli e82b762fb7 input/touchscreen: Translate raw X/Y data into pixel coordinates 2023-07-03 10:17:04 -03:00
Petro Karashchenko b1dd5d1189 drivers/wireles/gs2200m: add NET_TCP dependency to NFS_DONT_BIND_TCP_SOCKET option
The NFS_DONT_BIND_TCP_SOCKET should be selected only TCP networking is enabled

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-07-03 13:32:31 +08:00
Petro Karashchenko 46facd44b3 drivers/net/netdev: improve granularity of 'quota' locking
There is no need to use global spinlock to protect netdev
specific data counters. Allocate per-netdev specific spinlock
to get better locking granularity.

Move C/C++ atomic support checking to compiler.h

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-07-01 15:27:09 -03:00
Masayuki Ishikawa 248fe7529a drivers: wireless: select NFS_DONT_BIND_TCP_SOCKET for GS2200M
Summary:
- https://github.com/apache/nuttx/pull/3707

Impact:
- None

Testing:
- Tested with spresense:wifi_smp

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2023-07-01 13:18:27 +08:00
Mingjie Shen 1d6e51220d cxd56_dmac, lcd_dev: fix null pointer dereference
Check return values of following functions for null:
   - board_lcd_getdev
   - get_device

Signed-off-by: Mingjie Shen <shen497@purdue.edu>
2023-06-28 10:16:38 +03: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
raiden00pl c63b2d5c91 drivers/userled: add an interface to support LED effects.
LED effects must be implemented in the lower-half of the LED driver.
The interface is designed to supports the following LED effects:
  - intenisty (PWM)
  - Bling (Timer)
  - Fade in, Fade out (Ramp)
2023-06-27 14:44:00 -03:00
Xiang Xiao 7f80b4aeba clock: Move the content of include/nuttx/time.h to include/nuttx/clock.h
and remove include/nuttx/time.h to reduce the nuttx specific header files

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-26 19:14:08 +03:00
Mingjie Shen 3344697afc drivers/sensors/apds9960.c: Fix resource leak in error handling
Signed-off-by: Mingjie Shen <shen497@purdue.edu>
2023-06-26 09:43:01 -03:00
Mingjie Shen 65e97ffca1 drivers/can/can.c: Fix nested loops with same variable
In this nested loop, the iteration variable is the same for both loops.
This is a typo and the inner loop should use a new loop variable.

Signed-off-by: Mingjie Shen <shen497@purdue.edu>
2023-06-25 11:47:34 +03:00
Mingjie Shen 209bee3266 drivers/sensors/apds9960.c: Fix use after free
Memory pointed by priv may be used (in line 1289) after it is
freed in line 1283.
Fix by adding the missing return statement in error handling.

Signed-off-by: Mingjie Shen <shen497@purdue.edu>
2023-06-25 14:36:22 +08:00
Filipe Cavalcanti 9603288c80 drivers/sensors/mpu60x0.c: add IOCTL for AFS_SEL, sample rate and FIFO support 2023-06-24 10:57:12 -03:00
Xiang Xiao efd1b838e6 syslog: Add sc_write_force callback
It is used to write the log message to the channel immediately
when the log message is generated in the interrupt context, which
is faster than the normal force callback.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-23 09:55:19 -03:00
Xiang Xiao e62c915972 syslog: Remove syslog_force and related stuff
syslog_force is used to force the syslog output to the
console in interrupt context, but we can use syslog_write
to do the same(and more) thing.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-23 09:55:19 -03:00
Xiang Xiao 309f89d6c3 segger: Change the default value of SEGGER_RTT_MAX_NUM_DOWN_BUFFERS to SEGGER_RTT_MAX_NUM_UP_BUFFERS
since the number of down buffers should be equal to the number of up buffers in most cases.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-23 00:36:36 +03:00
simbit18 f0a74eb492 Fix Kconfig style
Remove spaces from Kconfig files
2023-06-22 11:46:09 +09:00
Masayuki Ishikawa 5e7ce13b3e drivers: virtio: Use one dscriptor for RX in virtio-mmio-net.c
Summary:
- In this implementation, only one descriptor is used for RX.
- NOTE: we still use two descriptors for TX

Impact:
- None

Testing:
- Tested with qemu-7.1

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2023-06-21 16:38:04 +08:00
wangchen dd0f967798 usrsock_server:fix incomplete received data error
if number of bytes available for reading more than zero,set USRSOCK_EVENT_RECVFROM_AVAIL flag into the event

Signed-off-by: wangchen <wangchen41@xiaomi.com>
2023-06-21 07:40:52 +03:00
simbit18 3f4151525d Fix Kconfig style
Remove TABs from Kconfig files
Add comments
2023-06-19 20:05:57 +03:00
simbit18 a4398b50c8 drivers/lcd/Kconfig: Fix Kconfig style
Remove TABs from Kconfig file
Add comments
2023-06-19 23:06:48 +08:00
Bowen Wang 69756f277e rptun_dump: do not acquire the lock when has hold the lock
Otherwise, system will crash again when call rptun_dump_all()
after has acquired the lock.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2023-06-17 19:38:39 +08:00
wangbowen6 41e399aa43 rptun: init the semtx before the thread/workqueue created
If the rptun driver set auto start, the smetx may has been used
in rptun_notify_wait() but not inited.

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2023-06-17 19:38:39 +08:00
wangbowen6 940bbfc720 rpmsg: support the fdsan feature for rpmsg dev/mtd/blk
Directly return -ENOTTY in rpmsgxxx_ioctl() when the command is
not supported to avoid fdsan command FIOC_SETTAG and FIOC_GETTAG
pass to the rpmsg dev/mtd/blk server with CONFIG_FDSAN enabled.

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
2023-06-17 19:34:39 +08:00
Zhe Weng f80539b6a8 netdev/upper: Use atomic when we have atomic support from compiler
Ref: How to test atomic support https://beej.us/guide/bgc/html/split/chapter-atomics.html

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-06-15 19:31:59 -03:00
Zhe Weng 483eb10f37 netdev/upper: Make quota_load public
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-06-15 19:31:59 -03:00
Simon Filgis 04f8bab063 Dynamic adjustment of the orientation, switch orientation on the fly:
1. orientation is a parameter of initialize
2. y and x offset need to be adjusted with the orientaiton
3. bpp must be changed no matter what
2023-06-15 10:15:11 -03:00
raiden00pl 387944b837 usbdev/cdcacm.c: register console only for device with minor number 0
With this change, we can register several CDCACM devices where one is used as a console
2023-06-14 16:24:20 -03:00
Sebastien Lorquet 43fec5dd53 pca9555: fix const correctness of pin set parameters 2023-06-13 16:10:52 -03:00
zhanghongyu aa43f6ff1a usrsock_rpmsg_server: fix poll recursive when revent POLLHUP or POLLERR
the previous patch can not handle the revent is POLLHUP or POLLERR,
poll_setup needs to be executed only when the POLLIN or POLLOUT event
changes.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-06-13 15:33:05 +08:00
Petro Karashchenko 2a38c38b03 style: fix style issues found during code review
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-06-11 12:54:52 +08:00
Sebastien Lorquet d36e2a8394 is25xp: Enable usage of several chips on the same spi bus 2023-06-10 02:14:23 +08:00
Huang Qi d8a61108cf drivers/ptmx: Fix a potential buffer overflow
Fix warning:
```
serial/ptmx.c:205:34: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 8 [-Wformat-truncation=]
  205 |   snprintf(devname, 16, "/dev/pty%d", minor);
      |
serial/ptmx.c:205:25: note: directive argument in the range [0, 2147483647]
  205 |   snprintf(devname, 16, "/dev/pty%d", minor);
      |                         ^~~~~~~~~~~~
serial/ptmx.c:205:3: note: ‘snprintf’ output between 10 and 19 bytes into a destination of size 16
  205 |   snprintf(devname, 16, "/dev/pty%d", minor);
```

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-06-09 19:41:11 +03:00
SPRESENSE 54112ac070 drivers/modem/alt1250: Update alt1250 driver
Updated alt1250 driver with regarding to the following changes.
- Add LTE hibernation feature
- Split source code per module
- Some refactoring
- Some bug fixes
2023-06-08 07:48:17 +02:00
xucheng5 f4e3f23945 driver/mtd : mtd_config name len max changed to NAME_MAX
Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
2023-06-07 09:40:02 -03:00
chao an 7c5d2a8bdd usrsock/dns: add sanity check before send dns event
Signed-off-by: chao an <anchao@xiaomi.com>
2023-06-06 13:29:23 +08:00
Xiang Xiao 694c0f0b7f usbhost/cdcacm: Fix the compiler warning when serial dma is enabled
CP:  nuttx/nuttx/include/nuttx/config.h
CC:  mqueue/mq_sndinternal.c usbhost/usbhost_cdcacm.c:435:3: warning: initialization of ‘void (*)(struct uart_dev_s *)’ from incompatible pointer type ‘void (*)(struct uart_dev_s *, _Bool)’ [-Wincompatible-pointer-types]
  435 |   usbhost_txint,         /* txinit */
      |   ^~~~~~~~~~~~~
usbhost/usbhost_cdcacm.c:435:3: note: (near initialization for ‘g_uart_ops.dmareceive’)
usbhost/usbhost_cdcacm.c:436:3: warning: initialization of ‘void (*)(struct uart_dev_s *)’ from incompatible pointer type ‘_Bool (*)(struct uart_dev_s *)’ [-Wincompatible-pointer-types]
  436 |   usbhost_txready,       /* txready */
      |   ^~~~~~~~~~~~~~~
usbhost/usbhost_cdcacm.c:436:3: note: (near initialization for ‘g_uart_ops.dmarxfree’)
usbhost/usbhost_cdcacm.c:437:3: warning: initialization of ‘void (*)(struct uart_dev_s *)’ from incompatible pointer type ‘_Bool (*)(struct uart_dev_s *)’ [-Wincompatible-pointer-types]
  437 |   usbhost_txempty        /* txempty */
      |   ^~~~~~~~~~~~~~~
usbhost/usbhost_cdcacm.c:437:3: note: (near initialization for ‘g_uart_ops.dmatxavail’)

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-05 09:25:31 +02:00
Xiang Xiao 87aa067ab3 serial/16550: Include nuttx/clk/clk.h
to avoid the build break when CONFIG_CLK is enabled

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-04 11:37:59 +03:00
Masayuki Ishikawa ee364e115a drivers: virtio: Remove unused code and fix comments in virtio-mmio-net.c
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2023-06-04 01:14:08 +08:00
wanggang26 01348b70a9 mtd: fix a typo 2023-06-02 19:57:15 +03:00
Masayuki Ishikawa e149a1278b dirivers: virtio: Fix virtnet_virtnet_txpoll() in virtio-mmio-net.c
Summary:
- I noticed that nfsmount always timed out.
- This commit fixes this issue.

Impact:
- None

Testing:
- Tested wih qemu-7.1
- NOTE: defconfigs will be updated later.

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2023-06-02 16:28:34 +08:00
Tiago Medicci Serrano 71c8265e2d drivers/syslog: add mutex to syslog_default_write
This commit reverts 19f269e54b and
substitutes the semaphore to a mutex, used as a locking mechanism
to avoid syslog messages being messed.

Considering SMP, threads running on different CPUs could call
syslog_default_write simultaneously. It then calls `up_nputs` that,
in most of the implementations, calls `up_putc` multiple times to
write to the serial. So, calling it at the same would cause syslog
messages to interfere with each other.

`up_nputs` and `up_putc` are low-level functions that could be used
during initialization and by the interrupt handler. Hence, it isn't
advisable to implement any locking mechanism on them. On the other
hand, syslog can also be used from the interrupt: if the interrupt
buffer is selected (`CONFIG_SYSLOG_INTBUFFER=y`), the syslog
messages will be flushed when we aren't serving an interrupt.
On the contrary, if it isn't set, it would call the registered
`sc_force` callback, which calls `syslog_default_putc` instead of
the lock-protected `syslog_default_write`.
2023-06-02 10:17:54 +08:00
raiden00pl 4089e35805 drivers/sensors: add bh1749nuc color sensor support
Add support for the BH1749NUC I2C color sensor.
Currently, the interrupt pin is not supported.
2023-06-01 23:45:30 +08:00
raiden00pl e1ffacfc33 drivers/sensors: add BMI270 IMU support 2023-06-01 11:23:54 -04:00
paolovolpi 0ed9842180 drivers/can/mcp2515.c Fix: add missing spi configuration in mcp2515_reset_lowlevel 2023-06-01 09:52:16 -03:00
Masayuki Ishikawa 6b35a49f6e dirivers: virtio: Fix virtnet_transmit() in virtio-mmio-net.c
Summary:
- I noticed that the driver sends incorrect packets sometimes.
- This commit fixes this issue.

Impact:
- None

Testing:
- Tested with qemu-7.1

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2023-06-01 13:44:30 +08:00
xucheng5 484d349fe3 driver/mtd : check args for nvs read
mtd_config_fs: check configdata before use

Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
2023-05-31 15:24:14 +08:00
chao an 589d4a9f8e net/semantic/parser: fix compile warning found by sparse
Reference:
https://linux.die.net/man/1/sparse

Signed-off-by: chao an <anchao@xiaomi.com>
2023-05-30 23:00:00 +08:00
chao an fb9b41221d semantic/parser: fix compile warning found by sparse
Reference:
https://linux.die.net/man/1/sparse

Signed-off-by: chao an <anchao@xiaomi.com>
2023-05-30 23:00:00 +08:00
paolovolpi f875db41d4 drivers/can/mcp2515.c Use SPIDEV_CANBUS(config->devid) instead of SPIDEV_CANBUS(0) 2023-05-30 11:48:13 +03:00
Michal Lenc 5f5ffa9380 fix compile warnings caused by incorrect variable format in print
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-05-27 18:52:01 +08:00
Michael Jung 2e27698d6c SLIP: Switch to poll based design
This is a refactored version of the SLIP network driver.  Updates
include:

1. The original design started two kernel threads per SLIP device.
   The refactored version uses file_poll to essentially be driven
   by the UART RX and TX interrupts and pushes work to the low
   priority work queue.

2. The SLIP byte un-/stuffing is more efficient now, using memcpy
   instead of handling each byte individually.

3. The switch of the old SLIP driver to IOBs caused buffer overwrites
   if packets were sent that would not fit into a single IOB.  This is
   fixed now.

Signed-off-by: Michael Jung <michael.jung@secore.ly>
2023-05-26 19:57:57 -03:00
paolovolpi ecaa62010a drivers/can/mcp2515.c Fix Configure Spi Bus on every bus lock 2023-05-27 03:18:31 +08:00
TimJTi c904b16cd9 Rename touchscreen ioctls for clarity 2023-05-26 22:42:57 +08:00
paolovolpi 8b27e455b1 drivers/can/mcp2515.c Fix Missing Chipselect de-assert before bus unlocking 2023-05-25 18:55:07 -03:00
fangpeina 0b8d5e993d drivers/lcd: Add JD9851 driver
Added support for the JD9851 TFT controller based on ST7789

Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2023-05-26 02:21:25 +08:00
jianglianfang 73832ab0a4 vnc server: Fix that vnc_updater thread exited caused by readed a null data
When updating the full-screen data, sq_ init() will clear the updqueue and add just one new full-screen data to the updqueue. So when the vnc_updater thread is awakened, it may read a null data due to multiple reading, leading to vnc_updater thread exited , which is not expected.

Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2023-05-25 22:41:47 +08:00
Xiang Xiao 20ea607bd0 stream: Rename syslogstream to syslograwstream
to prepare a new stream implementation of syslog

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Signed-off-by: chao an <anchao@xiaomi.com>
2023-05-25 15:22:04 +08:00
chao an 0455167457 stream/syslog: use internal buffer to decoupling syslog with iob
Signed-off-by: chao an <anchao@xiaomi.com>
2023-05-24 09:53:30 +08:00
TimJTi 3cb168b177 GD25 Flash memory - performance enhancements 2023-05-23 01:32:58 +08:00
zhanghu5 a043657323 dma support 16550 uart
Signed-off-by: zhanghu5 <zhanghu5@xiaomi.com>
2023-05-23 01:32:03 +08:00
simbit18 e4ffce3355 Fix Kconfig style
Remove spaces from Kconfig files
2023-05-23 00:03:25 +08:00
Xiang Xiao 7990f90915 Indent the define statement by two spaces
follow the code style convention

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-21 09:52:08 -03:00
Lwazi Dube ae1fd83a46 usbhost: Can now handle multiple interface descriptors.
See #3644. Code from:
https://github.com/apache/nuttx/compare/master...btashton:libusb
2023-05-21 09:50:36 -03:00
jianglianfang 14c77dce15 fb_driver: add fb_open and fb_close
Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2023-05-19 21:46:07 +08:00
jianglianfang 73a1066613 vnc_server: set touch.maxpoint to 1 for circbuf_init
set touch.maxpoint to 1 in vnc_server.c for circbuf_init,otherwise
touch_event will circbuf_overwrite a wrong value.
test step:vnc run lvgldemo,test input event

Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2023-05-19 17:42:05 +08:00
Petro Karashchenko c70b7f6b3d nuttx: improve C89 compatibility in common code
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-05-19 02:40:38 +08:00
Petro Karashchenko 8254b374dd drivers/mmcsd: fix style issues
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-05-19 02:40:38 +08:00
Petro Karashchenko 1e86682feb drivers/mtd: fix C89 compatibility of w25qxxxjv
Correct various style issues

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-05-19 02:40:38 +08:00
Xiang Xiao 8d56a9bbcb Remove #warning if the code already return the error code or value
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-18 15:44:28 +03:00
simbit18 ca026a5b0f drivers\power\supply\Kconfig: Fix indentation
Remove TABs
2023-05-18 15:43:22 +03:00
Lwazi Dube 9948b5e701 usbhost: Make unplugging hubs more reliable.
USB drivers should not try control devices in the usbhost_disconnected
function. The control endpoint is NULL at this point because the device
has already been disconnected.

Before this change, the hub driver crashed when the child called
usbhost_hubpwr after the parent had already deactivated the control
pipe and set hport->ep0 to NULL.
2023-05-18 13:47:15 +08:00
Michal Lenc cf04f2e555 w25qxxxjv: add dual die support for 1 Gbit flash
1 Gbit W25Q01JV flash uses two 512 Mbit dies. This requires specific
operations in the driver in order to support the entire 1 Gbit region.
This commit adds dual die support for W25Q01JV flash.

Generally the driver has to switch active dies when die specific read from
status register is required (therefore before read, write, erase and when
checking if write status register was successful).

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-05-18 01:10:55 +08:00
chao an 6be363ff35 drivers/serial: fix race condition in multi-thread write
if multiple threads are doing serial read/write at the same time,
the driver will only wake up one of the thread, which will cause
other threads fail to be woken up in time and cause blocking

Signed-off-by: chao an <anchao@xiaomi.com>
2023-05-17 07:56:08 +02:00
Huang Qi 23ad4700a9 drivers/serial/pty.c: Fix coverity issue
Coverity report that `ntotal` may be a negative value.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-05-17 07:44:26 +02:00
Zhe Weng eb47312518 netdev_upper: Protect quota by spin lock to allow netpkt_xxx be called in interrupt context
Before atomic is ready on every platform, we need a way to protect
quota, previously it's protected by net_lock, but this makes netpkt_xxx
interfaces unable to be called under interrupt context, so changed to
spin lock. Also, we can easily change them into atomic under this
implementation.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-05-16 21:39:05 +08:00
hujun5 6da335cd81 driver/uart_16550: serial output can cause deadlock
All interrupts must be disabled to prevent re-entrancy and to prevent
interrupts from firing in the serial driver code.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-05-16 15:11:38 +08:00
Michal Lenc 482cbc4363 w25qxxxjv: fix STATUS2_QE_ENABLED bitfield write
W25QXXXJV_WRITE_STATUS_2 register uses just first byte therefore all
operations has to be done in priv->cmdbuf[0]. Previous priv->cmdbuf[1]
caused QuadSPI mode not being enabled.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-05-15 10:43:55 +08:00
Masayuki Ishikawa 498a75a58b drivers: virtio: Add virtio-mmio-blk
Summary:
- This commit adds virtio-mmio-blk driver

Impact:
- None

Testing:
- Tested with rv-virt:netnsh which will be updated later

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2023-05-13 13:58:09 +08:00
TimJTi b4b9a180c0 Add ATSAMA5D2/D4 Secure Fuse Controller (SFC) driver 2023-05-12 16:29:48 -03:00
zhanghongyu 06a10202af usrsock_server: fix issues with usrsock_rpmsg_sendto_handler
If the current poll setup only has POLLIN, adding POLLOUT does not cause the
protocol stack to refocus on flags such as TCP_ACK or UDP_POLL, the user is
not notified when flags for POLLOUT relationships appear and vice versa,
so we have to call poll_setup again.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-05-12 22:40:41 +08:00
Lwazi Dube 38ba0aefca usbhost_hub: Prevent crash when the last hub port is used.
An off-by-one error caused invalid memory to be accessed when the
last port was used. The first entry, at index 0, was never used.
The USB standard uses 1-based numbering for hub ports. This number
was used to index an array. This change converts the port number to
a zero-based port index when the array is accessed. The zero-based
value in the port field of the usbhost_hubport_s structure is also
converted before printing.

For testing, this bug was exposed on a 4 port hub when port 4 was
used after changing USBHUB_MAX_PORTS to 4 in hub.h. The bug should
also be triggered without changing hub.h if a 7 port hub is
available.
2023-05-12 11:41:26 +08:00
Alan Carvalho de Assis 54d92d1a0f Fix typo -EACESS -> -EACCES 2023-05-12 06:29:35 +03:00
Fotis Panagiotopoulos 4231938892 rtc: Fix compiler warning in driver initialization. 2023-05-11 22:18:10 +03:00
pengyiqiang 26e99ed042 drivers/video/fb: adapt to fbmem dynamic update.
Considering that the future fb needs to achieve dynamic resolution, the address and size of fbmem will be redistributed on the bottom driver side, so remove fbmem, fblen, and bpp cached in fb_chardev_s, and change it to call getplaneinfo every time to re-acquire panel info from the bottom driver. Avoid cache coherency problems.

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2023-05-12 01:06:52 +08:00
Lwazi Dube d66282a893 usbhost: Fix function address generation for multi-port root hubs.
Devices connected to the same USB bus should have unique function addresses.
This was not true for root hubs with multiple ports. After this change,
enumeration is more reliable on the sama5d3-xplained board when both root hub
ports are used.

This change amounts to using one usbhost_devaddr_s object per root hub
instead of one per root hub port. For the majority of boards only one
root hub port is available so no change in behavior should be expected.
2023-05-11 09:44:18 +02:00
simbit18 f12b9c44cb drivers/power/relay/Kconfig: Fix Kconfig style
Remove spaces from Kconfig files
Add TABs
2023-05-10 22:51:11 +08:00
simbit18 e320299ba7 drivers/audio/Kconfig: Fix Kconfig style
Remove spaces from Kconfig files
Add TABs
2023-05-10 22:51:11 +08:00
hujun5 7f4cb3057a arch/arm64: merge serial_pl011.c and qemu_serial.c
At present, the serial drivers qemu_serial.c and serial_pl011.c on the fvp-v8r and qemu platforms in arm64 are duplicated
and need to be merged. The plan is to place them under the drivers\serial directory to create a common code module,
so that both fvp-v8r and qemu can use the same code.
In the future, if new platforms use pl011 serial ports, they can also be directly reused

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-05-10 09:06:59 +02:00
gaojiawei 64b51bbbf7 driver/serial/pty.c fix update local flags for the pty device attribute
Signed-off-by: gaojiawei <gaojiawei@xiaomi.com>
2023-05-10 00:47:33 +08:00
raiden00pl b7341975ab drivers/usbhost/usbhost_cdcacm.c: fix warning 2023-05-09 20:48:51 +08:00
chao an d3240061db syslog/Kconfig: fix kconfig warning
warning: The int symbol SYSLOG_RPMSG_WORK_DELAY (defined at drivers/syslog/Kconfig:274) is being evaluated in a logical context somewhere. It will always evaluate to n.
make: *** [tools/Unix.mk:663: olddefconfig] Error 1

Signed-off-by: chao an <anchao@xiaomi.com>
2023-05-08 21:36:45 +03:00
Xiang Xiao 325f395300 Replace all strncpy with strlcpy
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-08 09:57:01 +02:00
Xiang Xiao 6f6fce95a2 Replace all sprintf with snprintf
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-08 09:57:01 +02:00
Xiang Xiao fa8719bb5a Replace all strcat with strlcat
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-08 09:57:01 +02:00
Lucas Saavedra Vaz 8b9dc54a0a drivers/audio: Add support for the ES8311 codec
Adds support for the ES8311 audio codec by Everest Semiconductor on NuttX. Both output and input are supported.
2023-05-04 18:41:54 -03:00
Lucas Saavedra Vaz d82d73c660 audio: Separate common settings for the ESXXXX family of products
To avoid code duplication, the common settings for Everest Semiconductor's codecs were separated in an "esxxxx_common" header
2023-05-04 18:41:54 -03:00
Lucas Saavedra Vaz a5a3b919a0 audio: Add i2s_getmclkfrequency function
Rename i2s_mclkfrequency to i2s_setmclkfrequency and add i2s_getmclkfrequency for getting the current MCLK frequency from the I2S interface
2023-05-04 18:41:54 -03:00
Xiang Xiao a514c0a13e mtd/nand: Implement isbad and markbad callback
these new callbacks are added by:
https://github.com/apache/nuttx/pull/8683

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-03 17:40:18 +03:00
Xiang Xiao 3e1ddb3de9 mtd/nand: Return -EUCLEAN when the bit error happen but fixed by ecc
follow how Linux report the correction information from ecc:
http://www.infradead.org/pipermail/linux-mtd/2012-March/040305.html
since this information is very useful to file system(e.g. yaffs, ubi/buifs)
which is specially designed for nand flash.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-03 17:40:18 +03:00
Xiang Xiao 7a725019bc mtd/nand: Add nand_raw_initialize to skip the probing
Since not all nand devices follow ONFI spec, nand_raw_initialize could be used to skip ONFI special action

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-02 15:02:38 +02:00
Xiang Xiao b4814811f5 mtd/nand: Implement MTDIOC_ERASESECTORS ioctl
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-02 12:15:56 +02:00
Xiang Xiao 3fc882df9e mtd/nand: Implement MTDIOC_ERASESTATE ioctl
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-02 12:15:56 +02:00
Xiang Xiao 3c54e66683 mtd/nand: Fix the comment and remove the uneeded inclusion
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-01 22:47:00 +03:00
Xiang Xiao 25a1191763 mtd/nand: Correct the check of erasing bad blocks
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-01 22:47:00 +03:00
Xiang Xiao c1680d2f03 mtd/nand: Call nandmodel_getdevpagesize directly to get the page number
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-01 22:47:00 +03:00
Michal Lenc 02aa7bcefe mtd: add support for MTDIOC_ERASESECTORS ioctl
Current driver supports MTDIOC_BULKERASE ioctl that erases the entire
device. The added ioctl MTDIOC_ERASESECTORS adds possibility to erase
just sectors defined by the user.

This is similar to MEMERASE call in Linux kernel.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-04-29 21:23:08 +08:00
anjiahao 0c9ca52f37 tty:support tty c_cc VMIN & VTIME
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-04-29 13:48:52 +08:00
Huang Qi 9de449c8b6 drivers/telnet: Refused to enter character mode
Refuse SGA to work in line mode, it's OK for modern rich featured telnet clients.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-04-28 13:44:51 +03:00
Masayuki Ishikawa 8355ab9070 drivers: wireless: Fix mtu info for gs2200m
Summary:
- I noticed that mtu info with ifconfig shows incorrect size.
- This commit fixes this issue.

Impact:
- None

Testing:
- Tested with spresense:wifi_smp

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2023-04-28 18:25:37 +08:00
Tiago Medicci Serrano d4e7fe55c7 drivers/pipe: fix blocking file_pipe
Similar to the fix introduced by
4d6a8663fa, it's necessary to set
one end of the file_pipe as non-blocking temporarily while opening
the other end to avoid it blocking unexpectedily.
2023-04-28 09:42:17 +08:00
chao an 507c8145a9 sched/spawn: remove spawn proxy thread to simplify task/posix_spawn()
The spawn proxy thread is a special existence in NuttX, usually some developers
spend a lot of time on stack overflow of spawn proxy thread:

https://github.com/apache/nuttx/issues/9046
https://github.com/apache/nuttx/pull/9081

In order to avoid similar issues, this PR will remove spawn proxy thread to simplify
the process of task/posix_spawn().

1. Postpone the related processing of spawn file actions until after task_init()
2. Delete the temporary thread of spawn proxy and related global variables

Signed-off-by: chao an <anchao@xiaomi.com>
2023-04-27 17:35:58 +08:00
SPRESENSE 307839ab6d drivers/spi/spi_bitbang: Add private data on spi_bitbang
Add private data for spi_bitbang low-level driver to add an instance
specific private data.
And add spi_destroy_bitbang() to clean up a driver instance.
2023-04-27 17:06:14 +08:00
SPRESENSE e542ef9175 drivers/video: Support spot position setting
Add new control id V4L2_CID_EXPOSURE_METERING_SPOT_POSITION
to support spot position setting in spot exposure metering.
2023-04-27 17:05:32 +08:00
Radek Pesina 3ba792cb52 Fix missing instantiation of return value in rwb_mediaremoved. 2023-04-27 17:03:25 +08:00
Lucas Saavedra Vaz 506b57eebf drivers/lcd/st7789: Add color inversion 2023-04-27 02:18:32 +08:00
SPRESENSE 93a1adf83e drivers/spi/spi_bitbang: Fix build warnings
Fix build warnings of spi_bitbang.c
2023-04-26 11:51:31 +02:00
pengyiqiang 0939634b42 video/fb: fix pollnotify calling crash in advance
When executing up_fbinitialize, the driver may turn on the vsync interrupt. If the vsync interrupt calls fb_pollnotify before executing fb->vtable->priv = fb it will cause null pointer access and crash.

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2023-04-26 11:51:21 +02:00
Radek Pesina 50a8ec62c4 Add eMMC driver support
- Fix DMA addressing issues within litex_sendsetup/litex_recvsetup
- Extend with handling specific to eMMC commands during init & use.
- Cleanup of 4-bit BUS handling for SD and eMMC
- For eMMC, Send CMD0 during init as per JEDEC v4.41 for pre-idle
2023-04-26 00:34:36 -04:00
Masayuki Ishikawa 8c89052fb3 drivers/net, include/nuttx/net: Add AR8031 PHY
Summary:
- This commit adds AR8031 PHY definitions

Impact:
- None

Testing:
- Tested with sabre-6quad:netnsh_ar8031 (will be added later)

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2023-04-25 11:45:19 +08:00
Xiang Xiao dd631265c4 fs: Add g_ prefix for all global mountpt_operations instances
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-24 16:13:29 +02:00
Xiang Xiao 51dc67ad5f fs: Add g_ prefix for all global file_operations instances
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-24 16:13:29 +02:00
TimJTi 4719e44b8b APDS9922
WIP

WIP - ALS now OK with full IOCTL.

WIP

WIP

ALS now works as intended

WIP - getting to bottom of crash when ctrl-c the app

Seems to all work...

ioctl #define changes

Update ioctl.h

Maybe final changes

Maybe final changes - again

Delete .settings directory

Delete nuttx Default.launch

Maybe final changes - again

changes after initial feedback

changes after initial feedback

Add snerr error when incorrect device ID seen

Update apds9922.c

Revert "Merge branch 'apds9922' of https://github.com/TimJTi/nuttx into apds9922"

This reverts commit 8fdf5cbfb783d25251d13bc338ece6adca1308bc, reversing
changes made to 0d58237ba27f3cf87cf711658f5388d974be502e.

Improve probe error messages

APDS9922

WIP

WIP - ALS now OK with full IOCTL.

WIP

WIP

ALS now works as intended

WIP - getting to bottom of crash when ctrl-c the app

Seems to all work...

ioctl #define changes

Update ioctl.h

Maybe final changes

Maybe final changes - again

Delete .settings directory

Delete nuttx Default.launch

Maybe final changes - again

changes after initial feedback

changes after initial feedback

Add snerr error when incorrect device ID seen

Update apds9922.c

Revert "Merge branch 'apds9922' of https://github.com/TimJTi/nuttx into apds9922"

This reverts commit 8fdf5cbfb783d25251d13bc338ece6adca1308bc, reversing
changes made to 0d58237ba27f3cf87cf711658f5388d974be502e.

Improve probe error messages

Update drivers/sensors/apds9922.c

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

Update drivers/sensors/apds9922.c

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

Update drivers/sensors/apds9922.c

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

Update drivers/sensors/apds9922.c

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

Update drivers/sensors/apds9922.c

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

Update drivers/sensors/apds9922.c

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

Update drivers/sensors/apds9922.c

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

Update drivers/sensors/apds9922.c

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

Update drivers/sensors/apds9922.c

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

Update drivers/sensors/apds9922.c

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

Update drivers/sensors/apds9922.c

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

Update drivers/sensors/apds9922.c

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

Update drivers/sensors/apds9922.c

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

Update drivers/sensors/apds9922.c

Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>

Delete .gitignore

Changes after PR review

Remove static arrays from header file

Update apds9922.c

improvements to enum usage

Restore .gitignore

Update Kconfig

Update .gitignore

Update .gitignore
2023-04-22 20:38:29 +08:00
zouboan 9bc3a9e4bb drivers/mpu60x0 Fix the error when mpu60x0 in SPI case 2023-04-22 20:38:21 +08:00
Xiang Xiao c6d210289f procfs: remove procfs_ from procfs_operations variables
to aglin the naming style with other implementation

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-22 03:33:50 -04:00
Xiang Xiao 149cafe450 procfs: Add g_ prefix to all procfs_operations
to conform the coding style

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-04-22 03:33:50 -04:00
rongyichang e6490694a1 drivers/video: passthrough unknown ioctl commands for customized scenarios in fb
driver

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-04-22 12:48:46 +08:00
ZhongAn 7eeba71366 audio: add audio_dma device driver.
Signed-off-by: ZhongAn <zhongan@pinecone.net>
2023-04-22 01:50:51 +08:00
Zhe Weng 60e66d5e29 net/netdev: Support dedicated thread in upper half driver
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-04-22 01:41:01 +08:00
Zhe Weng f21742899f net/netdev: Use upper half of netdev to simplify sim driver
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-04-22 01:41:01 +08:00
Zhe Weng 72b77d36e2 net/netdev: Add upper half of netdev to simplify driver logic
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-04-22 01:41:01 +08:00
raiden00pl b737d410b9 bt_rpmsghci: fix warnings 2023-04-22 01:37:24 +08:00
Tiago Medicci Serrano 4d6a8663fa drivers/pipe: make pipe and named pipe (mkfifo) POSIX-compliant
According to https://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html

"
 When opening a FIFO with O_RDONLY or O_WRONLY set:
  * If O_NONBLOCK is set, an open() for reading-only shall return
    without delay. An open() for writing-only shall return an error
    if no process currently has the file open for reading.

  * If O_NONBLOCK is clear, an open() for reading-only shall block
    the calling thread until a thread opens the file for writing.
    An open() for writing-only shall block the calling thread until
    a thread opens the file for reading.
"

This commit has an equivalent on nuttx-apps: EXAMPLES_PIPE app
was updated to be able to check pipes and named pipes behavior.
2023-04-22 01:28:33 +08:00
pengyiqiang 0ed82e8380 video/fb: add vsync offset support
Android Documentation: https://source.android.com/docs/core/graphics/implement-vsync#vsync_offset

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2023-04-22 01:09:09 +08:00
Huang Qi c7a935dc1a drivers/telnet: Implement part of termios
Implement local mode control (ECHO only) for telnet, this allow application to disable ECHO of telnet, it's useful to input password during shell login and other case.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-04-22 01:03:51 +08:00
Huang Qi d6c56e7105 driver/telnet: Remove TELNET_CHARACTER_MODE
If TELNET_CHARACTER_MODE is set, the ECHO must be handled by the telnet server.

So this option is useless. We need a new approach to control the ECHO behavior.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-04-22 01:03:51 +08:00
ZhongAn 596f52c3ee Nuttx/dma: add dma framework for nuttx
Signed-off-by: ZhongAn <zhongan@pinecone.net>
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-04-22 01:02:51 +08:00
yinshengkai a297ff61f5 drivers/note: replace sched_note_filter_dump to sched_note_filter_tag
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-04-19 02:53:34 +08:00
Fotis Panagiotopoulos ab1b3c0337 Added missing checks in strdup'ed strings. 2023-04-19 02:49:31 +08:00
simbit18 433ec4c9de drivers/sensors/Kconfig: Fix bmp280 texts in Kconfig
Fix SENSORS_BMP280 texts in Kconfig
2023-04-19 02:46:09 +08:00
XinStellaris a4546f35d2 drivers/mtd:fix uninit data in mtd_config_fs
Signed-off-by: XinStellaris <tianxin7@xiaomi.com>
2023-04-19 02:45:46 +08:00
SPRESENSE 20424a8a59 drivers/audio/cxd56.c: Fix freeze audio and add underrun notify
Fix freeze audio driver when it start 2nd time.
And add underrun notify to application as an event.
2023-04-17 10:24:48 +02:00
Zhe Weng 7671ed9615 usrsock_server: Raise error earlier for large sendto request
It's better to raise error before client sends its (NIOVEC+1)th buffer
(and release buffers held by server), otherwise the client may stuck at
getting (NIOVEC+1)th tx buffer if NIOVEC is equal to rpmsg buffer num.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-04-15 21:56:03 +09:00
Zhe Weng 0d118ec214 usrsock_server: Use remain instead of iov[0] to figure out partial requests
Found a problem:

When sendto handler gets an error, it will release all its rx buffer,
then iov_base becomes NULL. But it cannot let client stop its request,
then the next data from client cannot be handled by usrsock server
correctly.

It's better to note down the remaining bytes, then we can stop at
correct time.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-04-15 21:56:03 +09:00
simbit18 2309eacf9f drivers/sensors/Kconfig: Fix bmi160 help texts in Kconfig
Fix bmi160 help texts in Kconfig
2023-04-12 07:54:19 +02:00
zhangyuan21 c239d19df0 nuttx: add more dependent header file
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-04-11 09:13:32 +03:00
wangming9 a7fc26124d arch/arm64: the arm64 perf interface supports pmu
Summary:
- Support arm64 pmu api, Currently only the cycle counter function is supported.
- Using ARM64 PMU hardware capability to implement perf interface, modify all
  perf interface related code.
- Support for pmu init under smp.

Signed-off-by: wangming9 <wangming9@xiaomi.com>
2023-04-10 16:23:49 -03:00
zouboan 90ff76dfd6 drivers/sensors: add support of InvenSense MPU-9250 sensor 2023-04-10 11:25:42 -03:00
yinshengkai b3e1004658 sched_note: add function auto-tracing
After enabling this option, you can automatically trace the function instrumentation without adding tracepoint manually.
This is similar to the Function Trace effect of the linux kernel

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-04-10 11:04:24 -03:00
Dong Heng a51e102a41 xtensa/esp32: Make asprintf and lib_free corresponding 2023-04-06 20:57:19 +03:00
raiden00pl 478f2f3d5f rndis: move private definitions from a public header to the source file 2023-03-31 08:17:01 +09:00
raiden00pl 58e817db76 rndis: do not configure endpoints from Kconfig when composite enabled
This should be done from a board specific logic, as for other composite devices
2023-03-31 08:17:01 +09:00
Lwazi Dube 18d196e968 usbhost_hidkbd: Add the option to use interrupt transfers.
Using the interrupt pipe is recommended in the Get_Report
request section of the HID standard. This option has been
added to support some keyboards that refuse to return valid
keys when polled using the Get_Report request. Support for
the Caps Lock key, including LED, has also been added.
2023-03-29 09:22:41 -03:00
Zhe Weng 9fd4d6b767 usrsock_server: Do not poll SOCK_CTRL.
It seems that we don't need to poll the SOCK_CTRL sockets, so skip them in usrsock server.

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-03-29 09:18:36 -03:00
zhanghongyu 0550082966 usrsock_server: add debug info for poll_setup
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-03-29 09:18:36 -03:00
raiden00pl bed53538e8 rndis: EP0 belongs to composite class if composite enabled 2023-03-28 19:43:56 -03:00
raiden00pl 8de2197773 rndis: exclude the logic that belongs to composite 2023-03-28 19:43:56 -03:00
raiden00pl cb05700acf rndis: interface association descriptor should depend on CONFIG_COMPOSITE_IAD 2023-03-28 19:43:56 -03:00
raiden00pl 10f1d3e76e rndis: fix dev info init for composite 2023-03-28 19:43:56 -03:00
raiden00pl 9b70e010dc rndis: refactor usbdev_rndis_get_composite_devdesc to make it more like in other composite drivers 2023-03-28 19:43:56 -03:00
Huang Qi c623a7b731 drivers/lcd/st7789: Support mirror X/Y
Support mirror display by X/Y axis, it's useful for
single portrait/landscape but need to mirror specific direction.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-03-27 17:55:49 -03:00
Xiang Xiao bc3e6c84e1 arch: Rename up_[early]serialinit to [arm64|riscv|x86_64][early]serialinit
The naming standard at:
https://cwiki.apache.org/confluence/display/NUTTX/Naming+of+Architecture%2C+MCU%2C+and+Board+Interfaces
requires that all MCU-private function begin with the name of the architecture, not up_.

follow the change from: https://github.com/apache/nuttx/pull/930

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-03-27 12:35:04 +03:00