Commit graph

7000 commits

Author SHA1 Message Date
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
simbit18
d3d1f67198 drivers/analog/CMakeLists.txt: Aligned Cmake with Make
Add:

Texas Instruments ADS1115

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-08-19 19:07:30 -03:00
lipengfei28
1013faac30 pci: epf test default a function
Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2025-08-16 19:49:08 +08:00
Côme
25fe6b0749 Update capture.c 2025-08-12 20:21:14 +08:00
Côme VINCENT
a4b17a2d14 arch/stm32h7: Fix timer capture
This patch fixes an incorrect call to stm32_cap_initialize() in
stm32_bringup.c: the call was made without the channel parameter.
Instead of adding the channel in the call, the channel is selected by
stm32_cap_gpio() (first available channel).

This patch also fixes incorrect driver registration in
drivers/timers/capture.c: the driver was registered with the wrong
name (/dev/cap -> /dev/capture). Also added more error checking in
cap_register_multiple().

Signed-off-by: Côme VINCENT <44554692+comejv@users.noreply.github.com>
2025-08-12 20:21:14 +08:00
Matteo Golin
41eaa50a58 drivers/sensors/lis2mdl: Increase buffer size
The ODR of this sensor is too high to have a buffer size of 1.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-08-08 14:50:19 -04:00
Matteo Golin
7d9d59f069 drivers/sensors/lsm6dso32: Increase buffer size
The ODR of this device is too high to only have a buffer size of 1.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-08-08 14:50:19 -04:00
Matteo Golin
4845eadaa9 drivers/l86xxx: Mutex fixes & performance improvements
Fix mutex locking bugs and improve performance. Fix interval no longer
set statically since it is available via `set_interval` uORB function.
Activation/deactivation no longer triggers standby/hotstart since this
functionality was very unstable.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-08-08 14:49:49 -04:00
Côme VINCENT
2771df6250 arch/arm/stm32h7: Port timer capture driver from stm32
This commit introduces a timer capture driver for the STM32H7 series
ported from the STM32 F series.

The main changes include:
- A new generic timer capture driver for STM32H7.
- A lower-half driver to integrate with the NuttX capture subsystem.
- Kconfig options to enable and configure capture for various timers.
- Pin definitions for TIM1-4 capture inputs on the nucleo-h743zi.
- An update to `cap_register_multiple` to handle multiple device registration.
- An update to `stm32_bringup` to register the capture drivers.

The current implementation is based on a driver originally for PWM input,
and as such, it calculates duty cycle and frequency. It is also limited
to a single capture channel per timer.

The original implementation's `stm32_cap_init` in
`arch/arm/src/stm32h7/stm32_capture.c` has been modified to accept a
channel number instead of using a hardcoded 0 through
`STM32_CAP_CHANNEL_COUNTER`.

This serves as a foundation for future development of more comprehensive
input capture capabilities on STM32H7 platforms.

Tested by polling and reading `/dev/cap0-4` with
`ioctl(fds[i], CAPIOC_FREQUENCE, freq)` while sending a square wave signal to
appropriate pins and checking frequency.

Also tested by bypassing upper half driver and setting up capture on
TIM4 channels 1-4 as explained in #16762.

Signed-off-by: Côme VINCENT <44554692+comejv@users.noreply.github.com>
2025-08-07 10:46:39 -03:00
Michal Lenc
1c1b814a9a drivers/syslog/syslog_channel.c: fix incompatible-pointer-types compile errors
Use typedef syslog_channel_t instead of struct syslog_channel_s.

CC:  dirent/lib_telldir.c syslog/syslog_channel.c:151:3: error: initialization of ‘int (*)(const syslog_channel_t *, int)’ {aka ‘int (*)(const struct syslog_channel_s *, int)’} from incompatible pointer type ‘int (*)(struct syslog_channel_s *, int)’ [-Wincompatible-pointer-types]
  151 |   syslog_cdcacm_putc,
      |   ^~~~~~~~~~~~~~~~~~
syslog/syslog_channel.c:151:3: note: (near initialization for ‘g_cdcacm_channel_ops.sc_putc’)
syslog/syslog_channel.c:152:3: error: initialization of ‘int (*)(const syslog_channel_t *, int)’ {aka ‘int (*)(const struct syslog_channel_s *, int)’} from incompatible pointer type ‘int (*)(struct syslog_channel_s *, int)’ [-Wincompatible-pointer-types]
  152 |   syslog_cdcacm_putc,
      |   ^~~~~~~~~~~~~~~~~~
syslog/syslog_channel.c:152:3: note: (near initialization for ‘g_cdcacm_channel_ops.sc_force’)
syslog/syslog_channel.c:154:3: error: initialization of ‘ssize_t (*)(const syslog_channel_t *, const char *, size_t)’ {aka ‘int (*)(const struct syslog_channel_s *, const char *, unsigned int)’} from incompatible pointer type ‘ssize_t (*)(struct syslog_channel_s *, const char *, size_t)’ {aka ‘int (*)(struct syslog_channel_s *, const char *, unsigned int)’} [-Wincompatible-pointer-types]
  154 |   syslog_cdcacm_write,
      |   ^~~~~~~~~~~~~~~~~~~
syslog/syslog_channel.c:154:3: note: (near initialization for ‘g_cdcacm_channel_ops.sc_write’)
syslog/syslog_channel.c:155:3: error: initialization of ‘ssize_t (*)(const syslog_channel_t *, const char *, size_t)’ {aka ‘int (*)(const struct syslog_channel_s *, const char *, unsigned int)’} from incompatible pointer type ‘ssize_t (*)(struct syslog_channel_s *, const char *, size_t)’ {aka ‘int (*)(struct syslog_channel_s *, const char *, unsigned int)’} [-Wincompatible-pointer-types]
  155 |   syslog_cdcacm_write
      |   ^~~~~~~~~~~~~~~~~~~
syslog/syslog_channel.c:155:3: note: (near initialization for ‘g_cdcacm_channel_ops.sc_write_force’)
syslog/syslog_channel.c:243:3: warning: excess elements in array initializer
  243 |   &g_cdcacm_channel
      |   ^
syslog/syslog_channel.c:243:3: note: (near initialization for ‘g_syslog_channel’)

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-08-07 10:16:20 -03:00
Theodore Karatapanis
9970e6a54e drivers/misc/optee: Add error conversion from errno to TEE errors
This commit simplifies sending errors back to OP-TEE and avoids
code duplication when handling errno values.

Signed-off-by: Theodore Karatapanis <tkaratapanis@census-labs.com>
2025-08-06 02:29:33 +08:00
Theodore Karatapanis
707cdaf42e drivers/misc/optee: Expanded RPC support.
This commit expands RPC support for the OP-TEE driver using 2 files:
1) drivers/misc/optee_rpc.c
   * Add support for RPCs that can be handled directly by the kernel.
   * Can delegate RPC handling to optee_supplicant.c for RPCs that
     need userspace interaction.
2) drivers/misc/optee_supplicant.c
   * Enable communication between the userspace TEE supplicant and the
     kernel driver.

Additional changes were needed to the following files:
1) drivers/misc/optee.c
   * Add ioctls used SOLELY by the userspace TEE supplicant.
   * Register /dev/teepriv0 if the supplicant is enabled in Kconfig
   * Add OPTEE_ROLE_CA and OPTEE_ROLE_SUPPLICANT conditionals to
     differentiate paths, between a normal Client Application (CA)
     and the TEE supplicant.
   * Change some functions from static to "public" to reuse them
     in other C files.
   * Adjust optee_to/from_msg_param() to work with RPCs.

2) drivers/misc/optee_smc.c
   * Call the RPC handler from optee_rpc.c

3) drivers/misc/optee_msg.h
   * Add definition needed for RPCs

4) drivers/misc/tee.h
   * Add ioctl definitions
   * Add TEE_SHM_SUPP flag, checked when unregistering supplicant
     memory.

5) Documentation/guides/optee.rs
   * Add documentation for RPCs and the supplicant.

6) drivers/misc/{CMakeLists.txt, Make.defs}
   * Account for the new files.

7) drivers/misc/Kconfig
   * Add DEV_OPTEE_SUPPLICANT option to enable/disable the supplicant
     driver.

Signed-off-by: Theodore Karatapanis <tkaratapanis@census-labs.com>
2025-08-06 02:29:33 +08:00
Theodore Karatapanis
95ca3e7ca5 drivers/misc/optee: Add mmap shm op + remove memfd
The previous approach with memfd has 3 problems:
1) The close operation on the memfd isn't tied with optee_shm_close,
   therefore close(fd) doesn't free the optee_shm struct allocated
   by the kernel.

2) The kernel unnecessarily maps the file descriptor to its memory,
   however only userspace should need to do that.

3) Since the kernel doesn't need to map the file descriptor we
   don't need to unmap it.

To use anonymous mapping, the prototype of map_anonymous() was
moved from fs/mmap/fs_anonmap.h to include/nuttx/fs/fs.h. Since
fs_anonmap.h didn't contain any other information it is deleted.

A type from fs/mmap/fs_rammap.h was moved to the public :
include/nuttx/fs/fs.h as well.

Signed-off-by: Theodore Karatapanis <tkaratapanis@census-labs.com>
2025-08-06 02:29:33 +08:00
Theodore Karatapanis
cbdd3ac39b drivers/misc/optee: Add virtual and physical address to sturct optee_shm
The VA -> PA translation must be performed once, at allocation time,
while the caller's virtual address space is known. If a second process
later tries to translate the same VA from a different mapping, the
calculated physical address can be wrong.

Signed-off-by: Theodore Karatapanis <tkaratapanis@census-labs.com>
2025-08-06 02:29:33 +08:00
Laczen JMS
c506c25f19 drivers/mtd: introduce nvblk
NVBLK provides a block device that operates on top of a non volatile
memory (as a mtd device) that enables wear levelling for non volatile
memory. It's operation is similar to the dhara wear levelling library,
but nvblk is meant to be used on smaller (nor, mram, rram) memory.

I am also the author and maintainer of the nvblk library.

A block device can be created during startup by using:
```
nvblk_initialize(0, mtd, CONFIG_MTD_NVBLK_DEFAULT_LBS,
                         CONFIG_MTD_NVBLK_DEFAULT_IOBS,
                         CONFIG_MTD_NVBLK_DEFAULT_SPEB);
```
and a fat filesystem on top of this as:
```
nsh> mkfatfs /dev/mtdblock0
nsh> mount -t vfat /dev/mtdblock0 /mnt
```
this fat filesystem can then be used:
```
nsh> echo "test" > /mnt/test.txt
nsh> cat test.txt
test
nsh>
```

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2025-08-06 01:53:56 +08:00
George Poulios
c78e5b983a drivers/misc/optee_smc: Fix sched_yield() on flat builds
Previous change that introduced yielding upon OP-TEE
return with reason foreign interrupt, omitted to include
<sched.h>. This worked on kernel builds, but not on flat
builds. Include it.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-08-03 13:00:47 -03:00
wangjianyu3
8c32bed29e drivers/sensors/gnss: Skip copying extended satellite flags
The extended member `flags` of `info` of `struct sensor_gnss_satellite` is not parsed from GSV.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2025-08-03 10:41:06 +08:00
lipengfei28
4fa6d4b791 drivers/pci: epc add dma heap
The PCI inbound address space and the CPU cache need to maintain cache coherence

Signed-off-by: lipengfei28 <lipengfei28@xiaomi.com>
2025-08-01 20:47:43 +08:00
George Poulios
199c301a8e drivers/misc/optee_smc: Explicitly yield during NW interrupts
CPU heavy OP-TEE calls would starve the Normal World tasks.
OP-TEE foreign interrupts were delivered to NW but we would
resume OP-TEE immediately without giving any potentially
unblocked tasks a chance to run. This would violate real-
time guarantees. Fix that by calling sched_yield() during
OP-TEE return with reason foreign interrupts.

Signed-off-by: George Poulios <gpoulios@census-labs.com>
2025-07-31 09:14:34 -03:00
jianglianfang
b7156384d1 video: add sched_note_mark at fb_remove_paninfo and fb_notify_vsync
fb_notify_vsync is called when TE irq comming, and fb_remove_paninfo is called after paninfo comsumed

Signed-off-by: jianglianfang <jianglianfang@xiaomi.com>
2025-07-30 02:50:21 +08:00
Alan Carvalho de Assis
934b7b4bf5 drivers/lcd/st7735: Don't define st7735_rdram if write only mode
Signed-off-by: Alan C. Assis <acassis@gmail.com>
2025-07-29 08:18:30 -03:00
Matteo Golin
b0760dceb6 drivers/sensors/l86xxx: Use uORB GNSS lower-half
Changes the implementation of the L86xxx driver to use the
gnss_lowerhalf driver implementation, simplifying this driver's logic.
It also fixes the `read_line` function which would early return on `\r`,
as well as adding some retries for response checking and better mutex
locking.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-07-28 10:46:55 +02:00
Matteo Golin
da72df9ab6 drivers/sensors/l86xxx: Fix kernel crashes on failed registration
Sometimes this driver will boot when the serial port is of the wrong
baud rate, and it cannot set the correct baud rate or verify
communication. This commit prevents registration if any settings fail to
be set, and also prevents the kernel thread from setting the L86 to
enabled (this is done only by the uORB upper half).

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2025-07-25 10:48:55 +08:00
simbit18
d7a05dfcc6 drivers/segger: Add a kconfig to override Segger SystemView target sources version
update:
    CMakeLists.txt
    Make.defs
    Kconfig

It allows the same version of SystemView target sources to be used for CMake and Make, to avoid discrepancies in the future.

Signed-off-by: simbit18 <simbit18@gmail.com>
2025-07-22 23:21:31 +08:00
Michal Lenc
e96ef8abe3 drivers/ioexpander/icjx.c: reconfigure icjx after undervoltage
According to a reference manual, VCC and VDD undervoltage
and VDD burst leads to the reset of all registers.
Therefore we have to reconfigure the expander to make
it functional again.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-07-18 12:08:39 -03:00