Skip to contentSkip to conversation

haptic: Samsung SoCs PWM controlled haptic support

PATCH In review Kyungmin Park 4 participants 8 messages Oct 7, 2009 – Oct 12, 2009 HID

lore
Share & tools
lore
#0 lore raw

PATCH 5/6 haptic: Samsung SoCs PWM controlled haptic support

Samsung SoCs PWM and gpio connected haptic device support It's tested on s3c64xx, s5pc1xx

---
 drivers/haptic/Kconfig              |    9 +
 drivers/haptic/Makefile             |    3 +
 drivers/haptic/haptic-samsung-pwm.c |  377 +++++++++++++++++++++++++++++++++++
 3 files changed, 389 insertions(+), 0 deletions(-)
 create mode 100644 drivers/haptic/haptic-samsung-pwm.c
drivers/haptic/Kconfig +9 -0
index 656b022..1e9849c 100644
@@ -11,4 +11,13 @@ config HAPTIC_CLASS
 	help
 	  This option enables the haptic sysfs class in /sys/class/haptic.
 
+comment "Haptic drivers"
+
+config HAPTIC_SAMSUNG_PWM
+	tristate "Haptic Support for SAMSUNG PWM-controlled haptic (ISA1000)"
+	depends on HAPTIC_CLASS && (ARCH_S3C64XX || ARCH_S5PC1XX)
+	help
+	  This options enables support for haptic connected to GPIO lines
+	  controlled by a PWM timer on SAMSUNG CPUs.
+
 endif	# HAPTIC
drivers/haptic/Makefile +3 -0
index d30f8cd..c691f7d 100644
@@ -1,2 +1,5 @@
 # Haptic Core
 obj-$(CONFIG_HAPTIC_CLASS)		+= haptic-class.o
+
+# Drivers
+obj-$(CONFIG_HAPTIC_SAMSUNG_PWM)	+= haptic-samsung-pwm.o
drivers/haptic/haptic-samsung-pwm.c new file +377 -0

377 lines not on this page · raw message

Signature · 1 line
1.5.3.3
#1 lore raw

Adding Bill Gatliff.

Hi Kyungmin,

Most of the driver looks fine. I have only one generic comment, but not for this driver:

- Someone should really work on getting PWM framework (may be the one written by Bill Gatliff) into the kernel, because
if we don't do this and if new PWM controller provides it's own APIs
then we can't leverage the chips using them, like the
case here for ISA1000 and ISA1200. These chips are using the pwm
APIs exported by Samsung PWM controller, but it would
be painful to integrate other PWM controller if that has slightly
little different API due to its nature.

So, it would be better to get one generic PWM framework mainline in
the kernel.

drivers/haptic/haptic-samsung-pwm.c line 320

Quoted 6 lines
drivers/haptic/haptic-samsung-pwm.c new file +6 -0
+static int __devexit samsung_pwm_haptic_remove(struct platform_device *pdev)
+{
+       struct samsung_pwm_haptic *haptic = platform_get_drvdata(pdev);
+
+       samsung_pwm_haptic_set(&haptic->cdev, HAPTIC_OFF);
+       del_timer_sync(&haptic->timer);

cancel_work_sync ?

Signature · 3 lines
---Trilok Soni
http://triloksoni.wordpress.com
http://www.linkedin.com/in/triloksoni
#2 lore raw
Quoted 16 lines · Trilok Soni

Adding Bill Gatliff.

Hi Kyungmin,

Most of the driver looks fine. I have only one generic comment, but not for this driver:

- Someone should really work on getting PWM framework (may be the one written by Bill Gatliff) into the kernel, because
if we don't do this and if new PWM controller provides it's own APIs
then we can't leverage the chips using them, like the
case here for ISA1000 and ISA1200. These chips are using the pwm
APIs exported by Samsung PWM controller, but it would
be painful to integrate other PWM controller if that has slightly
little different API due to its nature.

Quoted 3 lines

So, it would be better to get one generic PWM framework mainline in
the kernel.

I can repost for review, if you like.

The only objection I received last time, IIRC, was that I proffered it as a "generic" API but only provided support for a couple of AT91 parts. I haven't had much time to add other support, so I haven't pushed for inclusion.

I would be happy to coordinate the development/migration of support to the API. I can still do the AT91 parts and probably PXA, maybe OMAP3430/Beagleboard. But I would need others to help me with the rest.

b.g.

Signature · 2 lines
Bill Gatliff
[email protected]
#3 lore raw

Hi,

I agree use the generic PWM framework. But it's not support on Samsung SoCs yet.

I also wrote the OMAP driver. Of course it uses the OMAP specific PWM drivers.

I think after full integration of PWM frameworks as GPIO does, It will be replace with new PWM frameworks.

Thank you,
Kyungmin Park

Quoted 45 lines · Bill Gatliff
Quoted 17 lines · Trilok Soni

Adding Bill Gatliff.

Hi Kyungmin,

Most of the driver looks fine. I have only one generic comment, but not for this driver:

- Someone should really work on getting PWM framework (may be the one written by Bill Gatliff) into the kernel, because
 if we don't do this and if new PWM controller provides it's own APIs then we can't leverage the chips using them, like the
 case here for ISA1000 and ISA1200. These chips are using the pwm APIs exported by Samsung PWM controller, but it would
 be painful to integrate other PWM controller if that has slightly little different API due to its nature.

Quoted 3 lines

 So, it would be better to get one generic PWM framework mainline in the kernel.

I can repost for review, if you like.

The only objection I received last time, IIRC, was that I proffered it as a "generic" API but only provided support for a couple of AT91 parts.  I haven't had much time to add other support, so I haven't pushed for inclusion.

I would be happy to coordinate the development/migration of support to the API.  I can still do the AT91 parts and probably PXA, maybe OMAP3430/Beagleboard.  But I would need others to help me with the rest.

b.g.

--
Bill Gatliff
[email protected]

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

#4 lore raw

Hi Kyungmin,

Quoted 8 lines · Kyungmin Park

Hi,

I agree use the generic PWM framework. But it's not support on Samsung SoCs yet.

I also wrote the OMAP driver. Of course it uses the OMAP specific PWM drivers.

I think after full integration of PWM frameworks as GPIO does, It will be replace with new PWM frameworks.

Yes, I don't want to stop Haptics class and drivers because of no. generic PWM framework yet in mainline. Someone could write down OMAP and Samsung PWM controller drivers once Bill refreshes his patchesets with latest kernel version.

Signature · 3 lines
---Trilok Soni
http://triloksoni.wordpress.com
http://www.linkedin.com/in/triloksoni
#5 lore raw
In reply to Bill Gatliff

Hi Bill,

Quoted 24 lines · Bill Gatliff
Quoted 17 lines · Trilok Soni

Adding Bill Gatliff.

Hi Kyungmin,

Most of the driver looks fine. I have only one generic comment, but not for this driver:

- Someone should really work on getting PWM framework (may be the one written by Bill Gatliff) into the kernel, because
 if we don't do this and if new PWM controller provides it's own APIs then we can't leverage the chips using them, like the
 case here for ISA1000 and ISA1200. These chips are using the pwm APIs exported by Samsung PWM controller, but it would
 be painful to integrate other PWM controller if that has slightly little different API due to its nature.

Quoted 3 lines

 So, it would be better to get one generic PWM framework mainline in the kernel.

I can repost for review, if you like.

Quoted 8 lines

The only objection I received last time, IIRC, was that I proffered it as a "generic" API but only provided support for a couple of AT91 parts.  I haven't had much time to add other support, so I haven't pushed for inclusion.

I would be happy to coordinate the development/migration of support to the API.  I can still do the AT91 parts and probably PXA, maybe OMAP3430/Beagleboard.  But I would need others to help me with the rest.

Two drivers are OK to begin with and for mainline. It is expected that framework author may not have all parts with him to demonstrate a thumbrule of atleast three driver per framework in-order to make it mainline to test most the framework logic.

If mainline authors doesn't agree still, we can still target this through drivers\stagic area through Greg KH. Please post your refreshed version.

Signature · 3 lines
---Trilok Soni
http://triloksoni.wordpress.com
http://www.linkedin.com/in/triloksoni
#6 lore raw
Quoted 2 lines · Trilok Soni

Please post your refreshed version.

Ok. I'll try to rebase it to the latest over the weekend.

b.g.

Signature · 2 lines
Bill Gatliff
[email protected]