Commit Graph

5427 Commits

Author SHA1 Message Date
dulibo1
1456919e58 regulator:support lp mode and auto pm register
1.add new intf regulator_set_mode to manual set rehulator lower power mode;
2.when add auto lp desc,the regulator lp mode is controlled by  pm framework;

Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2023-08-10 23:17:51 +08:00
dulibo1
935359fa3f regulator: support link to supply
when add supply desc,the regulator is linked to the parent regulator
1.if enable the regualtor, the parent regulator is enabled
2.if disable all child regulator, the parent regualtor is disabled

Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2023-08-10 23:17:51 +08:00
dulibo1
67aa12e762 regulator:support always on
when add always on desc,the regulator is always enabled

Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2023-08-10 23:17:51 +08:00
zhanghu5
5890fde1ed drivers/input: Implement the debounce in button_upper.c
use delay configurable watchdog to implement debounce

Signed-off-by: zhanghu5 <zhanghu5@xiaomi.com>
2023-08-10 23:14:26 +08:00
yintao
26f996b927 nuttx/input: fix uinput_rpmsg_device_destroy crash
Signed-off-by: yintao <yintao@xiaomi.com>
2023-08-10 23:13:40 +08:00
wangbowen6
9aa57b6c53 virtio: add virtio framework in NuttX
1. virtio devics/drivers match and probe/remote mechanism;
2. virtio mmio transport layer based on OpenAmp (Compatible with both
   virtio mmio version 1 and 2);
3. virtio-serial driver based on new virtio framework;
4. virtio-rng driver based on new virtio framework;
5. virtio-net driver based on new virtio framework
   (IOB Offload implementation);
6. virtio-blk driver based on new virtio framework;
7. Remove the old virtio mmio framework, the old framework only
   support mmio transport layer, and the new framwork support
   more transport layer and this commit has implemented all the
   old virtio drivers;
8. Refresh the the qemu-arm64 and qemu-riscv virtio related
   configs, and update its README.txt;

New virtio-net driver has better performance
Compared with previous virtio-mmio-net:
|                        | master/-c | master/-s | this/-c | this/-s |
| :--------------------: | :-------: | :-------: | :-----: | :-----: |
| qemu-armv8a:netnsh     |  539Mbps  |  524Mbps  | 906Mbps | 715Mbps |
| qemu-armv8a:netnsh_smp |  401Mbps  |  437Mbps  | 583Mbps | 505Mbps |
| rv-virt:netnsh         |  487Mbps  |  512Mbps  | 760Mbps | 634Mbps |
| rv-virt:netnsh_smp     |  387Mbps  |  455Mbps  | 447Mbps | 502Mbps |
| rv-virt:netnsh64       |  602Mbps  |  595Mbps  | 881Mbps | 769Mbps |
| rv-virt:netnsh64_smp   |  414Mbps  |  515Mbps  | 491Mbps | 525Mbps |
| rv-virt:knetnsh64      |  515Mbps  |  457Mbps  | 606Mbps | 540Mbps |
| rv-virt:knetnsh64_smp  |  308Mbps  |  389Mbps  | 415Mbps | 474Mbps |
Note: Both CONFIG_IOB_NBUFFERS=64, using iperf command, all in Mbits/sec
      Tested in QEMU 7.2.2

Signed-off-by: wangbowen6 <wangbowen6@xiaomi.com>
Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
2023-08-10 03:39:39 +08:00
chao an
d010744582 drivers/pipes: use circbuf to refine buffer model
Signed-off-by: chao an <anchao@xiaomi.com>
2023-08-10 03:33:56 +08:00
jinxudong
571f52c9d3 feature: sensor: add force sensor
A sensor of this type measures the force on it, and additionally
compares the force with one or more specified thresholds. The sensor
can output the force value directly. Moreover, it's usually applied
as a press key. In that case, when it detects a force greater than
some given threshold, a corresponding event is reported.

Signed-off-by: jinxudong <jinxudong@xiaomi.com>
2023-08-09 21:57:58 +08:00
yangsen5
ce9f40aeb6 drivers/video: add nuttx goldfish camera driver
Signed-off-by: yangsen5 <yangsen5@xiaomi.com>
2023-08-09 18:30:11 +08:00
Petro Karashchenko
1651bb476c c89: move variable declaration out from the for loop
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-08-08 11:58:29 -03:00
Petro Karashchenko
1b0baa8337 nuttx: use lib_free for memory de-allocation after strdup or asprintf
The memory allocated with strdup and asprintf is done via lib_malloc
so we need to use lib_free to deallocate memory otherwise the assertion
"Free memory from the wrong heap" is hit with flat mode and user separated
heap enabled mode.

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-08-08 11:58:29 -03:00
Petro Karashchenko
b3d620152e Revert "Don't call lib_free in the kernel code"
This reverts commit 7884c18620.
2023-08-08 11:58:29 -03:00
zhangyuan21
5af40a6fa4 composite: add COMPOSITE_DEVICES config for composite device
Add COMPOSITE_DEVICES configuration so that external composite
devices can also know the maximum number of supported classes.
The default COMPOSITE_DEVICES number is 8.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-08-08 19:25:57 +08:00
zhangyuan21
dc0b0d6b4c composite: Use the correct USB dual-speed descriptor when enabling IAD
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-08-08 17:01:41 +08:00
xucheng5
23d4263207 driver/mtd_config: just query when data is null or len is zero
Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
2023-08-07 05:45:56 -07:00
xucheng5
da9b05cc33 driver/mtd_config_fs: just query when data is null or len is zero
Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
2023-08-07 05:45:56 -07:00
xucheng5
860571471d driver/mtdconfig_fs : return -ENOENT when delete non-existed key
Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
2023-08-07 01:15:15 -07:00
xucheng5
d0a2fa626a driver/mtd_config : add mtdconfig_register_by_path()
Signed-off-by: xucheng5 <xucheng5@xiaomi.com>
2023-08-07 01:08:24 -07:00
zhangyuan21
98fba71998 usbadb: add usbadb boardctl
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-08-07 11:23:36 +08:00
zhangyuan21
419207d23d adb: Use composite devices as universal devices
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-08-07 11:23:36 +08:00
zhangyuan21
f52f04e131 composite: return ok when host send a duplicate setconfig message
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-08-07 11:23:36 +08:00
zhangyuan21
fe6b0619f9 usbdev: Use composite devices as universal devices
The enumeration process for composite and non-composite devices
has a lot of duplicate code. Treating the code for composite
devices as universal enumeration code can reduce redundant code.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-08-07 11:23:36 +08:00
Xiang Xiao
7884c18620 Don't call lib_free in the kernel code
since kernel just allocate memory from kmm_malloc

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-06 06:51:24 -03:00
Brennan Ashton
46b0f6d6ee fdt: Add initial FDT support and procfs for userspace export
VELAPLATFO-12536

This provides the initial hooks for Flattened Device Tree support
with QEMU RV. It also provides a new procfs file that exposes the
fdt to userspace much like the /sys/firmware/fdt endpoint in Linux.
See https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-firmware-ofw

Nodes in the fdt are not yet usable by the OS.

Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
Signed-off-by: liaoao <liaoao@xiaomi.com>
2023-08-05 12:41:06 -07:00
yinshengkai
a6fcb0a5a9 fs: add pipe type support to inode
Both the device and the pipe used the FSNODEFLAG_TYPE_DRIVER type before,
and now add an independent pipe type

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-05 06:32:50 -07:00
yinshengkai
72de29422a drivers/noteram: noteram support multiple instances
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-04 06:48:48 -07:00
yinshengkai
3ab4d4a113 drivers/noteram: reduce global variable references
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-04 06:48:48 -07:00
yinshengkai
2168b744ca drivers/noteram: change ni_buffer to point
ni_buffer is defined in the initialized structure, put it in the data segment, it will increase the flash size

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-08-04 06:48:48 -07:00
sunkun3
e872610071 usbdev-composite: In the device descriptor, 0xEF means use of IAD
Signed-off-by: sunkun3 <sunkun3@xiaomi.com>
2023-08-04 10:58:50 +02:00
sunkun3
1b0ab4c0f7 usbdev-composite: The maximum number of composite devices supported is changed to 8
Signed-off-by: sunkun3 <sunkun3@xiaomi.com>
2023-08-04 10:58:50 +02:00
sunkun3
324402ed30 usbdev-composite: fix enumeration error for 192 bytes desc
when the size of the usb configuration descriptor
is a multiple of 64 integers, only for this size less than wlength,
host do need send ZLP

Signed-off-by: sunkun3 <sunkun3@xiaomi.com>
2023-08-04 10:58:50 +02:00
sunkun3
9f19a333d2 usbdev/cdcacm: Logic error handled in USB_REQ_SETINTERFACE.
config value changed after resetconfig was executed
endpoint will stay disable state after setinterface cmd

Signed-off-by: sunkun3 <sunkun3@xiaomi.com>
2023-08-04 10:58:50 +02:00
dinglongfei
8520a40866 usb:When the adbd task is running, the usb uninstall process will panic in the adbd task, because the memory of the adb driver has been freed.
unbind will call the adb_char_on_connect interface to wake up the adbd task,
adbd will then access the adb device and fail to return, at this time it will
close the adb device, we can do the final memory release operation in the
second unbind

Signed-off-by: dinglongfei <dinglongfei@xiaomi.com>
2023-08-04 10:58:50 +02:00
zhangyuan21
602d5974c8 usbdev: move usbdev_req function to common code
Move usbdev_req function to common code, Reduce duplicated code.

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-08-03 22:46:25 -07:00
yangsen5
d8ca744052 drivers/video: video driver supports NV12
Signed-off-by: yangsen5 <yangsen5@xiaomi.com>
2023-08-03 22:37:53 -07:00
rongyichang
9e4a9fe32b drivers/fb: add fboverlay pandisplay & display area ioctl
1. support doublebuffer swtich for overlay layer
2. Add display area ioctl to scale the active area of the overlay layer
   to a specific region on the LCD through hardware.

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2023-08-03 10:57:14 -07:00
ligd
83a3b969a3 rptun: fix use after free caused by API wrong order
remove list delete from rptun_dev_stop

Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-03 10:53:49 -07:00
ligd
2fae0af914 rptun: metal_init only call once
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-03 10:53:49 -07:00
ligd
bfe962ce2c pm: fix second time add wakelock dq caused error
Signed-off-by: ligd <liguiding1@xiaomi.com>
2023-08-03 10:16:41 -07: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
jianglianfang
b14cb6ccb4 driver/fb: fix that vtable.priv is not freed when fb register failed.
The vtable.priv is better to be assigned after fb is registered sucessfully.

Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2023-08-03 03:10:34 -07:00
anjiahao
ebecd81de7 1wrie:fix typo
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-08-03 00:06:24 -07:00
Lee Lup Yuen
b2c1930825 serial/uart_16550: Wait before setting Line Control Register (Synopsys DesignWare 8250)
Some UART Controllers (Synopsys DesignWare 8250) will trigger spurious interrupts when the Line Control Register (LCR) is set while the UART is busy. This patch provides the option (16550_WAIT_LCR) to wait for UART until it's not busy, before setting the LCR. (16550_WAIT_LCR is disabled by default)

This patch fixes the spurious UART interrupts for the upcoming port of NuttX to StarFive JH7110 SoC (with Synopsys DesignWare 8250 UART). [The patch is explained here](https://lupyuen.github.io/articles/plic#appendix-fix-the-spurious-uart-interrupts)

drivers/serial/uart_16550.c: If 16550_WAIT_LCR is enabled, wait until UART is not busy before setting LCR

include/nuttx/serial/uart_16550.h: Define the UART Status Register (USR) for checking if UART is busy

drivers/serial/Kconfig-16550: Added option 16550_WAIT_LCR to 16550 UART Config, disabled by default
2023-08-03 08:38:07 +02:00
fangxinyong
7e90855d76 drivers/pipe: implement pipe mmap just return ENODEV
The fd of pipe type is not supported by mmap, mmap() shall failed
with ENODEV. If pipe mmap is not implemented, mmap will forward to
rammap() and get unexpected error.

Implement pipe mmap just return ENODEV. That is to pass LTP posix
test case mmap/23-1.c

https://pubs.opengroup.org/onlinepubs/9699919799/functions/mmap.html

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2023-08-02 22:57:28 -07:00
zhangyuan21
0cb8fdfe83 usbdev: set ep0 priv only not define CONFIG_USBDEV_COMPOSITE
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-08-02 17:42:28 -03:00
zhangyuan21
9893bfd45a rndis: fixed wrong incorrect macro definition
Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
2023-08-02 17:42:28 -03:00
raiden00pl
3fb378a54d note_initialize.c: add debug messages 2023-08-02 08:05:37 -07:00
raiden00pl
dbc28cbf75 note_sysview.c: note_sysview_initialize should return error value 2023-08-02 08:05:37 -07:00
raiden00pl
7f6cb66dc0 note_driver.c: fix warning
CC:  note/note_driver.c note/note_driver.c:180:19: warning: 'g_note_lock' defined but not used [-Wunused-variable]
  180 | static spinlock_t g_note_lock;
      |
2023-08-02 08:05:37 -07:00