4 * Copyright (c) 2022 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the License);
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
19 #include <shared/common.h>
20 #include <shared/devices.h>
21 #include <libsyscommon/libgdbus.h>
23 static GVariant *dbus_lockstate(GDBusConnection *conn,
24 const gchar *sender, const gchar *path, const gchar *iface, const gchar *name,
25 GVariant *param, GDBusMethodInvocation *invocation, gpointer user_data)
27 return g_variant_new("(i)", 0);
30 static GVariant *dbus_unlockstate(GDBusConnection *conn,
31 const gchar *sender, const gchar *path, const gchar *iface, const gchar *name,
32 GVariant *param, GDBusMethodInvocation *invocation, gpointer user_data)
34 return g_variant_new("(i)", 0);
37 static const dbus_method_s dbus_methods[] = {
38 { "lockstate", "sssi", "i", dbus_lockstate },
39 { "unlockstate", "ss", "i", dbus_unlockstate },
42 static const dbus_interface_u dbus_interface = {
44 .name = DEVICED_INTERFACE_DISPLAY,
45 .methods = dbus_methods,
46 .nr_methods = ARRAY_SIZE(dbus_methods),
49 static void display_init(void *data)
51 gdbus_add_object(NULL, DEVICED_PATH_DISPLAY, &dbus_interface);
54 static const struct device_ops display_device_ops = {
55 .priority = DEVICE_PRIORITY_HIGH,
56 DECLARE_NAME_LEN("display"),
60 DEVICE_OPS_REGISTER(&display_device_ops)