aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorFrank Praznik <frank.praznik@oh.rr.com>2014-02-20 11:36:00 -0500
committerJiri Kosina <jkosina@suse.cz>2014-02-24 11:38:45 -0500
commitad142b9e44efe4b6faa2553fd1e4d0e3a70619f8 (patch)
tree6338a78048a09fbe2cf91f11d1838cb6f1e48a22 /drivers
parentfee4e2d526c08946f481a27fd40090edce005080 (diff)
HID: sony: Fix multi-line comment styling
Convert multi-line comments to comply with the kernel coding style. Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com> Reviewed-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hid/hid-sony.c45
1 files changed, 30 insertions, 15 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index 526705fac82c..26992e15d0e2 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -17,7 +17,8 @@
17 * any later version. 17 * any later version.
18 */ 18 */
19 19
20/* NOTE: in order for the Sony PS3 BD Remote Control to be found by 20/*
21 * NOTE: in order for the Sony PS3 BD Remote Control to be found by
21 * a Bluetooth host, the key combination Start+Enter has to be kept pressed 22 * a Bluetooth host, the key combination Start+Enter has to be kept pressed
22 * for about 7 seconds with the Bluetooth Host Controller in discovering mode. 23 * for about 7 seconds with the Bluetooth Host Controller in discovering mode.
23 * 24 *
@@ -81,7 +82,8 @@ static const u8 sixaxis_rdesc_fixup2[] = {
81 0xb1, 0x02, 0xc0, 0xc0, 82 0xb1, 0x02, 0xc0, 0xc0,
82}; 83};
83 84
84/* The default descriptor doesn't provide mapping for the accelerometers 85/*
86 * The default descriptor doesn't provide mapping for the accelerometers
85 * or orientation sensors. This fixed descriptor maps the accelerometers 87 * or orientation sensors. This fixed descriptor maps the accelerometers
86 * to usage values 0x40, 0x41 and 0x42 and maps the orientation sensors 88 * to usage values 0x40, 0x41 and 0x42 and maps the orientation sensors
87 * to usage values 0x43, 0x44 and 0x45. 89 * to usage values 0x43, 0x44 and 0x45.
@@ -340,7 +342,8 @@ static u8 dualshock4_usb_rdesc[] = {
340 0xC0 /* End Collection */ 342 0xC0 /* End Collection */
341}; 343};
342 344
343/* The default behavior of the Dualshock 4 is to send reports using report 345/*
346 * The default behavior of the Dualshock 4 is to send reports using report
344 * type 1 when running over Bluetooth. However, as soon as it receives a 347 * type 1 when running over Bluetooth. However, as soon as it receives a
345 * report of type 17 to set the LEDs or rumble it starts returning it's state 348 * report of type 17 to set the LEDs or rumble it starts returning it's state
346 * in report 17 instead of 1. Since report 17 is undefined in the default HID 349 * in report 17 instead of 1. Since report 17 is undefined in the default HID
@@ -667,7 +670,8 @@ static const unsigned int ps3remote_keymap_remote_buttons[] = {
667}; 670};
668 671
669static const unsigned int buzz_keymap[] = { 672static const unsigned int buzz_keymap[] = {
670 /* The controller has 4 remote buzzers, each with one LED and 5 673 /*
674 * The controller has 4 remote buzzers, each with one LED and 5
671 * buttons. 675 * buttons.
672 * 676 *
673 * We use the mapping chosen by the controller, which is: 677 * We use the mapping chosen by the controller, which is:
@@ -838,7 +842,8 @@ static void sixaxis_parse_report(struct sony_sc *sc, __u8 *rd, int size)
838 unsigned long flags; 842 unsigned long flags;
839 __u8 cable_state, battery_capacity, battery_charging; 843 __u8 cable_state, battery_capacity, battery_charging;
840 844
841 /* The sixaxis is charging if the battery value is 0xee 845 /*
846 * The sixaxis is charging if the battery value is 0xee
842 * and it is fully charged if the value is 0xef. 847 * and it is fully charged if the value is 0xef.
843 * It does not report the actual level while charging so it 848 * It does not report the actual level while charging so it
844 * is set to 100% while charging is in progress. 849 * is set to 100% while charging is in progress.
@@ -868,18 +873,21 @@ static void dualshock4_parse_report(struct sony_sc *sc, __u8 *rd, int size)
868 int n, offset; 873 int n, offset;
869 __u8 cable_state, battery_capacity, battery_charging; 874 __u8 cable_state, battery_capacity, battery_charging;
870 875
871 /* Battery and touchpad data starts at byte 30 in the USB report and 876 /*
877 * Battery and touchpad data starts at byte 30 in the USB report and
872 * 32 in Bluetooth report. 878 * 32 in Bluetooth report.
873 */ 879 */
874 offset = (sc->quirks & DUALSHOCK4_CONTROLLER_USB) ? 30 : 32; 880 offset = (sc->quirks & DUALSHOCK4_CONTROLLER_USB) ? 30 : 32;
875 881
876 /* The lower 4 bits of byte 30 contain the battery level 882 /*
883 * The lower 4 bits of byte 30 contain the battery level
877 * and the 5th bit contains the USB cable state. 884 * and the 5th bit contains the USB cable state.
878 */ 885 */
879 cable_state = (rd[offset] >> 4) & 0x01; 886 cable_state = (rd[offset] >> 4) & 0x01;
880 battery_capacity = rd[offset] & 0x0F; 887 battery_capacity = rd[offset] & 0x0F;
881 888
882 /* When a USB power source is connected the battery level ranges from 889 /*
890 * When a USB power source is connected the battery level ranges from
883 * 0 to 10, and when running on battery power it ranges from 0 to 9. 891 * 0 to 10, and when running on battery power it ranges from 0 to 9.
884 * A battery level above 10 when plugged in means charge completed. 892 * A battery level above 10 when plugged in means charge completed.
885 */ 893 */
@@ -903,7 +911,8 @@ static void dualshock4_parse_report(struct sony_sc *sc, __u8 *rd, int size)
903 911
904 offset += 5; 912 offset += 5;
905 913
906 /* The Dualshock 4 multi-touch trackpad data starts at offset 35 on USB 914 /*
915 * The Dualshock 4 multi-touch trackpad data starts at offset 35 on USB
907 * and 37 on Bluetooth. 916 * and 37 on Bluetooth.
908 * The first 7 bits of the first byte is a counter and bit 8 is a touch 917 * The first 7 bits of the first byte is a counter and bit 8 is a touch
909 * indicator that is 0 when pressed and 1 when not pressed. 918 * indicator that is 0 when pressed and 1 when not pressed.
@@ -932,7 +941,8 @@ static int sony_raw_event(struct hid_device *hdev, struct hid_report *report,
932{ 941{
933 struct sony_sc *sc = hid_get_drvdata(hdev); 942 struct sony_sc *sc = hid_get_drvdata(hdev);
934 943
935 /* Sixaxis HID report has acclerometers/gyro with MSByte first, this 944 /*
945 * Sixaxis HID report has acclerometers/gyro with MSByte first, this
936 * has to be BYTE_SWAPPED before passing up to joystick interface 946 * has to be BYTE_SWAPPED before passing up to joystick interface
937 */ 947 */
938 if ((sc->quirks & SIXAXIS_CONTROLLER) && rd[0] == 0x01 && size == 49) { 948 if ((sc->quirks & SIXAXIS_CONTROLLER) && rd[0] == 0x01 && size == 49) {
@@ -1057,7 +1067,8 @@ static int sixaxis_set_operational_bt(struct hid_device *hdev)
1057 HID_FEATURE_REPORT); 1067 HID_FEATURE_REPORT);
1058} 1068}
1059 1069
1060/* Requesting feature report 0x02 in Bluetooth mode changes the state of the 1070/*
1071 * Requesting feature report 0x02 in Bluetooth mode changes the state of the
1061 * controller so that it sends full input reports of type 0x11. 1072 * controller so that it sends full input reports of type 0x11.
1062 */ 1073 */
1063static int dualshock4_set_operational_bt(struct hid_device *hdev) 1074static int dualshock4_set_operational_bt(struct hid_device *hdev)
@@ -1211,9 +1222,11 @@ static int sony_leds_init(struct hid_device *hdev)
1211 name_fmt = "%s::sony%d"; 1222 name_fmt = "%s::sony%d";
1212 } 1223 }
1213 1224
1214 /* Clear LEDs as we have no way of reading their initial state. This is 1225 /*
1226 * Clear LEDs as we have no way of reading their initial state. This is
1215 * only relevant if the driver is loaded after somebody actively set the 1227 * only relevant if the driver is loaded after somebody actively set the
1216 * LEDs to on */ 1228 * LEDs to on
1229 */
1217 sony_set_leds(hdev, initial_values, drv_data->led_count); 1230 sony_set_leds(hdev, initial_values, drv_data->led_count);
1218 1231
1219 name_sz = strlen(dev_name(&hdev->dev)) + name_len + 1; 1232 name_sz = strlen(dev_name(&hdev->dev)) + name_len + 1;
@@ -1420,7 +1433,8 @@ static int sony_battery_probe(struct sony_sc *sc)
1420 struct hid_device *hdev = sc->hdev; 1433 struct hid_device *hdev = sc->hdev;
1421 int ret; 1434 int ret;
1422 1435
1423 /* Set the default battery level to 100% to avoid low battery warnings 1436 /*
1437 * Set the default battery level to 100% to avoid low battery warnings
1424 * if the battery is polled before the first device report is received. 1438 * if the battery is polled before the first device report is received.
1425 */ 1439 */
1426 sc->battery_capacity = 100; 1440 sc->battery_capacity = 100;
@@ -1533,7 +1547,8 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
1533 goto err_stop; 1547 goto err_stop;
1534 } 1548 }
1535 } 1549 }
1536 /* The Dualshock 4 touchpad supports 2 touches and has a 1550 /*
1551 * The Dualshock 4 touchpad supports 2 touches and has a
1537 * resolution of 1920x940. 1552 * resolution of 1920x940.
1538 */ 1553 */
1539 ret = sony_register_touchpad(sc, 2, 1920, 940); 1554 ret = sony_register_touchpad(sc, 2, 1920, 940);