patch tizen_2.0_build
[framework/api/haptic.git] / src / haptic_private.c
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License. 
15  */
16
17
18
19
20 #include <stdio.h> // xxx
21 #include <unistd.h>
22 #include <devman.h>
23 #include <devman_haptic.h>
24 #include "haptic.h"
25
26 #define IMMERSION_DRV_NODE      "/dev/tspdrv"
27 #define INPUT_PARM_MAX          0xFFFFFF
28 #define COMP_CMD(idx, value)    (value<<4)|(idx&0x0F)
29
30 enum {
31     HAPTIC_PROP_ENABLE,
32     HAPTIC_PROP_LEVEL,
33     HAPTIC_PROP_LEVEL_MAX,
34     HAPTIC_PROP_VALUE,
35     HAPTIC_PROP_ONESHOT,
36 };
37
38 enum {
39         CMD_GET_INITIALIZE,
40         CMD_SET_OPEN_DEVICE,
41         CMD_GET_CURRENT_DEVICE_HANDLE,
42         CMD_GET_CURRENT_EFFECT_HANDLE,
43         CMD_SET_EFFECT_TYPE,
44         CMD_SET_EFFECT_FILE,
45         CMD_GET_EFFECT_DURATION,
46         CMD_SET_EFFECT_PLAY,
47         CMD_SET_EFFECT_PLAY_REPEAT,
48         CMD_SET_NORMAL_PLAY,
49         CMD_SET_EFFECT_ALL_STOP,
50         CMD_PROPERTY_SET_LICENSE_KEY,
51         CMD_PROPERTY_GET_PRIORITY,
52         CMD_PROPERTY_SET_PRIORITY,
53         CMD_PROPERTY_GET_STRENGTH,
54         CMD_PROPERTY_SET_STRENGTH,
55         CMD_PROPERTY_GET_MASTER_STRENGTH,
56         CMD_PROPERTY_SET_MASTER_STRENGTH,
57         CMD_SET_CLOSE_DEVICE,
58         CMD_GET_TERMINATE,
59         CMD_GET_DEVICE_COUNT,
60 };
61
62 static int immersion;
63
64 void _haptic_init()
65 {
66     immersion = access(IMMERSION_DRV_NODE, F_OK) == 0;
67 }
68
69 void _haptic_deinit()
70 {
71 }
72