Deviced will check if there is an external vibrator plugin.
It should be named 'libhaptic-module.so' in lib directory.
If not, it checks whether this target supports the input force feedback.
If there is no valid module, it will return fail
and do not register any function and method related to vibrator.
Change-Id: I3bc1da9cb378fac1ecea3cb0480915e0485c229f
Signed-off-by: Jiyoung Yun <jy910.yun@samsung.com>
src/led/torch.c
)
-IF(TIZEN_VIBRATOR)
SET(SRCS ${SRCS}
src/haptic/haptic.c
src/haptic/external.c
src/haptic/standard.c
src/haptic/emulator.c)
-ENDIF(TIZEN_VIBRATOR)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/src)
%bcond_with sdcard
%bcond_with sim
%bcond_with usb
-%bcond_with vibrator
Name: deviced
Summary: Deviced
%if %{with usb}
-DTIZEN_USB:BOOL=ON \
%endif
-%if %{with vibrator}
- -DTIZEN_VIBRATOR:BOOL=ON \
-%endif
#eol
%build
{ DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY, NULL, NULL },
{ DEVICED_PATH_POWER , DEVICED_INTERFACE_POWER , NULL, NULL },
{ DEVICED_PATH_STORAGE, DEVICED_INTERFACE_STORAGE, NULL, NULL },
- { DEVICED_PATH_HAPTIC , DEVICED_INTERFACE_HAPTIC , NULL, NULL },
{ DEVICED_PATH_MMC , DEVICED_INTERFACE_MMC , NULL, NULL },
{ DEVICED_PATH_PROCESS, DEVICED_INTERFACE_PROCESS, NULL, NULL },
{ DEVICED_PATH_KEY , DEVICED_INTERFACE_KEY , NULL, NULL },
dlopen_handle = NULL;
}
- _I("Do not support external haptic device");
+ _E("Do not support external haptic device");
return false;
}
/* Add methods here */
};
+static int haptic_probe(void *data)
+{
+ /**
+ * load haptic module.
+ * if there is no haptic module,
+ * deviced does not activate a haptic interface.
+ */
+ return haptic_module_load();
+}
+
static void haptic_init(void *data)
{
int r;
- /* Load haptic module */
- haptic_module_load();
-
/* get haptic data from configuration file */
r = config_parse(HAPTIC_CONF_PATH, haptic_load_config, &haptic_conf);
if (r < 0) {
}
/* init dbus interface */
- r = register_edbus_method(DEVICED_PATH_HAPTIC, edbus_methods, ARRAY_SIZE(edbus_methods));
+ r = register_edbus_interface_and_method(DEVICED_PATH_HAPTIC,
+ DEVICED_INTERFACE_HAPTIC,
+ edbus_methods, ARRAY_SIZE(edbus_methods));
if (r < 0)
- _E("fail to init edbus method(%d)", r);
+ _E("fail to init edbus interface and method(%d)", r);
/* register notifier for below each event */
register_notifier(DEVICE_NOTIFIER_TOUCH_HARDKEY, haptic_hardkey_changed_cb);
static const struct device_ops haptic_device_ops = {
.name = "haptic",
+ .probe = haptic_probe,
.init = haptic_init,
.exit = haptic_exit,
};
ret = ff_find_device();
if (ret < 0) {
- _I("Do not support standard haptic device");
+ _E("Do not support standard haptic device");
return false;
}