Advertisement
Guest User

TerraTec Cinergy T Stick Kernel 3.2 Patch

a guest
Jan 29th, 2012
876
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 3.24 KB | None | 0 0
  1. --- af9035.c.orig   2009-09-26 20:56:12.000000000 +0200
  2. +++ af9035.c    2012-01-29 14:59:01.000000000 +0100
  3. @@ -4,6 +4,8 @@
  4.   * Copyright (C) 2008 Afatech
  5.   * Copyright (C) 2009 Antti Palosaari <crope@iki.fi>
  6.   *
  7. + * Kernel 3.2 Patch by Federico Quagliata <federico at quagliata dot org>
  8. + *
  9.   *    This program is free software; you can redistribute it and/or modify
  10.   *    it under the terms of the GNU General Public License as published by
  11.   *    the Free Software Foundation; either version 2 of the License, or
  12. @@ -27,6 +29,8 @@
  13.  #include "af9033.h"
  14.  #include "tua9001.h"
  15.  
  16. +#include "linux/version.h"
  17. +
  18.  static int dvb_usb_af9035_debug;
  19.  module_param_named(debug, dvb_usb_af9035_debug, int, 0644);
  20.  MODULE_PARM_DESC(debug, "set debugging level" DVB_USB_DEBUG_STATUS);
  21. @@ -550,13 +554,21 @@
  22.     for (i = 0; i < af9035_properties_count; i++) {
  23.         /* USB1.1 set smaller buffersize and disable 2nd adapter */
  24.         if (udev->speed == USB_SPEED_FULL) {
  25. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
  26. +           af9035_properties[i].adapter[0].fe[0].stream.u.bulk.buffersize
  27. +#else
  28.             af9035_properties[i].adapter[0].stream.u.bulk.buffersize
  29. +#endif
  30.                 = TS_USB11_MAX_PACKET_SIZE;
  31.             /* disable 2nd adapter because we don't have
  32.                PID-filters */
  33.             af9035_config.dual_mode = 0;
  34.         } else {
  35. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
  36. +           af9035_properties[i].adapter[0].fe[0].stream.u.bulk.buffersize
  37. +#else
  38.             af9035_properties[i].adapter[0].stream.u.bulk.buffersize
  39. +#endif
  40.                 = TS_USB20_MAX_PACKET_SIZE;
  41.         }
  42.     }
  43. @@ -711,10 +723,18 @@
  44.     }
  45.  
  46.     /* attach demodulator */
  47. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
  48. +   adap->fe_adap[0].fe = dvb_attach(af9033_attach, &af9035_af9033_config[adap->id],
  49. +#else
  50.     adap->fe = dvb_attach(af9033_attach, &af9035_af9033_config[adap->id],
  51. +#endif
  52.         &adap->dev->i2c_adap);
  53.  
  54. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
  55. +   return adap->fe_adap[0].fe == NULL ? -ENODEV : 0;
  56. +#else
  57.     return adap->fe == NULL ? -ENODEV : 0;
  58. +#endif
  59.  
  60.  error:
  61.     return ret;
  62. @@ -756,8 +776,11 @@
  63.         /* activate tuner - TODO: do that like I2C gate control */
  64.         ret = af9035_write_reg_bits(adap->dev, LINK, p_reg_top_gpiot2_o,
  65.              reg_top_gpiot2_o_pos, reg_top_gpiot2_o_len, 1);
  66. -
  67. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
  68. +       ret = dvb_attach(tua9001_attach, adap->fe_adap[0].fe, &adap->dev->i2c_adap,
  69. +#else
  70.         ret = dvb_attach(tua9001_attach, adap->fe, &adap->dev->i2c_adap,
  71. +#endif
  72.             &af9035_tua9001_config) == NULL ? -ENODEV : 0;
  73.         break;
  74.     default:
  75. @@ -795,6 +818,10 @@
  76.  
  77.         .adapter = {
  78.             {
  79. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
  80. +               .num_frontends = 1,
  81. +               .fe = {{
  82. +#endif
  83.                 .frontend_attach =
  84.                     af9035_af9033_frontend_attach,
  85.                 .tuner_attach = af9035_tuner_attach,
  86. @@ -803,8 +830,15 @@
  87.                     .count = 6,
  88.                     .endpoint = 0x84,
  89.                 },
  90. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
  91. +               }},
  92. +#endif
  93.             },
  94.             {
  95. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
  96. +               .num_frontends = 1,
  97. +               .fe = {{
  98. +#endif
  99.                 .frontend_attach =
  100.                     af9035_af9033_frontend_attach,
  101.                 .tuner_attach = af9035_tuner_attach,
  102. @@ -819,6 +853,9 @@
  103.                         }
  104.                     }
  105.                 },
  106. +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)
  107. +               }},
  108. +#endif
  109.             }
  110.         },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement