Commit graph

7024 commits

Author SHA1 Message Date
wangchengdong
76dcec8f4b Documentation: Add description for early_syslog()
Add documentation describing the purpose and behavior of early_syslog(),
   which provides a minimal logging facility available during early system
   initialization or system down.

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
2025-10-31 08:29:17 -03:00
wangchengdong
378a827a7a sched/syslog: Add early_syslog() for early boot or system down debugging
Introduce early_syslog() to enable basic logging during the very early
    boot or system down stages, when the full syslog subsystem is not yet
    available.

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
2025-10-31 08:29:17 -03:00
Alan Carvalho de Assis
8cb1fd713e drivers/usbhost_hub: Add support to Multiple TT HS HUB
This is the case for USB2517 USB HUB. Also improved the driver to
avoid mistakes: initially I changed g_id[3], but the in register
there is another field where we need to pass this size again. So
it is better to use ARRAY_SIZE() macro to avoid mistakes.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-10-27 18:24:42 +08:00
wangchengdong
519ffe66d0 sched/sched: Replace nxsched_alarm_tick_expiration()
Introduce a new function nxsched_tick_expiration() to replace
    nxsched_alarm_tick_expiration(). The new function provides a
    common implementation that can be shared by both the alarm
    and timer architectures.

    This change reduces code duplication and provides a unified
    function that can be directly reused.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-10-18 20:07:59 +08:00
chao an
a8af5f3d0e style/spell: fix spell checker error
To make checker happy:

arch/arm/src/sama5/sam_classd.c:997: nd ==> and, 2nd
arch/arm/src/sama5/sam_classd.c:1362: levl ==> level
drivers/sensors/apds9922.c:286: persistance ==> persistence

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-10-17 14:05:02 +08:00
chao an
87f134cfaa sched/sleep: replace all Signal-based sleep implement to Scheduled sleep
Nuttx currently has 2 types of sleep interfaces:

1. Signal-scheduled sleep: nxsig_sleep() / nxsig_usleep() / nxsig_nanosleep()
Weaknesses:
a. Signal-dependent: The signal-scheduled sleep method is bound to the signal framework, while some driver sleep operations do not depend on signals.
b. Timespec conversion: Signal-scheduled sleep involves timespec conversion, which has a significant impact on performance.

2. Busy sleep: up_mdelay() / up_udelay()
Weaknesses:
a. Does not actively trigger scheduling, occupy the CPU loading.

3. New interfaces: Scheduled sleep: nxsched_sleep() / nxsched_usleep() / nxsched_msleep() / nxsched_ticksleep()
Strengths:
a. Does not depend on the signal framework.
b. Tick-based, without additional computational overhead.

Currently, the Nuttx driver framework extensively uses nxsig_* interfaces. However, the driver does not need to rely on signals or timespec conversion.
Therefore, a new set of APIs is added to reduce dependencies on other modules.

(This PR also aims to make signals optional, further reducing the code size of Nuttx.)

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-10-17 14:05:02 +08:00
Alan Carvalho de Assis
6e7f596c83 drivers/lwl: Fix lwl_console.c to support is own up_putc()
After removing stm32_serial.c compilation we need to create a new
up_putc() to be used by syslog.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-10-14 08:36:44 -04:00
yushuailong1
097c594aba video/fb: add FBIOGET_PANINFOCNT ioctl
Add a new ioctl to get the count of paninfo

The framebuffer is usually in high-speed RAM. Getting the paninfo
count can help us get the idle state of the framebuffer so that we
can temporarily use this memory.

Signed-off-by: yushuailong1 <yushuailong1@xiaomi.com>
2025-10-14 17:50:42 +08:00
Jukka Laitinen
1210dc4919 drivers/usbdev/cdcacm: Add a mutex around driver initialize / uninitialize
This protects the driver in case multiple threads are trying to initialize
or uninitialize the cdcacm concurrently.

Note that this only protects the case when the private pointer is not managed
outside the kernel. If someone has acquired the pointer to the driver and uses
that, it also needs to manage the protection itself if needed.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-10-11 00:47:02 +08:00
Jukka Laitinen
2435caa925 drivers/usbdev: Unregister CDCACM by instance number
Add a function to search the cdcacm instance by the devnode
minor number to unregister it

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-10-11 00:47:02 +08:00
chao an
4c7deedd27 sched/clock: remove return value of clock_systime_timespec()
clock_systime_timespec() always returns 0, so there is no need to
check the return value in the caller code, let us remove the return
value directly.

Signed-off-by: chao an <anchao.archer@bytedance.com>
2025-10-10 23:15:27 +08:00
Stepan Pressl
84b0492fbd drivers/1wire/1wire_ds2xxx.h: add the driver for DS2XXX eeproms.
Supports these Maxim/Analog Devices eeproms with a scratchpad:
DS2430,2431,2432,2433,28E04,28E07,28EC20.

For each type of an eeprom, you create a new driver.
Other than that, the driver is file oriented and supports seeks,
for example.

Signed-off-by: Stepan Pressl <pressl.stepan@gmail.com>
2025-10-10 08:55:45 +02:00
Stepan Pressl
d1e1643b84 drivers/1wire: capture scanned roms of onewire_search, standartized ioctls
This commit introduces 2 new fields in the onewire_master_s struct:
uint64_t selected_rom,
uint64_t *available_roms.

The key point behind this is to allow onewire_search to capture all
devices on the bus into the kernel struct. While this commit is keeping
the old API (for the sake of not messing everything up), you don't have
to reimplement the search of all roms in very strange ways
(such as custom callbacks into the userspace).

Instead of that, a generic ioctl (only a function to be called from
the device driver) was implemented, that searches
the bus (for a particular 1wire family), saves it and then copies it
in a standard way to your application. The ioctl is called
ONEWIREIOC_GETFAMILYROMS.

Also as 1wire can interface multiple devices, a API telling the
driver which ROM to interface was missing, this commit fixes
this with the ONEWIREIOC_SETROM call.

The example usage is you first get all the devices on the bus
using ONEWIREIOC_GETFAMILYROMS. In your application, you choose
the correct device you want to talk to. Then you call
ONEWIREIOC_SETROM. And then writes, reads, ...

Signed-off-by: Stepan Pressl <pressl.stepan@gmail.com>
2025-10-10 08:55:45 +02:00
simbit18
ebbb85e0f2 drivers/usbmisc: Aligned Cmake with Make
Add:
- ST standalone USB PD sink controller #14895

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-10-09 18:21:04 -04:00
simbit18
db26ef1bd2 drivers/usbhost: Aligned Cmake with Make
Add:

- Bluetooth HCI Driver #11552

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-10-09 18:20:36 -04:00
simbit18
ff1dc87ccf drivers/usbdev: Aligned Cmake with Make
Add:
- media transfer protocol (MTP) #10620

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-10-09 20:01:30 +08:00
simbit18
ee1b6203c3 drivers/wireless/bluetooth: Aligned Cmake with Make
Add
- bt slip driver #14224

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-10-09 19:22:43 +08:00
simbit18
4442cb7826 drivers/mtd/CMakeLists.txt: Aligned Cmake with Make
Add:
- GD55 QSPI NOR Flash #15523
- nvblk  #16789
- virtual NAND Flash device simulator #11806

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-10-09 08:31:01 +08:00
simbit18
2290999754 drivers/wireless/ieee80211/bcm43xxx/CMakeLists.txt: Aligned Cmake with Make
Add bcm43013, bcm43455  CYW43439 chip #5112 #6430 #6845

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-10-08 15:21:27 -04:00
p-szafonimateusz
a38dc249ed drivers/can/kvaser_pci.c: refactor to use netdev_upperhalf
Refactor kvaser_pci.c to use netdev_upperhalf for SocketCAN interface.

The reason for this change is to simplify the driver code and get rid of
duplicate code that may be shared between other network devices.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-10-08 12:00:06 +02:00
p-szafonimateusz
f84d34a57b drivers/can/ctucanfd_pci.c: refactor to use netdev_uperhalf
refactor ctucanfd_pci.c to use netdev_uperhalf for SocketCAN interface

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-10-01 11:36:26 +08:00
Matteo Golin
504ec6b2c6 arch/udelay: Make common, weak definition of up_*delay functions
Many different architectures re-implemented the exact same code for
`up_*delay` because it was originally written as architecture dependent
code. Busy-waiting can be done regardless of architecture, so this
commit moves that duplicated implementation to a common file with weak
definitions so that individual architectures (see tc32) are still able
to override the definition if needed/desired.

Default implementation is not included if ARCH_TIMER is enabled, since
it is more accurate and provides its own weak definitions to override.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-09-29 09:22:56 +08:00
Matteo Golin
615f1f3f46 drivers/sensors/ms56xx: Replace custom curtime with standard function
The custom implementation of obtaining a timestamp for this driver
returned an unsigned long, which limited the amount of time the driver
could run before roll-over quite significantly (since timestamps are in
microseconds). This change standardizes the driver to use the sensor
driver implementation for timestamps.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-09-26 12:14:32 +02:00
LuchianMihai
95efa6f7cf net/mdio: add mdio bus
Currently the mdio communication is part of the monolithic 'full netdevs'.
This commit serves as an way to add modularity for the netdevs drivers.
A new upperhalf/lowerhalf mdio device comes with this commit that manages the data transfer ofer mdio interface.

Signed-off-by: Luchian Mihai <luchiann.mihai@gmail.com>
2025-09-25 16:24:18 +08:00
simbit18
6e247670f6 drivers/input: Fix Kconfig style
Remove spaces from Kconfig
Add TABs

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-09-17 08:54:58 +08:00
wangchengdong
474835eabe drivers/syslog: let syslog_write() return the maximum bytes writen
In current implementation, when doing syslog_write(), there may
 be more than one channel, the syslog will iterate each channel,
 but only return the bytes writen through the last channel, the
 better way should be returning the maximum bytes writen
 through one channel.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
2025-09-14 11:08:35 -04:00
wangjianyu3
23e5e1b86e mtd/nvs: Save events if not waited
This patch will report events in the following scenarios:

1. Events that have changed but not been waited for before being added to
   the interest list.
2. Events that occur after `epoll_wait()` returns and before it is called
   again.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-09-10 10:54:39 -03:00
wangjianyu3
7e5c970cf2 mtd/nvs: Trigger POLLPRI on config change
Report the POLLPRI event if any configuration is updated.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-09-05 09:33:37 +08:00
michal matias
0f498005f0 drivers/net/oa_tc6: Add driver for the Microchip LAN865x SPI MAC-PHY
Add driver for the LAN865x 10BASE-T1S SPI MAC-PHY.
The driver is a lower-half driver to the OA-TC6 base driver.

Signed-off-by: michal matias <mich4l.matias@gmail.com>
2025-09-03 00:53:03 +08:00
michal matias
fbb3b6d07b drivers/net/oa_tc6: Add driver for the Onsemi NCV7410 (NCN26010) SPI MAC-PHY
Add driver for the Onsemi NCV7410 10BASE-T1S SPI MAC-PHY.
The driver also works for the NCN26010, which is an identical chip.
The driver is a lower-half driver to the OA-TC6 base driver.

Signed-off-by: michal matias <mich4l.matias@gmail.com>
2025-09-03 00:53:03 +08:00
michal matias
95b3b65778 drivers/net: Add base driver for the OA-T6 protocol MAC-PHYs
Add base driver common for OPEN Alliance 10BASE-T1x MAC-PHY Serial Interface (OA-TC6)
protocol SPI MAC-PHYs.

Signed-off-by: michal matias <mich4l.matias@gmail.com>
2025-09-03 00:53:03 +08:00
Zik Saleeba
835c535e18 drivers/ioexpander/aw9523b: New driver for AW9523B i/o expander
This is an I2C driver for the Awinic AW9523B I/O expander. As well
as the supporting usual digital I/Os, this device features the
ability to drive LEDs directly, and can control the drive current
to each LED individually. The driver was derived from the PCA9555
driver, provides all the standard interfaces of an i/o expander
driver. It also features support for the special features of the
AW9523B through pin direction IOEXPANDER_DIRECTION_OUT_LED and
IOEXPANDER_OPTION_NONGENERIC with AW9523B_OPTION_* options.

The driver has a number of configurable features including interrupt
handling and a shadow register mode based on the PCA9555 driver,
plus new LED/dimming support.

Testing was done using an ESP32S3 host and I2C connection to the
Adafruit AW9523 breakout board.

Signed-off-by: Zik Saleeba <zik@zikzak.net>
2025-08-29 09:10:50 -03:00
Tiago Medicci Serrano
585c25bac0 drivers/i2s/i2schar: Implement blocking read/write operations
This commit implements simple (blocking) read and write operations
for the i2schar driver. Although it already contained such methods,
the read/write operation was not being properly handled by the
`i2schar_[rx|tx]callback` (called when the operation has finished).
A semaphore is used to ensure that read data was received by the
receiver and another semaphore ensures that data was written by the
transmitter.

Please note that the already-existing mutex for the I2S peripheral
was replaced by two mutexes, one for the receiver and other for the
transmitter to allow full-duplex communication.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-08-27 11:07:05 +08:00
Tiago Medicci Serrano
6f5a8c6b25 drivers/i2s/i2schar: Implement ioctl commands for i2schar
This commit implements a set of commands to the i2s character
driver. The implemented commands allows getting and setting
parameters like data width, sample rate and number of channels for
both receiver and transmitter. If no ioctl is found, the command
is redirected to the lower driver implementation if it has the
ioctl callback registered.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2025-08-27 11:07:05 +08:00
simbit18
aadb929526 drivers/net/CMakeLists.txt: Aligned Cmake with Make
Add KSZ9477 driver #10503

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-08-27 11:05:32 +08:00
Jani Paalijarvi
e2b1d186d7 drivers/net/ksz9477.c: Errata 16, reset SGMII always on init 2025-08-26 09:10:43 -03:00
Jari Nippula
56870fb0ea ksz9477: MMD indirect access check fix
Instead of verifying MMD indirect access by checking
EEE ADVERTISEMENT register has value 0x6 (which may be changed),
the verification is done by write and check LED MODE register.
1. Backup current LED_MODE register value
2. Write value Single-LED mode (0x10) to LED_MODE
3. Read LED_MODE register and verify it returns value 0x10
4. Write original (backup) value to LED_MODE
2025-08-26 09:10:43 -03:00
Jani Paalijarvi
fcab00d3a8 drivers/net/ksz9477: Implement errata fixes
From the ksz9477 errata, setup the configuration which is tested to work.

- Improve PHY receive performance
- Disable EEE for ports 1-5
- Fix supply current values

Signed-off-by: Jani Paalijarvi <jani.paalijarvi@unikie.com>
2025-08-26 09:10:43 -03:00
Jouni Ukkonen
9b8c8bdd7b drivers/tca64xx: Add support for PCAL6416
- Added new part support for PCAL6416
- Added pullup/pulldown configuration support

Signed-off-by: Jouni Ukkonen <jouni.ukkonen@unikie.com>
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-08-26 09:46:09 +08:00
Jukka Laitinen
710bd199e5 drivers/ioexpander/tca64xx.c: Fix polarity register address
This corrects a copy-paste error; polarity register is tp_polarity, not tp_output

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-08-26 09:46:09 +08:00
Jouni Ukkonen
38fbe166ee drivers/ioexpander/tca64xx: Fix compile errors
- Fix gpioinfo argument type
- Fix unused variable "ret" warning when CONFIG_TCA64XX_INT_POLL is not defined

Signed-off-by: Jouni Ukkonen <jouni.ukkonen@unikie.com>
Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2025-08-26 09:46:09 +08:00
michal matias
4a4235b5a2 drivers/net: Remove the NCV7410 10BASE-T1S MAC-PHY driver
This commit removes existing support for the NCV7410 10BASE-T1S MAC-PHY.
The driver will be replaced by its generalized version with different organization.
The new driver has naming clashes with the old, therefore the old has to be removed first.

Signed-off-by: michal matias <mich4l.matias@gmail.com>
2025-08-25 20:32:35 +08:00
simbit18
95f1cf4748 drivers/spi/CMakeLists.txt: Aligned Cmake with Make
Add iCE40 driver #12012

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-08-22 08:18:50 -03:00
p-szafonimateusz
4ed174a7e0 drivers/can/kvaser_pci.c: configure number of passes in interrupt handler
Configure number of passes in interrupt handler logic to avoid losing RX frames
in QEMU environment.

Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
2025-08-22 15:34:38 +08:00
Niccolò Maggioni
7a2343f1be drivers/analog/ads7046: Add support for ADS7046 ADC
Add support for the Texas Instruments ADS7046 12-bit, SPI-compatible ADC.

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-22 00:29:55 +08:00
simbit18
337c1128db drivers/ioexpander/CMakeLists.txt: Aligned Cmake with Make
Add:

iC-JX driver #11590

ISO1H812G driver #10426

ISO1I813T driver #10435

PCA9557 driver #16042

mcp23008 driver #10532

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-08-21 15:22:50 +08:00
simbit18
50bbad510a drivers/leds/CMakeLists.txt: Aligned Cmake with Make
Add:

KTD2052 led driver

#16217

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-08-21 13:23:41 +08:00
simbit18
d54fb6ad00 drivers/audio/CMakeLists.txt: Aligned Cmake with Make
Add:

fake audio driver

https://github.com/apache/nuttx/pull/15295

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-08-21 13:22:26 +08:00
Niccolò Maggioni
3ba6047e29 drivers/sensors/tmp112: Add support for TMP112 temperature sensor
Add support for the Texas Instruments TMP112 I2C/SMBus digital
temperature sensor. Also add a new defconfig that includes
support for a TMP112 sensor and extend the existing documentation
to include its description.

Signed-off-by: Niccolò Maggioni <nicco.maggioni+nuttx@gmail.com>
2025-08-19 19:45:32 -03:00
simbit18
2b3741d083 drivers: Fix Kconfig style
Remove spaces from Kconfig
2025-08-19 19:44:31 -03:00