Commit Graph

200 Commits

Author SHA1 Message Date
ligd
7fa3ecde5a pm: modify for nxstyle
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 11:11:00 +08:00
ligd
3ea2dbb7b4 power: change pm_count to pm_empty to optimize speed
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 11:11:00 +08:00
ligd
487771033d power: move EXPLICIT_RELAX operation to pm_initialize()
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 11:11:00 +08:00
ligd
d8ebe98c6c pm: use rmutex_xx API for recursive lock
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 11:11:00 +08:00
ligd
f9849c7f60 pm: memset when do pm_wakelock_init
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-07-26 11:11:00 +08:00
Xiang Xiao
959031ebca power/greedy: Call pm_auto_updatestate in timeout callback
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-07-26 11:11:00 +08:00
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
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
anjiahao
b88a8cf39f use rmutex inside of all repeated implementation
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2022-05-30 19:43:48 +08:00
Xiang Xiao
5b0b4bd586 sched/wdog: Change the return type of wd_gettime from int to sclock_t
to handle 64bits sclock_t correctly

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-05-19 23:21:54 +03:00
Petro Karashchenko
09b3fb25ab drivers: remove unimplemented open/close/ioctl interfaces
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-04-15 16:56:25 +08:00
Xiang Xiao
4b9c74514d drivers/power: Remove activity_governor.h and greedy_governor.h
since they aren't really used anymore

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-13 15:38:46 +03:00
zhuyanlin
5cc4f22b43 power/governor: Remove the duplicated function prototype
since they are declared include/nuttx/power/pm.h by:
commit 5ce181e6b7
Author: zhuyanlin <zhuyanlin1@xiaomi.com>
Date:   Mon Feb 14 15:32:40 2022 +0800

    power:govorner: add govorner to per domain.

    For mult domains scene,,
    activity and greety can be used at same time.
    Let user to select domain governor.

    Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>

and add static const to g_pmgovernor

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2022-04-13 15:38:46 +03:00
Xiang Xiao
9785d6606c openamp: Change the dependence from OPENAMP to RPTUN
since all rpmsg driver need the extension api exposed by rptun driver

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-04-05 10:05:41 +03:00
Petro Karashchenko
d08fbca679 nuttx: unify FAR attribute usage across the code
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-04-04 21:32:58 +08:00
zhuyanlin
79bcc662d9 power:driver: move pm_auto_update to outer dir
Pm_auto_update maybe called by outter PM users

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2022-04-02 00:11:00 +08:00
zhuyanlin
ae21df2ed3 power: unify lock states
unify critical_section and nxsem with pm_lock/pm_unlock

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2022-04-02 00:11:00 +08:00
ligd
ed49aa1906 pm: remove unnecessary depends on OSINIT_OS_READY
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-03-28 22:48:14 +08:00
Petro Karashchenko
98ba65c422 c89: get rid of designated initializers in common code
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-03-28 13:39:27 +08:00
chao.an
cce125aae7 regulator/rpmsg: list delete should use safe version in loop
Signed-off-by: chao.an <anchao@xiaomi.com>
2022-03-19 11:13:55 +02:00
zhuyanlin
5ce181e6b7 power:govorner: add govorner to per domain.
For mult domains scene,,
activity and greety can be used at same time.
Let user to select domain governor.

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2022-03-09 14:17:57 -03:00
zhuyanlin
f7a7eb9ee3 power/PM: add domain inner update power state feature
In some scenarios, We need to update state information internally.
Instead of use idle-task to drive the checkstate and change state
function.

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2022-02-25 00:16:48 +08:00
Alin Jerpelea
3a77cd3d6a drivers: power: exclude BSD components from build
Unless ALLOW_BSD_COMPONENTS is enabled support will not be built

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2022-02-24 22:48:47 +08:00
Masayuki Ishikawa
6a1a7bf455 Revert "pm: remove unnecessary depends on OSINIT_OS_READY"
This reverts commit 8785673a70.
2022-02-22 10:56:14 +01:00
ligd
8785673a70 pm: remove unnecessary depends on OSINIT_OS_READY
Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-02-22 07:58:55 +01:00
Xiang Xiao
1d1bdd85a3 Remove the double blank line from source files
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-02-20 20:10:14 +01:00
Petro Karashchenko
41c95da594 register_driver: fix driver modes accross the code
State of problem:
 - Some drivers that do not support write operations (does not
   have write handler or ioctl do not perform any write actions)
   are registered with write permissions
 - Some drivers that do not support read operation (does not
   have read handler or ioctl do not perform any read actions)
   are registered with read permissions
 - Some drivers are registered with execute permissions

Solution:
 - Iterate code where register_driver() is used and change 'mode'
   parameter to reflect the actual read/write operations executed
   by a driver
 - Remove execute permissions from 'mode' parameter

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-02-16 16:15:29 +08:00
Petro Karashchenko
a743fed63d file_operations: get back C89 compatible initializer
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2022-01-11 02:14:00 +08:00
zhuyanlin
a22dae19c1 regulator/rpmsg: pending in wait ept ready for regulator client
Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2021-12-27 23:25:28 -06:00
zhuyanlin
c5aca37f8f regulator: fix warning in RPIu32
Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2021-12-27 06:56:38 -06:00
songnannan
0a62701c1a fix: regulator: set ioexpander direction in regulator gpio init.
Signed-off-by: songnannan <songnannan@xiaomi.com>
2021-12-21 08:47:17 -06:00
Jiuzhu Dong
8b0d45abef charger: fix crash when notify without pollwaiter
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2021-12-13 05:34:49 -06:00
zhuyanlin
3e8a3c9cc2 driver:regulator: add delay feature
N/A
2021-12-07 23:29:05 -06:00
zhuyanlin
b7db4304d6 driver/power: add gpio regulator
N/A

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2021-12-07 23:29:05 -06:00
zhuyanlin
eed6510202 driver:power:add regulator remote proc
N/A

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2021-12-07 23:29:05 -06:00
zhuyanlin
c8f1a9e430 driver:power:add regulator framework
N/A

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2021-12-07 23:29:05 -06:00
zhangguoliang
b16eea4f14 feat: charger: add operation to get out voltage
Signed-off-by: zhangguoliang <zhangguoliang3@xiaomi.com>
2021-11-26 11:16:53 +01:00
weizhifang
e20becd91b feature: charge: add add chipid ioctl api
1.add chipid ioctl api to battery monitor code
2.add chipid itctl api to battery charger code
3.add chipid itctl api to battery gauge code

Signed-off-by: weizhifang <weizhifang@xiaomi.com>
2021-11-26 11:16:53 +01:00