75
75
* axis values. Additionally, the controller only has 20 actual, physical axes
76
76
* so there are several unused axes in between the used ones.
77
77
*/
78
- static __u8 sixaxis_rdesc [] = {
78
+ static u8 sixaxis_rdesc [] = {
79
79
0x05 , 0x01 , /* Usage Page (Desktop), */
80
80
0x09 , 0x04 , /* Usage (Joystick), */
81
81
0xA1 , 0x01 , /* Collection (Application), */
@@ -153,7 +153,7 @@ static __u8 sixaxis_rdesc[] = {
153
153
};
154
154
155
155
/* PS/3 Motion controller */
156
- static __u8 motion_rdesc [] = {
156
+ static u8 motion_rdesc [] = {
157
157
0x05 , 0x01 , /* Usage Page (Desktop), */
158
158
0x09 , 0x04 , /* Usage (Joystick), */
159
159
0xA1 , 0x01 , /* Collection (Application), */
@@ -250,7 +250,7 @@ static __u8 motion_rdesc[] = {
250
250
};
251
251
252
252
/* PS/3 Navigation controller */
253
- static __u8 navigation_rdesc [] = {
253
+ static u8 navigation_rdesc [] = {
254
254
0x05 , 0x01 , /* Usage Page (Desktop), */
255
255
0x09 , 0x04 , /* Usage (Joystik), */
256
256
0xA1 , 0x01 , /* Collection (Application), */
@@ -810,7 +810,7 @@ static u8 dualshock4_bt_rdesc[] = {
810
810
0xC0 /* End Collection */
811
811
};
812
812
813
- static __u8 ps3remote_rdesc [] = {
813
+ static u8 ps3remote_rdesc [] = {
814
814
0x05 , 0x01 , /* GUsagePage Generic Desktop */
815
815
0x09 , 0x05 , /* LUsage 0x05 [Game Pad] */
816
816
0xA1 , 0x01 , /* MCollection Application (mouse, keyboard) */
@@ -980,33 +980,33 @@ static enum power_supply_property sony_battery_props[] = {
980
980
};
981
981
982
982
struct sixaxis_led {
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") */
985
- __u8 enabled ;
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%) */
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") */
985
+ u8 enabled ;
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%) */
988
988
} __packed ;
989
989
990
990
struct sixaxis_rumble {
991
- __u8 padding ;
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) */
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 */
991
+ u8 padding ;
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) */
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 */
996
996
} __packed ;
997
997
998
998
struct sixaxis_output_report {
999
- __u8 report_id ;
999
+ u8 report_id ;
1000
1000
struct sixaxis_rumble rumble ;
1001
- __u8 padding [4 ];
1002
- __u8 leds_bitmap ; /* bitmap of enabled LEDs: LED_1 = 0x02, LED_2 = 0x04, ... */
1001
+ u8 padding [4 ];
1002
+ u8 leds_bitmap ; /* bitmap of enabled LEDs: LED_1 = 0x02, LED_2 = 0x04, ... */
1003
1003
struct sixaxis_led led [4 ]; /* LEDx at (4 - x) */
1004
1004
struct sixaxis_led _reserved ; /* LED5, not actually soldered */
1005
1005
} __packed ;
1006
1006
1007
1007
union sixaxis_output_report_01 {
1008
1008
struct sixaxis_output_report data ;
1009
- __u8 buf [36 ];
1009
+ u8 buf [36 ];
1010
1010
};
1011
1011
1012
1012
struct motion_output_report_02 {
@@ -1039,26 +1039,26 @@ struct sony_sc {
1039
1039
struct power_supply * battery ;
1040
1040
struct power_supply_desc battery_desc ;
1041
1041
int device_id ;
1042
- __u8 * output_report_dmabuf ;
1042
+ u8 * output_report_dmabuf ;
1043
1043
1044
1044
#ifdef CONFIG_SONY_FF
1045
- __u8 left ;
1046
- __u8 right ;
1045
+ u8 left ;
1046
+ u8 right ;
1047
1047
#endif
1048
1048
1049
- __u8 mac_address [6 ];
1050
- __u8 worker_initialized ;
1051
- __u8 cable_state ;
1052
- __u8 battery_charging ;
1053
- __u8 battery_capacity ;
1054
- __u8 led_state [MAX_LEDS ];
1055
- __u8 resume_led_state [MAX_LEDS ];
1056
- __u8 led_delay_on [MAX_LEDS ];
1057
- __u8 led_delay_off [MAX_LEDS ];
1058
- __u8 led_count ;
1049
+ u8 mac_address [6 ];
1050
+ u8 worker_initialized ;
1051
+ u8 cable_state ;
1052
+ u8 battery_charging ;
1053
+ u8 battery_capacity ;
1054
+ u8 led_state [MAX_LEDS ];
1055
+ u8 resume_led_state [MAX_LEDS ];
1056
+ u8 led_delay_on [MAX_LEDS ];
1057
+ u8 led_delay_off [MAX_LEDS ];
1058
+ u8 led_count ;
1059
1059
};
1060
1060
1061
- static __u8 * sixaxis_fixup (struct hid_device * hdev , __u8 * rdesc ,
1061
+ static u8 * sixaxis_fixup (struct hid_device * hdev , u8 * rdesc ,
1062
1062
unsigned int * rsize )
1063
1063
{
1064
1064
* rsize = sizeof (sixaxis_rdesc );
@@ -1079,7 +1079,7 @@ static u8 *navigation_fixup(struct hid_device *hdev, u8 *rdesc,
1079
1079
return navigation_rdesc ;
1080
1080
}
1081
1081
1082
- static __u8 * ps3remote_fixup (struct hid_device * hdev , __u8 * rdesc ,
1082
+ static u8 * ps3remote_fixup (struct hid_device * hdev , u8 * rdesc ,
1083
1083
unsigned int * rsize )
1084
1084
{
1085
1085
* rsize = sizeof (ps3remote_rdesc );
@@ -1120,7 +1120,7 @@ static int ps3remote_mapping(struct hid_device *hdev, struct hid_input *hi,
1120
1120
return 1 ;
1121
1121
}
1122
1122
1123
- static __u8 * sony_report_fixup (struct hid_device * hdev , __u8 * rdesc ,
1123
+ static u8 * sony_report_fixup (struct hid_device * hdev , u8 * rdesc ,
1124
1124
unsigned int * rsize )
1125
1125
{
1126
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
1174
return rdesc ;
1175
1175
}
1176
1176
1177
- static void sixaxis_parse_report (struct sony_sc * sc , __u8 * rd , int size )
1177
+ static 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
1180
unsigned long flags ;
1181
1181
int offset ;
1182
- __u8 cable_state , battery_capacity , battery_charging ;
1182
+ u8 cable_state , battery_capacity , battery_charging ;
1183
1183
1184
1184
/*
1185
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
1194
battery_charging = !(rd [offset ] & 0x01 );
1195
1195
cable_state = 1 ;
1196
1196
} else {
1197
- __u8 index = rd [offset ] <= 5 ? rd [offset ] : 5 ;
1197
+ u8 index = rd [offset ] <= 5 ? rd [offset ] : 5 ;
1198
1198
battery_capacity = sixaxis_battery_capacity [index ];
1199
1199
battery_charging = 0 ;
1200
1200
cable_state = 0 ;
@@ -1207,14 +1207,14 @@ static void sixaxis_parse_report(struct sony_sc *sc, __u8 *rd, int size)
1207
1207
spin_unlock_irqrestore (& sc -> lock , flags );
1208
1208
}
1209
1209
1210
- static void dualshock4_parse_report (struct sony_sc * sc , __u8 * rd , int size )
1210
+ static void dualshock4_parse_report (struct sony_sc * sc , u8 * rd , int size )
1211
1211
{
1212
1212
struct hid_input * hidinput = list_entry (sc -> hdev -> inputs .next ,
1213
1213
struct hid_input , list );
1214
1214
struct input_dev * input_dev = hidinput -> input ;
1215
1215
unsigned long flags ;
1216
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
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
1264
* follows the data for the first.
1265
1265
*/
1266
1266
for (n = 0 ; n < 2 ; n ++ ) {
1267
- __u16 x , y ;
1267
+ u16 x , y ;
1268
1268
1269
1269
x = rd [offset + 1 ] | ((rd [offset + 2 ] & 0xF ) << 8 );
1270
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
1282
1282
static 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
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
1405
const int buf_size =
1406
1406
max (SIXAXIS_REPORT_0xF2_SIZE , SIXAXIS_REPORT_0xF5_SIZE );
1407
- __u8 * buf ;
1407
+ u8 * buf ;
1408
1408
int ret ;
1409
1409
1410
1410
buf = kmalloc (buf_size , GFP_KERNEL );
@@ -1443,8 +1443,8 @@ static int sixaxis_set_operational_usb(struct hid_device *hdev)
1443
1443
1444
1444
static int sixaxis_set_operational_bt (struct hid_device * hdev )
1445
1445
{
1446
- static const __u8 report [] = { 0xf4 , 0x42 , 0x03 , 0x00 , 0x00 };
1447
- __u8 * buf ;
1446
+ static const u8 report [] = { 0xf4 , 0x42 , 0x03 , 0x00 , 0x00 };
1447
+ u8 * buf ;
1448
1448
int ret ;
1449
1449
1450
1450
buf = kmemdup (report , sizeof (report ), GFP_KERNEL );
@@ -1465,7 +1465,7 @@ static int sixaxis_set_operational_bt(struct hid_device *hdev)
1465
1465
*/
1466
1466
static int dualshock4_set_operational_bt (struct hid_device * hdev )
1467
1467
{
1468
- __u8 * buf ;
1468
+ u8 * buf ;
1469
1469
int ret ;
1470
1470
1471
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
1483
1483
static 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
1486
{ 0x01 , 0x00 , 0x00 , 0x00 },
1487
1487
{ 0x00 , 0x01 , 0x00 , 0x00 },
1488
1488
{ 0x00 , 0x00 , 0x01 , 0x00 },
@@ -1509,7 +1509,7 @@ static void sixaxis_set_leds_from_id(struct sony_sc *sc)
1509
1509
static void dualshock4_set_leds_from_id (struct sony_sc * sc )
1510
1510
{
1511
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
1513
/* Blue */ { 0x00 , 0x00 , 0x01 },
1514
1514
/* Red */ { 0x01 , 0x00 , 0x00 },
1515
1515
/* Green */ { 0x00 , 0x01 , 0x00 },
@@ -1537,7 +1537,7 @@ static void buzz_set_leds(struct sony_sc *sc)
1537
1537
& hdev -> report_enum [HID_OUTPUT_REPORT ].report_list ;
1538
1538
struct hid_report * report = list_entry (report_list -> next ,
1539
1539
struct hid_report , list );
1540
- __s32 * value = report -> field [0 ]-> value ;
1540
+ s32 * value = report -> field [0 ]-> value ;
1541
1541
1542
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
1631
struct hid_device * hdev = to_hid_device (dev );
1632
1632
struct sony_sc * drv_data = hid_get_drvdata (hdev );
1633
1633
int n ;
1634
- __u8 new_on , new_off ;
1634
+ u8 new_on , new_off ;
1635
1635
1636
1636
if (!drv_data ) {
1637
1637
hid_err (hdev , "No device data\n" );
@@ -1702,8 +1702,8 @@ static int sony_leds_init(struct sony_sc *sc)
1702
1702
const char * name_fmt ;
1703
1703
static const char * const ds4_name_str [] = { "red" , "green" , "blue" ,
1704
1704
"global" };
1705
- __u8 max_brightness [MAX_LEDS ] = { [0 ... (MAX_LEDS - 1 )] = 1 };
1706
- __u8 use_hw_blink [MAX_LEDS ] = { 0 };
1705
+ u8 max_brightness [MAX_LEDS ] = { [0 ... (MAX_LEDS - 1 )] = 1 };
1706
+ u8 use_hw_blink [MAX_LEDS ] = { 0 };
1707
1707
1708
1708
BUG_ON (!(sc -> quirks & SONY_LED_SUPPORT ));
1709
1709
@@ -1731,7 +1731,7 @@ static int sony_leds_init(struct sony_sc *sc)
1731
1731
name_len = 0 ;
1732
1732
name_fmt = "%s:%s" ;
1733
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
1736
memcpy (sc -> led_state , navigation_leds , sizeof (navigation_leds ));
1737
1737
sc -> led_count = 1 ;
@@ -1854,15 +1854,15 @@ 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
1858
sizeof (struct sixaxis_output_report ),
1859
1859
HID_OUTPUT_REPORT , HID_REQ_SET_REPORT );
1860
1860
}
1861
1861
1862
1862
static void dualshock4_send_output_report (struct sony_sc * sc )
1863
1863
{
1864
1864
struct hid_device * hdev = sc -> hdev ;
1865
- __u8 * buf = sc -> output_report_dmabuf ;
1865
+ u8 * buf = sc -> output_report_dmabuf ;
1866
1866
int offset ;
1867
1867
1868
1868
if (sc -> quirks & DUALSHOCK4_CONTROLLER_USB ) {
@@ -1922,7 +1922,7 @@ static void motion_send_output_report(struct sony_sc *sc)
1922
1922
report -> rumble = max (sc -> right , sc -> left );
1923
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
1928
1928
static 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
2156
2156
static int sony_check_add (struct sony_sc * sc )
2157
2157
{
2158
- __u8 * buf = NULL ;
2158
+ u8 * buf = NULL ;
2159
2159
int n , ret ;
2160
2160
2161
2161
if ((sc -> quirks & DUALSHOCK4_CONTROLLER_BT ) ||
0 commit comments