Commit Graph

46063 Commits

Author SHA1 Message Date
Jiuzhu Dong
24040250f5 driver/sensor: support multi users to access device
1.Allow multi users to access the same sensor device simultaneously.
2.Get real state of sensor device by cmd SNIOC_GET_STATE for users.
3.Get update state since last read by poll without timeout for users.
4.Sensor device will be activated when first user open and will close when
  last user closed.
5.When multi users to access device, driver always set the minimum
  sampling interval and latency to the sensor device and allow
  downsampled for users above the minimum sampling interval.
6.The circbuffer will overwrite old data when buffer is full, so if users
  don't read data soon, data will be lost, and the oldest data in circbuffer
  are returned to the users.
7.Always read the last data in the circbuffer as initial value for new
  users when the sensor device has not yet generated new data.
8.when user uses poll, if subscription interval is satisfied, the POLLIN
  events is returned for each users.
9.When new user generate or the state of sensor device changed, the POLLPRI
  will notify to all users.
10.Support multi advertisers to subscribe their own data as loop test.

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-26 10:40:21 +08:00
Jiuzhu Dong
b3ea6522f4 driver/usensor: support register user sensor
1.cmd:SNIOC_REGISTER with struct sensor_reginfo_s to register user sensor
2.cmd:SNIOC_UNREGISTER to unregister user sensor

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-26 10:40:21 +08:00
Jiuzhu Dong
8d971101cd driver/sensor: change protype of set_interval, batch to follow ioctl
1. change unsigned int to unsigned long

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-26 10:40:21 +08:00
Jiuzhu Dong
8f39c5f11b driver/sensor: simplify buffer operation
1.Simplify buffer opeations to avoid frequent resize for batch and no-batch mode.
2.When sensor event is first generated, the buffer is initialized.
3.Remove and merge batch_number to buffer_number when device support batch mode.

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-26 10:40:21 +08:00
Jiuzhu Dong
dad5ab75ff driver/sensor: support userspace wirte data into sensor device
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-26 10:40:21 +08:00
ligd
5f68aa56fd poll: defalut set POLLERR POLLHUP to events
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 09:36:55 +08:00
ligd
434c49f282 rptun_dump: use METAL_LOG_EMERGENCY log level
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 09:36:05 +08:00
ligd
4a9bd26317 rptun: merge rptun_ioctl & rptun_ops to one
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 09:36:05 +08:00
ligd
631eb516c9 rptun_dump: don't get lock in IRQ handler
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 09:36:05 +08:00
Peter van der Perk
9e7e45df76 Evaluate n in preprocessor before masking 2022-07-25 23:47:05 +08:00
Peter van der Perk
ec118743ea NX style fixes 2022-07-25 23:47:05 +08:00
Peter van der Perk
eae3f77673 Fix wrong comment style 2022-07-25 23:47:05 +08:00
Peter van der Perk
b3590f00b3 NXStyle and preprocessor fixes
Co-authored-by: Jari van Ewijk <jari.vanewijk@nxp.com>
2022-07-25 23:47:05 +08:00
Jari van Ewijk
7f3fc23dd6 NXP S32K3XX: add initial support for NXP MR-CANHUBK3 board
Co-authored-by: Peter van der Perk <peter.vanderperk@nxp.com>
2022-07-25 23:47:05 +08:00
Jari van Ewijk
7816ba9a7b NXP S32K3XX: add initial support for NXP S32K344EVB board
Co-authored-by: Peter van der Perk <peter.vanderperk@nxp.com>
2022-07-25 23:47:05 +08:00
Jari van Ewijk
dd1096695d Add initial support for NXP S32K3 MCU family
Co-authored-by: Peter van der Perk <peter.vanderperk@nxp.com>
2022-07-25 23:47:05 +08:00
Jari van Ewijk
51a845ce54 SocketCAN: add non-blocking write
Co-authored-by: Peter van der Perk <peter.vanderperk@nxp.com>
2022-07-25 23:47:05 +08:00
Jari van Ewijk
d3b1ee9866 Macronix MX25RXX driver: add support for MX25LXX as well
Co-authored-by: Peter van der Perk <peter.vanderperk@nxp.com>
2022-07-25 23:47:05 +08:00
raiden00pl
8eae3bb5ff stm32f0l0g0/stm32_spi.c: fix receiving data for half duplex mode 2022-07-25 23:46:33 +08:00
raiden00pl
351c9dc837 stm32f0l0g0/stm32_spi.c: remove unused spi_readbyte function 2022-07-25 23:46:33 +08:00
raiden00pl
af4d65416a stm32f0l0g0/stm32_spi.c: add missing SPI mode config and fix ifdef 2022-07-25 23:46:33 +08:00
raiden00pl
69986fad84 stm32f0l0g0/hardware/stm32_spi.h: remove unused definitions 2022-07-25 23:46:33 +08:00
Jiuzhu Dong
fc84813b0a driver/sensor: add calibrate interface for sensor driver.
Add standard sensor interface for calibrate, can trigger
calibration and obtain calibration value.

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-25 17:44:31 +08:00
zhanghongyu
51a262150d wifi: clear IFF_RUNNING flag when ifdown
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-07-25 15:29:24 +08:00
zhanghongyu
7467586d55 netdev: add return value for ifup / ifdown
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2022-07-25 15:29:24 +08:00
Jiuzhu Dong
1c342328de rtc/rpmsg: when a client connection, server initiates time sync
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-25 14:58:16 +08:00
Jiuzhu Dong
6e1244c274 mm/circbuf: add circ_peekat to read data with specified postion
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-25 13:35:26 +08:00
Jiuzhu Dong
a853c70093 mm/circbuf: add circbuf_is_init to indicate circbuf state
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-25 13:35:26 +08:00
Jiuzhu Dong
3132f169ef driver/sensor: add sensor type of cap and wake_gesture
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-25 13:34:58 +08:00
Alan Carvalho de Assis
a8cf7aea39 esp32s3-devkit: Add support to discrete 5-way joystick 2022-07-24 16:33:42 +08:00
raiden00pl
0fe378621e boards: add initial support for ST steval-stlcs01v1 2022-07-23 16:51:31 -03:00
raiden00pl
92b676479a stm32l4/Kconfig: add support for STM32L476JG and STM32L476JE 2022-07-23 16:51:31 -03:00
raiden00pl
0e97e57d23 stm32g071b-disco: gpio dev support 2022-07-23 16:48:13 -03:00
raiden00pl
0253f0ff66 stm32g071b-disco: ina230 support 2022-07-23 16:48:13 -03:00
raiden00pl
0570704cdc sensors: use the INA226 driver also for INA230 chips 2022-07-23 16:48:13 -03:00
curuvar
c21c7ac8dc Added Adafruit QT Py RP2040 board.
Added ability to configure indivdual UART, SPI and I2C pin location.
2022-07-23 18:25:38 +08:00
curuvar
421b8ae3e7 Ability to use newer pico-sdk with RP2040 builds (Issue #4919) 2022-07-23 14:36:52 +08:00
Masayuki Ishikawa
0cef7b765e binfmt: Fix memory leak in ELF loader
Summary:
- I noticed that the hello (ELF) application causes a memory leak.
- Finally, I found that the data section is not deallocated.
- This commit fixes this issue.

Impact:
- ELF loader with CONFIG_ARCH_ADDRENV=n

Testing:
- Tested with the following configs
  - sprensense:elf, esp32-devkitc:elf, sabre-6quad:elf
  - spresense:wifi_smp, rv-virt:nsh64, sabre-6quad:netnsh

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2022-07-23 14:34:27 +08:00
ligd
79952163c1 rpmsg_socket: use sendto_nocopy() instead of send_nocopy().
only wait ept ready after ept_create, not after ept_destroy

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-23 08:16:48 +03:00
ligd
9c106c1bdc rpmsg_socket: defalut set POLLERR POLLHUP to events
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-23 08:16:48 +03:00
ligd
ba990619ed socket_rpmsg: set poll err instead return err
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-23 08:16:48 +03:00
ligd
630ca45a50 rpmsg_socket: connect addrlen can bigger then expect
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-23 08:16:48 +03:00
Jiuzhu Dong
fab2f6d3d8 net/rpmsg: fix minor issue on strncpy
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-23 08:16:48 +03:00
Fotis Panagiotopoulos
ad7f503cfa sim: Increased priority of loop task. 2022-07-23 00:22:35 +08:00
Karel Kočí
6c7f99189b libs/libc/string: add memmem
This function is the GNU extension.
2022-07-22 19:04:11 +03:00
Jouni Ukkonen
e268b23142 OpenSBI: Add configurable support for domain init
Initialize .domains_init function entry point in sbi_platform_operations when
CONFIG_OPENSBI_DOMAINS=y. In this case, the board specific code must provide
the "board_domains_init" function.

Signed-off-by: Jouni Ukkonen <jouni.ukkonen@unikie.com>
2022-07-22 19:00:33 +03:00
ligd
1e5568b030 rpmsgfs: fix nx_style
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-22 17:10:19 +03:00
ligd
572d865034 rpmsgfs: cache statfs result in case of deadlock
rptun: msg from other cpu
[ap] [ 5] [<0x2c353768>] arm_switchcontext+0xc/0x10
[ap] [ 5] [<0x2c322266>] sem_wait+0x5a/0xbc
[ap] [ 5] [<0x2c7400a8>] inode_semtake+0x24/0x5c
[ap] [ 5] [<0x2c74087a>] inode_release+0x6/0x60
[ap] [ 5] [<0x2c741284>] file_close+0x18/0x44
[ap] [ 5] [<0x2c74fb06>] rpmsgfs_close_handler+0x86/0xe4
[ap] [ 5] [<0x2c75b8de>] rpmsg_virtio_rx_callback+0xba/0x1b4
[ap] [ 5] [<0x2c75af70>] rproc_virtio_notified+0x44/0x5c
[ap] [ 5] [<0x2c75a93c>] remoteproc_get_notification+0x1c/0x2c
[ap] [ 5] [<0x2c335a08>] rptun_thread+0x74/0x208
[ap] [ 5] [<0x2c323e72>] nxtask_start+0x3a/0x60

nsh: send msg to other cpu with inode lock
[ap] [10] [<0x2c353768>] arm_switchcontext+0xc/0x10
[ap] [10] [<0x2c3221b2>] nxsem_wait_uninterruptible+0x6e/0xc8
[ap] [10] [<0x2c74e498>] rpmsgfs_send_recv.constprop.0+0x78/0xc0
[ap] [10] [<0x2c74ebc0>] rpmsgfs_client_statfs+0x50/0x80
[ap] [10] [<0x2c3221ca>] nxsem_wait_uninterruptible+0x86/0xc8
[ap] [10] [<0x2c74da78>] rpmsgfs_statfs+0x28/0x50
[ap] [10] [<0x2c74534e>] mountpoint_filter+0x66/0x90
[ap] [10] [<0x2c740016>] foreach_inodelevel+0x66/0x88
[ap] [10] [<0x2c73fffa>] foreach_inodelevel+0x4a/0x88
[ap] [10] [<0x2c740062>] foreach_inode+0x2a/0x48
[ap] [10] [<0x2c745388>] foreach_mountpoint+0x10/0x20
[ap] [10] [<0x2c745606>] mount_read+0x36/0x70
[ap] [10] [<0x2c742a34>] read+0x30/0x5c
[ap] [10] [<0x2c371096>] nsh_catfile+0x36/0x140
[ap] [10] [<0x2c36d01a>] nsh_parse_command+0x7fe/0xc54
[ap] [10] [<0x2c370f92>] nsh_session+0x66/0x134
[ap] [10] [<0x2c3721a4>] nsh_consolemain+0x2c/0x44
[ap] [10] [<0x2c374fde>] nsh_main+0x2a/0x4c
[ap] [10] [<0x2c33f7f8>] lib_cxx_initialize+0x24/0x48
[ap] [10] [<0x2c34274a>] nxtask_startup+0x12/0x24
[ap] [10] [<0x2c323e7e>] nxtask_start+0x46/0x60

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-22 17:10:19 +03:00
ligd
5f60b7dc12 rpmsgfs: hande count <=0 when rpmsgfs_read&write
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-22 17:10:19 +03:00
ligd
837c15dcb6 rpmsgfs: improve file read & write performance
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-22 17:10:19 +03:00