Haptic: add haptic class
PATCH 1/6 Haptic: add haptic class
New haptic class support.
This class handles the haptic devices.
--- drivers/haptic/Kconfig | 14 +++ drivers/haptic/Makefile | 2 + drivers/haptic/haptic-class.c | 255 +++++++++++++++++++++++++++++++++++++++++ drivers/haptic/haptic.h | 35 ++++++ include/linux/haptic.h | 85 ++++++++++++++ 5 files changed, 391 insertions(+), 0 deletions(-) create mode 100644 drivers/haptic/Kconfig create mode 100644 drivers/haptic/Makefile create mode 100644 drivers/haptic/haptic-class.c create mode 100644 drivers/haptic/haptic.h create mode 100644 include/linux/haptic.h
drivers/haptic/Kconfig new file +14 -0
@@ -0,0 +1,14 @@ +menuconfig HAPTIC + bool "Haptic support" + help + Say Y to enable haptic support. It enables the haptic and controls + from userspace. + +if HAPTIC + +config HAPTIC_CLASS + tristate "Haptic Class Support" + help + This option enables the haptic sysfs class in /sys/class/haptic. + +endif # HAPTIC
drivers/haptic/Makefile new file +2 -0
@@ -0,0 +1,2 @@ +# Haptic Core +obj-$(CONFIG_HAPTIC_CLASS) += haptic-class.o
drivers/haptic/haptic-class.c new file +255 -0
255 lines not on this page · raw message
drivers/haptic/haptic.h new file +35 -0
@@ -0,0 +1,35 @@ +/* +* Haptic Core +* +* Copyright (C) 2008 Samsung Electronics +* Kyungmin Park <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +* +*/ + +#ifndef __HAPTIC_H_INCLUDED +#define __HAPTIC_H_INCLUDED + +#include <linux/device.h> +#include <linux/rwsem.h> +#include <linux/haptic.h> + +static inline void haptic_set_value (struct haptic_classdev *haptic_cdev, +enum haptic_value value) +{ +if (value >HAPTIC_FULL ) + value =HAPTIC_FULL ; + haptic_cdev->value = value; +if (!(haptic_cdev->flags &HAPTIC_SUSPENDED )) + haptic_cdev->set (haptic_cdev, value); +} + +static inline int haptic_get_value (struct haptic_classdev *haptic_cdev) +{ +return haptic_cdev->value; +} + +#endif /* __HAPTIC_H_INCLUDED */
include/linux/haptic.h new file +85 -0
85 lines not on this page · raw message
Signature · 1 line
1.5.3.3
Hi Kyungmin,
Quoted 4 lines · Kyungmin Park
New haptic class support.
This class handles the haptic devices.Signed-off-by Kyungmin Park <[email protected]>
---Trilok Soni
Quoted 2 lines · Kyungmin Park
New haptic class support.
This class handles the haptic devices.
I'm wondering why a haptic class is needed when there is force feedback support. Admittedly, I don't know the force feedback implementation too well, but could someone please enlighten me on this? Am I missing something here?
I see haptics as simple force feedback, just with (usually) small force and short duration. There are devices out there doing haptics using vibra motors, which I think would be limited if implemented using this haptics class driver. Would it be somehow problematic interfacing with the simple haptic hardware using the force feedback API?
BR,
Jani.
Hi Kyungmin, Dmitry,
Quoted 9 lines · Jani Nikula
Quoted 2 lines · Kyungmin Park
New haptic class support.
This class handles the haptic devices.I'm wondering why a haptic class is needed when there is force feedback support. Admittedly, I don't know the force feedback implementation too well, but could someone please enlighten me on this? Am I missing something here?
Quoted 6 lines
I see haptics as simple force feedback, just with (usually) small force and short duration. There are devices out there doing haptics using vibra motors, which I think would be limited if implemented using this haptics class driver. Would it be somehow problematic interfacing with the simple haptic hardware using the force feedback API?
Please share your inputs on ff_device usage instead of haptics class. I think Dmitry could add some points here as I don't see much users of ff_device and I don't see any embedded device (like mobile) using it.
Signature · 3 lines
---Trilok Soni http://triloksoni.wordpress.com http://www.linkedin.com/in/triloksoni
Quoted 20 lines · Trilok Soni
Hi Kyungmin, Dmitry,
Quoted 9 lines · Jani Nikula
Quoted 2 lines · Kyungmin Park
New haptic class support.
This class handles the haptic devices.I'm wondering why a haptic class is needed when there is force feedback support. Admittedly, I don't know the force feedback implementation too well, but could someone please enlighten me on this? Am I missing something here?
Quoted 6 lines
I see haptics as simple force feedback, just with (usually) small force and short duration. There are devices out there doing haptics using vibra motors, which I think would be limited if implemented using this haptics class driver. Would it be somehow problematic interfacing with the simple haptic hardware using the force feedback API?
Quoted 4 lines
Please share your inputs on
ff_deviceusage instead of haptics class. I think Dmitry could add some points here as I don't see much users offf_deviceand I don't see any embedded device (like mobile) using it.
Using ff_device was considered when Jiri Slaby was trying to merge PHANTOM driver, bit for that device FF infrastructure was too limited and this it was decided that phantom would need a special userpsace that knows what it is and how to handle it.
The curtrent haptic class seems to be bery limited and may be served via FF (constant or other effect in a single direction) but I don't know what kind of plans you have to extend it. I guess it warrants another discussion.
Signature · 1 line
Dmitry
Hi Dmitry,
Quoted 31 lines · Dmitry Torokhov
Quoted 20 lines · Trilok Soni
Hi Kyungmin, Dmitry,
Quoted 9 lines · Jani Nikula
Quoted 2 lines · Kyungmin Park
New haptic class support.
This class handles the haptic devices.I'm wondering why a haptic class is needed when there is force feedback support. Admittedly, I don't know the force feedback implementation too well, but could someone please enlighten me on this? Am I missing something here?
Quoted 6 lines
I see haptics as simple force feedback, just with (usually) small force and short duration. There are devices out there doing haptics using vibra motors, which I think would be limited if implemented using this haptics class driver. Would it be somehow problematic interfacing with the simple haptic hardware using the force feedback API?
Quoted 4 lines
Please share your inputs on
ff_deviceusage instead of haptics class. I think Dmitry could add some points here as I don't see much users offf_deviceand I don't see any embedded device (like mobile) using it.Using
ff_devicewas considered when Jiri Slaby was trying to merge PHANTOM driver, bit for that device FF infrastructure was too limited and this it was decided that phantom would need a special userpsace that knows what it is and how to handle it.
Quoted 4 lines
The curtrent haptic class seems to be bery limited and may be served via FF (constant or other effect in a single direction) but I don't know what kind of plans you have to extend it. I guess it warrants another discussion.
Probably Kyungmin is the right person to analyze the ff_device infrastructure in input_device framework and see it fits haptics class or not. As per me, for the mobile like applications current haptics class should meet the needs.
Signature · 3 lines
---Trilok Soni http://triloksoni.wordpress.com http://www.linkedin.com/in/triloksoni