upload tizen1.0 source
[kernel/linux-2.6.36.git] / drivers / haptic / haptic.h
1 /*
2  * Haptic Core
3  *
4  * Copyright (C) 2008 Samsung Electronics
5  *
6  * Author: Kyungmin Park <kyungmin.park@samsung.com>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 as
10  * published by the Free Software Foundation.
11  *
12  */
13 #ifndef __HAPTIC_H_INCLUDED
14 #define __HAPTIC_H_INCLUDED
15
16 #include <linux/device.h>
17 #include <linux/rwsem.h>
18 #include <linux/haptic.h>
19
20 static inline void haptic_set_value(struct haptic_classdev *haptic_cdev,
21                                         enum haptic_value value)
22 {
23         if (value > HAPTIC_FULL)
24                 value = HAPTIC_FULL;
25         haptic_cdev->value = value;
26         if (!(haptic_cdev->flags & HAPTIC_SUSPENDED))
27                 haptic_cdev->set(haptic_cdev, value);
28 }
29
30 static inline int haptic_get_value(struct haptic_classdev *haptic_cdev)
31 {
32         return haptic_cdev->value;
33 }
34
35 #endif  /* __HAPTIC_H_INCLUDED */