aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Machek <pavel@ucw.cz>2016-02-09 07:55:08 -0500
committerJiri Kosina <jkosina@suse.cz>2016-02-10 05:32:08 -0500
commit1adf904e90059a5b577dbf49b57c27da29b1e69e (patch)
treee173326231b46156afbf81d37d0bcae065dab26d
parentef916ef5ef75fe0206b2c0cfcd696b32aa1ea872 (diff)
HID: sony: underscores are unnecessary for u8, u16, s32
Double-underscore prefixed types are unnecessary in pure kernel code, replace them with the non prefixed equivalents. Signed-off-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Antonio Ospite <ao2@ao2.it> Acked-by: Frank Praznik <frank.praznik@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/hid/hid-sony.c114
1 files changed, 57 insertions, 57 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index 145579666f18..ccf7ef2d0b5e 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -75,7 +75,7 @@
75 * axis values. Additionally, the controller only has 20 actual, physical axes 75 * axis values. Additionally, the controller only has 20 actual, physical axes
76 * so there are several unused axes in between the used ones. 76 * so there are several unused axes in between the used ones.
77 */ 77 */
78static __u8 sixaxis_rdesc[] = { 78static u8 sixaxis_rdesc[] = {
79 0x05, 0x01, /* Usage Page (Desktop), */ 79 0x05, 0x01, /* Usage Page (Desktop), */
80 0x09, 0x04, /* Usage (Joystick), */ 80 0x09, 0x04, /* Usage (Joystick), */
81 0xA1, 0x01, /* Collection (Application), */ 81 0xA1, 0x01, /* Collection (Application), */
@@ -153,7 +153,7 @@ static __u8 sixaxis_rdesc[] = {
153}; 153};
154 154
155/* PS/3 Motion controller */ 155/* PS/3 Motion controller */
156static __u8 motion_rdesc[] = { 156static u8 motion_rdesc[] = {
157 0x05, 0x01, /* Usage Page (Desktop), */ 157 0x05, 0x01, /* Usage Page (Desktop), */
158 0x09, 0x04, /* Usage (Joystick), */ 158 0x09, 0x04, /* Usage (Joystick), */
159 0xA1, 0x01, /* Collection (Application), */ 159 0xA1, 0x01, /* Collection (Application), */
@@ -250,7 +250,7 @@ static __u8 motion_rdesc[] = {
250}; 250};
251 251
252/* PS/3 Navigation controller */ 252/* PS/3 Navigation controller */
253static __u8 navigation_rdesc[] = { 253static u8 navigation_rdesc[] = {
254 0x05, 0x01, /* Usage Page (Desktop), */ 254 0x05, 0x01, /* Usage Page (Desktop), */
255 0x09, 0x04, /* Usage (Joystik), */ 255 0x09, 0x04, /* Usage (Joystik), */
256 0xA1, 0x01, /* Collection (Application), */ 256 0xA1, 0x01, /* Collection (Application), */
@@ -810,7 +810,7 @@ static u8 dualshock4_bt_rdesc[] = {
810 0xC0 /* End Collection */ 810 0xC0 /* End Collection */
811}; 811};
812 812
813static __u8 ps3remote_rdesc[] = { 813static u8 ps3remote_rdesc[] = {
814 0x05, 0x01, /* GUsagePage Generic Desktop */ 814 0x05, 0x01, /* GUsagePage Generic Desktop */
815 0x09, 0x05, /* LUsage 0x05 [Game Pad] */ 815 0x09, 0x05, /* LUsage 0x05 [Game Pad] */
816 0xA1, 0x01, /* MCollection Application (mouse, keyboard) */ 816 0xA1, 0x01, /* MCollection Application (mouse, keyboard) */
@@ -980,33 +980,33 @@ static enum power_supply_property sony_battery_props[] = {
980}; 980};
981 981
982struct sixaxis_led { 982struct sixaxis_led {
983 __u8 time_enabled; /* the total time the led is active (0xff means forever) */ 983 u8 time_enabled; /* the total time the led is active (0xff means forever) */
984 __u8 duty_length; /* how long a cycle is in deciseconds (0 means "really fast") */ 984 u8 duty_length; /* how long a cycle is in deciseconds (0 means "really fast") */
985 __u8 enabled; 985 u8 enabled;
986 __u8 duty_off; /* % of duty_length the led is off (0xff means 100%) */ 986 u8 duty_off; /* % of duty_length the led is off (0xff means 100%) */
987 __u8 duty_on; /* % of duty_length the led is on (0xff mean 100%) */ 987 u8 duty_on; /* % of duty_length the led is on (0xff mean 100%) */
988} __packed; 988} __packed;
989 989
990struct sixaxis_rumble { 990struct sixaxis_rumble {
991 __u8 padding; 991 u8 padding;
992 __u8 right_duration; /* Right motor duration (0xff means forever) */ 992 u8 right_duration; /* Right motor duration (0xff means forever) */
993 __u8 right_motor_on; /* Right (small) motor on/off, only supports values of 0 or 1 (off/on) */ 993 u8 right_motor_on; /* Right (small) motor on/off, only supports values of 0 or 1 (off/on) */
994 __u8 left_duration; /* Left motor duration (0xff means forever) */ 994 u8 left_duration; /* Left motor duration (0xff means forever) */
995 __u8 left_motor_force; /* left (large) motor, supports force values from 0 to 255 */ 995 u8 left_motor_force; /* left (large) motor, supports force values from 0 to 255 */
996} __packed; 996} __packed;
997 997
998struct sixaxis_output_report { 998struct sixaxis_output_report {
999 __u8 report_id; 999 u8 report_id;
1000 struct sixaxis_rumble rumble; 1000 struct sixaxis_rumble rumble;
1001 __u8 padding[4]; 1001 u8 padding[4];
1002 __u8 leds_bitmap; /* bitmap of enabled LEDs: LED_1 = 0x02, LED_2 = 0x04, ... */ 1002 u8 leds_bitmap; /* bitmap of enabled LEDs: LED_1 = 0x02, LED_2 = 0x04, ... */
1003 struct sixaxis_led led[4]; /* LEDx at (4 - x) */ 1003 struct sixaxis_led led[4]; /* LEDx at (4 - x) */
1004 struct sixaxis_led _reserved; /* LED5, not actually soldered */ 1004 struct sixaxis_led _reserved; /* LED5, not actually soldered */
1005} __packed; 1005} __packed;
1006 1006
1007union sixaxis_output_report_01 { 1007union sixaxis_output_report_01 {
1008 struct sixaxis_output_report data; 1008 struct sixaxis_output_report data;
1009 __u8 buf[36]; 1009 u8 buf[36];
1010}; 1010};
1011 1011
1012struct motion_output_report_02 { 1012struct motion_output_report_02 {
@@ -1039,26 +1039,26 @@ struct sony_sc {
1039 struct power_supply *battery; 1039 struct power_supply *battery;
1040 struct power_supply_desc battery_desc; 1040 struct power_supply_desc battery_desc;
1041 int device_id; 1041 int device_id;
1042 __u8 *output_report_dmabuf; 1042 u8 *output_report_dmabuf;
1043 1043
1044#ifdef CONFIG_SONY_FF 1044#ifdef CONFIG_SONY_FF
1045 __u8 left; 1045 u8 left;
1046 __u8 right; 1046 u8 right;
1047#endif 1047#endif
1048 1048
1049 __u8 mac_address[6]; 1049 u8 mac_address[6];
1050 __u8 worker_initialized; 1050 u8 worker_initialized;
1051 __u8 cable_state; 1051 u8 cable_state;
1052 __u8 battery_charging; 1052 u8 battery_charging;
1053 __u8 battery_capacity; 1053 u8 battery_capacity;
1054 __u8 led_state[MAX_LEDS]; 1054 u8 led_state[MAX_LEDS];
1055 __u8 resume_led_state[MAX_LEDS]; 1055 u8 resume_led_state[MAX_LEDS];
1056 __u8 led_delay_on[MAX_LEDS]; 1056 u8 led_delay_on[MAX_LEDS];
1057 __u8 led_delay_off[MAX_LEDS]; 1057 u8 led_delay_off[MAX_LEDS];
1058 __u8 led_count; 1058 u8 led_count;
1059}; 1059};
1060 1060
1061static __u8 *sixaxis_fixup(struct hid_device *hdev, __u8 *rdesc, 1061static u8 *sixaxis_fixup(struct hid_device *hdev, u8 *rdesc,
1062 unsigned int *rsize) 1062 unsigned int *rsize)
1063{ 1063{
1064 *rsize = sizeof(sixaxis_rdesc); 1064 *rsize = sizeof(sixaxis_rdesc);
@@ -1079,7 +1079,7 @@ static u8 *navigation_fixup(struct hid_device *hdev, u8 *rdesc,
1079 return navigation_rdesc; 1079 return navigation_rdesc;
1080} 1080}
1081 1081
1082static __u8 *ps3remote_fixup(struct hid_device *hdev, __u8 *rdesc, 1082static u8 *ps3remote_fixup(struct hid_device *hdev, u8 *rdesc,
1083 unsigned int *rsize) 1083 unsigned int *rsize)
1084{ 1084{
1085 *rsize = sizeof(ps3remote_rdesc); 1085 *rsize = sizeof(ps3remote_rdesc);
@@ -1120,7 +1120,7 @@ static int ps3remote_mapping(struct hid_device *hdev, struct hid_input *hi,
1120 return 1; 1120 return 1;
1121} 1121}
1122 1122
1123static __u8 *sony_report_fixup(struct hid_device *hdev, __u8 *rdesc, 1123static u8 *sony_report_fixup(struct hid_device *hdev, u8 *rdesc,
1124 unsigned int *rsize) 1124 unsigned int *rsize)
1125{ 1125{
1126 struct sony_sc *sc = hid_get_drvdata(hdev); 1126 struct sony_sc *sc = hid_get_drvdata(hdev);
@@ -1174,12 +1174,12 @@ static __u8 *sony_report_fixup(struct hid_device *hdev, __u8 *rdesc,
1174 return rdesc; 1174 return rdesc;
1175} 1175}
1176 1176
1177static void sixaxis_parse_report(struct sony_sc *sc, __u8 *rd, int size) 1177static void sixaxis_parse_report(struct sony_sc *sc, u8 *rd, int size)
1178{ 1178{
1179 static const __u8 sixaxis_battery_capacity[] = { 0, 1, 25, 50, 75, 100 }; 1179 static const u8 sixaxis_battery_capacity[] = { 0, 1, 25, 50, 75, 100 };
1180 unsigned long flags; 1180 unsigned long flags;
1181 int offset; 1181 int offset;
1182 __u8 cable_state, battery_capacity, battery_charging; 1182 u8 cable_state, battery_capacity, battery_charging;
1183 1183
1184 /* 1184 /*
1185 * The sixaxis is charging if the battery value is 0xee 1185 * The sixaxis is charging if the battery value is 0xee
@@ -1194,7 +1194,7 @@ static void sixaxis_parse_report(struct sony_sc *sc, __u8 *rd, int size)
1194 battery_charging = !(rd[offset] & 0x01); 1194 battery_charging = !(rd[offset] & 0x01);
1195 cable_state = 1; 1195 cable_state = 1;
1196 } else { 1196 } else {
1197 __u8 index = rd[offset] <= 5 ? rd[offset] : 5; 1197 u8 index = rd[offset] <= 5 ? rd[offset] : 5;
1198 battery_capacity = sixaxis_battery_capacity[index]; 1198 battery_capacity = sixaxis_battery_capacity[index];
1199 battery_charging = 0; 1199 battery_charging = 0;
1200 cable_state = 0; 1200 cable_state = 0;
@@ -1207,14 +1207,14 @@ static void sixaxis_parse_report(struct sony_sc *sc, __u8 *rd, int size)
1207 spin_unlock_irqrestore(&sc->lock, flags); 1207 spin_unlock_irqrestore(&sc->lock, flags);
1208} 1208}
1209 1209
1210static void dualshock4_parse_report(struct sony_sc *sc, __u8 *rd, int size) 1210static void dualshock4_parse_report(struct sony_sc *sc, u8 *rd, int size)
1211{ 1211{
1212 struct hid_input *hidinput = list_entry(sc->hdev->inputs.next, 1212 struct hid_input *hidinput = list_entry(sc->hdev->inputs.next,
1213 struct hid_input, list); 1213 struct hid_input, list);
1214 struct input_dev *input_dev = hidinput->input; 1214 struct input_dev *input_dev = hidinput->input;
1215 unsigned long flags; 1215 unsigned long flags;
1216 int n, offset; 1216 int n, offset;
1217 __u8 cable_state, battery_capacity, battery_charging; 1217 u8 cable_state, battery_capacity, battery_charging;
1218 1218
1219 /* 1219 /*
1220 * Battery and touchpad data starts at byte 30 in the USB report and 1220 * Battery and touchpad data starts at byte 30 in the USB report and
@@ -1264,7 +1264,7 @@ static void dualshock4_parse_report(struct sony_sc *sc, __u8 *rd, int size)
1264 * follows the data for the first. 1264 * follows the data for the first.
1265 */ 1265 */
1266 for (n = 0; n < 2; n++) { 1266 for (n = 0; n < 2; n++) {
1267 __u16 x, y; 1267 u16 x, y;
1268 1268
1269 x = rd[offset+1] | ((rd[offset+2] & 0xF) << 8); 1269 x = rd[offset+1] | ((rd[offset+2] & 0xF) << 8);
1270 y = ((rd[offset+2] & 0xF0) >> 4) | (rd[offset+3] << 4); 1270 y = ((rd[offset+2] & 0xF0) >> 4) | (rd[offset+3] << 4);
@@ -1280,7 +1280,7 @@ static void dualshock4_parse_report(struct sony_sc *sc, __u8 *rd, int size)
1280} 1280}
1281 1281
1282static int sony_raw_event(struct hid_device *hdev, struct hid_report *report, 1282static int sony_raw_event(struct hid_device *hdev, struct hid_report *report,
1283 __u8 *rd, int size) 1283 u8 *rd, int size)
1284{ 1284{
1285 struct sony_sc *sc = hid_get_drvdata(hdev); 1285 struct sony_sc *sc = hid_get_drvdata(hdev);
1286 1286
@@ -1404,7 +1404,7 @@ static int sixaxis_set_operational_usb(struct hid_device *hdev)
1404{ 1404{
1405 const int buf_size = 1405 const int buf_size =
1406 max(SIXAXIS_REPORT_0xF2_SIZE, SIXAXIS_REPORT_0xF5_SIZE); 1406 max(SIXAXIS_REPORT_0xF2_SIZE, SIXAXIS_REPORT_0xF5_SIZE);
1407 __u8 *buf; 1407 u8 *buf;
1408 int ret; 1408 int ret;
1409 1409
1410 buf = kmalloc(buf_size, GFP_KERNEL); 1410 buf = kmalloc(buf_size, GFP_KERNEL);
@@ -1443,8 +1443,8 @@ out:
1443 1443
1444static int sixaxis_set_operational_bt(struct hid_device *hdev) 1444static int sixaxis_set_operational_bt(struct hid_device *hdev)
1445{ 1445{
1446 static const __u8 report[] = { 0xf4, 0x42, 0x03, 0x00, 0x00 }; 1446 static const u8 report[] = { 0xf4, 0x42, 0x03, 0x00, 0x00 };
1447 __u8 *buf; 1447 u8 *buf;
1448 int ret; 1448 int ret;
1449 1449
1450 buf = kmemdup(report, sizeof(report), GFP_KERNEL); 1450 buf = kmemdup(report, sizeof(report), GFP_KERNEL);
@@ -1465,7 +1465,7 @@ static int sixaxis_set_operational_bt(struct hid_device *hdev)
1465 */ 1465 */
1466static int dualshock4_set_operational_bt(struct hid_device *hdev) 1466static int dualshock4_set_operational_bt(struct hid_device *hdev)
1467{ 1467{
1468 __u8 *buf; 1468 u8 *buf;
1469 int ret; 1469 int ret;
1470 1470
1471 buf = kmalloc(DS4_REPORT_0x02_SIZE, GFP_KERNEL); 1471 buf = kmalloc(DS4_REPORT_0x02_SIZE, GFP_KERNEL);
@@ -1482,7 +1482,7 @@ static int dualshock4_set_operational_bt(struct hid_device *hdev)
1482 1482
1483static void sixaxis_set_leds_from_id(struct sony_sc *sc) 1483static void sixaxis_set_leds_from_id(struct sony_sc *sc)
1484{ 1484{
1485 static const __u8 sixaxis_leds[10][4] = { 1485 static const u8 sixaxis_leds[10][4] = {
1486 { 0x01, 0x00, 0x00, 0x00 }, 1486 { 0x01, 0x00, 0x00, 0x00 },
1487 { 0x00, 0x01, 0x00, 0x00 }, 1487 { 0x00, 0x01, 0x00, 0x00 },
1488 { 0x00, 0x00, 0x01, 0x00 }, 1488 { 0x00, 0x00, 0x01, 0x00 },
@@ -1509,7 +1509,7 @@ static void sixaxis_set_leds_from_id(struct sony_sc *sc)
1509static void dualshock4_set_leds_from_id(struct sony_sc *sc) 1509static void dualshock4_set_leds_from_id(struct sony_sc *sc)
1510{ 1510{
1511 /* The first 4 color/index entries match what the PS4 assigns */ 1511 /* The first 4 color/index entries match what the PS4 assigns */
1512 static const __u8 color_code[7][3] = { 1512 static const u8 color_code[7][3] = {
1513 /* Blue */ { 0x00, 0x00, 0x01 }, 1513 /* Blue */ { 0x00, 0x00, 0x01 },
1514 /* Red */ { 0x01, 0x00, 0x00 }, 1514 /* Red */ { 0x01, 0x00, 0x00 },
1515 /* Green */ { 0x00, 0x01, 0x00 }, 1515 /* Green */ { 0x00, 0x01, 0x00 },
@@ -1537,7 +1537,7 @@ static void buzz_set_leds(struct sony_sc *sc)
1537 &hdev->report_enum[HID_OUTPUT_REPORT].report_list; 1537 &hdev->report_enum[HID_OUTPUT_REPORT].report_list;
1538 struct hid_report *report = list_entry(report_list->next, 1538 struct hid_report *report = list_entry(report_list->next,
1539 struct hid_report, list); 1539 struct hid_report, list);
1540 __s32 *value = report->field[0]->value; 1540 s32 *value = report->field[0]->value;
1541 1541
1542 BUILD_BUG_ON(MAX_LEDS < 4); 1542 BUILD_BUG_ON(MAX_LEDS < 4);
1543 1543
@@ -1631,7 +1631,7 @@ static int sony_led_blink_set(struct led_classdev *led, unsigned long *delay_on,
1631 struct hid_device *hdev = to_hid_device(dev); 1631 struct hid_device *hdev = to_hid_device(dev);
1632 struct sony_sc *drv_data = hid_get_drvdata(hdev); 1632 struct sony_sc *drv_data = hid_get_drvdata(hdev);
1633 int n; 1633 int n;
1634 __u8 new_on, new_off; 1634 u8 new_on, new_off;
1635 1635
1636 if (!drv_data) { 1636 if (!drv_data) {
1637 hid_err(hdev, "No device data\n"); 1637 hid_err(hdev, "No device data\n");
@@ -1702,8 +1702,8 @@ static int sony_leds_init(struct sony_sc *sc)
1702 const char *name_fmt; 1702 const char *name_fmt;
1703 static const char * const ds4_name_str[] = { "red", "green", "blue", 1703 static const char * const ds4_name_str[] = { "red", "green", "blue",
1704 "global" }; 1704 "global" };
1705 __u8 max_brightness[MAX_LEDS] = { [0 ... (MAX_LEDS - 1)] = 1 }; 1705 u8 max_brightness[MAX_LEDS] = { [0 ... (MAX_LEDS - 1)] = 1 };
1706 __u8 use_hw_blink[MAX_LEDS] = { 0 }; 1706 u8 use_hw_blink[MAX_LEDS] = { 0 };
1707 1707
1708 BUG_ON(!(sc->quirks & SONY_LED_SUPPORT)); 1708 BUG_ON(!(sc->quirks & SONY_LED_SUPPORT));
1709 1709
@@ -1731,7 +1731,7 @@ static int sony_leds_init(struct sony_sc *sc)
1731 name_len = 0; 1731 name_len = 0;
1732 name_fmt = "%s:%s"; 1732 name_fmt = "%s:%s";
1733 } else if (sc->quirks & NAVIGATION_CONTROLLER) { 1733 } else if (sc->quirks & NAVIGATION_CONTROLLER) {
1734 static const __u8 navigation_leds[4] = {0x01, 0x00, 0x00, 0x00}; 1734 static const u8 navigation_leds[4] = {0x01, 0x00, 0x00, 0x00};
1735 1735
1736 memcpy(sc->led_state, navigation_leds, sizeof(navigation_leds)); 1736 memcpy(sc->led_state, navigation_leds, sizeof(navigation_leds));
1737 sc->led_count = 1; 1737 sc->led_count = 1;
@@ -1854,7 +1854,7 @@ static void sixaxis_send_output_report(struct sony_sc *sc)
1854 } 1854 }
1855 } 1855 }
1856 1856
1857 hid_hw_raw_request(sc->hdev, report->report_id, (__u8 *)report, 1857 hid_hw_raw_request(sc->hdev, report->report_id, (u8 *)report,
1858 sizeof(struct sixaxis_output_report), 1858 sizeof(struct sixaxis_output_report),
1859 HID_OUTPUT_REPORT, HID_REQ_SET_REPORT); 1859 HID_OUTPUT_REPORT, HID_REQ_SET_REPORT);
1860} 1860}
@@ -1862,7 +1862,7 @@ static void sixaxis_send_output_report(struct sony_sc *sc)
1862static void dualshock4_send_output_report(struct sony_sc *sc) 1862static void dualshock4_send_output_report(struct sony_sc *sc)
1863{ 1863{
1864 struct hid_device *hdev = sc->hdev; 1864 struct hid_device *hdev = sc->hdev;
1865 __u8 *buf = sc->output_report_dmabuf; 1865 u8 *buf = sc->output_report_dmabuf;
1866 int offset; 1866 int offset;
1867 1867
1868 if (sc->quirks & DUALSHOCK4_CONTROLLER_USB) { 1868 if (sc->quirks & DUALSHOCK4_CONTROLLER_USB) {
@@ -1922,7 +1922,7 @@ static void motion_send_output_report(struct sony_sc *sc)
1922 report->rumble = max(sc->right, sc->left); 1922 report->rumble = max(sc->right, sc->left);
1923#endif 1923#endif
1924 1924
1925 hid_hw_output_report(hdev, (__u8 *)report, MOTION_REPORT_0x02_SIZE); 1925 hid_hw_output_report(hdev, (u8 *)report, MOTION_REPORT_0x02_SIZE);
1926} 1926}
1927 1927
1928static inline void sony_send_output_report(struct sony_sc *sc) 1928static inline void sony_send_output_report(struct sony_sc *sc)
@@ -2155,7 +2155,7 @@ static int sony_get_bt_devaddr(struct sony_sc *sc)
2155 2155
2156static int sony_check_add(struct sony_sc *sc) 2156static int sony_check_add(struct sony_sc *sc)
2157{ 2157{
2158 __u8 *buf = NULL; 2158 u8 *buf = NULL;
2159 int n, ret; 2159 int n, ret;
2160 2160
2161 if ((sc->quirks & DUALSHOCK4_CONTROLLER_BT) || 2161 if ((sc->quirks & DUALSHOCK4_CONTROLLER_BT) ||