]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/input/joystick/iforce/iforce-ff.c
Merge branch 'for-rmk' of git://git.marvell.com/orion into devel
[linux-2.6-omap-h63xx.git] / drivers / input / joystick / iforce / iforce-ff.c
index f2a4381d0ab80cf899672defc8779483118b0bca..0de9a0943a9e9853b3f1618d011142f0611f8daf 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: iforce-ff.c,v 1.9 2002/02/02 19:28:35 jdeneux Exp $
- *
  *  Copyright (c) 2000-2002 Vojtech Pavlik <vojtech@ucw.cz>
  *  Copyright (c) 2001-2002, 2007 Johann Deneux <johann.deneux@gmail.com>
  *
@@ -199,13 +197,16 @@ static unsigned char find_button(struct iforce *iforce, signed short button)
  * Analyse the changes in an effect, and tell if we need to send an condition
  * parameter packet
  */
-static int need_condition_modifier(struct ff_effect *old, struct ff_effect *new)
+static int need_condition_modifier(struct iforce *iforce,
+                                  struct ff_effect *old,
+                                  struct ff_effect *new)
 {
        int ret = 0;
        int i;
 
        if (new->type != FF_SPRING && new->type != FF_FRICTION) {
-               warn("bad effect type in need_condition_modifier");
+               dev_warn(&iforce->dev->dev, "bad effect type in %s\n",
+                        __func__);
                return 0;
        }
 
@@ -224,10 +225,13 @@ static int need_condition_modifier(struct ff_effect *old, struct ff_effect *new)
  * Analyse the changes in an effect, and tell if we need to send a magnitude
  * parameter packet
  */
-static int need_magnitude_modifier(struct ff_effect *old, struct ff_effect *effect)
+static int need_magnitude_modifier(struct iforce *iforce,
+                                  struct ff_effect *old,
+                                  struct ff_effect *effect)
 {
        if (effect->type != FF_CONSTANT) {
-               warn("bad effect type in need_envelope_modifier");
+               dev_warn(&iforce->dev->dev, "bad effect type in %s\n",
+                        __func__);
                return 0;
        }
 
@@ -238,7 +242,8 @@ static int need_magnitude_modifier(struct ff_effect *old, struct ff_effect *effe
  * Analyse the changes in an effect, and tell if we need to send an envelope
  * parameter packet
  */
-static int need_envelope_modifier(struct ff_effect *old, struct ff_effect *effect)
+static int need_envelope_modifier(struct iforce *iforce, struct ff_effect *old,
+                                 struct ff_effect *effect)
 {
        switch (effect->type) {
        case FF_CONSTANT:
@@ -258,7 +263,8 @@ static int need_envelope_modifier(struct ff_effect *old, struct ff_effect *effec
                break;
 
        default:
-               warn("bad effect type in need_envelope_modifier");
+               dev_warn(&iforce->dev->dev, "bad effect type in %s\n",
+                        __func__);
        }
 
        return 0;
@@ -268,10 +274,12 @@ static int need_envelope_modifier(struct ff_effect *old, struct ff_effect *effec
  * Analyse the changes in an effect, and tell if we need to send a periodic
  * parameter effect
  */
-static int need_period_modifier(struct ff_effect *old, struct ff_effect *new)
+static int need_period_modifier(struct iforce *iforce, struct ff_effect *old,
+                               struct ff_effect *new)
 {
        if (new->type != FF_PERIODIC) {
-               warn("bad effect type in need_period_modifier");
+               dev_warn(&iforce->dev->dev, "bad effect type in %s\n",
+                        __func__);
                return 0;
        }
        return (old->u.periodic.period != new->u.periodic.period
@@ -357,7 +365,7 @@ int iforce_upload_periodic(struct iforce *iforce, struct ff_effect *effect, stru
        int param2_err = 1;
        int core_err = 0;
 
-       if (!old || need_period_modifier(old, effect)) {
+       if (!old || need_period_modifier(iforce, old, effect)) {
                param1_err = make_period_modifier(iforce, mod1_chunk,
                        old != NULL,
                        effect->u.periodic.magnitude, effect->u.periodic.offset,
@@ -367,7 +375,7 @@ int iforce_upload_periodic(struct iforce *iforce, struct ff_effect *effect, stru
                set_bit(FF_MOD1_IS_USED, core_effect->flags);
        }
 
-       if (!old || need_envelope_modifier(old, effect)) {
+       if (!old || need_envelope_modifier(iforce, old, effect)) {
                param2_err = make_envelope_modifier(iforce, mod2_chunk,
                        old !=NULL,
                        effect->u.periodic.envelope.attack_length,
@@ -427,7 +435,7 @@ int iforce_upload_constant(struct iforce *iforce, struct ff_effect *effect, stru
        int param2_err = 1;
        int core_err = 0;
 
-       if (!old || need_magnitude_modifier(old, effect)) {
+       if (!old || need_magnitude_modifier(iforce, old, effect)) {
                param1_err = make_magnitude_modifier(iforce, mod1_chunk,
                        old != NULL,
                        effect->u.constant.level);
@@ -436,7 +444,7 @@ int iforce_upload_constant(struct iforce *iforce, struct ff_effect *effect, stru
                set_bit(FF_MOD1_IS_USED, core_effect->flags);
        }
 
-       if (!old || need_envelope_modifier(old, effect)) {
+       if (!old || need_envelope_modifier(iforce, old, effect)) {
                param2_err = make_envelope_modifier(iforce, mod2_chunk,
                        old != NULL,
                        effect->u.constant.envelope.attack_length,
@@ -489,7 +497,7 @@ int iforce_upload_condition(struct iforce *iforce, struct ff_effect *effect, str
                default: return -1;
        }
 
-       if (!old || need_condition_modifier(old, effect)) {
+       if (!old || need_condition_modifier(iforce, old, effect)) {
                param_err = make_condition_modifier(iforce, mod1_chunk,
                        old != NULL,
                        effect->u.condition[0].right_saturation,