platform/core/system/deviced.git
6 weeks agoAdd plugins to deviced ISU configuration 70/308270/1 accepted/tizen/7.0/unified/20240322.094835
Adam Michalski [Fri, 15 Mar 2024 11:12:47 +0000 (12:12 +0100)]
Add plugins to deviced ISU configuration

Additionally it adds rndis.service to ISU configuration.

Change-Id: Ic616d09d0dbe23aae56b3b2a55f2a0b99be3d861

3 months agopower: Remove duplicate operation 74/293274/5 accepted/tizen/7.0/unified/20240122.175818
youngjae [Thu, 18 May 2023 02:52:13 +0000 (11:52 +0900)]
power: Remove duplicate operation

Change-Id: I00ebd2f5883dc4aec26146cdfd99e66caebaa221
Signed-off-by: youngjae <y0.cho@samsung.com>
3 months agodisplay: Add pmlock type and power lock type conversion 37/303937/1 accepted/tizen/7.0/unified/20240109.160531
Yunhee Seo [Mon, 8 Jan 2024 07:33:02 +0000 (16:33 +0900)]
display: Add pmlock type and power lock type conversion

When the emit power lock state signal, it was omitted pmlock and power lock conversion from deviced.
For accurate signal emitting, this is necessary.

Change-Id: Ida02a4cacda603c911d89c318e4d93274540f4a6
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
4 months agodisplay: Add getter for lock count and signal on count changed 57/303457/3 accepted/tizen/7.0/unified/20240103.164231 accepted/tizen/7.0/unified/20240104.073230
Youngjae Cho [Thu, 28 Dec 2023 04:11:49 +0000 (13:11 +0900)]
display: Add getter for lock count and signal on count changed

The dbus method "PmlockGetLockCount" has been added to get lock count.
And the dbus signal "PowerLockCountChanged" has also been added for
broadcasting on every display lock/unlock. The existing method
"PmlockGetLockState" and signal "PowerLockCountChanged" only say in
'locked' or 'unlocked', however, the "PmLockGetLockCount" and
"PowerLockCountChanged" respond in number.

Change-Id: I63a0eb7a12c76569d4c2de7bfe9089d5f98eac0e
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
6 months agousb-host: Filter out abnormal devpath 68/300768/1 accepted/tizen/7.0/unified/20231102.181239
Youngjae Cho [Tue, 31 Oct 2023 02:21:33 +0000 (11:21 +0900)]
usb-host: Filter out abnormal devpath

Sometimes the devpath gets empty string. It is not sure, but the deviced
seems to get blocked in such case, reading the parent's product/serial
node. It leads watchdog timeout, and the deviced gets SIGABRT from the
systemd. It is not clear that the empty devpath results it though, add
guard clauses for filtering out such an abnormal devpath.

 (gdb) bt
 #0  __libc_read (nbytes=4097, buf=0xaba70f28, fd=-1415114968)
     at ../sysdeps/unix/sysv/linux/read.c:26

 #1  __libc_read (fd=fd@entry=28, buf=buf@entry=0xaba70f28,
     nbytes=nbytes@entry=4097) at ../sysdeps/unix/sysv/linux/read.c:24

 #2  0xf76289a2 in read (__nbytes=4097, __buf=0xaba70f28, __fd=28)
     at /usr/include/bits/unistd.h:44

 #3  read_full_virtual_file (filename=<optimized out>, ret_contents=0xffd180ec,
     ret_size=0xffd180f4) at ../src/basic/fileio.c:371

 #4  0xf7626608 in sd_device_get_sysattr_value (device=0xaba084f8,
     sysattr=0xaaefe36c "product", _value=0xffd181b0)
     at ../src/libsystemd/sd-device/sd-device.c:1789

 #5  0xf761c92e in udev_device_get_sysattr_value (
     udev_device=udev_device@entry=0xaba2c060, sysattr=<optimized out>)
     at ../src/libudev/libudev-device.c:741

 #6  0xaaeec55c in add_usbhost_list (dev=dev@entry=0xab9fc4e0,
     devpath=devpath@entry=0xaba3d984 "")
     at /usr/src/debug/deviced-10.0.0-1.arm/src/usb-host/usb-host.c:236

Change-Id: I52ac60e5fefa48ea7e262c3ca7472a019786ca82
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
6 months agopackaging: Remove deviced-isu package requirement 13/300013/1 accepted/tizen/7.0/unified/20231016.045456
Chanwoo Choi [Thu, 7 Sep 2023 01:47:13 +0000 (10:47 +0900)]
packaging: Remove deviced-isu package requirement

deviced-isu package should be required in builing-blocks
to be included in snapshot image.

Change-Id: Ied498969a37567b831e8f7b6f767c83e6ba1ae3e
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 months agoFix ISU deviced.service 12/300012/1
Mateusz Moscicki [Mon, 31 Jul 2023 12:59:26 +0000 (14:59 +0200)]
Fix ISU deviced.service

Deviced cannot be run in the sandbox (in a different mount namespace)
because for USB gadget purposes it mounts FunctionFS, which is that case
is not visible outside this sandbox.

Change-Id: Ia1566b4ba7b37b56321033ee3d243a5fb89c805e
Signed-off-by: Mateusz Moscicki <m.moscicki2@partner.samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
6 months agoAdd ISU package 11/300011/1
Adam Michalski [Tue, 13 Jun 2023 15:52:56 +0000 (17:52 +0200)]
Add ISU package

The following changes have been made for ISU:
* isu/isu.cfg - ISU configuration file.
    [isu] section:
        `name` and `version` have been filled by using the #NAME# and #VERSION#
        patterns that in turn will be replaced by the `%isu_package` RPM macro
        into the name and version of the RPM package.
        `system_service` is the systemd service name and must be the same as the
        original one.
    [files] section:
        contains a list of all files that should be added to the ISU package.
        Since we only want to replace the binary, there is only one file here.
* isu/deviced.service - modified ISU service file.
    Compared to the original 'deviced.service' the following changes have been
    made for ISU:
    - `EnvironmentFile=/etc/isu/service-common.inc` - to include ISU-specific
      variables
    - `ExecStart=` has been changed to launch sandbox application with default
      parameters (`ISU_SANDBOX_INVOCATION`), ISU-provided
      `#ISU_RUN_PATH#/deviced/rootfs/usr/bin/deviced` is visible as
      `/usr/bin/deviced` in the sandbox
    - `NotifyAccess=all` has been set as there is one intermediate process
      (`isu-sandbox`) between `systemd` and `/usr/bin/deviced`
* isu/CMakeLists.txt - CMake config file for the ISU.
    Added installing ISU config file and the service file to the appropriate
    locations (/etc/isu/*)
* CMakeLists.txt - main config file for CMake.
    We've added the `isu` subdirectory where we placed the isu configuration
    file and the modified service file that will run `dlog` in a sandboxed
    environment.
* packaging/deviced.spec - main `deviced` RPM spec file.
    We've made the following changes:
    - added `Requires: %{name}-isu = %{version}-%{release}` tag in the main
      spec section which will cause the ISU package to be installed when the
      original package is installed.
    - added the `%isu_package` macro invocation right before the `%prep` section
      which will cause the configuration to be placed in the correct location
      with all ISU-related files packaged into the `*-isu` RPM package.

Change-Id: I8c81d0df6d81afae50d1e703940d1889df0b68bf
Signed-off-by: Adam Michalski <a.michalski2@partner.samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
7 months agoconf: org.tizen.system/deviced.conf: Add dbus policy for input interface 43/298743/1 accepted/tizen/7.0/unified/20230913.174319 accepted/tizen/7.0/unified/20230914.170406
Chanwoo Choi [Wed, 13 Sep 2023 05:45:57 +0000 (14:45 +0900)]
conf: org.tizen.system/deviced.conf: Add dbus policy for input interface

Add dbus policy of org.tizen.system.deviced.input
to allow user to use input interface.

Change-Id: Ib83ca06cb4e31283e9678cc5c38547dc399026da
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
10 months agopower: Add device_notify() right after echomem resuming 10/294810/3 accepted/tizen/7.0/unified/20230628.014038
Youngjae Cho [Tue, 27 Jun 2023 02:43:47 +0000 (11:43 +0900)]
power: Add device_notify() right after echomem resuming

It gives chance to doing immediate action on resuming from echomem.

Change-Id: I566a2dcee22c90a02af0c10ee394f1fa4a58a894
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
11 months agocore: Change to register signal handler with glib 52/293052/1 accepted/tizen/7.0/unified/20230531.153704
TaeminYeom [Thu, 18 May 2023 07:33:32 +0000 (16:33 +0900)]
core: Change to register signal handler with glib

Using standard signal handler can make deadlock in terminating progress.
When standard signal handler is called dispatching g_main_context,
glib attempts to lock g_main_context again.
To prevent this situation, it is needed to use glib signal handler function.

Change-Id: If2e2fa1c3ebc4bbc7a00b11b3c7f42a9e4fd36ee
Signed-off-by: TaeminYeom <taemin.yeom@samsung.com>
12 months agodisplay: Change operation when system wakeup 29/291429/3 accepted/tizen/7.0/unified/20230424.020447
Youngjae Cho [Mon, 17 Apr 2023 01:00:06 +0000 (10:00 +0900)]
display: Change operation when system wakeup

The callback power_resume_from_echomem_callback(), which is invoked on
finishing power transition, has changed to operate only when the display
state remains S_SLEEP. That is, if the display has turned on while wait
for other apps' notification that they're OK to proceed transition, the
callback has nothing to do. The below is an example of such case.
  1. An application has registered power state change callback on one of
     the resuming transient state. let's say it was
     DEVICED_POWER_TRANSIENT_STATE_RESUMING.
  2. The system is sleeping.
  3. There key input is coming. The system starts resuming.
  4. On the way of resuming, the deviced's power module waits for
     OK sign of the app against DEVICED_POWER_TRANSIENT_STATE_RESUMING.
     Following transitions will be delayed until the app's OK sign.
  5. While waiting for the app, the deviced turns display on by itself.
     The key input event is captured by input module. On detecting the
     key event, the input module triggers display to be turned on
     regardless of power state. It aims to user responsiveness. As a
     result, display state will be S_NORMAL.
  6. The deviced receives app's OK sign. Remaining resume transitions
     will take place.
  7. On finishing resuming, the power_resume_from_echomem_callback()
     is invoked. But the display has already been turned on by input
     module. In this case, this callback has nothing to do.

On the other hand, if an event wouldn't change the display state, it
is necessary for the callback to change display state. For example,
let's assume an event were RTC, not key input, on the step 3 above. In
this case, the deviced will not turn the display on by itself so the
step 5 won't take place. Therefore on finishing power transition, it
is necessary for the power_resume_from_echomem_callback() to change
display state manually from S_SLEEP.

Change-Id: I2f0f693317a2d4387a4478e391c0251da4b9db72
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
12 months agodisplay: Relocate wakeup to where subroutine must go through 28/291428/3
Youngjae Cho [Fri, 14 Apr 2023 08:22:43 +0000 (17:22 +0900)]
display: Relocate wakeup to where subroutine must go through

Wakeup request via power_request_change_state_strict() has moved to
location where all request must go through so that redundant requests
could be removed. There are the two points:
 - lcd_on_procedure()
 - proc_condition_lock()
Those two are the essential point considering both autosleep and
echomem in that system must remain wakeup on that point.

Change-Id: Ie257403c8f04fd8aac63f588d120858b7d1006e9
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
13 months agopower: Relocate resuming device_notify() properly 76/289576/1 accepted/tizen/7.0/unified/20230327.042642
Youngjae Cho [Fri, 10 Mar 2023 01:53:52 +0000 (10:53 +0900)]
power: Relocate resuming device_notify() properly

The resuming notify should be broadcasted after completely finishing
wakeup transition. In other words, broadcasting should be held when a
transition is waiting for being confirmed by user program. In this
context, it is proper to relocate device_notify() to resume_echo_mem(),
which is invoked on finishing wakeup transition.

Change-Id: I0c924d5667b749f79e95f04b62c69e499ffb7058
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
14 months agopower: Wake unlock in case of cancelling transition 53/288553/1 accepted/tizen/7.0/unified/20230227.140639
Youngjae Cho [Thu, 16 Feb 2023 06:36:14 +0000 (15:36 +0900)]
power: Wake unlock in case of cancelling transition

Properly unlock the secondary wakelock when cancelling transition.
Currently there is no scenario for cancelling wakeup transition though,
it is important when it comes to undoing wakeup and trying to go sleep
again.

Change-Id: I5c4cc65d6bf8453919e0a2624603b8c04f574eb7
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
14 months agodisplay: Add support to select the DPMS type 85/288485/1 accepted/tizen/7.0/unified/20230220.064529
TaeminYeom [Tue, 14 Feb 2023 03:18:58 +0000 (12:18 +0900)]
display: Add support to select the DPMS type

DPMS (Display Power Management Signaling) is typically done by
requesting window manager. But some devices don't support window manager
and previous DPMS code was written assuming exiting window manager.
So, to support none window manager devices, dpms_ops struct is added.
According to DPMS type configuration, DPMS function can be bypassed.
If a new DPMS function is created later, it can be supported by connecting to dpms_ops.

[New added configuration]
- DisplayDPMSType
  : Indicates the type of DPMS. (window_manager or none)
    Default value is window_manager

Change-Id: I8a9f254102086b3e22c9498c1604e45c5053b60e
Signed-off-by: TaeminYeom <taemin.yeom@samsung.com>
14 months agodisplay: Change DPMS init and exit fucntion name 84/288484/1
TaeminYeom [Wed, 15 Feb 2023 03:00:27 +0000 (12:00 +0900)]
display: Change DPMS init and exit fucntion name

For consistent naming rule with other DPMS function,
change the names.

init_dpms -> dpms_init
exit_dpms -> dpms_exit
add_timer_for_init_dpms -> add_timer_for_dpms_init
delayed_init_done_dpms -> delayed_dpms_init_done

Change-Id: I1de2c9741526238d33c03e815f2ff73fa2a13f9f
Signed-off-by: TaeminYeom <taemin.yeom@samsung.com>
14 months agodisplay: Change get_var_display_config return type to const 83/288483/1
TaeminYeom [Wed, 15 Feb 2023 08:22:26 +0000 (17:22 +0900)]
display: Change get_var_display_config return type to const

To prevent modify display config static struct in other file.
If it wanted to be modified later, setter will have to be added.

Change-Id: I477fc8476981f18d92509dfb6b2c0783cc7df734
Signed-off-by: TaeminYeom <taemin.yeom@samsung.com>
14 months agodisplay: Move white_balance_ops functions from plugins to core display module 70/288470/1
Yunhee Seo [Thu, 16 Feb 2023 06:16:07 +0000 (15:16 +0900)]
display: Move white_balance_ops functions from plugins to core display module

Remove and redefine functions related to display white balance work.
Because white balancing is common for display.
Thus, these functions are added below display-panel.

int display_panel_set_white_balance(enum hal_display_white_balance white_balance_type, int value)
int display_panel_get_white_balance(enum hal_display_white_balance white_balance_type, int* out_val)
-> With hal_display_white_balance enum type, it is possible to get and set white_balance values.

Change-Id: I10213315d109e47f0e8c3a58382648ccef3ca2d1
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
14 months agodisplay: Add display hal-backend check function 69/288469/1
Yunhee Seo [Thu, 16 Feb 2023 05:32:53 +0000 (14:32 +0900)]
display: Add display hal-backend check function

Before plugin to core centralization, display hal backend check is needed.
To move functions without plugin dependency, this temporary function is necessary.
With this, plugin functions can be moved to core(deviced/src/display module).
These functions will be modified during plugin to core centralization.

void display_set_hal_backend_available(bool display_check_hal_backend)
-> With this, while plugin probing, deviced core can know whether hal_backend is
available or not.
bool display_check_hal_backend_available(void)
-> This function is for replacing the display_dev_available variable of plugins.

Change-Id: I1e926da29ab097e08533f73136a2f928daca9167
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
14 months agodisplay: change sleep reason to DISPLAY_OFF_TIMEOUT 45/288245/1
Youngjae Cho [Tue, 14 Feb 2023 01:11:34 +0000 (10:11 +0900)]
display: change sleep reason to DISPLAY_OFF_TIMEOUT

Technically, the sleep request of display plugin is triggered by timer,
not by display off itself.
  1. Display off, display state is changed to S_LCDOFF.
  2. Start timer, 300ms.
  3. On expiring the timer, display state is changed to S_SLEEP.
  4. The display plugin requests power module to change its state to
     DEVICED_POWER_STATE_SLEEP.
Therefore, it is proper to use enum DISPLAY_OFF_TIMEOUT instead of
just DISPLAY_OFF.

Change-Id: I93e6d092ebcc23e09db61f65d8f0b7e4dc5aac7e
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
(cherry picked from commit 918acdfef05bde8242672031c7c10430a1e6c165)

14 months agopower: skip echo mem if there is pending transition 29/288229/1
Youngjae Cho [Thu, 9 Feb 2023 02:33:52 +0000 (11:33 +0900)]
power: skip echo mem if there is pending transition

For echo mem, there could be some pending transitions when it comes to
enter suspend. This is because transition is asynchronously processed.
That is, if there were another transition request during a sleep
transition, the sleep transition should be skipped and take the next
transition immediately. Otherwise, the next transition will handled
after wakeup, which is indefinite.

Change-Id: Ia09a1d1162e21710538f6e9ce7bd1fb3e9c43d0f
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
14 months agopower: add transient scenario from START to SLEEP 28/288228/1
Youngjae Cho [Wed, 8 Feb 2023 09:50:34 +0000 (18:50 +0900)]
power: add transient scenario from START to SLEEP

Transient scenario for suspending from START to SLEEP has been added.
  DEVICED_POWER_STATE_START
              |
              V
  DEVICED_POWER_TRANSIENT_STATE_SUSPENDING_EARLY
              |
              V
  DEVICED_POWER_TRANSIENT_STATE_SUSPENDING
              |
              V
  DEVICED_POWER_TRANSIENT_STATE_SUSPENDING_LATE
              |
              V
  DEVICED_POWER_STATE_SLEEP

Change-Id: I814defb0245e94302746918fa5392ed3a08c64b3
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
14 months agopower: separate action_for_state() callback 27/288227/1
Youngjae Cho [Wed, 8 Feb 2023 09:17:17 +0000 (18:17 +0900)]
power: separate action_for_state() callback

Separated the callback action_for_state() into two type
 - pre_action_state()
 - post_action_state()
Literally, it only differs when the time it is invoked based on
completing transition, one is before and the other is after finishing
transition.

 It is necessary for echo mem. Previously, the action_for_state()
always invoked 'right before' transition completion. As it is echo mem,
system is forced to go suspend within the action_for_state() callback.
After resuming from the suspend, the processing thread still be in the
action_for_state(), which is still not having completed sleep transition.
As a result, a system is waking up but the internal power state is about
to be changed to sleep state. This is contradiction and causes various
undesirable behavior.
 To address it, move echo mem to post_action_state(). Unlike the
previous action_for_state(), the post_action_state() is invoked 'after'
the completion of transition. That is, it is natural that waking up
within the post_action_state() as it already has been finished sleep
transition. Thus it won't change the internal state to sleep anymore.

Change-Id: I49e12a19538bdb4241cba34fd536c942257ccaec
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
14 months agopower: remove unused code 26/288226/1
Youngjae Cho [Thu, 9 Feb 2023 02:55:25 +0000 (11:55 +0900)]
power: remove unused code

Change-Id: I7f77684552998c5ba5810143cfde854bd56105d2
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
14 months agopower: get wakeup_reason by calling hal-api 25/288225/1
Youngjae Cho [Mon, 13 Feb 2023 08:46:11 +0000 (17:46 +0900)]
power: get wakeup_reason by calling hal-api

As the previous patch,
 - power: update wakeup reason immediately after wakeup
has changed not to maintain wakeup reason after resume, it is necessary
to access it via hal-api for every request for wakeup reason.

Change-Id: Ibf2aebb5b542dd1d55f799be0fbaddf65a6a8e7c
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
14 months agopower: update wakeup reason immediately after wakeup 24/288224/1
Youngjae Cho [Wed, 8 Feb 2023 03:40:14 +0000 (12:40 +0900)]
power: update wakeup reason immediately after wakeup

The wakeup reason would be utilized by callback of device_notify().
Therefore update it on resuming. To prevent the wakeup reason from
lingering, reset it by 0 before returning the function.

Change-Id: I149b2999f14a1c2461098506bd64a242d66937fd
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
14 months agoinput: add input config file parsing code for touchscreen 94/287894/1 accepted/tizen/7.0/unified/20230209.070244
Yunhee Seo [Tue, 7 Feb 2023 09:28:18 +0000 (18:28 +0900)]
input: add input config file parsing code for touchscreen

Add input config file parsing code for touchscreen input type.

Change-Id: I6b9623760e082ea33b86fa0e4c4eaf3d429a2b38
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
14 months agodisplay: add function for broadcasting pmlock state 67/287867/1
Yunhee Seo [Mon, 6 Feb 2023 05:14:50 +0000 (14:14 +0900)]
display: add function for broadcasting pmlock state

Add functions to inform/get pmlock state.
When the pmlock node is changed(locked or unlocked), signal will be emitted.
Also, It is possible to get pmlock state with below dbus method.

1. Get pmlock lock state
path: /Org/Tizen/System/DeviceD/Display
interface: org.tizen.system.deviced.display
member: PmlockGetLockState
parameter: "(i)", power lock type to get lock status of pmlock state
return: "(i)", value which means locked or unlocked of pmlock state

Change-Id: I35fe5e882cc22616190a56d18155fcde7aa1b968
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
14 months agopower: clarify notion of action callback function 52/287852/1
Youngjae Cho [Tue, 31 Jan 2023 09:06:59 +0000 (18:06 +0900)]
power: clarify notion of action callback function

The callback, action_for_state(), now denotes jobs that are necessary
before the target state, that is, it is kind of to-do list for entering
the state.

To this end, the name has been slightnly changed from action_on_state(),
which implies it is invoked right 'after' the state change, to
action_for_state(), which emphasizes it is invoked 'before' the state.

In addition, the position where the variable 'current' is updated has
been relocated to fit into the concept of action_for_state(). That is,
it is updated after the callback.

Change-Id: I47698ce9147c155c0d5e30feed0a60d65d69031b
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
14 months agopower: introduce transition cancelling 51/287851/1
Youngjae Cho [Fri, 20 Jan 2023 06:25:07 +0000 (15:25 +0900)]
power: introduce transition cancelling

Cancelling transition reserves a new transition that undoing the ongoing
transition. That is, the power state will return to the previous state
after finishing the ongoing transition. Additionally with that
reservation, it discards all the pending transitions except one that is
to the poweroff/reboot/exit state.

Change-Id: Ib05841fa91162109db1c05b2f5e0a3e7edd3b90c
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
14 months agopower: change variable name for clear meaning 50/287850/1
Youngjae Cho [Thu, 26 Jan 2023 02:35:27 +0000 (11:35 +0900)]
power: change variable name for clear meaning

Change-Id: Ib6342fa303d95a8597a08cb4a1f483f390dc9b75
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
15 months agousb-gadget: Handle more than one extcon reporting USB cable 65/287065/3
Marek Szyprowski [Thu, 19 Jan 2023 07:30:10 +0000 (08:30 +0100)]
usb-gadget: Handle more than one extcon reporting USB cable

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I0c26ac4ecb13f1cd6d0c464a105e1e333b411806
(cherry picked from commit 80bf51f40a15940a966acc363a7e48480b9f11fc)

15 months agotools: devicectl: add handling code to return check accepted/tizen/7.0/unified/20230203.164113
Yunhee Seo [Fri, 27 Jan 2023 01:35:06 +0000 (10:35 +0900)]
tools: devicectl: add handling code to return check

Add handling code to resolve issue reported by static analysis.

Change-Id: I357c4169783b51423c6216a8b7808fbc051bce44
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
(cherry picked from commit 1db22485982467cb1f3e3a92d1ce335839dc27a2)

15 months agopower: add handling code to return check
Yunhee Seo [Thu, 26 Jan 2023 11:19:11 +0000 (20:19 +0900)]
power: add handling code to return check

Add handling code to resolve issue reported by static analysis.

Change-Id: I960daea8e8c670579bf2ab0b98cfb5a5842a9b68
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
(cherry picked from commit 51a87ea655edc22411975eefc192a646f4113ae8)

15 months agoplugin: iot-headless: input: add handling code to return check
Yunhee Seo [Thu, 26 Jan 2023 11:03:28 +0000 (20:03 +0900)]
plugin: iot-headless: input: add handling code to return check

Add handling code to resolve issue reported by static analysis.

Change-Id: Ice9db999cfbd4de35de504dd773fa782a61eca51
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
(cherry picked from commit 80525ca8953ae0258e4e1fafa7af56d64b91b65a)

15 months agoplugin: iot-headless: display: add handling code to return check
Yunhee Seo [Thu, 26 Jan 2023 10:50:04 +0000 (19:50 +0900)]
plugin: iot-headless: display: add handling code to return check

Add handling code to resolve issue reported by static analysis.

Change-Id: I761e84429ad3372a029a7daedd2ef430a1472c23
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
(cherry picked from commit 523bcf82fbc6d051b41f247ff4b5e00ac74ce42a)

15 months agoinput: add handling code to avoid memory leak issue 45/287345/1
Yunhee Seo [Thu, 26 Jan 2023 07:36:54 +0000 (16:36 +0900)]
input: add handling code to avoid memory leak issue

Clean-up the reported issue by static analysis.

Change-Id: I474f8974943b74eec769a6dfd2c7199261d6155d
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
(cherry picked from commit 849f43b7a0a22ad1a9a2058c532b7ff4d6b9424c)

15 months agoinput: add DEVICE_INPUT_TYPE_ALL enum type handling 21/287221/1 accepted/tizen/7.0/unified/20230126.170233
Yunhee Seo [Wed, 18 Jan 2023 02:12:43 +0000 (11:12 +0900)]
input: add DEVICE_INPUT_TYPE_ALL enum type handling

Add DEVICE_INPUT_TYPE_ALL handling code which was omitted.
With this, it is possible to get all kinds of device ids.

Change-Id: I24a6f4706214fb2963ac6e7a4ad3ae8a4ff58ffb
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
(cherry picked from commit 6f3964ad83f4ca4718735962bf5a4ea2e590cf52)

15 months agotouchscreen: clean-up uninitialized variable warning by static analysis 20/287220/1
Yunhee Seo [Thu, 19 Jan 2023 06:24:23 +0000 (15:24 +0900)]
touchscreen: clean-up uninitialized variable warning by static analysis

Add return code to avoid reaching uninitialized enum variable "state".

Change-Id: Idce5e24bc2c979c350629b8e413494dd62003cf5
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
(cherry picked from commit 5d024fdb8bd0ab5d493ddaeeccd0fff5bc9472f8)

15 months agoinput: clean-up the useless code and add handling code 72/286972/1
Yunhee Seo [Mon, 16 Jan 2023 11:07:13 +0000 (20:07 +0900)]
input: clean-up the useless code and add handling code

add detecting existence of config file and parsing fail condition,
also added input device manager exit condition check
remove useless header line

Change-Id: I16e5e3c82947f444251156e3305067d536a0ece7
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
(cherry picked from commit 5ea085bf8d22694323fca7a82f54fe459d0d1b3a)

15 months agoinput: clean-up the reported warning by static analysis 31/286931/1 accepted/tizen/7.0/unified/20230118.093750
Yunhee Seo [Mon, 16 Jan 2023 09:57:51 +0000 (18:57 +0900)]
input: clean-up the reported warning by static analysis

improve code reported warning by static analysis
to avoid memory leak, build warning, unexpected return value issues

Change-Id: Ic9c3435c6515e645b52cdbc5feca223f918f6443
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
(cherry picked from commit 094f89dcd1555fb18ec1ff49c3503fa67f02936f)

15 months agoinput: add the dbus interface and input config parser 84/286884/1 accepted/tizen/7.0/unified/20230117.141746
Yunhee Seo [Mon, 9 Jan 2023 14:18:46 +0000 (23:18 +0900)]
input: add the dbus interface and input config parser

Add input device information dbus methods
Input event on/off option can be handled by device id number.
With config file, user can set the customed input devices
and input-parser will mananging input devices from it.

[InputDeivce] format which is in input.conf
InputDeviceType -> hal_deivce_input_type
InputDeviceId -> id number which exist under the /sys/class/input/inputXX path
InputDeviceName -> device name
InputDeviceDefault -> yes/no

Input dbus methods
1. Get input devices
    path: /Org/Tizen/System/DeviceD/Input
    interface: org.tizen.system.deviced.input
    member: InputGetDevices
    parameter: "(i)", input device type to get device id list
    return: "(ai)", get int device id list on success, empty list on error.

2. Get default device
    path: /Org/Tizen/System/DeviceD/Input
    interface: org.tizen.system.deviced.input
    member: InputGetDefaultDevice
    parameter: "(i)", input device type to get default devicd id
    return: "(i)", get device id value on success, negative on error.

3. Get device name
    path: /Org/Tizen/System/DeviceD/Input
    interface: org.tizen.system.deviced.input
    member: InputGetDeviceName
    parameter: "(i)", input device id to get device name
    return: "(is)", (ret_val, ret_dev_name)
        negative ret_val means error, otherwise success.

Change-Id: I0977c29f538f432cb5ab82e610130698ce7ad5b9
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
(cherry picked from commit c67debace2c0a2f2bfb53b9d71cb18d3a6f947fc)

15 months agodisplay: remove rotation dbus method in headless profile 28/286528/1 accepted/tizen/7.0/unified/20230111.015124
TaeminYeom [Thu, 5 Jan 2023 08:13:41 +0000 (17:13 +0900)]
display: remove rotation dbus method in headless profile

Display rotation API cannot be used in headless profile
because display feature is false.
So, these methods should be removed.

removed dbus method:
  dbus_getrotationangle
  dbus_setrotationangle

Change-Id: I10c029136f5e2fa456aac8f839c4dab3532fa1f2
Signed-off-by: TaeminYeom <taemin.yeom@samsung.com>
15 months agodisplay: Add init direction in rotation angle 27/286527/1
TaeminYeom [Tue, 3 Jan 2023 10:53:48 +0000 (19:53 +0900)]
display: Add init direction in rotation angle

init direction means the display direction of degree 0.
It is needed to know physical display state by app.

When deviced boot, it parses the conf file "/etc/deviced/display.conf"
and it saves the initial display is horizontal or vertical.

changed dbus method:
dbus_getrotationangle
  path: "/Org/Tizen/System/DeviceD/Display"
  interace: "org.tizen.system.deviced.display"
  member: "GetRotationAngle"
  paremeter: "(i)", display index to get rotation angle.
  return: "(iii)", 0 on success, negative on error.
enum display rotation angle to get.
enum display initial direction.

added configuration property:
  DisplayInitDirection : "horizontal" or "vertical"

Change-Id: I9a45d06b712a04d79e8614bac5880d4be6fe4fd3
Signed-off-by: TaeminYeom <taemin.yeom@samsung.com>
15 months agopower: apply suspend to ram by echo mem 00/286300/1 accepted/tizen/7.0/unified/20230104.173118
Youngjae Cho [Tue, 3 Jan 2023 02:33:31 +0000 (11:33 +0900)]
power: apply suspend to ram by echo mem

Change-Id: Ia68f749de8010ba7fbbb0ae8a29ec8f6d6de7ccf
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
(cherry picked from commit 523acd6ad10f333d95a2bfb01252010a53c60bbb)

15 months agopower: move broadcast suspend/resume into power module 99/286299/1
Youngjae Cho [Mon, 2 Jan 2023 10:58:27 +0000 (19:58 +0900)]
power: move broadcast suspend/resume into power module

Change-Id: I3a9499947866716154dadc1a415578630c60ad7b
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
(cherry picked from commit 41ab55ff50cd06956fabeaf70cec5ad0b8fe81da)

16 months agoinput: relocate dbus interface initialization 72/286272/1
Yunhee Seo [Mon, 2 Jan 2023 02:11:11 +0000 (11:11 +0900)]
input: relocate dbus interface initialization

Previous input dbus interface was initialized by input plugin part.
Thus, input dbus interface initialization part is moved to core input module.

Change-Id: Ie786e15b49b20d30e35719e5f5f26dd0a492a4e8
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
16 months agodevicectl: add suspend/resume command 18/286218/1
Youngjae Cho [Tue, 27 Dec 2022 08:25:51 +0000 (17:25 +0900)]
devicectl: add suspend/resume command

Usage: devicectl power suspend|resume reason(int)
 #) devicectl power suspend 12345
 #) devicectl power resume 2000

The value reason can be an any integer and the devicectl doesn't test
it is valid reason or not. Therefore some listeners of suspend/resume
event might malfunction as they receive a wierd reason.

Change-Id: I62c66e0a8034f9884fd006404991330902ecca21
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
(cherry picked from commit 4d0daf18b56643cfaeb81f7ca777135726340398)

16 months agopower: reloacte marking poweroff option 04/286004/1 accepted/tizen/7.0/unified/20230103.055617
Youngjae Cho [Fri, 23 Dec 2022 01:17:08 +0000 (10:17 +0900)]
power: reloacte marking poweroff option

Poweroff option can be marked just on receiving the option from dbus
method. It is safer in that it prevents loss of option address due to
asynchronous process of power transition.

Change-Id: I77f7c81035d3281396c0aea0a8c96760f08d5334
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
(cherry picked from commit 470680f23c1c37d375238c43c7f7821977350814)

16 months agodisplay: Add rotation angle interface 50/285950/1 accepted/tizen/7.0/unified/20221226.131616 accepted/tizen/7.0/unified/20221226.172021 accepted/tizen/7.0/unified/20221227.024850
TaeminYeom [Thu, 29 Sep 2022 04:52:55 +0000 (13:52 +0900)]
display: Add rotation angle interface

rotation angle means "physical display" direction.
Clients can rotate display or check current display angle.

dbus method:
dbus_getrotationangle
  path: "/Org/Tizen/System/DeviceD/Display"
  interace: "org.tizen.system.deviced.display"
  member: "GetRotationAngle"
  paremeter: "(i)", display index to get rotation angle.
  return: "(ii)", 0 on success, negative on error.
enum display rotation angle to get.

dbus_setrotationangle
  path: "/Org/Tizen/System/DeviceD/Display"
  interace: "org.tizen.system.deviced.display"
  member: "SetRotationAngle"
  paremeter: "(iii)", display index to set rotation angle.
enum display rotation angle to set.
enum display rotation direction.
  return: "(i)", 0 on success, negative on error.

Change-Id: I792dd4d68034d511443c3c09c5b37bea220bce81
Signed-off-by: TaeminYeom <taemin.yeom@samsung.com>
16 months agopower: fix data type of transition id 31/285731/1 accepted/tizen/7.0/unified/20221220.180247
Youngjae Cho [Thu, 15 Dec 2022 08:03:14 +0000 (17:03 +0900)]
power: fix data type of transition id

Prevent including garbage at broadcast_transition_info() where an id
is extended to a 64-bit size datatype.

Change-Id: I5aabaecbb3a8dfa5a54aa7bd43248546e731bca6
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
(cherry picked from commit 98289c214d9a610c009505639353bb49a8f69d65)

16 months agopower: add getter wakeup reason 82/285682/1
TaeminYeom [Thu, 1 Dec 2022 08:59:14 +0000 (17:59 +0900)]
power: add getter wakeup reason

Add function to get wakeup reason by calling hal api function
and save wakup reason.

Add dbus method to delliver saved wakeup reason to device API.

"wakeup reason" is the power transition state reason of sleep to normal.
There are several reasons why the device wakeup and
sometimes it Is needed to get the reason.

added dbus method:
dbus_power_get_wakeup_reason
  path: "/Org/Tizen/System/DeviceD/Power"
  interace: "org.tizen.system.deviced.Power"
  member: "PowerGetWakeupReason"
  paremeter: "(i)", enum transition reason to get.
  return: "(i)", 0 on success, negative on error.

Change-Id: I2f96fecb3bc1308afc712421e3b2f6c8a7efefea
Signed-off-by: TaeminYeom <taemin.yeom@samsung.com>
(cherry picked from commit 5f262d9d915ec4b49e6a78a0bec04bfb30f3fdfd)

16 months agoinput: add the input dbus interface 71/285671/1
Yunhee Seo [Tue, 13 Dec 2022 02:41:35 +0000 (11:41 +0900)]
input: add the input dbus interface

Add a getter and setter function of input device event status
With input device id parameter, it is possible to enable/disable input device event

Input device event getter/setter dbus methods
1. Set input event state
    path: /Org/Tizen/System/DeviceD/Input
    interface: org.tizen.system.deviced.input
    member: InputSetEventState
    parameter: "(ii)", input device id to be set event state, value to be set
    return: "(i)", 0 on success, negative on error.
2. Get input event state
    path: /Org/Tizen/System/DeviceD/Input
    interface: org.tizen.system.deviced.input
    member: InputGetEventState
    parameter: "(i)", input device id to be get event state
    return: "(i)", get value on success, negative on error.

Change-Id: I820add4689222198e3cc9a24fd616382800bcf16
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
(cherry picked from commit 4e1f541f0a9e027a64a5ba4e53e091fe5ef24853)

16 months agopower: redefine deviced-exclusive power state enum 79/285579/1
Youngjae Cho [Wed, 14 Dec 2022 09:20:05 +0000 (18:20 +0900)]
power: redefine deviced-exclusive power state enum

Do not use enums from device API for the deviced power module. Instead,
the deviced defines its own enums prefixed with DEVICED_POWER. When the
deviced receives request from device API with API enum, then it is
converted to the deviced enum, and vice versa.

Change-Id: Ic67ba5c1bbbb1fa8335c15fde43cb13e9705eb0c
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
(cherry picked from commit bab81b4522e739a2f5cc3046b4d50363b806fe79)

16 months agopower: Add "DEVICE" or "device" prefix to enum and API 77/285577/1
TaeminYeom [Mon, 12 Dec 2022 09:05:12 +0000 (18:05 +0900)]
power: Add "DEVICE" or "device" prefix to enum and API

To prevent collision, it is a principle to attach a prefix of project name
in capi project. However, previous codes does not meet it. So, there is
a patch in capi-system-device, and also change the code using them
in deviced.

changed enum:

power_state_e -> device_power_state_e
POWER_STATE_* -> DEVICE_POWER_STATE_*

power_transient_state_e -> device_power_transient_state_e
POWER_STATE_TRANSIENT_* -> DEVICE_POWER_STATE_TRANSIENT_*
POWER_STATE_TRANSIENT_*_EARLY -> DEVICE_POWER_STATE_TRANSIENT_*_EARLY
POWER_STATE_TRANSIENT_*_LATE -> DEVICE_POWER_STATE_TRANSIENT_*_LATE

POWER_STATE_*_INDEX -> DEVICE_POWER_STATE_*_INDEX
POWER_STATE_TRANSIENT_*_INDEX -> DEVICE_POWER_STATE_TRANSIENT_*_INDEX

changed callback:

power_change_state_wait_callback -> device_power_change_state_wait_callback

Change-Id: I38887a0c35f897af2607b4ddf1e167675c1daf72
Signed-off-by: TaeminYeom <taemin.yeom@samsung.com>
(cherry picked from commit 0adc137f91bfe4b6e170df8607f4d1778ac38e64)

16 months agopower: fix condition for available starting state 38/285438/1
Youngjae Cho [Mon, 12 Dec 2022 02:17:00 +0000 (11:17 +0900)]
power: fix condition for available starting state

 The condition for checking queue should have come first. This matters
during a system haven't been initialized, that is before the call of
delayed_init_callback(). Before the delayed_init_callback(), all
requests are enqueued even though transition is not underway. In this
case, it is possible to meet the both condtitions below:
  1. there is no ongoing transition
  2. there are some enqueued transitions
In this situation, we must select the last state of transition as an
available state. But the previous condition chooses the current state.

Change-Id: If6285e2ca78734378ac9b626947b24ebb3d8594d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
(cherry picked from commit d861ffd68509eb9871c0ab0f990e8cde61da5940)

16 months agopower: introduce transient state 33/285233/1
Youngjae Cho [Tue, 22 Nov 2022 08:27:36 +0000 (17:27 +0900)]
power: introduce transient state

It is able to define transient state between static states. The deviced
always follows those transient states in sequence. It provides some
checkpoints between static states, giving chances for other processes
to sync with each other.

Change-Id: I446083fd1c90610f805a64d61f16defc5a0a9b67
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
(cherry picked from commit 888dc040d3e1b48d7d370919292ccf2a0646562c)

16 months agopower: revamp power module 24/285224/1
Youngjae Cho [Tue, 22 Nov 2022 08:27:36 +0000 (17:27 +0900)]
power: revamp power module

- Integrate power-state-wait.c into power.c

- Transition is not preemptive anymore
  : Previosuly, transitions can cancel and intercept ongoing one.
    But it has changed to be enqueued if there is ongoing transition.
    It will be handled after handling all the other pending transitions.

Change-Id: Ifbe92098ea4c69f09f744609405dfb1e5e67f75f
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
(cherry picked from commit 0850fa700466f27ca2ddcf7d721700859a3107be)

17 months agopower: check operation is null 68/284668/1 accepted/tizen/7.0/unified/20221128.015433
Youngjae Cho [Tue, 22 Nov 2022 10:52:02 +0000 (19:52 +0900)]
power: check operation is null

The iot-headless profile has been changed to have display module.
  - display: add dummy display for iot-headless
    (1985b78991d1fe925b827ded4fdae58d1b4e1d7a)

Prevent crash on accessing not existing operation.

Change-Id: I601e4cb8412423ed8ecca9d9c022b366e039690e
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
(cherry picked from commit 7d138e274e8c62aa49fc31615af98eea83d0f929)

17 months agodisplay: add getter/setter function for white balance 92/284292/1 accepted/tizen/7.0/unified/20221117.014348
Yunhee Seo [Thu, 10 Nov 2022 08:12:45 +0000 (17:12 +0900)]
display: add getter/setter function for white balance

Add a dbus/plugin getter and setter function of display white balance which controls RGB gain and offset.

White balancing is adjusting standard point of white color, this because the light source is different for each device.
gain value is a value to be multiplied for RGB value calculation.
offset value is a value to be added for RGB value calculation.

white balancing getter/setter dbus methods
1. Set white balance
    path: /Org/Tizen/System/DeviceD/Display
    interface: org.tizen.system.deviced.display
    member: SetWhiteBalance
    parameter: "(ii)", white balance enum type to be set, value to be set
    return: "(i)", 0 on success, negative on error.

2. Get white balance
    path: /Org/Tizen/System/DeviceD/Display
    interface: org.tizen.system.deviced.display
    member: GetWhiteBalance
    parameter: "(i)", white balance enum type to be get
    return: "(i)", value for that white balance type, negative on error.

plugin implementation is referring to this enum type
enum hal_display_white_balance {
HAL_DISPLAY_WHITE_BALANCE_R_GAIN,
HAL_DISPLAY_WHITE_BALANCE_G_GAIN,
HAL_DISPLAY_WHITE_BALANCE_B_GAIN,
HAL_DISPLAY_WHITE_BALANCE_R_OFFSET,
HAL_DISPLAY_WHITE_BALANCE_G_OFFSET,
HAL_DISPLAY_WHITE_BALANCE_B_OFFSET,
};

Change-Id: I972bdb468806b442b221634a166645764c7c2ec9
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
(cherry picked from commit 0b807395978a911334d6204ba383d5ea5a244f5d)

17 months agodisplay: remove unused code 11/284111/1
Youngjae Cho [Wed, 9 Nov 2022 01:39:59 +0000 (10:39 +0900)]
display: remove unused code

It has been removed since ce471ec18f19bb184848f4c84e813b834ef4bdee.

Change-Id: I5b74f4907bc7e6b9a04f3b3960470fb984446737
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
(cherry picked from commit 3ae0cab3228895407a1462338c54f03636a4e049)

18 months agobattery: add missing low battery scenario 15/283815/1 accepted/tizen/7.0/unified/20221105.102655 accepted/tizen/7.0/unified/20221110.061653
Youngjae Cho [Thu, 3 Nov 2022 09:14:19 +0000 (18:14 +0900)]
battery: add missing low battery scenario

Change-Id: Ic99fd153288302d453c3a16c016f9cf432b25217
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
(cherry picked from commit 38d41b3f643627e914f0caccd6605388ee06615a)

19 months agodisplay: add dummy display for iot-headless 44/281644/2 accepted/tizen_7.0_unified_hotfix tizen_7.0_hotfix accepted/tizen/7.0/unified/hotfix/20221116.105704 accepted/tizen/unified/20220921.091815 tizen_7.0_m2_release
Youngjae Cho [Tue, 20 Sep 2022 06:45:26 +0000 (15:45 +0900)]
display: add dummy display for iot-headless

For who want cpulock directly via dbus API, not device API on headless
target, add dummy dbus object that receives those request not to emit
error.

Such a weird call, request for display function on headless profile,
is basically because display module provides state locking including
sleep state(cpulock), which should have been handled by power module.
Therefore in the future, moving cpulock from display to power module
should be followed by removing this dummy.

Change-Id: If8f0b449f65832ddf705b9e7ad4e461c20f6a102
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
20 months agoinput: comment out target-specific configuration 43/280343/1
Youngjae Cho [Mon, 29 Aug 2022 00:59:18 +0000 (09:59 +0900)]
input: comment out target-specific configuration

Leave configuration itself for use as an example.

Change-Id: I36723a7f6c3014c641bca58faf27c284c6d2a3ee
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
20 months agoinput: add dbus method for testing keyinput 13/279713/1
Youngjae Cho [Wed, 17 Aug 2022 00:58:38 +0000 (09:58 +0900)]
input: add dbus method for testing keyinput

Change-Id: Id59ec92a95335f2f9c142d95b8d1f08a5989887c
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
20 months agopower: consider bootmode as well as bootreason 59/279159/5
Youngjae Cho [Wed, 3 Aug 2022 02:33:50 +0000 (11:33 +0900)]
power: consider bootmode as well as bootreason

Take consideration of bootmode as well as bootreason for the initial
state transition.

Change-Id: I2ba378cbf146215f315b4d413ec4fd4e470cafe1
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agoinput: define all possible cases of longest powerkey 57/279057/2
Youngjae Cho [Mon, 1 Aug 2022 08:49:44 +0000 (17:49 +0900)]
input: define all possible cases of longest powerkey

Change-Id: I98f558f8878bcaa59b4d3d898bfd260143b2a56d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agobattery: redefine battery level threshold 77/278677/4
Youngjae Cho [Mon, 25 Jul 2022 04:50:00 +0000 (13:50 +0900)]
battery: redefine battery level threshold

The realoff threshold has been removed and the poweroff level takes
over the role of realoff level.

Change-Id: I887c3a49cd6d251e3c2837b6a123a6d0b190c708
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agopower: add getter for power state 58/277658/3
Youngjae Cho [Tue, 12 Jul 2022 01:10:23 +0000 (10:10 +0900)]
power: add getter for power state

Change-Id: I792f01d67adeba213f84003fea4fc506f4f04ad9
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agodevice-notifier: find existing notifier only 84/277684/2
Youngjae Cho [Tue, 12 Jul 2022 06:16:53 +0000 (15:16 +0900)]
device-notifier: find existing notifier only

It only finds a notifier that has not been deleted.

Change-Id: Ica945fb57cfe09cf4c82c94e07558abe23704b32
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agobattery: remove unreachable code 46/276446/8
Youngjae Cho [Fri, 17 Jun 2022 00:12:24 +0000 (09:12 +0900)]
battery: remove unreachable code

The fallback for not existing battery hal is technically useless. It
is because if there is no battery backend, the battery module itself
won't be work properly as it cannot know about target dependent
properties.

Change-Id: Iaea07a1ecd47fdf14b13ca9e07d42a28c07357a0
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agoinit: define state transition for bootreason=reboot 70/277470/2
Youngjae Cho [Thu, 7 Jul 2022 09:18:59 +0000 (18:18 +0900)]
init: define state transition for bootreason=reboot

Change-Id: I5cf8b2a27688a3fd0c0c550555673e99abcd4495
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
22 months agoRemove installation of not existing file 69/277469/1
Youngjae Cho [Thu, 30 Jun 2022 01:46:34 +0000 (10:46 +0900)]
Remove installation of not existing file

The iot-headless-power.so had been removed.

Change-Id: I4d45191e70e354934b5991a7f601afdd79e5ae17
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
22 months agobattery: broadcast signal on charger connected/disconnected 47/277047/1
Youngjae Cho [Thu, 30 Jun 2022 01:29:45 +0000 (10:29 +0900)]
battery: broadcast signal on charger connected/disconnected

Change-Id: Iaef820f91138eddead997f1a3c250d745d8ceb28
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
22 months agobattery: remove unnecessary probe for power-supply 69/276769/1
Youngjae Cho [Fri, 24 Jun 2022 07:54:05 +0000 (16:54 +0900)]
battery: remove unnecessary probe for power-supply

It is naturally done by the power-supply module itself. Therefore it
is unnecessary for lowbat module to probe power-supply.

Change-Id: Id18bcea6a1bd9a0aae87c5f6a54815dc74b814b6
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
22 months agoextcon: remove unused extcon count 38/276738/1
Youngjae Cho [Fri, 24 Jun 2022 01:05:40 +0000 (10:05 +0900)]
extcon: remove unused extcon count

Change-Id: I8d666e031338dd05db478b033ecf757a23971785
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
22 months agopower: change state only when it is explicitly specified 43/276543/5 accepted/tizen/unified/20220626.224815 submit/tizen/20220624.005127
Youngjae Cho [Mon, 20 Jun 2022 07:57:46 +0000 (16:57 +0900)]
power: change state only when it is explicitly specified

It might not to change state if there is no defined ActionChangeState.

Change-Id: I16f6bd7992722787d2a95cc38c6764db81b67238
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
22 months agoapps: move to shared library 68/276468/1
Youngjae Cho [Fri, 17 Jun 2022 05:26:50 +0000 (14:26 +0900)]
apps: move to shared library

Change-Id: I039bff30ad1b3745abd72ee4637caadd37487319
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
22 months agoinput: add WakeLockDurationSec to PWKEY_SHORT_EDGE 32/276432/1
Youngjae Cho [Thu, 16 Jun 2022 08:24:17 +0000 (17:24 +0900)]
input: add WakeLockDurationSec to PWKEY_SHORT_EDGE

Change-Id: Ia9e6ab7cec68ef7fe5e3cbe8926f3838fd583da6
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
22 months agoinput: add wakelock action for level event 16/276416/1
Youngjae Cho [Thu, 16 Jun 2022 05:59:57 +0000 (14:59 +0900)]
input: add wakelock action for level event

Change-Id: Ie7fa5cb2d4c8101c9d56bc52130ed29caac2ccf4
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
22 months agoinput: rename Name= of EventAction 12/276412/1
Youngjae Cho [Thu, 16 Jun 2022 05:42:25 +0000 (14:42 +0900)]
input: rename Name= of EventAction

Change-Id: Iabdf19bd8c90937f0052e598b608f68efc0a6be7
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
22 months agoinput: rearrange EventAction in chronological order 09/276409/1
Youngjae Cho [Thu, 16 Jun 2022 05:23:50 +0000 (14:23 +0900)]
input: rearrange EventAction in chronological order

Change-Id: Idd1363d61ca4c303936fcd027b812eb57c6efb5c
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
22 months agoinput: add broadcasting action for level event 07/276407/1
Youngjae Cho [Thu, 16 Jun 2022 05:22:07 +0000 (14:22 +0900)]
input: add broadcasting action for level event

Change-Id: I57090ba79f082d9c8c2a3c657e586ccc7f12a97f
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
22 months agoReconfigure input for iot-headless 47/276347/2
Youngjae Cho [Wed, 15 Jun 2022 05:28:17 +0000 (14:28 +0900)]
Reconfigure input for iot-headless

Change-Id: I035784568172ce7d8367f26361460d136b7d9c32
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
22 months agoevent: add event functions to shared library 25/276225/11
Youngjae Cho [Mon, 13 Jun 2022 06:09:12 +0000 (15:09 +0900)]
event: add event functions to shared library

It contains functions that handling wakelock of event, and broadcasting
signal about an event itself. The properties, WakeLockDurationSec= and
ActionBroadcast= of configuration file, utilize those functions.

Change-Id: I926f5e9cf19bfe09042797a200569c69e2b25a21
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
22 months agoChange format of EventAction properties 17/276217/9
Youngjae Cho [Mon, 13 Jun 2022 05:09:27 +0000 (14:09 +0900)]
Change format of EventAction properties

There were two types of Action= property, one is broadcasting and the
other is changing state. Separate them to have different property name,
Broadcast= and ChangeState=.
 - Action=broadcast -> ActionBroadcast=yes
 - Action=curr,next -> ActionChangeState=curr,next

In addition to this, changed Duration= to clarify its meaning.
 - Duration -> DetectionRangeMsec

This is intermediate patch. Therefore in this version, the property
'ActionBroadcast=yes' won't work properly.

Change-Id: I00440c9bc30557812618b95f1a25663e9466158a
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
22 months agopower: reinforce log at PowerChangeState method 77/276277/2
Youngjae Cho [Tue, 14 Jun 2022 01:35:50 +0000 (10:35 +0900)]
power: reinforce log at PowerChangeState method

Change-Id: I53db2b4855fc8fafb5ab4436d3d95d37e04bbf77
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
22 months agobattery: disable module if battery.present is 0 64/275064/4
Youngjae Cho [Mon, 16 May 2022 06:59:55 +0000 (15:59 +0900)]
battery: disable module if battery.present is 0

The actual behavior of no battery remains same as before. It is the
main purpose of this patch that cleaning up handlings and loggins.

Change-Id: Iaae8ac1ce6a438f0a2984d7ea6a3e6953ff8a51f
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
22 months agobattery: remove unused variable, charger_charging 36/275936/2
Youngjae Cho [Tue, 7 Jun 2022 05:31:25 +0000 (14:31 +0900)]
battery: remove unused variable, charger_charging

Change-Id: Ic7ea822a41b9cc1a1561d6b1a2c40da648220a3d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
22 months agolog: add critical-log type of error 34/275934/3
Youngjae Cho [Tue, 7 Jun 2022 04:41:27 +0000 (13:41 +0900)]
log: add critical-log type of error

Change-Id: I4e7abb62edafc719decd2d9f9e6841de46e0fbf7
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
22 months agobattery: rename charging_level to capacity_level 31/275931/1
Youngjae Cho [Tue, 7 Jun 2022 04:20:40 +0000 (13:20 +0900)]
battery: rename charging_level to capacity_level

Change-Id: If092c80ced70eb2ed64570383ffa1a99b1f442bf
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
22 months agobattery: remove unused frequency strength 85/274585/4
Youngjae Cho [Tue, 3 May 2022 05:04:18 +0000 (14:04 +0900)]
battery: remove unused frequency strength

Change-Id: I8e0ecff76defec792b9d0f694996d49435343791
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
23 months agousb-gadget: make variable null after free 15/275815/2
Youngjae Cho [Thu, 2 Jun 2022 06:30:19 +0000 (15:30 +0900)]
usb-gadget: make variable null after free

The SIGABRT(heap-use-after-free) was raised. It happened rarely when
the sdb is re-enabled after disabled due to unstable envrionment.
(But it is unclear what the unstable envrionment is.) To prevent this,
make a variable null after freeing it.

Change-Id: I2218004bf2069d6f8a6c835ba8883ece22f9c75b
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
23 months agopower: change PowerChangeState reason to 0 06/275806/1
Youngjae Cho [Thu, 2 Jun 2022 05:05:27 +0000 (14:05 +0900)]
power: change PowerChangeState reason to 0

Change-Id: I597f90d4ecae63b7cf645431f2ef09bb86fa02c8
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
23 months agopower: add dbus method for controlling power state 37/275737/3 accepted/tizen/unified/20220601.141558 submit/tizen/20220531.085748
Youngjae Cho [Tue, 31 May 2022 06:11:10 +0000 (15:11 +0900)]
power: add dbus method for controlling power state

Change-Id: I6973dd1fdad1e5c3c9aebbf23aa00be372cd3a1e
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
23 months agopower: unify power state transition routine 17/275117/19
Youngjae Cho [Tue, 17 May 2022 02:49:27 +0000 (11:49 +0900)]
power: unify power state transition routine

 Previously, the iot-headless dedicated poweroff was working on top of
the core poweroff routine. Integrate them into the single poweroff
routine so that all type of poweroff is now take the same subroutine.

 In addition to this, there two internal functions have been added for
deviced to trigger change power state by itself. All power state change
thorugh these functions take the same subroutine.
 - power_request_change_state_strict()
 - power_request_change_state()

 Due to the above changes, the deviced is now able to broadcast all
types of power change state in the unified manner. Therefore, if
someone wants to know the power state change of deviced, just use
power API.

Change-Id: I6573872eb3aa7c50d2d6af575ccce4dc25cab3de
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
23 months agoFix dbus policy typo 32/275532/1
Youngjae Cho [Thu, 26 May 2022 05:07:46 +0000 (14:07 +0900)]
Fix dbus policy typo

Change-Id: I84382003be4a4631fdabdc728a739ab755c291c6
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
23 months agopower: refactor poweroff sequence 69/274969/8 accepted/tizen/unified/20220526.144053 submit/tizen/20220525.001052
Youngjae Cho [Fri, 13 May 2022 01:49:05 +0000 (10:49 +0900)]
power: refactor poweroff sequence

This is intermediate patch before applying power-state-wait mechanism
to power-off.

Change-Id: Ie5e302962ffd206b61a8b3f9857e83e22f83ed17
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
23 months agoinput: support bluetooth key input for iot-headless 79/274879/2
Youngjae Cho [Wed, 11 May 2022 08:52:25 +0000 (17:52 +0900)]
input: support bluetooth key input for iot-headless

Change-Id: I9a082c36bba8a737a3f2fe29d8d75dc444803400
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>