aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/joystick
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/joystick')
-rw-r--r--drivers/input/joystick/iforce/iforce-ff.c36
-rw-r--r--drivers/input/joystick/iforce/iforce-main.c14
-rw-r--r--drivers/input/joystick/iforce/iforce-packets.c8
-rw-r--r--drivers/input/joystick/iforce/iforce-usb.c2
4 files changed, 37 insertions, 23 deletions
diff --git a/drivers/input/joystick/iforce/iforce-ff.c b/drivers/input/joystick/iforce/iforce-ff.c
index 7839b7b6fa96..0de9a0943a9e 100644
--- a/drivers/input/joystick/iforce/iforce-ff.c
+++ b/drivers/input/joystick/iforce/iforce-ff.c
@@ -197,13 +197,16 @@ static unsigned char find_button(struct iforce *iforce, signed short button)
197 * Analyse the changes in an effect, and tell if we need to send an condition 197 * Analyse the changes in an effect, and tell if we need to send an condition
198 * parameter packet 198 * parameter packet
199 */ 199 */
200static int need_condition_modifier(struct ff_effect *old, struct ff_effect *new) 200static int need_condition_modifier(struct iforce *iforce,
201 struct ff_effect *old,
202 struct ff_effect *new)
201{ 203{
202 int ret = 0; 204 int ret = 0;
203 int i; 205 int i;
204 206
205 if (new->type != FF_SPRING && new->type != FF_FRICTION) { 207 if (new->type != FF_SPRING && new->type != FF_FRICTION) {
206 warn("bad effect type in need_condition_modifier"); 208 dev_warn(&iforce->dev->dev, "bad effect type in %s\n",
209 __func__);
207 return 0; 210 return 0;
208 } 211 }
209 212
@@ -222,10 +225,13 @@ static int need_condition_modifier(struct ff_effect *old, struct ff_effect *new)
222 * Analyse the changes in an effect, and tell if we need to send a magnitude 225 * Analyse the changes in an effect, and tell if we need to send a magnitude
223 * parameter packet 226 * parameter packet
224 */ 227 */
225static int need_magnitude_modifier(struct ff_effect *old, struct ff_effect *effect) 228static int need_magnitude_modifier(struct iforce *iforce,
229 struct ff_effect *old,
230 struct ff_effect *effect)
226{ 231{
227 if (effect->type != FF_CONSTANT) { 232 if (effect->type != FF_CONSTANT) {
228 warn("bad effect type in need_envelope_modifier"); 233 dev_warn(&iforce->dev->dev, "bad effect type in %s\n",
234 __func__);
229 return 0; 235 return 0;
230 } 236 }
231 237
@@ -236,7 +242,8 @@ static int need_magnitude_modifier(struct ff_effect *old, struct ff_effect *effe
236 * Analyse the changes in an effect, and tell if we need to send an envelope 242 * Analyse the changes in an effect, and tell if we need to send an envelope
237 * parameter packet 243 * parameter packet
238 */ 244 */
239static int need_envelope_modifier(struct ff_effect *old, struct ff_effect *effect) 245static int need_envelope_modifier(struct iforce *iforce, struct ff_effect *old,
246 struct ff_effect *effect)
240{ 247{
241 switch (effect->type) { 248 switch (effect->type) {
242 case FF_CONSTANT: 249 case FF_CONSTANT:
@@ -256,7 +263,8 @@ static int need_envelope_modifier(struct ff_effect *old, struct ff_effect *effec
256 break; 263 break;
257 264
258 default: 265 default:
259 warn("bad effect type in need_envelope_modifier"); 266 dev_warn(&iforce->dev->dev, "bad effect type in %s\n",
267 __func__);
260 } 268 }
261 269
262 return 0; 270 return 0;
@@ -266,10 +274,12 @@ static int need_envelope_modifier(struct ff_effect *old, struct ff_effect *effec
266 * Analyse the changes in an effect, and tell if we need to send a periodic 274 * Analyse the changes in an effect, and tell if we need to send a periodic
267 * parameter effect 275 * parameter effect
268 */ 276 */
269static int need_period_modifier(struct ff_effect *old, struct ff_effect *new) 277static int need_period_modifier(struct iforce *iforce, struct ff_effect *old,
278 struct ff_effect *new)
270{ 279{
271 if (new->type != FF_PERIODIC) { 280 if (new->type != FF_PERIODIC) {
272 warn("bad effect type in need_period_modifier"); 281 dev_warn(&iforce->dev->dev, "bad effect type in %s\n",
282 __func__);
273 return 0; 283 return 0;
274 } 284 }
275 return (old->u.periodic.period != new->u.periodic.period 285 return (old->u.periodic.period != new->u.periodic.period
@@ -355,7 +365,7 @@ int iforce_upload_periodic(struct iforce *iforce, struct ff_effect *effect, stru
355 int param2_err = 1; 365 int param2_err = 1;
356 int core_err = 0; 366 int core_err = 0;
357 367
358 if (!old || need_period_modifier(old, effect)) { 368 if (!old || need_period_modifier(iforce, old, effect)) {
359 param1_err = make_period_modifier(iforce, mod1_chunk, 369 param1_err = make_period_modifier(iforce, mod1_chunk,
360 old != NULL, 370 old != NULL,
361 effect->u.periodic.magnitude, effect->u.periodic.offset, 371 effect->u.periodic.magnitude, effect->u.periodic.offset,
@@ -365,7 +375,7 @@ int iforce_upload_periodic(struct iforce *iforce, struct ff_effect *effect, stru
365 set_bit(FF_MOD1_IS_USED, core_effect->flags); 375 set_bit(FF_MOD1_IS_USED, core_effect->flags);
366 } 376 }
367 377
368 if (!old || need_envelope_modifier(old, effect)) { 378 if (!old || need_envelope_modifier(iforce, old, effect)) {
369 param2_err = make_envelope_modifier(iforce, mod2_chunk, 379 param2_err = make_envelope_modifier(iforce, mod2_chunk,
370 old !=NULL, 380 old !=NULL,
371 effect->u.periodic.envelope.attack_length, 381 effect->u.periodic.envelope.attack_length,
@@ -425,7 +435,7 @@ int iforce_upload_constant(struct iforce *iforce, struct ff_effect *effect, stru
425 int param2_err = 1; 435 int param2_err = 1;
426 int core_err = 0; 436 int core_err = 0;
427 437
428 if (!old || need_magnitude_modifier(old, effect)) { 438 if (!old || need_magnitude_modifier(iforce, old, effect)) {
429 param1_err = make_magnitude_modifier(iforce, mod1_chunk, 439 param1_err = make_magnitude_modifier(iforce, mod1_chunk,
430 old != NULL, 440 old != NULL,
431 effect->u.constant.level); 441 effect->u.constant.level);
@@ -434,7 +444,7 @@ int iforce_upload_constant(struct iforce *iforce, struct ff_effect *effect, stru
434 set_bit(FF_MOD1_IS_USED, core_effect->flags); 444 set_bit(FF_MOD1_IS_USED, core_effect->flags);
435 } 445 }
436 446
437 if (!old || need_envelope_modifier(old, effect)) { 447 if (!old || need_envelope_modifier(iforce, old, effect)) {
438 param2_err = make_envelope_modifier(iforce, mod2_chunk, 448 param2_err = make_envelope_modifier(iforce, mod2_chunk,
439 old != NULL, 449 old != NULL,
440 effect->u.constant.envelope.attack_length, 450 effect->u.constant.envelope.attack_length,
@@ -487,7 +497,7 @@ int iforce_upload_condition(struct iforce *iforce, struct ff_effect *effect, str
487 default: return -1; 497 default: return -1;
488 } 498 }
489 499
490 if (!old || need_condition_modifier(old, effect)) { 500 if (!old || need_condition_modifier(iforce, old, effect)) {
491 param_err = make_condition_modifier(iforce, mod1_chunk, 501 param_err = make_condition_modifier(iforce, mod1_chunk,
492 old != NULL, 502 old != NULL,
493 effect->u.condition[0].right_saturation, 503 effect->u.condition[0].right_saturation,
diff --git a/drivers/input/joystick/iforce/iforce-main.c b/drivers/input/joystick/iforce/iforce-main.c
index 61ee6e38739d..baabf8302645 100644
--- a/drivers/input/joystick/iforce/iforce-main.c
+++ b/drivers/input/joystick/iforce/iforce-main.c
@@ -218,7 +218,9 @@ static void iforce_release(struct input_dev *dev)
218 /* Check: no effects should be present in memory */ 218 /* Check: no effects should be present in memory */
219 for (i = 0; i < dev->ff->max_effects; i++) { 219 for (i = 0; i < dev->ff->max_effects; i++) {
220 if (test_bit(FF_CORE_IS_USED, iforce->core_effects[i].flags)) { 220 if (test_bit(FF_CORE_IS_USED, iforce->core_effects[i].flags)) {
221 warn("iforce_release: Device still owns effects"); 221 dev_warn(&dev->dev,
222 "%s: Device still owns effects\n",
223 __func__);
222 break; 224 break;
223 } 225 }
224 } 226 }
@@ -335,26 +337,26 @@ int iforce_init_device(struct iforce *iforce)
335 if (!iforce_get_id_packet(iforce, "M")) 337 if (!iforce_get_id_packet(iforce, "M"))
336 input_dev->id.vendor = (iforce->edata[2] << 8) | iforce->edata[1]; 338 input_dev->id.vendor = (iforce->edata[2] << 8) | iforce->edata[1];
337 else 339 else
338 warn("Device does not respond to id packet M"); 340 dev_warn(&iforce->dev->dev, "Device does not respond to id packet M\n");
339 341
340 if (!iforce_get_id_packet(iforce, "P")) 342 if (!iforce_get_id_packet(iforce, "P"))
341 input_dev->id.product = (iforce->edata[2] << 8) | iforce->edata[1]; 343 input_dev->id.product = (iforce->edata[2] << 8) | iforce->edata[1];
342 else 344 else
343 warn("Device does not respond to id packet P"); 345 dev_warn(&iforce->dev->dev, "Device does not respond to id packet P\n");
344 346
345 if (!iforce_get_id_packet(iforce, "B")) 347 if (!iforce_get_id_packet(iforce, "B"))
346 iforce->device_memory.end = (iforce->edata[2] << 8) | iforce->edata[1]; 348 iforce->device_memory.end = (iforce->edata[2] << 8) | iforce->edata[1];
347 else 349 else
348 warn("Device does not respond to id packet B"); 350 dev_warn(&iforce->dev->dev, "Device does not respond to id packet B\n");
349 351
350 if (!iforce_get_id_packet(iforce, "N")) 352 if (!iforce_get_id_packet(iforce, "N"))
351 ff_effects = iforce->edata[1]; 353 ff_effects = iforce->edata[1];
352 else 354 else
353 warn("Device does not respond to id packet N"); 355 dev_warn(&iforce->dev->dev, "Device does not respond to id packet N\n");
354 356
355 /* Check if the device can store more effects than the driver can really handle */ 357 /* Check if the device can store more effects than the driver can really handle */
356 if (ff_effects > IFORCE_EFFECTS_MAX) { 358 if (ff_effects > IFORCE_EFFECTS_MAX) {
357 warn("Limiting number of effects to %d (device reports %d)", 359 dev_warn(&iforce->dev->dev, "Limiting number of effects to %d (device reports %d)\n",
358 IFORCE_EFFECTS_MAX, ff_effects); 360 IFORCE_EFFECTS_MAX, ff_effects);
359 ff_effects = IFORCE_EFFECTS_MAX; 361 ff_effects = IFORCE_EFFECTS_MAX;
360 } 362 }
diff --git a/drivers/input/joystick/iforce/iforce-packets.c b/drivers/input/joystick/iforce/iforce-packets.c
index 015b50aa76fc..a17b50016009 100644
--- a/drivers/input/joystick/iforce/iforce-packets.c
+++ b/drivers/input/joystick/iforce/iforce-packets.c
@@ -65,7 +65,8 @@ int iforce_send_packet(struct iforce *iforce, u16 cmd, unsigned char* data)
65 65
66 66
67 if (CIRC_SPACE(head, tail, XMIT_SIZE) < n+2) { 67 if (CIRC_SPACE(head, tail, XMIT_SIZE) < n+2) {
68 warn("not enough space in xmit buffer to send new packet"); 68 dev_warn(&iforce->dev->dev,
69 "not enough space in xmit buffer to send new packet\n");
69 spin_unlock_irqrestore(&iforce->xmit_lock, flags); 70 spin_unlock_irqrestore(&iforce->xmit_lock, flags);
70 return -1; 71 return -1;
71 } 72 }
@@ -148,7 +149,7 @@ static int mark_core_as_ready(struct iforce *iforce, unsigned short addr)
148 return 0; 149 return 0;
149 } 150 }
150 } 151 }
151 warn("unused effect %04x updated !!!", addr); 152 dev_warn(&iforce->dev->dev, "unused effect %04x updated !!!\n", addr);
152 return -1; 153 return -1;
153} 154}
154 155
@@ -159,7 +160,8 @@ void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data)
159 static int being_used = 0; 160 static int being_used = 0;
160 161
161 if (being_used) 162 if (being_used)
162 warn("re-entrant call to iforce_process %d", being_used); 163 dev_warn(&iforce->dev->dev,
164 "re-entrant call to iforce_process %d\n", being_used);
163 being_used++; 165 being_used++;
164 166
165#ifdef CONFIG_JOYSTICK_IFORCE_232 167#ifdef CONFIG_JOYSTICK_IFORCE_232
diff --git a/drivers/input/joystick/iforce/iforce-usb.c b/drivers/input/joystick/iforce/iforce-usb.c
index 851cc4087c2f..f83185aeb511 100644
--- a/drivers/input/joystick/iforce/iforce-usb.c
+++ b/drivers/input/joystick/iforce/iforce-usb.c
@@ -64,7 +64,7 @@ void iforce_usb_xmit(struct iforce *iforce)
64 64
65 if ( (n=usb_submit_urb(iforce->out, GFP_ATOMIC)) ) { 65 if ( (n=usb_submit_urb(iforce->out, GFP_ATOMIC)) ) {
66 clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags); 66 clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags);
67 warn("usb_submit_urb failed %d\n", n); 67 dev_warn(&iforce->dev->dev, "usb_submit_urb failed %d\n", n);
68 } 68 }
69 69
70 /* The IFORCE_XMIT_RUNNING bit is not cleared here. That's intended. 70 /* The IFORCE_XMIT_RUNNING bit is not cleared here. That's intended.