Advertisement
Guest User

Untitled

a guest
Dec 14th, 2013
1,857
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 19.88 KB | None | 0 0
  1. diff -Naur debian/linux-3.10.11/debian/changelog steamos/linux-3.10.11/debian/changelog
  2. --- debian/linux-3.10.11/debian/changelog   2013-09-10 09:13:17.000000000 -0400
  3. +++ steamos/linux-3.10.11/debian/changelog  2013-11-15 13:28:40.000000000 -0500
  4. @@ -1,3 +1,35 @@
  5. +linux (3.10.11-1+steamos5) alchemist; urgency=low
  6. +
  7. +  * Add postinst step to touch /var/run/reboot-required
  8. +
  9. + -- Pierre-Loup A. Griffais <pgriffais@valvesoftware.com>  Fri, 15 Nov 2013 10:27:39 -0800
  10. +
  11. +linux (3.10.11-1+steamos4) alchemist; urgency=low
  12. +
  13. +  * Hard-code parallel build for now since our OBS infrastructure doesn't know
  14. +    how to set these options yet.
  15. +
  16. + -- Pierre-Loup A. Griffais <pgriffais@valvesoftware.com>  Fri, 15 Nov 2013 09:24:09 -0800
  17. +
  18. +linux (3.10.11-1+steamos3) alchemist; urgency=low
  19. +
  20. +  * Disable Intel P-State driver as it causes issues with sound being choppy
  21. +    during BigPicture trailer video playback.
  22. +
  23. + -- Pierre-Loup A. Griffais <pgriffais@valvesoftware.com>  Thu, 14 Nov 2013 16:41:37 -0800
  24. +
  25. +linux (3.10.11-1+steamos2) alchemist; urgency=low
  26. +
  27. +  * New XBox controller driver
  28. +
  29. + -- Pierre-Loup A. Griffais <pgriffais@valvesoftware.com>  Fri, 01 Nov 2013 19:34:17 -0700
  30. +
  31. +linux (3.10.11-1st1) alchemist; urgency=low
  32. +
  33. +  * Make the binnmu regexp also reconize our build suffixes
  34. +
  35. + --  <sjoerd@valvealias-linux>  Tue, 08 Oct 2013 14:46:59 -0700
  36. +
  37.  linux (3.10.11-1) unstable; urgency=low
  38.  
  39.    * New upstream stable update:
  40. diff -Naur debian/linux-3.10.11/debian/config/kernelarch-x86/config steamos/linux-3.10.11/debian/config/kernelarch-x86/config
  41. --- debian/linux-3.10.11/debian/config/kernelarch-x86/config    2013-09-08 12:11:58.000000000 -0400
  42. +++ steamos/linux-3.10.11/debian/config/kernelarch-x86/config   2013-11-14 19:41:31.000000000 -0500
  43. @@ -354,7 +354,7 @@
  44.  ##
  45.  ## file: drivers/cpufreq/Kconfig.x86
  46.  ##
  47. -CONFIG_X86_INTEL_PSTATE=y
  48. +# CONFIG_X86_INTEL_PSTATE is not set
  49.  CONFIG_X86_PCC_CPUFREQ=m
  50.  CONFIG_X86_ACPI_CPUFREQ=m
  51.  CONFIG_X86_ACPI_CPUFREQ_CPB=y
  52. diff -Naur debian/linux-3.10.11/debian/control.md5sum steamos/linux-3.10.11/debian/control.md5sum
  53. --- debian/linux-3.10.11/debian/control.md5sum  2013-09-10 09:13:31.000000000 -0400
  54. +++ steamos/linux-3.10.11/debian/control.md5sum 2013-10-08 17:47:30.000000000 -0400
  55. @@ -1,5 +1,5 @@
  56.  3e9ea9910531a747f9534a1f59846407  debian/bin/gencontrol.py
  57. -aa8fb65df0b8ea8e0c0f8e689d62203c  debian/changelog
  58. +c60e59fe6039b4f255f90f6068cfd153  debian/changelog
  59.  d253b8a3cc1ffc2054b1d485facc490a  debian/templates/control.headers.arch.in
  60.  d60e1ee86882c530ea74bfbb684a506e  debian/templates/control.headers.featureset.in
  61.  3a8040742dfc77adae08116a336e98c3  debian/templates/control.headers.in
  62. diff -Naur debian/linux-3.10.11/debian/patches/defer-input-nodes-and-led-support steamos/linux-3.10.11/debian/patches/defer-input-nodes-and-led-support
  63. --- debian/linux-3.10.11/debian/patches/defer-input-nodes-and-led-support   1969-12-31 19:00:00.000000000 -0500
  64. +++ steamos/linux-3.10.11/debian/patches/defer-input-nodes-and-led-support  2013-11-01 22:32:12.000000000 -0400
  65. @@ -0,0 +1,493 @@
  66. +Description: <short summary of the patch>
  67. + TODO: Put a short summary on the line above and replace this paragraph
  68. + with a longer explanation of this change. Complete the meta-information
  69. + with other relevant fields (see below for details). To make it easier, the
  70. + information below has been extracted from the changelog. Adjust it or drop
  71. + it.
  72. + .
  73. + linux (3.10.11-1st1) alchemist; urgency=low
  74. + .
  75. +   * Make the binnmu regexp also reconize our build suffixes
  76. +Author: <sjoerd@valvealias-linux>
  77. +
  78. +---
  79. +The information above should follow the Patch Tagging Guidelines, please
  80. +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
  81. +are templates for supplementary fields that you might want to add:
  82. +
  83. +Origin: <vendor|upstream|other>, <url of original patch>
  84. +Bug: <url in upstream bugtracker>
  85. +Bug-Debian: http://bugs.debian.org/<bugnumber>
  86. +Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
  87. +Forwarded: <no|not-needed|url proving that it has been forwarded>
  88. +Reviewed-By: <name and email of someone who approved the patch>
  89. +Last-Update: <YYYY-MM-DD>
  90. +
  91. +--- linux-3.10.11.orig/drivers/input/joystick/xpad.c
  92. ++++ linux-3.10.11/drivers/input/joystick/xpad.c
  93. +@@ -280,17 +280,21 @@ struct usb_xpad {
  94. +   struct urb *irq_out;        /* urb for interrupt out report */
  95. +   unsigned char *odata;       /* output data */
  96. +   dma_addr_t odata_dma;
  97. +-  struct mutex odata_mutex;
  98. ++  spinlock_t odata_lock;
  99. + #endif
  100. +
  101. + #if defined(CONFIG_JOYSTICK_XPAD_LEDS)
  102. +   struct xpad_led *led;
  103. + #endif
  104. ++ 
  105. ++  int joydev_id;
  106. +
  107. +   char phys[64];          /* physical device path */
  108. +
  109. +   int mapping;            /* map d-pad to buttons or to axes */
  110. +   int xtype;          /* type of xbox device */
  111. ++ 
  112. ++  const char *name;
  113. + };
  114. +
  115. + /*
  116. +@@ -434,6 +438,109 @@ static void xpad360_process_packet(struc
  117. +
  118. +   input_sync(dev);
  119. + }
  120. ++static void xpad_send_led_command(struct usb_xpad *xpad, int command);
  121. ++static int xpad_open(struct input_dev *dev);
  122. ++static void xpad_close(struct input_dev *dev);
  123. ++static void xpad_set_up_abs(struct input_dev *input_dev, signed short abs);
  124. ++static int xpad_init_ff(struct usb_xpad *xpad);
  125. ++static int xpad_find_joydev(struct device *dev, void *data)
  126. ++{
  127. ++  if (strstr(dev_name(dev), "js"))
  128. ++      return 1;
  129. ++ 
  130. ++  return 0;
  131. ++}
  132. ++
  133. ++static struct workqueue_struct *my_wq;
  134. ++
  135. ++typedef struct {
  136. ++  struct work_struct my_work;
  137. ++  struct usb_xpad *xpad;
  138. ++} my_work_t;
  139. ++
  140. ++static void my_wq_function( struct work_struct *work)
  141. ++{
  142. ++  my_work_t *my_work = (my_work_t *)work;
  143. ++ 
  144. ++  struct usb_xpad *xpad = my_work->xpad;
  145. ++ 
  146. ++  if (xpad->pad_present) {
  147. ++     
  148. ++      struct input_dev *input_dev;
  149. ++      int i;
  150. ++     
  151. ++      input_dev = input_allocate_device();
  152. ++
  153. ++      xpad->dev = input_dev;
  154. ++      input_dev->name = xpad->name;
  155. ++      input_dev->phys = xpad->phys;
  156. ++      usb_to_input_id(xpad->udev, &input_dev->id);
  157. ++      input_dev->dev.parent = &xpad->intf->dev;
  158. ++     
  159. ++      input_set_drvdata(input_dev, xpad);
  160. ++     
  161. ++      input_dev->open = xpad_open;
  162. ++      input_dev->close = xpad_close;
  163. ++     
  164. ++      input_dev->evbit[0] = BIT_MASK(EV_KEY);
  165. ++     
  166. ++      if (!(xpad->mapping & MAP_STICKS_TO_NULL)) {
  167. ++          input_dev->evbit[0] |= BIT_MASK(EV_ABS);
  168. ++          /* set up axes */
  169. ++          for (i = 0; xpad_abs[i] >= 0; i++)
  170. ++              xpad_set_up_abs(input_dev, xpad_abs[i]);
  171. ++      }
  172. ++     
  173. ++      /* set up standard buttons */
  174. ++      for (i = 0; xpad_common_btn[i] >= 0; i++)
  175. ++          __set_bit(xpad_common_btn[i], input_dev->keybit);
  176. ++     
  177. ++      /* set up model-specific ones */
  178. ++      if (xpad->xtype == XTYPE_XBOX360 || xpad->xtype == XTYPE_XBOX360W) {
  179. ++          for (i = 0; xpad360_btn[i] >= 0; i++)
  180. ++              __set_bit(xpad360_btn[i], input_dev->keybit);
  181. ++      } else {
  182. ++          for (i = 0; xpad_btn[i] >= 0; i++)
  183. ++              __set_bit(xpad_btn[i], input_dev->keybit);
  184. ++      }
  185. ++     
  186. ++      if (xpad->mapping & MAP_DPAD_TO_BUTTONS) {
  187. ++          for (i = 0; xpad_btn_pad[i] >= 0; i++)
  188. ++              __set_bit(xpad_btn_pad[i], input_dev->keybit);
  189. ++      } else {
  190. ++          for (i = 0; xpad_abs_pad[i] >= 0; i++)
  191. ++              xpad_set_up_abs(input_dev, xpad_abs_pad[i]);
  192. ++      }
  193. ++     
  194. ++      if (xpad->mapping & MAP_TRIGGERS_TO_BUTTONS) {
  195. ++          for (i = 0; xpad_btn_triggers[i] >= 0; i++)
  196. ++              __set_bit(xpad_btn_triggers[i], input_dev->keybit);
  197. ++      } else {
  198. ++          for (i = 0; xpad_abs_triggers[i] >= 0; i++)
  199. ++              xpad_set_up_abs(input_dev, xpad_abs_triggers[i]);
  200. ++      }
  201. ++     
  202. ++      input_register_device(xpad->dev);
  203. ++     
  204. ++      {
  205. ++          struct device* joydev_dev = device_find_child(&xpad->dev->dev, NULL, xpad_find_joydev);
  206. ++         
  207. ++          if (joydev_dev) {
  208. ++//                printk("found joydev child with minor %i\n", MINOR(joydev_dev->devt));
  209. ++              xpad->joydev_id = MINOR(joydev_dev->devt);
  210. ++              xpad_send_led_command(xpad, (xpad->joydev_id % 4) + 2);
  211. ++          }
  212. ++      }
  213. ++     
  214. ++      xpad_init_ff(xpad);
  215. ++  } else {
  216. ++      input_unregister_device(xpad->dev);
  217. ++  }
  218. ++ 
  219. ++  kfree( (void *)work );
  220. ++ 
  221. ++  return;
  222. ++}
  223. +
  224. + /*
  225. +  * xpad360w_process_packet
  226. +@@ -455,11 +562,35 @@ static void xpad360w_process_packet(stru
  227. +   /* Presence change */
  228. +   if (data[0] & 0x08) {
  229. +       if (data[1] & 0x80) {
  230. +-          xpad->pad_present = 1;
  231. +-          usb_submit_urb(xpad->bulk_out, GFP_ATOMIC);
  232. +-      } else
  233. +-          xpad->pad_present = 0;
  234. ++         
  235. ++          if (!xpad->pad_present)
  236. ++          {
  237. ++              my_work_t * work;
  238. ++              xpad->pad_present = 1;
  239. ++              usb_submit_urb(xpad->bulk_out, GFP_ATOMIC);
  240. ++             
  241. ++              work = (my_work_t *)kmalloc(sizeof(my_work_t), GFP_KERNEL);
  242. ++              INIT_WORK( (struct work_struct *)work, my_wq_function );
  243. ++              work->xpad = xpad;
  244. ++              queue_work( my_wq, (struct work_struct *)work );
  245. ++          }
  246. ++         
  247. ++      } else {
  248. ++          if (xpad->pad_present)
  249. ++          {
  250. ++              my_work_t * work;
  251. ++              xpad->pad_present = 0;
  252. ++
  253. ++              work = (my_work_t *)kmalloc(sizeof(my_work_t), GFP_KERNEL);
  254. ++              INIT_WORK( (struct work_struct *)work, my_wq_function );
  255. ++              work->xpad = xpad;
  256. ++              queue_work( my_wq, (struct work_struct *)work );
  257. ++          }
  258. ++//            printk("got kill packet for id %i\n", xpad->joydev_id);
  259. ++      }
  260. +   }
  261. ++ 
  262. ++//    printk("xpad packet %hhX %hhX %hhX %hhX %hhX %hhX\n", data[0], data[1], data[2], data[3], data[4], data[5]);
  263. +
  264. +   /* Valid pad data */
  265. +   if (!(data[1] & 0x1))
  266. +@@ -475,6 +606,8 @@ static void xpad_irq_in(struct urb *urb)
  267. +   int retval, status;
  268. +
  269. +   status = urb->status;
  270. ++ 
  271. ++//    printk("xpad_irq_in %i\n", status);
  272. +
  273. +   switch (status) {
  274. +   case 0:
  275. +@@ -583,8 +716,6 @@ static int xpad_init_output(struct usb_i
  276. +       goto fail1;
  277. +   }
  278. +
  279. +-  mutex_init(&xpad->odata_mutex);
  280. +-
  281. +   xpad->irq_out = usb_alloc_urb(0, GFP_KERNEL);
  282. +   if (!xpad->irq_out) {
  283. +       error = -ENOMEM;
  284. +@@ -713,15 +844,38 @@ struct xpad_led {
  285. +
  286. + static void xpad_send_led_command(struct usb_xpad *xpad, int command)
  287. + {
  288. +-  if (command >= 0 && command < 14) {
  289. +-      mutex_lock(&xpad->odata_mutex);
  290. +-      xpad->odata[0] = 0x01;
  291. +-      xpad->odata[1] = 0x03;
  292. +-      xpad->odata[2] = command;
  293. +-      xpad->irq_out->transfer_buffer_length = 3;
  294. +-      usb_submit_urb(xpad->irq_out, GFP_KERNEL);
  295. +-      mutex_unlock(&xpad->odata_mutex);
  296. ++  if ((unsigned)command > 15)
  297. ++      return;
  298. ++
  299. ++  spin_lock(&xpad->odata_lock);
  300. ++
  301. ++  switch (xpad->xtype) {
  302. ++     
  303. ++      case XTYPE_XBOX360:
  304. ++          xpad->odata[0] = 0x01;
  305. ++          xpad->odata[1] = 0x03;
  306. ++          xpad->odata[2] = command;
  307. ++          xpad->irq_out->transfer_buffer_length = 3;
  308. ++          break;
  309. ++      case XTYPE_XBOX360W:
  310. ++          xpad->odata[0] = 0x00;
  311. ++          xpad->odata[1] = 0x00;
  312. ++          xpad->odata[2] = 0x08;
  313. ++          xpad->odata[3] = 0x40 + (command % 0x0e);
  314. ++          xpad->odata[4] = 0x00;
  315. ++          xpad->odata[5] = 0x00;
  316. ++          xpad->odata[6] = 0x00;
  317. ++          xpad->odata[7] = 0x00;
  318. ++          xpad->odata[8] = 0x00;
  319. ++          xpad->odata[9] = 0x00;
  320. ++          xpad->odata[10] = 0x00;
  321. ++          xpad->odata[11] = 0x00;
  322. ++          xpad->irq_out->transfer_buffer_length = 12;
  323. ++          break;
  324. +   }
  325. ++
  326. ++  usb_submit_urb(xpad->irq_out, GFP_KERNEL);
  327. ++  spin_unlock(&xpad->odata_lock);
  328. + }
  329. +
  330. + static void xpad_led_set(struct led_classdev *led_cdev,
  331. +@@ -740,8 +894,10 @@ static int xpad_led_probe(struct usb_xpa
  332. +   struct xpad_led *led;
  333. +   struct led_classdev *led_cdev;
  334. +   int error;
  335. ++ 
  336. ++//    printk("xpad_led_probe\n");
  337. +
  338. +-  if (xpad->xtype != XTYPE_XBOX360)
  339. ++  if (xpad->xtype != XTYPE_XBOX360 && xpad->xtype != XTYPE_XBOX360W)
  340. +       return 0;
  341. +
  342. +   xpad->led = led = kzalloc(sizeof(struct xpad_led), GFP_KERNEL);
  343. +@@ -764,11 +920,6 @@ static int xpad_led_probe(struct usb_xpa
  344. +       return error;
  345. +   }
  346. +
  347. +-  /*
  348. +-   * Light up the segment corresponding to controller number
  349. +-   */
  350. +-  xpad_send_led_command(xpad, (led_no % 4) + 2);
  351. +-
  352. +   return 0;
  353. + }
  354. +
  355. +@@ -790,6 +941,7 @@ static void xpad_led_disconnect(struct u
  356. + static int xpad_open(struct input_dev *dev)
  357. + {
  358. +   struct usb_xpad *xpad = input_get_drvdata(dev);
  359. ++//    printk("xpad open driver data %x\n", (unsigned int)xpad);
  360. +
  361. +   /* URB was submitted in probe */
  362. +   if (xpad->xtype == XTYPE_XBOX360W)
  363. +@@ -838,23 +990,24 @@ static int xpad_probe(struct usb_interfa
  364. + {
  365. +   struct usb_device *udev = interface_to_usbdev(intf);
  366. +   struct usb_xpad *xpad;
  367. +-  struct input_dev *input_dev;
  368. +   struct usb_endpoint_descriptor *ep_irq_in;
  369. +   int i, error;
  370. ++  struct input_dev *input_dev;
  371. ++ 
  372. ++  if (!my_wq) {
  373. ++      my_wq = create_workqueue("xpad_queue");
  374. ++  }
  375. +
  376. +   for (i = 0; xpad_device[i].idVendor; i++) {
  377. +       if ((le16_to_cpu(udev->descriptor.idVendor) == xpad_device[i].idVendor) &&
  378. +           (le16_to_cpu(udev->descriptor.idProduct) == xpad_device[i].idProduct))
  379. +           break;
  380. +   }
  381. +-
  382. ++ 
  383. +   xpad = kzalloc(sizeof(struct usb_xpad), GFP_KERNEL);
  384. +-  input_dev = input_allocate_device();
  385. +-  if (!xpad || !input_dev) {
  386. +-      error = -ENOMEM;
  387. +-      goto fail1;
  388. +-  }
  389. +
  390. ++  xpad->name = xpad_device[i].name;
  391. ++ 
  392. +   xpad->idata = usb_alloc_coherent(udev, XPAD_PKT_LEN,
  393. +                    GFP_KERNEL, &xpad->idata_dma);
  394. +   if (!xpad->idata) {
  395. +@@ -890,65 +1043,12 @@ static int xpad_probe(struct usb_interfa
  396. +           xpad->mapping |= MAP_STICKS_TO_NULL;
  397. +   }
  398. +
  399. +-  xpad->dev = input_dev;
  400. +-  usb_make_path(udev, xpad->phys, sizeof(xpad->phys));
  401. +-  strlcat(xpad->phys, "/input0", sizeof(xpad->phys));
  402. +-
  403. +-  input_dev->name = xpad_device[i].name;
  404. +-  input_dev->phys = xpad->phys;
  405. +-  usb_to_input_id(udev, &input_dev->id);
  406. +-  input_dev->dev.parent = &intf->dev;
  407. +-
  408. +-  input_set_drvdata(input_dev, xpad);
  409. +-
  410. +-  input_dev->open = xpad_open;
  411. +-  input_dev->close = xpad_close;
  412. +-
  413. +-  input_dev->evbit[0] = BIT_MASK(EV_KEY);
  414. +-
  415. +-  if (!(xpad->mapping & MAP_STICKS_TO_NULL)) {
  416. +-      input_dev->evbit[0] |= BIT_MASK(EV_ABS);
  417. +-      /* set up axes */
  418. +-      for (i = 0; xpad_abs[i] >= 0; i++)
  419. +-          xpad_set_up_abs(input_dev, xpad_abs[i]);
  420. +-  }
  421. +-
  422. +-  /* set up standard buttons */
  423. +-  for (i = 0; xpad_common_btn[i] >= 0; i++)
  424. +-      __set_bit(xpad_common_btn[i], input_dev->keybit);
  425. +-
  426. +-  /* set up model-specific ones */
  427. +-  if (xpad->xtype == XTYPE_XBOX360 || xpad->xtype == XTYPE_XBOX360W) {
  428. +-      for (i = 0; xpad360_btn[i] >= 0; i++)
  429. +-          __set_bit(xpad360_btn[i], input_dev->keybit);
  430. +-  } else {
  431. +-      for (i = 0; xpad_btn[i] >= 0; i++)
  432. +-          __set_bit(xpad_btn[i], input_dev->keybit);
  433. +-  }
  434. +-
  435. +-  if (xpad->mapping & MAP_DPAD_TO_BUTTONS) {
  436. +-      for (i = 0; xpad_btn_pad[i] >= 0; i++)
  437. +-          __set_bit(xpad_btn_pad[i], input_dev->keybit);
  438. +-  } else {
  439. +-      for (i = 0; xpad_abs_pad[i] >= 0; i++)
  440. +-          xpad_set_up_abs(input_dev, xpad_abs_pad[i]);
  441. +-  }
  442. +-
  443. +-  if (xpad->mapping & MAP_TRIGGERS_TO_BUTTONS) {
  444. +-      for (i = 0; xpad_btn_triggers[i] >= 0; i++)
  445. +-          __set_bit(xpad_btn_triggers[i], input_dev->keybit);
  446. +-  } else {
  447. +-      for (i = 0; xpad_abs_triggers[i] >= 0; i++)
  448. +-          xpad_set_up_abs(input_dev, xpad_abs_triggers[i]);
  449. +-  }
  450. +-
  451. +   error = xpad_init_output(intf, xpad);
  452. +   if (error)
  453. +       goto fail3;
  454. +
  455. +-  error = xpad_init_ff(xpad);
  456. +-  if (error)
  457. +-      goto fail4;
  458. ++  usb_make_path(xpad->udev, xpad->phys, sizeof(xpad->phys));
  459. ++  strlcat(xpad->phys, "/input0", sizeof(xpad->phys));
  460. +
  461. +   error = xpad_led_probe(xpad);
  462. +   if (error)
  463. +@@ -962,10 +1062,6 @@ static int xpad_probe(struct usb_interfa
  464. +   xpad->irq_in->transfer_dma = xpad->idata_dma;
  465. +   xpad->irq_in->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
  466. +
  467. +-  error = input_register_device(xpad->dev);
  468. +-  if (error)
  469. +-      goto fail6;
  470. +-
  471. +   usb_set_intfdata(intf, xpad);
  472. +
  473. +   if (xpad->xtype == XTYPE_XBOX360W) {
  474. +@@ -973,6 +1069,7 @@ static int xpad_probe(struct usb_interfa
  475. +        * Setup the message to set the LEDs on the
  476. +        * controller when it shows up
  477. +        */
  478. ++      spin_lock(&xpad->odata_lock);
  479. +       xpad->bulk_out = usb_alloc_urb(0, GFP_KERNEL);
  480. +       if (!xpad->bulk_out) {
  481. +           error = -ENOMEM;
  482. +@@ -1014,23 +1111,55 @@ static int xpad_probe(struct usb_interfa
  483. +        */
  484. +       xpad->irq_in->dev = xpad->udev;
  485. +       error = usb_submit_urb(xpad->irq_in, GFP_KERNEL);
  486. ++     
  487. ++      spin_unlock(&xpad->odata_lock);
  488. +       if (error)
  489. +           goto fail9;
  490. ++     
  491. ++      // I don't know how to check controller state on driver load so just slam them
  492. ++      // off so that people have to turn them on, triggering a state update
  493. ++     
  494. ++      // got the power off packet from an OSX reverse-engineered driver:
  495. ++      // http://tattiebogle.net/index.php/ProjectRoot/Xbox360Controller/OsxDriver#toc1
  496. ++      spin_lock(&xpad->odata_lock);
  497. ++      xpad->odata[0] = 0x00;
  498. ++      xpad->odata[1] = 0x00;
  499. ++      xpad->odata[2] = 0x08;
  500. ++      xpad->odata[3] = 0xC0;
  501. ++      xpad->odata[4] = 0x00;
  502. ++      xpad->odata[5] = 0x00;
  503. ++      xpad->odata[6] = 0x00;
  504. ++      xpad->odata[7] = 0x00;
  505. ++      xpad->odata[8] = 0x00;
  506. ++      xpad->odata[9] = 0x00;
  507. ++      xpad->odata[10] = 0x00;
  508. ++      xpad->odata[11] = 0x00;
  509. ++      xpad->irq_out->transfer_buffer_length = 12;
  510. ++      usb_submit_urb(xpad->irq_out, GFP_KERNEL);
  511. ++      spin_unlock(&xpad->odata_lock);
  512. ++  } else {
  513. ++      my_work_t *work;
  514. ++      xpad->pad_present = 1;
  515. ++     
  516. ++      work = (my_work_t *)kmalloc(sizeof(my_work_t), GFP_KERNEL);
  517. ++      INIT_WORK( (struct work_struct *)work, my_wq_function );
  518. ++      work->xpad = xpad;
  519. ++      queue_work( my_wq, (struct work_struct *)work );
  520. +   }
  521. +
  522. +   return 0;
  523. +
  524. +  fail9:   kfree(xpad->bdata);
  525. +  fail8:   usb_free_urb(xpad->bulk_out);
  526. +- fail7:   input_unregister_device(input_dev);
  527. +-  input_dev = NULL;
  528. ++ fail7:   //input_unregister_device(input_dev);
  529. ++  //input_dev = NULL;
  530. +  fail6:   xpad_led_disconnect(xpad);
  531. +- fail5:   if (input_dev)
  532. +-      input_ff_destroy(input_dev);
  533. ++ fail5:   //if (input_dev)
  534. ++      //input_ff_destroy(input_dev);
  535. +  fail4:   xpad_deinit_output(xpad);
  536. +  fail3:   usb_free_urb(xpad->irq_in);
  537. +  fail2:   usb_free_coherent(udev, XPAD_PKT_LEN, xpad->idata, xpad->idata_dma);
  538. +- fail1:   input_free_device(input_dev);
  539. ++ fail1:   //input_free_device(input_dev);
  540. +   kfree(xpad);
  541. +   return error;
  542. +
  543. +@@ -1040,8 +1169,14 @@ static void xpad_disconnect(struct usb_i
  544. + {
  545. +   struct usb_xpad *xpad = usb_get_intfdata (intf);
  546. +
  547. ++//    printk("xpad_disconnect\n");
  548. +   xpad_led_disconnect(xpad);
  549. +-  input_unregister_device(xpad->dev);
  550. ++ 
  551. ++  if (xpad->pad_present)
  552. ++  {
  553. ++      xpad->pad_present = 0;
  554. ++      input_unregister_device(xpad->dev);
  555. ++  }
  556. +   xpad_deinit_output(xpad);
  557. +
  558. +   if (xpad->xtype == XTYPE_XBOX360W) {
  559. diff -Naur debian/linux-3.10.11/debian/patches/series steamos/linux-3.10.11/debian/patches/series
  560. --- debian/linux-3.10.11/debian/patches/series  2013-09-09 23:47:55.000000000 -0400
  561. +++ steamos/linux-3.10.11/debian/patches/series 2013-11-01 22:32:12.000000000 -0400
  562. @@ -124,3 +124,4 @@
  563.  bugfix/all/HID-sensor-hub-validate-feature-report-details.patch
  564.  bugfix/all/HID-picolcd_core-validate-output-report-details.patch
  565.  bugfix/all/HID-check-for-NULL-field-when-setting-values.patch
  566. +defer-input-nodes-and-led-support
  567. diff -Naur debian/linux-3.10.11/debian/rules steamos/linux-3.10.11/debian/rules
  568. --- debian/linux-3.10.11/debian/rules   2013-05-04 16:47:13.000000000 -0400
  569. +++ steamos/linux-3.10.11/debian/rules  2013-11-15 12:24:05.000000000 -0500
  570. @@ -5,13 +5,17 @@
  571.  SOURCE := $(shell dpkg-parsechangelog | sed -ne 's,^Source: *\(.*\)$$,\1,p')
  572.  VERSION := $(shell dpkg-parsechangelog | sed -ne 's,^Version: *\(.*\)$$,\1,p')
  573.  VERSION_UPSTREAM := $(shell echo "$(VERSION)" | sed -e 's,-[^-]*$$,,')
  574. -VERSION_BINNMU := $(shell echo "$(VERSION)" | sed -ne 's,.*+b\(.*\)$$,,p')
  575. +VERSION_BINNMU := $(shell echo "$(VERSION)" | sed -ne 's,.*bs[a-z]\(.*\)$$,,p')
  576.  
  577.  include debian/rules.defs
  578.  
  579.  ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
  580.    DEBIAN_KERNEL_JOBS := $(subst parallel=,,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
  581.  endif
  582. +
  583. +# Hard-code a default value for now, since OBS doesn't have support for this
  584. +DEBIAN_KERNEL_JOBS := 16
  585. +
  586.  ifdef DEBIAN_KERNEL_JOBS
  587.    MAKEFLAGS += -j$(DEBIAN_KERNEL_JOBS)
  588.  endif
  589. diff -Naur debian/linux-3.10.11/debian/templates/temp.image.plain/postinst steamos/linux-3.10.11/debian/templates/temp.image.plain/postinst
  590. --- debian/linux-3.10.11/debian/templates/temp.image.plain/postinst 2013-05-03 22:44:45.000000000 -0400
  591. +++ steamos/linux-3.10.11/debian/templates/temp.image.plain/postinst    2013-11-15 13:28:57.000000000 -0500
  592. @@ -707,6 +707,10 @@
  593.              die "Failed to process /etc/kernel/postinst.d/$version";
  594.  }
  595.  
  596. +# This is normally a hook in /etc/kernel/postinst.d that
  597. +# update-notifier-common installs, but we don't have that on SteamOS
  598. +system ("touch /var/run/reboot-required");
  599. +
  600.  exit 0;
  601.  
  602.  __END__
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement