led: Apply hal-api-device-led module HAL ABI versioning 06/310006/1
authorYunhee Seo <yuni.seo@samsung.com>
Fri, 19 Apr 2024 05:54:38 +0000 (14:54 +0900)
committerYunhee Seo <yuni.seo@samsung.com>
Fri, 19 Apr 2024 05:54:38 +0000 (14:54 +0900)
As HAL ABI versioning is applied to hal-api-device-led module,
inclusion path is changed.

Change-Id: Ia6f10aa76bc9954c67da338a57b5ba8cfb10671b
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
src/led/rgb.c
src/led/torch.c
src/led/touch-key.c

index ef8eacad67f99d2efbfdf115d92c98f0cee76ab4..a4c8759681358ed2c5ea85626b8f1f97f8144ba7 100644 (file)
@@ -23,7 +23,7 @@
 #include <glib.h>
 
 #include <vconf.h>
-#include <hal/hal-led.h>
+#include <hal/hal-device-led.h>
 #include <libsyscommon/libgdbus.h>
 #include <libsyscommon/list.h>
 
@@ -34,7 +34,7 @@
 
 struct rgb_request {
        pid_t pid;
-       struct led_state state;
+       hal_device_led_state_s state;
 };
 
 /* enum values defined in capi-system-device */
@@ -81,7 +81,7 @@ static int remove_req_from_list(pid_t pid)
        return -EINVAL;
 }
 
-static int add_req_to_list(pid_t pid, struct led_state *state)
+static int add_req_to_list(pid_t pid, hal_device_led_state_s *state)
 {
        int ret;
        struct rgb_request *req;
@@ -110,9 +110,9 @@ static int add_req_to_list(pid_t pid, struct led_state *state)
        return 0;
 }
 
-static int rgb_play(struct led_state *state)
+static int rgb_play(hal_device_led_state_s *state)
 {
-       struct led_state off = { 0, };
+       hal_device_led_state_s off = { 0, };
 
        if (!rgb_dev_available) {
                _E("There is no HAL for rgb.");
@@ -120,9 +120,9 @@ static int rgb_play(struct led_state *state)
        }
 
        if (state)
-               return hal_device_led_set_state(NOTIFICATION, state);
+               return hal_device_led_set_state(HAL_DEVICE_LED_NOTIFICATION, state);
 
-       return hal_device_led_set_state(NOTIFICATION, &off);
+       return hal_device_led_set_state(HAL_DEVICE_LED_NOTIFICATION, &off);
 }
 
 static gboolean remove_not_handled_req(gpointer data)
@@ -210,7 +210,7 @@ static GVariant *dbus_playcustom(GDBusConnection *conn,
        int ret;
        int on, off;
        unsigned int color, flags;
-       struct led_state state;
+       hal_device_led_state_s state;
        pid_t pid;
        static pid_t old_pid;
 
@@ -231,9 +231,9 @@ static GVariant *dbus_playcustom(GDBusConnection *conn,
        state.duty_on = on;
        state.duty_off = off;
        if (flags & LED_CUSTOM_DUTY_ON)
-               state.type = LED_TYPE_BLINK;
+               state.type = HAL_DEVICE_LED_TYPE_BLINK;
        else
-               state.type = LED_TYPE_MANUAL;
+               state.type = HAL_DEVICE_LED_TYPE_MANUAL;
 
        ret = rgb_play(&state);
        if (ret < 0) {
@@ -306,7 +306,7 @@ static GVariant *dbus_multi_led_control(GDBusConnection *conn,
        GVariantIter *iter = NULL;
        pid_t pid;
        static pid_t old_pid;
-       struct led_state state;
+       hal_device_led_state_s state;
 
        pid = gdbus_connection_get_sender_pid(conn, sender);
        if (pid == -1 || kill(pid, 0) == -1) {
@@ -347,7 +347,7 @@ static GVariant *dbus_multi_led_control(GDBusConnection *conn,
        i = 0;
        state.duty_on = 0;
        state.duty_off = 0;
-       state.type = LED_TYPE_MANUAL;
+       state.type = HAL_DEVICE_LED_TYPE_MANUAL;
 
        while (g_variant_iter_next(iter, "u", &color[i])) {
                if (rgb_dev_available)
index 2b07acc6322ce60775a80fecb03c15e6fe291641..f16563c5adda387e66eec7cdde980968518f11cd 100644 (file)
@@ -21,7 +21,7 @@
 #include <errno.h>
 #include <assert.h>
 #include <vconf.h>
-#include <hal/hal-led.h>
+#include <hal/hal-device-led.h>
 #include <libsyscommon/libgdbus.h>
 
 #include "core/log.h"
@@ -34,8 +34,8 @@
 #define SIGNAL_FLASH_STATE "ChangeFlashState"
 
 static bool torch_dev_available = false;
-static struct led_state led_state = {
-       .type = LED_TYPE_MANUAL,
+static hal_device_led_state_s led_state = {
+       .type = HAL_DEVICE_LED_TYPE_MANUAL,
        .color = 0x0,
        .duty_on = 0,
        .duty_off = 0,
@@ -92,7 +92,7 @@ static GVariant *dbus_set_brightness(GDBusConnection *conn,
        GVariant *param, GDBusMethodInvocation *invocation, gpointer user_data)
 {
        int val, enable, ret;
-       struct led_state tmp = {0,};
+       hal_device_led_state_s tmp = {0,};
 
        g_variant_get(param, "(ii)", &val, &enable);
 
@@ -105,7 +105,7 @@ static GVariant *dbus_set_brightness(GDBusConnection *conn,
        tmp.color = (((int)(val * 255.f) / LED_MAX_BRIGHTNESS) & 0xFF) << 24;
        _D("Set brightness. val=%d color=%#x", val, tmp.color);
 
-       ret = hal_device_led_set_state(CAMERA_BACK, &tmp);
+       ret = hal_device_led_set_state(HAL_DEVICE_LED_CAMERA_BACK, &tmp);
        if (ret < 0)
                goto error;
 
index a36b028fb79cccfb0abc293c48b2f2251b39a63e..2c2eeba54514b063890e323c817b294045728b9c 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <stdio.h>
 #include <vconf.h>
-#include <hal/hal-led.h>
+#include <hal/hal-device-led.h>
 #include <libsyscommon/libgdbus.h>
 
 #include "core/log.h"
@@ -52,7 +52,7 @@ static int hardkey_duration;
 
 static int touchled_set_state(bool on)
 {
-       struct led_state tmp = {0,};
+       hal_device_led_state_s tmp = {0,};
        int r;
 
        if (!touchkey_dev_available) {
@@ -65,7 +65,7 @@ static int touchled_set_state(bool on)
        else
                tmp.color = SET_BRIGHTNESS(0);
 
-       r = hal_device_led_set_state(TOUCH_KEY, &tmp);
+       r = hal_device_led_set_state(HAL_DEVICE_LED_TOUCH_KEY, &tmp);
        if (r < 0) {
                _E("Failed to set touch led state: %d", r);
                return r;