Commit graph

5384 commits

Author SHA1 Message Date
Xiang Xiao
8c2a40f864 power/battery: Move the enumurate to the common place
so the userspace program can handle the different battery driver equally

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ib00bb6bd6c543c01cb0ed03bc631ec8337720528
2021-09-29 17:33:23 +08:00
Jiuzhu Dong
959f5496de driver/sensor: support sensor_ops: selftest
Change-Id: I9aaadd2d6a61aed8212f2a88c507caeeb433c360
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-09-29 15:28:39 +08:00
Jiuzhu Dong
cd9f115550 wd_start: use sclock_t type replace int
MIRTOS-1055

when enable SYSTEM_TIME64, tick may exceed the int32 range
example:
pthread_cond_clockwait
        ---->clock_abstime2ticks
                    ---->wd_start

Change-Id: Id6b8f9e92cbcad285c8fa684a73b7d75a8ccfebc
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-09-29 10:24:28 +08:00
ligd
c0ffee0728 mm: do kmm_checkcorruption in IRQ when TCB_FLAG_DEBUG_CHECK set
Change-Id: Iad5dc7e0aa07a854f64b79b6e3eae57c4112a998
Signed-off-by: ligd <liguiding1@xiaomi.com>
2021-09-28 12:36:05 +08:00
zhuyanlin
758c042b01 sched:tcb_s:rearrange sched_priority/int_priority to word align
As pid_t is uint16_t,this could save space for many archs.

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2021-09-27 15:07:47 +08:00
songnannan
5766096fe8 feature: sensor: add lps27hhw baro sensor driver.
CHAMPION-96

Add lps27hhw baro sensor driver to sensor drivers.

Change-Id: I0b1c9809eef13b564166621961c1679ed8de415b
Signed-off-by: songnannan <songnannan@xiaomi.com>
2021-09-27 10:51:00 +08:00
liushuai25
7f3456de09 feat: driver: support double buffer for display
CHAMPION-91

add pan display for fb driver.

reference links:
https://github.com/torvalds/linux/blob/master/drivers/video/fbdev/core/fbmem.c
https://github.com/torvalds/linux/blob/master/drivers/video/fbdev/goldfishfb.c

Signed-off-by: liushuai25 <liushuai25@xiaomi.com>
Change-Id: If322cab9be2784e42f84060f8e94f52757c0dd8a
2021-09-27 09:53:35 +08:00
futerigele
ea1e5c3d2c feat: touch: add nt38350 selftest
CHAMPION-95

add nt38350 selftest

Change-Id: I15cbaf04f9dc9131b4e661cd29e56d5bece6b4db
Signed-off-by: futerigele <futerigele@xiaomi.com>
2021-09-26 17:09:40 +08:00
futerigele
5a62cff0e5 feat: touch: bring up novatek nt38350 touch panel
CHAMPION-95

bring up novatek nt38350 touch panel

Change-Id: Ia890518620a00df0bd9e51aface1bb019034ec94
Signed-off-by: futerigele <futerigele@xiaomi.com>
2021-09-23 11:18:47 +08:00
Alexander Lunev
eafe6e50ac net/devif/devif_callback.c: corrected the connection event list to work as FIFO instead of LIFO.
In case of enabled packet forwarding mode, packets were forwarded in a reverse order
because of LIFO behavior of the connection event list.
The issue exposed only during high network traffic. Thus the event list started to grow
that resulted in changing the order of packets inside of groups of several packets
like the following: 3, 2, 1, 6, 5, 4, 8, 7 etc.

Remarks concerning the connection event list implementation:
* Now the queue (list) is FIFO as it should be.
* The list is singly linked.
* The list has a head pointer (inside of outer net_driver_s structure),
  and a tail pointer is added into outer net_driver_s structure.
* The list item is devif_callback_s structure.
  It still has two pointers to two different list chains (*nxtconn and *nxtdev).
* As before the first argument (*dev) of the list functions can be NULL,
  while the other argument (*list) is effective (not NULL).
* An extra (*tail) argument is added to devif_callback_alloc()
  and devif_conn_callback_free() functions.
* devif_callback_alloc() time complexity is O(1) (i.e. O(n) to fill the whole list).
* devif_callback_free() time complexity is O(n) (i.e. O(n^2) to empty the whole list).
* devif_conn_event() time complexity is O(n).

Change-Id: I1123657f9a591b29f2a7546691d58dff58896a18
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-09-22 19:30:52 +08:00
zhangguoliang
a87fbef0f1 feat: charge: initialize pump charger sc8551a driver
CHAMPION-25

Change-Id: I32bf77d04fc5c67f52dcc7ec8081a3feb4b08795
Signed-off-by: zhangguoliang <zhangguoliang3@xiaomi.com>
2021-09-22 19:13:02 +08:00
zhangguoliang
888ea2ae84 fix: charger: change the operations of battery ioctl to common
Almost all charger chip need the same oprations, which was not
appropriate only for BQ2429X. Therefore, open the operations to
all charger chips.

Signed-off-by: zhangguoliang <zhangguoliang3@xiaomi.com>
Change-Id: Iac5653eab68e551391537d6b5c2a18004a8023fe
2021-09-22 09:01:41 +00:00
weizhifang
d6a798ebf2 feature: charge: modify battery_gauge code
CHAMPION-137

1.add temperature and current ioctl api

Signed-off-by: weizhifang <weizhifang@xiaomi.com>
Change-Id: I958f37aa385d942b24a44c696a7b8d5c45d3b9c5
2021-09-22 09:36:15 +08:00
weizhifang
9391f43482 feature: charge: add battery gauge cw2218 driver
CHAMPION-137

1.add cw2218 driver code

Signed-off-by: weizhifang <weizhifang@xiaomi.com>
Change-Id: I32bdb045fdddf976b0643b064b892b6092109f2a
2021-09-22 09:35:55 +08:00
liangdongdong
af949ba40d feature: bsp: add bq25618 driver
CHAMPION-105

Signed-off-by: liangdongdong<liangdongdong@xiaomi.com>
Change-Id: I061f297e7a65137b610f6fe4edc0305bf86934b9
2021-09-18 18:46:22 +08:00
Jiuzhu Dong
aa1c65a364 errno: use staic errno to replace tl_errno before tls initialization
Change-Id: I44a53b2f5cdb3f4e6c755e5663867cd74361bc7c
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-09-09 21:18:32 +08:00
liushuai25
00d49aa9c2 feature: driver: add interface for fb driver
CHAMPION-99

add get and set panel power interface for fb driver.
add get and set framerate interface for fb driver.
add panel information at videoinfo for fb driver.

Signed-off-by: liushuai25 <liushuai25@xiaomi.com>
Change-Id: I4121411280027b12e7ab68c56a68d1efbbcc7641
2021-09-09 20:31:28 +08:00
liushuai25
193e898b51 feature: driver: add interface for lcd dev driver
CHAMPION-100

add get and set framerate interface for lcd dev driver.

Signed-off-by: liushuai25 <liushuai25@xiaomi.com>
Change-Id: I42584fa2adde9783fac9ac31bfe0b29b426a82e1
2021-09-09 20:28:58 +08:00
chao.an
1d52c08bdd sys/socket/scm: add more socket message control helper
Change-Id: I051e82f1722d092b62f1ff52a6492a91191cfe25
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-09-02 22:46:41 +08:00
futerigele
e3b87ea0aa feat: touch: add io command for touch firmware version
CHAMPION-53

add io command for touch firmware version

Change-Id: I777285d2343b32ffd9caef2fc746fe491c5890d7
Signed-off-by: futerigele <futerigele@xiaomi.com>
2021-08-31 20:18:35 +08:00
Jiuzhu Dong
40380c117c fs/ioctl: using FIOC_FILEPATH instead of FIOC_FILENAME.
Change-Id: Ib285455a251bd3c475e8ff402936070da209eb67
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-08-31 19:17:20 +08:00
Jiuzhu Dong
4743c089d0 libc/rexec: support remote execution
Change-Id: I0f61326081f87d9bdf7234088f352328b8828adb
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-08-31 10:19:09 +08:00
zhuyanlin
46a93b5045 stddef: Let offset be defined from toolchain
Let `offset` could be defined from toolchain,
Which will be usefull for fixed code project.
2021-08-28 09:39:32 +08:00
Xiang Xiao
2659ab121f fs: Remove magic field from partition_info_s
since it is wrong and impossible to return file
system magic number from the block or mtd layer.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-28 09:26:22 +08:00
Jiuzhu Dong
7561882938 lib_vsprintf: Add %pV format support
test case:
void test(const char *fmt, ...)
{
  struct va_format vaf;
  va_list ap;

  va_start(ap, fmt);
  vaf.fmt = fmt;
  vaf.va = &ap;
  printf("func:%s, %pV, line:%d\n", __func__, &vaf, __LINE__);
  va_end(ap);
}

int main(int argc, FAR char *argv[])
{
  char str[] = "Hello Boy and Girl!";
  int count = 10;

  test("%s %d", str, count);
  return 0;
}

>> test
func:test, Hello Boy and Girl! 10, line:49

Change-Id: I6d97515dce3f10a880145a1ff7fcba5e9cbebd37
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-08-27 11:08:48 +08:00
pengyiqiang
b8f12c357f libc/misc: add lib_glob.
N/A

Change-Id: I1bace79c4c580e3a7e84aaf37e7963f789a896ef
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2021-08-26 16:57:07 +08:00
pengyiqiang
01cbfec897 libc/string: fix lib_strchrnul warning.
N/A

Change-Id: I4661a42923b7e2f59155c734cba2131bddb94211
Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
2021-08-25 15:08:37 +08:00
Jiuzhu Dong
2862e57495 debug: allow customize EXTRA_FMT
Change-Id: I8c74871fa841584f31ba4873d0adf639e49eafd9
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-08-24 12:26:19 +08:00
chao.an
93bd61a0e8 nuttx/up_backtrace: add up_backtrace interface
Change-Id: Ic056d679ae68a579b94a75dd05abbe390f7c7a4f
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-08-23 12:08:43 +08:00
Jiuzhu Dong
b3cb28a9ae fs: support exfat filesystem
VELAPLATFO-15

Change-Id: I222cc45cec45018db26f7e0d1551d6e84285b739
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-08-20 22:14:46 +08:00
chao.an
7f192ca255 sched/backtrace: add sched_backtrace support
Change-Id: Ia764cf54dfa215b313f9d5f1a060aac18d765982
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-08-18 19:36:38 +08:00
chao.an
db06f769ff libs/libc: move the backtrace implement to sched
1. move the backtrace implement to sched
2. rename CONFIG_UNWINDER to CONFIG_SCHED_BACKTRACE

Change-Id: I8176727602bfc695184b88210a3aaf90c6acaac7
Signed-off-by: chao.an <anchao@xiaomi.com>
2021-08-18 19:36:23 +08:00
Xiang Xiao
c906f1d482 fs: Add model field to geometry and mtd_geometry_s
the model is very to track the device info

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-18 18:37:51 +08:00
liucheng5
4a38b651c6 Feature: Sensor: Add new sensor types
N/A

New sensor types ECG(25), PPG(26), impedance(27), and their event types are added to sensor.h.

Change-Id: I2a2558e744b777178c4bf49505a92021595eb150
Signed-off-by: liucheng5 <liucheng5@xiaomi.com>
2021-08-17 15:56:29 +08:00
liucheng5
7feeda8882 Feature: Sensor: Add sensor driver for MAX86178
CHAMPION-51

Add a driver for the Maxim MAX86178 vital-sign AFE, used for ECG and PPG measurements.

Change-Id: Iae10315abf9d1889af5257495da64c3221014dd7
Signed-off-by: liucheng5 <liucheng5@xiaomi.com>
2021-08-17 15:25:22 +08:00
Xiang Xiao
6803b6d23d fs: Support 64bit in register_[block|mtd]partition
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-16 22:07:08 +08:00
genghuihui
11a0bb3e98 feature:add audio AUDIOIOC_SETPARAMTER ioctl command
add AUDIOIOC_SETPARAMTER iotcl command in include/nuttx/audio/audio.h

Signed-off-by: genghuihui <genghuihui@xiaomi.com>
Change-Id: I8d88c649a87cb5fbdd0fb1f83c111a1fff380507
2021-08-13 15:47:56 +08:00
genghuihui
d8c0f7279e feature:add awinic88266a smart pa nuttx driver
awinic88266a smart pa driver use nuttx/audio framework to register audio device,
use i2c to control smart pa configuration

Signed-off-by: genghuihui <genghuihui@xiaomi.com>
Change-Id: I05361a582dde49af71c5dbd08ab9365b4ea0f80a
2021-08-13 15:44:03 +08:00
Xiang Xiao
4bee1e5690 mtd: Replace MTDIOC_XIPBASE with BIOC_XIPBASE
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-12 20:29:18 +08:00
Xiang Xiao
1e557e16ff Revert "mtd: Add MTDIOC_FLUSH IOCTL like MTDIOC_XIPBASE"
to simplify flt and partion layer implementation

This reverts commit 2e49e1bc5c.
2021-08-12 20:29:12 +08:00
Xiang Xiao
0705ae633e mtd: Replace MTDIOC_PARTINFO with BIOC_PARTINFO
to simplify flt and partion layer implementation

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-12 20:28:45 +08:00
Xiang Xiao
36e744d88a fs: Remove endsector from partition_info_s
since it can be computed from startsector and numsectors simply

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-11 23:39:02 +08:00
Gustavo Henrique Nihei
e66503788e fs: Add ioctl command for retrieving partition info of a block device
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-08-11 23:39:02 +08:00
Gustavo Henrique Nihei
1767685a9e mtd: Enable retrieval of MTD partition information
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-08-11 23:39:02 +08:00
Gustavo Henrique Nihei
5883abbe77 fs: Add data structure for Partition Information
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-08-11 23:39:02 +08:00
Gustavo Henrique Nihei
f5964d55dd mtd: Add MTDIOC_ERASESTATE command for retrieving erase state value
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-08-11 23:30:30 +08:00
Xiang Xiao
622c637832 fs/userfs: Support fchstat and chstat callback
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-11 18:18:52 +08:00
Jiuzhu Dong
36ac863777 endian.h: add prefix for __LITTLE/__BIG_ENDIAN, __BYTE_ODRER
Change-Id: If072b69e37a89ccd6dc62e1d485b15703da029ac
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-08-11 17:58:17 +08:00
Jiuzhu Dong
10f091fdbb byteswap.h: add byteswap.h header file
Change-Id: I2b00618f608efbb8834328823b5e0eaa66f42aba
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-08-11 16:49:39 +08:00
Xiang Xiao
d27a86486f fs/hostfs: Support fchstat and chstat callback
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2021-08-10 14:33:14 +08:00