Commit 43e61fc7 authored by Dmitry Torokhov's avatar Dmitry Torokhov

Input: iforce - update formatting of switch statements

According to our coding style case labels in switch statements should
be aligned with the switch keyword.
Tested-by: default avatarTim Schumacher <timschumi@gmx.de>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 48735862
...@@ -132,7 +132,6 @@ static int iforce_upload_effect(struct input_dev *dev, struct ff_effect *effect, ...@@ -132,7 +132,6 @@ static int iforce_upload_effect(struct input_dev *dev, struct ff_effect *effect,
* Upload the effect * Upload the effect
*/ */
switch (effect->type) { switch (effect->type) {
case FF_PERIODIC: case FF_PERIODIC:
ret = iforce_upload_periodic(iforce, effect, old); ret = iforce_upload_periodic(iforce, effect, old);
break; break;
...@@ -351,11 +350,9 @@ int iforce_init_device(struct device *parent, u16 bustype, ...@@ -351,11 +350,9 @@ int iforce_init_device(struct device *parent, u16 bustype,
signed short t = iforce->type->abs[i]; signed short t = iforce->type->abs[i];
switch (t) { switch (t) {
case ABS_X: case ABS_X:
case ABS_Y: case ABS_Y:
case ABS_WHEEL: case ABS_WHEEL:
input_set_abs_params(input_dev, t, -1920, 1920, 16, 128); input_set_abs_params(input_dev, t, -1920, 1920, 16, 128);
set_bit(t, input_dev->ffbit); set_bit(t, input_dev->ffbit);
break; break;
...@@ -363,12 +360,10 @@ int iforce_init_device(struct device *parent, u16 bustype, ...@@ -363,12 +360,10 @@ int iforce_init_device(struct device *parent, u16 bustype,
case ABS_THROTTLE: case ABS_THROTTLE:
case ABS_GAS: case ABS_GAS:
case ABS_BRAKE: case ABS_BRAKE:
input_set_abs_params(input_dev, t, 0, 255, 0, 0); input_set_abs_params(input_dev, t, 0, 255, 0, 0);
break; break;
case ABS_RUDDER: case ABS_RUDDER:
input_set_abs_params(input_dev, t, -128, 127, 0, 0); input_set_abs_params(input_dev, t, -128, 127, 0, 0);
break; break;
...@@ -376,7 +371,6 @@ int iforce_init_device(struct device *parent, u16 bustype, ...@@ -376,7 +371,6 @@ int iforce_init_device(struct device *parent, u16 bustype,
case ABS_HAT0Y: case ABS_HAT0Y:
case ABS_HAT1X: case ABS_HAT1X:
case ABS_HAT1Y: case ABS_HAT1Y:
input_set_abs_params(input_dev, t, -1, 1, 0, 0); input_set_abs_params(input_dev, t, -1, 1, 0, 0);
break; break;
} }
......
...@@ -166,14 +166,20 @@ void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data) ...@@ -166,14 +166,20 @@ void iforce_process_packet(struct iforce *iforce, u16 cmd, unsigned char *data)
if (i <= 8) { if (i <= 8) {
int btns = data[6]; int btns = data[6];
if (test_bit(ABS_HAT1X, dev->absbit)) { if (test_bit(ABS_HAT1X, dev->absbit)) {
if (btns & 8) input_report_abs(dev, ABS_HAT1X, -1); if (btns & 8)
else if (btns & 2) input_report_abs(dev, ABS_HAT1X, 1); input_report_abs(dev, ABS_HAT1X, -1);
else input_report_abs(dev, ABS_HAT1X, 0); else if (btns & 2)
input_report_abs(dev, ABS_HAT1X, 1);
else
input_report_abs(dev, ABS_HAT1X, 0);
} }
if (test_bit(ABS_HAT1Y, dev->absbit)) { if (test_bit(ABS_HAT1Y, dev->absbit)) {
if (btns & 1) input_report_abs(dev, ABS_HAT1Y, -1); if (btns & 1)
else if (btns & 4) input_report_abs(dev, ABS_HAT1Y, 1); input_report_abs(dev, ABS_HAT1Y, -1);
else input_report_abs(dev, ABS_HAT1Y, 0); else if (btns & 4)
input_report_abs(dev, ABS_HAT1Y, 1);
else
input_report_abs(dev, ABS_HAT1Y, 0);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment