Commit Graph

4658 Commits

Author SHA1 Message Date
ligd
0d1515f7fb pm_procfs: show stay-time-to-now when pm in stay state
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 11:11:00 +08:00
ligd
695b296681 pm: fix build warning
power/pm_procfs.c:282:27: warning: format specifies type 'unsigned long' but the argument has type 'time_t' (aka 'unsigned int') [-Wformat]
                          dom->wake[state].tv_sec,
                          ^~~~~~~~~~~~~~~~~~~~~~~
make[2]: Entering directory '/home/ligd/platform/m2/audio/frameworks/media'
power/pm_procfs.c:283:27: warning: format specifies type 'unsigned long' but the argument has type 'unsigned int' [-Wformat]
                          100 * dom->wake[state].tv_sec / sum,
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
power/pm_procfs.c:284:27: warning: format specifies type 'unsigned long' but the argument has type 'time_t' (aka 'unsigned int') [-Wformat]
                          dom->sleep[state].tv_sec,
                          ^~~~~~~~~~~~~~~~~~~~~~~~
power/pm_procfs.c:285:27: warning: format specifies type 'unsigned long' but the argument has type 'unsigned int' [-Wformat]
                          100 * dom->sleep[state].tv_sec / sum,
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
power/pm_procfs.c:286:27: warning: format specifies type 'unsigned long' but the argument has type 'time_t' (aka 'unsigned int') [-Wformat]
                          total.tv_sec,
                          ^~~~~~~~~~~~
power/pm_procfs.c:287:27: warning: format specifies type 'unsigned long' but the argument has type 'unsigned int' [-Wformat]
                          100 * total.tv_sec / sum);
                          ^~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 11:11:00 +08:00
ligd
c0f2b7811e pm: add pm procfs support
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 11:11:00 +08:00
ligd
f7a1c2a585 pm: move wdog from domain to wakelock
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 11:11:00 +08:00
ligd
0ca0c017fd pm: move pm_wakelock_global_init to the top
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 11:11:00 +08:00
ligd
82713d9eac pm: PM_RESTORE don't need do prepare_all
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 11:11:00 +08:00
ligd
88def0244c power: add pm_wakelock support
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 11:11:00 +08:00
ligd
f606689715 power: change pm_stay_timeout to pm_staytimout
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 11:11:00 +08:00
ligd
b34925e6eb power: move EXPLICIT_RELAX opreation to common place
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 11:11:00 +08:00
ligd
f0a1a2dc0b power: add pm_stay_timeout API
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 11:11:00 +08:00
ligd
479689eae9 power: fill acivity callback to greedy_governor
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 11:11:00 +08:00
ligd
25b16576e8 pm: pm_lock support recursive_lock
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 11:11:00 +08:00
zhuyanlin
4329967a01 pm: use pm_lock/unlock with domain lock
Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2022-07-26 11:11:00 +08:00
Jiuzhu Dong
01aa0c2d46 driver/sensor: change nbuffer and sensor event structure type
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-26 10:40:21 +08:00
Jiuzhu Dong
e3e59a03b1 driver/sensor: update sensor data structure and state structure
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-26 10:40:21 +08:00
Jiuzhu Dong
24040250f5 driver/sensor: support multi users to access device
1.Allow multi users to access the same sensor device simultaneously.
2.Get real state of sensor device by cmd SNIOC_GET_STATE for users.
3.Get update state since last read by poll without timeout for users.
4.Sensor device will be activated when first user open and will close when
  last user closed.
5.When multi users to access device, driver always set the minimum
  sampling interval and latency to the sensor device and allow
  downsampled for users above the minimum sampling interval.
6.The circbuffer will overwrite old data when buffer is full, so if users
  don't read data soon, data will be lost, and the oldest data in circbuffer
  are returned to the users.
7.Always read the last data in the circbuffer as initial value for new
  users when the sensor device has not yet generated new data.
8.when user uses poll, if subscription interval is satisfied, the POLLIN
  events is returned for each users.
9.When new user generate or the state of sensor device changed, the POLLPRI
  will notify to all users.
10.Support multi advertisers to subscribe their own data as loop test.

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-26 10:40:21 +08:00
Jiuzhu Dong
b3ea6522f4 driver/usensor: support register user sensor
1.cmd:SNIOC_REGISTER with struct sensor_reginfo_s to register user sensor
2.cmd:SNIOC_UNREGISTER to unregister user sensor

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-26 10:40:21 +08:00
Jiuzhu Dong
8d971101cd driver/sensor: change protype of set_interval, batch to follow ioctl
1. change unsigned int to unsigned long

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-26 10:40:21 +08:00
Jiuzhu Dong
8f39c5f11b driver/sensor: simplify buffer operation
1.Simplify buffer opeations to avoid frequent resize for batch and no-batch mode.
2.When sensor event is first generated, the buffer is initialized.
3.Remove and merge batch_number to buffer_number when device support batch mode.

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-26 10:40:21 +08:00
Jiuzhu Dong
dad5ab75ff driver/sensor: support userspace wirte data into sensor device
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-26 10:40:21 +08:00
ligd
434c49f282 rptun_dump: use METAL_LOG_EMERGENCY log level
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 09:36:05 +08:00
ligd
4a9bd26317 rptun: merge rptun_ioctl & rptun_ops to one
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 09:36:05 +08:00
ligd
631eb516c9 rptun_dump: don't get lock in IRQ handler
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 09:36:05 +08:00
Peter van der Perk
b3590f00b3 NXStyle and preprocessor fixes
Co-authored-by: Jari van Ewijk <jari.vanewijk@nxp.com>
2022-07-25 23:47:05 +08:00
Jari van Ewijk
dd1096695d Add initial support for NXP S32K3 MCU family
Co-authored-by: Peter van der Perk <peter.vanderperk@nxp.com>
2022-07-25 23:47:05 +08:00
Jari van Ewijk
d3b1ee9866 Macronix MX25RXX driver: add support for MX25LXX as well
Co-authored-by: Peter van der Perk <peter.vanderperk@nxp.com>
2022-07-25 23:47:05 +08:00
Jiuzhu Dong
fc84813b0a driver/sensor: add calibrate interface for sensor driver.
Add standard sensor interface for calibrate, can trigger
calibration and obtain calibration value.

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-25 17:44:31 +08:00
Jiuzhu Dong
1c342328de rtc/rpmsg: when a client connection, server initiates time sync
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-25 14:58:16 +08:00
Jiuzhu Dong
3132f169ef driver/sensor: add sensor type of cap and wake_gesture
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-25 13:34:58 +08:00
raiden00pl
0570704cdc sensors: use the INA226 driver also for INA230 chips 2022-07-23 16:48:13 -03:00
curuvar
c21c7ac8dc Added Adafruit QT Py RP2040 board.
Added ability to configure indivdual UART, SPI and I2C pin location.
2022-07-23 18:25:38 +08:00
Jiuzhu Dong
40e86501f1 driver/ioe_rpmsg: split server and client ept_cb to simplify code
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-22 14:44:44 +08:00
Karel Kočí
3693d38763 drivers/lcd/st7789: update implementation of driver for ST7789
'putarea' function now has to select the appropriate values from the
whole frame buffer instead of the previous expectation of having just
specified rectangle passed to it.

This required extension of WRRAM handling function as we now are not
writing simply buffer but we want to skip some values and do that
multiple times. Having two implementation in this case is worst as this
function is actually called only twice in the whole code (thus making
dedicated function for every call if we would have two variants).
Calling `st7789_wrram` multiple times is not an option as command
ST7789_RAMWR resets the position and thus calling it multiple times just
overwrites the previous values.
2022-07-22 11:08:00 +08:00
Alan Carvalho de Assis
a9d3e1bd08 lcd/apa102: Fix APA102 RGB LED Matrix interleaving issue
I found an issue in the APA102 framebuffer that wasn't spot
before by fb test because this application draw symetric squares

Normally in a display each line starts at left and increase to the
right, however for this APA102 matrix the next line starts at the
end of previous line and move the opposite direction, forming a
zig-zag pattern.
2022-07-22 11:05:32 +08:00
Xiang Xiao
d04ed9587b drivers/syslog: Call up_nputs in syslog_default_write
since the buffer may not be terminated by null

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-21 21:26:10 +03:00
Jiuzhu Dong
e7b8af7a35 driver/ramlog: set CONFIG_SYSLOG_DEVPATH to /dev/kmsg when enbale ramglog
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-21 23:40:56 +08:00
Jiuzhu Dong
af62e6cbfa driver/syslog: support syslog rpmsg server chardev
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-21 23:40:56 +08:00
Jiuzhu Dong
eedb774d68 driver/syslog: remove TRANSFER_DONE and sem wait when buffer is full
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-21 23:40:56 +08:00
Jiuzhu Dong
059114557f driver/syslog: support syslog output when buffer remaining space over 75%
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-21 23:40:56 +08:00
Jiuzhu Dong
664fcb2698 driver/syslog: support syslog rpmsg character buffer
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-07-21 23:40:56 +08:00
ligd
5c33db4220 syslog_rpmsg: head must bigger then tail when syslog_rpmsg_init
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-21 23:40:56 +08:00
Alan Carvalho de Assis
9587e4a85e lcd/apa102: Add putarea() support for faster rendering 2022-07-20 11:52:22 +08:00
Alan Carvalho de Assis
b3daaf765b drivers/lcd: Add support to use APA102 LED Matrix as LCD Display
Co-authored-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-07-19 18:50:04 +03:00
SPRESENSE
b04c4972fe mtd/smartfs: Fix uninitialized variable
If CONFIG_SMARTFS_MULTI_ROOT_DIRS is enabled and dev->partname is not empty,
dev->rwbuffer is an uninitialized variable and register_blockdriver is called.
2022-07-19 11:08:13 +03:00
Xiang Xiao
2166c98809 Add printflike and scanflike to all printf/scanf like functions
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-18 14:14:36 +03:00
Xiang Xiao
19f269e54b syslog: Remove the lock from syslog_default_write
to avoid the problem when is called from interrupt/signal handler

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-17 17:31:19 +03:00
Xiang Xiao
8254ad9159 drivers/syslog: Call up_puts instead up_putc one by one
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-17 17:31:19 +03:00
Xiang Xiao
02ea79365a drivers/bch: Adjust f_pos with the correct value
Fix the problem reported by:
https://github.com/apache/incubator-nuttx/issues/6619

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-17 17:13:36 +03:00
Xiang Xiao
a2239891e7 mmcsd: Remove the not really used capacity field
to avoid the check of CONFIG_HAVE_LONG_LONG in many place

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-16 11:12:30 +03:00
Gustavo Henrique Nihei
e999708b31 drivers: Convert DEBUGASSERT(false) into more intuitive DEBUGPANIC()
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-07-14 12:08:45 +08:00