Commit Graph

5407 Commits

Author SHA1 Message Date
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
simbit18
8ce16e9bd9 Fix Kconfig style
Remove spaces from Kconfig
2023-08-02 16:57:09 +02:00
yangguangcai
05af311e68 qemu:add qemu rtc driver.
Signed-off-by: yangguangcai <yangguangcai@xiaomi.com>
2023-08-02 03:27:55 -07:00
dongjiuzhu1
e9b22401b9 drivers/sensors/fakegps: support fakegps base on gps driver
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-08-01 23:09:46 -07:00
dongjiuzhu1
2945252b71 sensor/gps: support gps driver model
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-08-01 23:09:46 -07:00
Xiang Xiao
82e76961cd serial: Simplify the echo process
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-01 15:59:28 -03: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
simbit18
1b8714f79f fix incorrect comments
boards/arm/cxd56xx/drivers/sensors/bmi160_scu.c: fix incorrect comments to the Right of Statements.
drivers/sensors/ak09912.c: fix incorrect function description ak09912_putreg8 and ak09912_getreg8
2023-08-01 13:24:16 -04:00
simbit18
34c56139aa drivers/sensors/bmi270.c: fix define BMI270_TEMPERATURE
fix BMI160_TEMPERATURE_0 ->BMI270_TEMPERATURE_0
fix BMI270_TEMPERATURE_1 ->BMI270_TEMPERATURE_1
2023-08-01 18:06:59 +02:00
dongjiuzhu1
917728bad9 driver/ftl: pass the number of eraseblock for ftl_get_cblock
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-31 22:22:25 -07:00
Petro Karashchenko
effb0a1cad drivers: restore C89 compatibility by avoiding binary constants
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-07-31 18:56:40 -07:00
Petro Karashchenko
f3b5465969 drivers: remove redundant parentheses
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-07-31 18:56:40 -07:00
Michal Lenc
1fb65e18d2 w25.c: enable support for W25QxxxJV NOR flash memories
W25QxxxJV NOR memories are backward compatible with older Winbond´s
generations and thus can also be supported here. This essentially brings
the support for generic SPI to W25QxxxJV memories as w25qxxxjv.c file only
supports QSPI communication.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-07-31 05:46:57 -07:00
Bowen Wang
835a2a8801 watchdog: add CONFIG_WATCHDOG_PANIC_NOTIFIER for panic notifier
wdog_notifier() will be called in _assert to keep the crash scene
as mush as possible, which is useful for debug.

But once disable the watchdog, the hardware watchdog can not reboot
the system too. If a crash happened in the _assert (e.g. the tcb sp
has been corrupted, system will crash again in tack stack dump),
system will crashing forever and can not reboot.

So add a config to disable this feature by default and can be enable
if anyone need it.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
2023-07-31 14:45:18 +02:00
SPRESENSE
4b966aa1e7 drivers/video: Fix returned errno in error cases
When the value that is out of range is specified in ioctl(VIDIOC_S_CTRL) and
ioctl(VIDIOC_S_EXT_CTRLS), returned value should be not EINVAL but ERANGE.
2023-07-31 03:28:54 -07:00
SPRESENSE
2d2c3eb2cf drivers/video: Initialize flags member of query control APIs
video driver does not support flags member of ioctl(VIDIOC_QUERYCTRL)
and ioctl(VIDIOC_QUERY_EXT_CTRL).
But, ioctl returns with the flags member that has the garbage value.
Add initialization of flags member to avoid return of the garbage value.
2023-07-31 02:56:10 -07:00
Xiang Xiao
fc5e85da1b drivers: Format pointer through "%p" for kthread_create
to remove the unnecessary cast and unify the usage

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-07-30 23:40:59 +03:00
chenrun1
c267791f06 driver/mtd/ftl: Modify erasure result processing error issue
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-07-30 12:40:30 -07:00
simonatoaca
9794dc118f drivers: Added support for BME680
drivers/sensors/bme680.c: The bme680 driver
sensor.h: Added new type of sensor (Gas) to be used for retrieving the bme680 data
esp32/common/src/esp32_bme680.c: bme680 support on esp32
esp32/esp32-sparrow_kit/esp32_bringup.c: added support for the bme680
esp32/esp32-sparrow-kit/configs/nsh/defconfig: fixed defconfig ci problem

Signed-off-by: simonatoaca <simona.alexandra2000@gmail.com>

esp32-sparrow-kit: Fixed defconfig

Signed-off-by: simonatoaca <simona.alexandra2000@gmail.com>

Code is now C89 compatible

Signed-off-by: simonatoaca <simona.alexandra2000@gmail.com>

Reused already defined sensor data structs by registering every sub-sensor separately

Signed-off-by: simonatoaca <simona.alexandra2000@gmail.com>

Implemented suggestions

Signed-off-by: simonatoaca <simona.alexandra2000@gmail.com>
2023-07-29 17:47:23 -03:00
dongjiuzhu1
dcf3f9de75 driver/mtd/ftl: support to skip bad block for earse/bread/bwrite
1.support to use dd commond to burn romfs image to nand flash
2.support bare-write nand flash device without file system

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-07-29 17:46:14 -03:00
yuexinyi
326cf2bf88 drivers/video: add new video driver register api to support multi instance
Signed-off-by: yuexinyi <yuexinyi@xiaomi.com>
2023-07-29 07:42:29 -07:00