Commit Graph

5540 Commits

Author SHA1 Message Date
wangming9
f05e72324c drivers/video: fix build error on CONFIG_DEBUG_OPTLEVEL="-O3"
Summary
The following compilation error occurs after configuring CONFIG_DEBUG_OPTLEVEL="-O3"
CC:  ping.c video/video.c: In function 'video_ioctl':
video/video.c:2347:22: error: 'control.size' may be used uninitialized [-Werror=maybe-uninitialized]
 2347 |               control->size,
      |                      ^~
video/video.c:2273:28: note: 'control' declared here
 2273 |   struct v4l2_ext_control  control;
      |                            ^~~~~~~

Signed-off-by: wangming9 <wangming9@xiaomi.com>
2023-09-09 17:08:23 +03:00
Andre Heinemans
329e050c30 Added NXP SE05x support (secure element) 2023-09-09 15:54:08 +08:00
zhangyuan21
59f7fe11a3 usbdev: adb use fs device for ep process
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-09-09 15:52:08 +08:00
zhangyuan21
1f6d9bbd17 usbdev: add usbdev fs device for usb char device
Add usb_fs driver so that userspace can directly transfer USB packets
through the EP node. ADB, Fastboot, MTP will use usb_fs, these class
driver only need to provide the descriptors and register the usb_fs device.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-09-09 15:52:08 +08:00
SPRESENSE
60364d7c72 drivers/sensors/bmi270: Enable to select config memory
Allow to transfer the BMI270 configuration data directly, and
provide an option to use the heap memory if it cannot transfer
directly.
2023-09-09 00:46:24 +08:00
SPRESENSE
a015aa4fca boards: cxd56xx: Add board-specific driver for bmi270 2023-09-09 00:46:24 +08:00
raiden00pl
e26dfec157 cmake: add support for sensors/bmi270 2023-09-09 00:43:09 +08:00
raiden00pl
e83fd87f9c driver/sensors/: BMI270 fix compilation if sensor works in SPI mode 2023-09-09 00:43:09 +08:00
wanggang26
0e7e7c4ee6 rpmb: add virtio rpmb support
The RPMB partition cannot be accessed via standard block layer, but by a set of specific commands: WRITE, READ, GET_WRITE_COUNTER, and PROGRAM_KEY. Such a partition provides authenticated and replay protected access, hence suitable as a secure storage.

Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2023-09-09 00:13:25 +08:00
dongjiuzhu1
88105f2b3d driver/sensors: fix race condiftion about rptun thread recursive
In sensor_rpmsg_ioctl, when rpmsg_get_tx_payload_buffer is block,
The rptun thread will continue to process rx_buffers from other cores,
So the proxy may be released in sensor_unadv_handler, then if using
the proxy, It causes a crash.
backtrace:
0  0x06007c2e in is_rpmsg_ept_ready (ept=0x5a5a5a5a) at nuttx/include/openamp/rpmsg.h:172
1  0x06013354 in rpmsg_send_nocopy (len=<optimized out>,
    data=<optimized out>, ept=<optimized out>) at nuttx/include/openamp/rpmsg.h:521
2  rpmsg_send_nocopy (ept=0x5a5a5a5a, data=data@entry=0x201facf0,
    len=len@entry=40) at nuttx/include/openamp/rpmsg.h:512
3  0x06013b34 in sensor_rpmsg_ioctl (dev=dev@entry=0x201b7388,
    cmd=538701816, cmd@entry=2690, arg=0, len=len@entry=0,
        wait=<error reading variable: dwarf2_find_location_expression:
        Corrupted DWARF expression.>) at ../../../drivers/sensors/sensor_rpmsg.c:395
4  0x06013cce in sensor_rpmsg_alloc_proxy (dev=dev@entry=0x201b7388,
    ept=ept@entry=0x202073d0, msg=msg@entry=0x201684f0) at ../../../drivers/sensors/sensor_rpmsg.c:498
5  0x06013d12 in sensor_rpmsg_adv_handler (ept=0x202073d0,
    data=0x201684f0, len=49, src=<optimized out>, priv=0x202073c8) at ../../../drivers/sensors/sensor_rpmsg.c:905
6  0x0600d45e in sensor_rpmsg_ept_cb (ept=<optimized out>,
    data=<optimized out>, len=<optimized out>, src=<optimized out>,
    priv=0x202073c8) at ../../../drivers/sensors/sensor_rpmsg.c:1168

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-09-08 22:39:02 +08:00
dongjiuzhu1
f8052cdc76 driver/sensors: using list_for_every_entry_safe to fix race condition
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-09-08 22:39:02 +08:00
Jukka Laitinen
b343f5c0e7 drivers/net: Add a management driver for ksz9477 ethernet switch
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-09-08 22:34:27 +08:00
chenrun1
dd4055be78 button_upper.c:Modify the unknown command message level in ioctl to iinfo
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-09-08 15:55:28 +03:00
yinshengkai
15f88804ca drivers/alarm: modify the default precision of up_perf_gettime to ns
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-09-08 01:09:02 +03:00
yangyalei
fd776e8cee fix wait after vfork return error
vfork use waitpid hang father process,
but waitpid release child processs information by default.
So when user call wait, it return errno 10.

Signed-off-by: yangyalei <yangyalei@xiaomi.com>
2023-09-08 00:53:56 +03:00
Alan Carvalho de Assis
4b67e23049 mcp23008 Initial support 2023-09-08 01:33:12 +08:00
yintao
23dee24a7d nuttx/usrsock: fix rpmsg_usrsock memory leak when stop remote
1 0x826037 in host_memalign sim/posix/sim_hostmemory.c:180
2 0x82665a in host_realloc sim/posix/sim_hostmemory.c:222
3 0x6320b8 in mm_realloc sim/sim_heap.c:261
4 0x63201f in mm_malloc sim/sim_heap.c:193
5 0x632124 in mm_zalloc sim/sim_heap.c:296
6 0x62cbd2 in zalloc umm_heap/umm_zalloc.c:70
7 0x5f3548 in usrsock_rpmsg_ns_bind usrsock/usrsock_rpmsg_server.c:977
8 0x5cdb7a in rptun_ns_bind rptun/rptun.c:604
9 0x760a94 in rpmsg_virtio_ns_callback open-amp/lib/rpmsg/rpmsg_virtio.c:676
10 0x75f958 in rpmsg_virtio_rx_callback open-amp/lib/rpmsg/rpmsg_virtio.c:583
11 0x76b2c6 in virtqueue_notification open-amp/lib/virtio/virtqueue.c:711
12 0x756872 in rproc_virtio_notified open-amp/lib/remoteproc/remoteproc_virtio.c:433
13 0x751d2c in remoteproc_get_notification open-amp/lib/remoteproc/remoteproc.c:1005
14 0x5caa15 in rptun_worker rptun/rptun.c:344
15 0x5cabc7 in rptun_thread rptun/rptun.c:380
16 0x5849ca in nxtask_start task/task_start.c:129
17 0x62fd6a in pre_start sim/sim_initialstate.c:52

Signed-off-by: yintao <yintao@xiaomi.com>
2023-09-08 01:15:26 +08:00
haopengxiang
3a0e713f2e dirvers/mtd/dhara: add dhara folder in gitignore
Signed-off-by: haopengxiang <haopengxiang@xiaomi.com>
2023-09-07 23:05:11 +08:00
dongjiuzhu1
bfb0095ec7 driver/syslog: reset syslog buffer when syslog buffer include invalid data
When the machine is cold started, the psram area where the syslog
buffer is located contains some random values, so it will cause
loss of valid log.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-09-07 11:42:24 +03:00
zhangyuan21
aa9f15d635 arch_alarm: change tick to g_current_tick
When the system starts up, the hw count may not start counting from 0,
which can cause the processing time of the first oneshot handler to be
too long. Therefore, the current tick value should be set based on the
hw count during initialization.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-09-06 17:28:26 +08:00
likun17
7d7345a620 sensor/bmp180.c:provides work in character device mode and UORB communication mode.
Use the macro CONFIG_SENSORS_BMP180_UORB to enable the uorb feature.

Signed-off-by: likun17 <likun17@xiaomi.com>
2023-09-06 08:02:52 +02:00
Jukka Laitinen
7ec3cad5af drivers/timers/pcf85263.c: Fix compilation
Add the missing semicolons

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-09-06 12:20:57 +08:00
zhangyuan21
0efd4d0e12 usbdev: Split usbdev descriptor information
The class device only handles descriptor information specific to the class,
and shared descriptor information is passed through parameters and
handled by the composite driver.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-09-06 02:29:32 +08:00
likun17
b5bccbb70e sensor:bmi160.c:Fix the missing items caused by resolving merge conflicts after bmi160 cherry-pick submission. This cherry-pick missing CI check did not detect it.
Signed-off-by: likun17 <likun17@xiaomi.com>
2023-09-06 02:24:35 +08:00
Xiang Xiao
a9efeeeebc drivers/clk: Change CLK_SET_RATE_NO_REPARENT to CLK_MUX_SET_RATE_NO_REPARENT
since only mux clk use this flag

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-05 18:05:50 +03:00
Tiago Medicci Serrano
9357d70c25 audio/cs4344: Set master clock when resetting the device
Whevenever the bit rate is going to be set, it's necessary to first
set the master clock if the underlying device supports it. If it
fails, just return the error code.
2023-09-05 13:33:05 +08:00
Tiago Medicci Serrano
d9169b84e4 audio/cs4344: Set the default sample rate to the lowest possible
According to the struct `mclk_rate_s`, set the default sample rate
to its lowest valid value. This prevents the underlying driver from
setting unsupported values.
2023-09-05 13:33:05 +08:00
likun17
ad643fe7a3 sensor/bmi160.c:provides work in character device mode and UORB communication mode.
Create bmi160_base.h, bmi160_base.c bmi160_uorb.c files, the bmi160_base file stores
public function interfaces, and the bmi160_uorb file stores functions related to the
uorb framework. Switch the character interface and UORB interface through the
macro CONFIG_SENSORS_BMI160_UORB.

Signed-off-by: likun17 <likun17@xiaomi.com>
2023-09-04 08:17:44 +02:00
likun17
bc066af50a sensor/bmi160.c:provides work in character device mode and UORB communication mode.
create a new bmi160.h file.

Signed-off-by: likun17 <likun17@xiaomi.com>
2023-09-04 08:17:44 +02:00
TimJTi
3b4ea52a79 Remove spinlock, change to i2c_readwrite where appropriate , and consolidate i2c read and write calls. 2023-09-02 16:26:10 +03:00
zhangyuan21
06d9356d12 usbdev: Use BOARD_USBDEV_SERIALSTR config directly
A usbdev has only one serial string, so use a unique macro to control it.

For boards that enable board serial string using COMPOSITE_BOARD_SERIALSTR,
PL2303_BOARD_SERIALSTR, CDCACM_BOARD_SERIALSTR, USBADB_BOARD_SERIALSTR,
USBMSC_BOARD_SERIALSTR, and RNDIS_BOARD_SERIALSTR, they need to be replaced
with BOARD_USBDEV_SERIALSTR.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-09-01 19:29:12 +08:00
zhanghongyu
b30a389459 usrsock_server: fix coverity for recvfrom handle
req->usockid may not be in a valid range when ret less than zero and not -EAGAIN.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-09-01 12:30:54 +03: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
Eero Nurkkala
db13d5e24c drivers/mmcsd: fix regression causing emmcsd not working
Commit 50a8ec6 broke many mmc devices.  Only if the flag
priv->caps & SDIO_CAPS_4BIT_ONLY was set, it migth work.
Without the flag, the mmc clock is never set (mmcsd_widebus()
call is terminated early stopping the clock).  This flag
is probably not very generic because most mmc hw support
1, 4 and 8 bit modes.

JEDEC specifies a bus width selection procedure, but it's
not implemented in this mmcsd_sdio.c driver.  Thus, it's
not known whether the hw supports 1, 4 anf 8 bit modes or
a combination of them.

However, with priv->caps & SDIO_CAPS_4BIT_ONLY the driver
suddenly assigns priv->buswidth = MMCSD_SCR_BUSWIDTH_4BIT
making it the only way to have the driver working.

Fix this by relaxing the above mentioned restrictions.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
2023-08-30 14:33:32 +08:00
dongjiuzhu1
c983aee38a driver/serial: fix race condition about calling rxflowcontrol in mutli thread
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-08-30 14:33:00 +08:00
dongjiuzhu1
ec4f6ecce2 driver/serial: fix error echo about VT100 escape sequence
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-08-30 14:26:11 +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
chao an
b60f01a55b inode/i_private: remove all unnecessary cast for i_private
Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-29 08:58:07 +02:00
SPRESENSE
f556cb106a drivers/video: Fix an issue isx019 may freeze
isx019 driver freezes by I2C access in the interrupt context.
This I2C access is intended to stop data output from FPGA.
Delete this I2C access for the following reasons.
- Data output from FPGA does not affect power consumption
- There are no problems in capture restart without data output stop
  since restart is done by image data block first.
2023-08-29 13:37:01 +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
dulibo1
127bd81674 regulator:check id conflict when register
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2023-08-29 02:59:59 +08:00
Alan Carvalho de Assis
7f62e315c6 bh1750fvi: Fix compilation error
Error: sensors/bh1750fvi.c:73:16: error: unused function 'bh1750fvi_open' [-Werror,-Wunused-function]
static int     bh1750fvi_open(FAR struct file *filep);
               ^
Error: sensors/bh1750fvi.c:74:16: error: unused function 'bh1750fvi_close' [-Werror,-Wunused-function]
static int     bh1750fvi_close(FAR struct file *filep);
2023-08-28 21:03:19 +03:00
yinshengkai
02d0762c6e driver/note: fix trace dump: dump failed
Exceeding the length limit may cause an error when using sched_note_printf

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-29 00:09:10 +08:00
raiden00pl
8665acaffa lsm9ds1.c: fix printf warnings 2023-08-27 10:05:05 +08:00
raiden00pl
7109fd6121 sensors/Kconfig: fix wrong depends on SN_XXX 2023-08-26 20:00:12 +08:00
SPRESENSE
f7400a857d drivers/audio/cxd56: Move cxd56 sources into arch/cxd56xx
CXD56 audio functions are inside of the CXD56.
So implementation of it should be under arch directory.
2023-08-26 01:20:32 +08:00
ligd
b743d62703 syslog: remove unsed check
To simplify the code

Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-25 17:31:31 +08:00
Jiuzhu Dong
904ca21a00 syslog & ramlog: add BOARDIOC_RESET_CAUSE for syslog & ramlog
cold boot should clear syslog & ramlog buffer

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-25 17:31:31 +08:00