Commit Graph

5632 Commits

Author SHA1 Message Date
Philippe Leduc
98b15b1409 Cleanup interface and a4988 implementation
Change step frequency from step/ms to step/s
Add DRV8825 stepper driver
2023-10-16 08:55:53 +08:00
chenrun1
73ca090ab9 filemtd:Fix teardown return error number EINVAL
In previous versions, during the teardown phase, the "open_blockdriver" would call the "mtd proxy" causing the "file mtd" node to be registered in the ftl. " node is registered in ftl.
Therefore, we changed the behavior to find the corresponding inode by node name.

Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
2023-10-15 01:29:12 +08:00
Philippe Leduc
095c32b0eb Add a stepper generic upperhalf driver
Add a stepper A4988 lowerhalf driver
2023-10-14 12:28:41 -04:00
Xiang Xiao
f196d108bf drivers/note: Change 0/1 to false/true
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-10-13 14:38:51 -04:00
liqinhui
d27ca03b6c wifi/simdriver: Support the sim wifi.
Add the Sim WiFi function, which can provide the wifi operating on nuttx sim emulator,
  and support two modes that simulate wifi, HWSIM and RNC(real network card).

 - In the HWSIM mode, we simulates two wlan interfaces. The wlan0 is STA and
   the wlan1 is AP. The wlan0 can connect to the wlan1 in the nuttx simulator.
 - In the RNC mode, we can use the same wlan interface name on the nuttx simulator
   to control the connection behavior of the real wireless card.

Signed-off-by: liqinhui <liqinhui@xiaomi.com>
2023-10-12 17:08:25 +08:00
hujun5
061be5f18e refine: move BIT Macro to nuttx/bits.h
The BIT macro is widely used in NuttX,
and to achieve a unified strategy,
we have placed the implementation of the BIT macro
in bits.h to simplify code implementation.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-10-12 14:52:56 +08:00
hujun5
4967de8621 ramlog: remove sched_[un]lock and rl_nwaiters
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-10-12 10:14:59 +08:00
yinshengkai
9c59ee7c58 note: optimize note performance and reduce lib_sprintf calls
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-10-12 00:15:14 +08:00
hujun5
66fa229fcc Fix some typos in comments
Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-10-11 08:14:49 +02:00
Xiang Xiao
28dee592a3 video/fb: Add fb_register_device
so the user could register fb device directly instead
go through the sequence of up_fbinitialize/up_fbgetvplane

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-10-09 13:18:36 +03:00
laoniaokkk
aec0271e48 max31865:RTD-to-Digital Converter 2023-10-06 21:15:21 +08:00
Xiang Xiao
414491e340 pm: Let PM_PROCFS depend on FS_PROCFS_REGISTER
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-10-02 14:30:18 -04:00
raiden00pl
c52188f0bf drivers/foc/foc_dummy.c: update dummy device state only if dev opened
This is fix for seg fault for sim/foc configuration
2023-10-02 23:33:05 +08:00
yinshengkai
ddb87d3b86 clock: replace all up_perf_xx with perf_xx
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-10-02 16:11:43 +02:00
raiden00pl
6865697b70 sensors: SENSORS_BMI270_LOAD_FROM_HEAP equals ARCH_DMA_NO_FLASH_TRANSFER 2023-09-29 21:04:02 +08:00
raiden00pl
4db39d7afd drivers/rtt: make RTT console optional 2023-09-29 13:00:06 +08:00
Daniel P. Carvalho
024bdcbca0 Fixes compilation warnings. 2023-09-29 12:57:58 +08:00
Xiang Xiao
a37759a6a9 drivers/ioexpander: Add const to the value array of multiwritepin
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-28 10:09:51 +08:00
Xiang Xiao
e499c6c1c7 drivers/ioexpander: Add const to the pin array
forget in patch: https://github.com/apache/nuttx/pull/9529

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-28 10:09:51 +08:00
likun17
f99b1a41a3 nuttx/drivers: add regmap subsystems support.
regmap: add i2c and spi bus support.

Signed-off-by: likun17 <likun17@xiaomi.com>
2023-09-27 00:46:51 +08:00
Xiang Xiao
ee3d2d1c0d video/goldfish: Remove the vsync residual code
forget from patch:
commit bbf5b0bb6d
Author: jianglianfang <jianglianfang@xiaomi.com>
Date:   Tue Aug 15 19:47:14 2023 +0800

    driver/video: adapting Goldfish FB to VSync optimized FB driver

    The circbuf part is implemented by the fb driver, and goldfish needs to
    delete the part related to circbuf and adapt to the interface of the fb
    driver.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-26 22:51:12 +08:00
Xiang Xiao
f02ad03124 Fix error: 'mmcsd_general_cmd_read' defined but not used
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-26 00:45:50 +03:00
wanggang26
50cad1536d emmc: add get emmc cid register interface.
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2023-09-25 23:29:34 +08:00
shipei
f99f67378d audio:add state sync for virtio snd device
qemu host virtio device don't support recvice the same cmd like start/stop twice
Signed-off-by: shipei <shipei@xiaomi.com>
2023-09-25 21:04:59 +08:00
yintao
2a1f1041fd driver/sensors: fix sensor_rpmsg_ns_unbind_cb crash
==2787216==ERROR: AddressSanitizer: heap-use-after-free on address 0xf4702448 at pc 0x0136c544 bp 0x9f54d358 sp 0x9f54d348
READ of size 4 at 0xf4702448 thread T0

0 0x136c543 in rpmsg_destroy_ept open-amp/lib/rpmsg/rpmsg.c:357
1 0x1252b29 in sensor_rpmsg_ns_unbind_cb sensors/sensor_rpmsg.c:1216
2 0x1371de5 in rpmsg_virtio_ns_callback open-amp/lib/rpmsg/rpmsg_virtio.c:663
3 0x1371026 in rpmsg_virtio_rx_callback open-amp/lib/rpmsg/rpmsg_virtio.c:583
4 0x137c105 in virtqueue_notification open-amp/lib/virtio/virtqueue.c:711
5 0x1368604 in rproc_virtio_notified open-amp/lib/remoteproc/remoteproc_virtio.c:433
6 0x1363abe in remoteproc_get_notification open-amp/lib/remoteproc/remoteproc.c:10

Signed-off-by: yintao <yintao@xiaomi.com>
2023-09-25 12:52:09 +08:00
Dong Heng
ca03a92327 drivers/lcd/st7789: Add option to support set BGR mode 2023-09-25 12:51:43 +08:00
wanggang26
203b558ec9 mmcsd: fix a typo
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2023-09-24 19:34:14 -04:00
Xiang Xiao
723d721098 Fix mmcsd/mmcsd_debug.c:110:9: error: format '%d' expects argument of type 'int', but argument 3 has type 'long unsigned int'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-25 01:10:00 +03:00
Jiuzhu Dong
032a5c75a4 drivers/sensors/: Add coordinate conversion function
convert from body coordinate system to right-hand
coordinate system.

Example:
Compared to the standard coordinate system,
the x-axis and y-axis are interchanged and have opposite directions,
the z-axis remains normal.

  body coordinate   ---->     right-hand coordinate
              +x               +y
               |                |
               |                |
               |                |
               |                |
     -y<-------.                .------>+x
              /                /
             /                /
            /                /
           /                /
         +z                +z

So for the above conversion, using "P3" to represent transformation relationships
The front is 1 0 2, which represents the y x z axis.
The standard order is 0 1 2, so y and x are interchanged.

The following -1 1 1 indicates the direction of the axis.
The standard is 1 1 1. Because the current y-axis is opposite to
the standard x-axis, it is -1.

static const struct sensor_axis_map_s g_remap_tbl[] =
{
  { 0, 1, 2,  1,  1,  1 }, /* P0 */
  { 1, 0, 2,  1, -1,  1 }, /* P1 */
  { 0, 1, 2, -1, -1,  1 }, /* P2 */
  { 1, 0, 2, -1,  1,  1 }, /* P3 */
  { 0, 1, 2, -1,  1, -1 }, /* P4 */
  { 1, 0, 2, -1, -1, -1 }, /* P5 */
  { 0, 1, 2,  1, -1, -1 }, /* P6 */
  { 1, 0, 2,  1,  1, -1 }, /* P7 */
};

you can call the function sensor_remap_vector_raw16 and pass P3 parameters
to perform the conversion.

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2023-09-24 11:01:08 +08:00
dongjiuzhu1
dcb8188f07 driver/spi: avoid calling QPOLL to change rx_length and cause data loss
When the application calls poll and returns the POLLIN event,
QPOLL will be called again during the read operation,
causing rx_length to change and data to be lost.
Therefore, read only need to actively call qpoll to collect driver
data when rx length is 0.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-09-24 10:34:55 +08:00
dulibo1
7a417da65e pm:check the domain in pm_querystate
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2023-09-24 03:49:08 +08:00
xuxin19
712734d55b bcm43xxx: remove unuse function
I added a function that I didn't use when I upstream another patch. Delete it
https://github.com/apache/nuttx/pull/10709

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-09-24 03:48:55 +08:00
zhanghongyu
03e220a271 bcm43xxx: revert part of the previous upstream code
Revert WPA failure reason codes to the previous community version

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-09-24 01:55:54 +08:00
Shanmin Zhang
582e0ab51f goldfish: add goldfish sensors driver
Implemented Goldfish Sensors:
Accelerometer
Gyroscope
MagneticField
AmbientTemperature
Proximity
Light
Pressure
RelativeHumidity
MagneticFieldUncalibrated
GyroscopeFieldUncalibrated
HeartRate

Unimplemented Goldfish Sensors:
(sensor type is not defined nuttx)
Orientation
HingeAngle0
HingeAngle1
HingeAngle2
WristTilt

Verification:
uorb_listener -r 1 sensor_accel
uorb_listener -r 1 sensor_mag
uorb_listener -r 1 sensor_gyro
uorb_listener -r 1 sensor_prox
uorb_listener -r 1 sensor_light
uorb_listener -r 1 sensor_humi
uorb_listener -r 1 sensor_baro
uorb_listener -r 1 sensor_temp
uorb_listener -r 1 sensor_hrate

Signed-off-by: Shanmin Zhang <zhangshanmin@xiaomi.com>
2023-09-23 15:20:25 +08:00
raiden00pl
0e01836f09 serial: add an option that selects uart rpmsg as console 2023-09-22 19:46:26 +08:00
SPRESENSE
7f574210a7 drivers:alt1250: Correspond to shutdown
ALT1250 driver to support shutdown.
2023-09-22 13:51:28 +08:00
wanggang26
e930476b4b enable O_CLOEXEC explicit
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2023-09-22 13:51:00 +08:00
dulibo1
b57e43b4d0 clk:fix some issues when use rpmsg clk
1.check the rpmsg name when clk_register.
2.clk_get rpmsg clk print error:
clk/clk.c:1231:3: runtime error: null pointer passed as argument 2, which is declared to never be null
3.fix some function miss keyword FAR.
4.clk_disable_unused may disable rpmsg clk which disable the clk that maybe used by others

Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2023-09-22 08:47:23 +08:00
dulibo1
2db471fab3 regulator:fix some issues when use rpmsg
1.client get the regualtor which is enabled by server, will disable the regualtor.
2.regulator_rpmsg_server_unbind will disable regualtor which maybe used by other client.
3.regulator_rpmsg_server_unbind will be deadloop when the regulator is always_on;
4.regulator_rpmsg_client_destroy does not match server cpu name,may destory by stop other rptun dev

Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2023-09-21 19:41:34 -04:00
dulibo1
da1cd59f35 regualtor:fix regulator_register check rpmsg regulator which leads to recursion
Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
2023-09-21 19:41:34 -04:00
wanggang26
db2f204cc4 mmcsd: support dump cid and csd with mmc-utils
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
2023-09-21 22:40:39 +08:00
raiden00pl
0b00a02f81 sensors: add suffix _uorb to all sensors that use the new sensor framework
This'll make it easier to identify sensors supporting the new sensor approach
2023-09-21 20:30:08 +08:00
SPRESENSE
a3d17a18a7 drivers/modem/alt1250: Fix bug that errno was not converted correctly
Fix bug that errno was not converted correctly.
2023-09-21 13:54:21 +03:00
SPRESENSE
125f4a2ad0 drivers/modem/alt1250: Fix bug that modem version could not be taken
Fix bug that modem version could not be taken.
2023-09-21 17:44:12 +08:00
zhanghongyu
9267dbc7c2 bcm_driver: revert packed attribute for scan structure
These structures need to be aligned with the firmware, packed_struct will cause the scan information from Wi-Fi firmware not to be parsed by broadcom Wi-Fi driver. Therefore, we need to remove the packed_struct of the structure associated with the scan information.

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
2023-09-21 14:03:12 +08:00
dongjiuzhu1
c22646c0d4 driver/sensor: Solve the busy loop problem caused by sampling problems
Solve the problem that when a user modifies the sampling rate,
the difference between the generation and the mainline generation
may be greater than the own sampling interval.

After this problem occurs, sensor_is_update() will continue to
return true, resulting in a busy loop in the upper-layer application,
so, need update user generation according to mainline generation.

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-09-20 23:09:56 +03:00
dongjiuzhu1
93b2a3744f driver/spi: call bind and unbind when user open or close to save power
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2023-09-20 23:08:36 +03:00
chao.an
76dfffe834 wireless/bcm43xxx: fix nxstyle issue
Signed-off-by: chao.an <anchao@xiaomi.com>
2023-09-21 01:36:21 +08:00
chao.an
ff2b87c298 wireless/bcm43xxx: add Packet Traffic Arbitration Priority support
For Bluetooth wifi co-existence

Signed-off-by: chao.an <anchao@xiaomi.com>
2023-09-21 01:36:21 +08:00
hujun5
1aa42cc7d2 vnc_updater: use [enter|leave]_critical_section replace sched_[un]lock
sched_[un]lock can not prohibit pre-emption in smp

Signed-off-by: hujun5 <hujun5@xiaomi.com>
2023-09-21 00:57:51 +08:00