]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
backports: add Tevii S482 patch
authorArne Fitzenreiter <arne_f@ipfire.org>
Thu, 1 Oct 2015 09:14:58 +0000 (11:14 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Thu, 1 Oct 2015 09:14:58 +0000 (11:14 +0200)
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
lfs/backports
src/patches/linux-3.10-dvb_tevi_s482.patch [new file with mode: 0644]

index b5aabef5d5e334994509a641f6b271b042a3b730..ab6fbdccd9784922ef80ca67150e20b8026ad41d 100644 (file)
@@ -88,6 +88,7 @@ endif
 
        # DVB patches
        cd $(DIR_APP) && patch -Np2 < $(DIR_SRC)/src/patches/v4l-dvb_fix_tua6034_pll.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.10-dvb_tevi_s482.patch
 
        # Wlan patches
        cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/compat-drivers-3.8.3-ath_ignore_eeprom_regdomain.patch
diff --git a/src/patches/linux-3.10-dvb_tevi_s482.patch b/src/patches/linux-3.10-dvb_tevi_s482.patch
new file mode 100644 (file)
index 0000000..fed875d
--- /dev/null
@@ -0,0 +1,240 @@
+diff --git a/drivers/media/usb/dvb-usb/dw2102.c b/drivers/media/usb/dvb-usb/dw2102.c
+index 1a3df10..82d35c6 100644
+--- a/drivers/media/usb/dvb-usb/dw2102.c
++++ b/drivers/media/usb/dvb-usb/dw2102.c
+@@ -31,6 +31,9 @@
+ #include "m88rs2000.h"
+ #include "tda18271.h"
+ #include "cxd2820r.h"
++#include "m88ds3103.h"
++#include "m88ts2022.h"
++
+ /* Max transfer size done by I2C transfer functions */
+ #define MAX_XFER_SIZE  64
+@@ -71,6 +74,14 @@
+ #define USB_PID_TEVII_S480_2 0xd482
+ #endif
++#ifndef USB_PID_TEVII_S482_1
++#define USB_PID_TEVII_S482_1 0xd483
++#endif
++
++#ifndef USB_PID_TEVII_S482_2
++#define USB_PID_TEVII_S482_2 0xd484
++#endif
++
+ #ifndef USB_PID_PROF_1100
+ #define USB_PID_PROF_1100 0xb012
+ #endif
+@@ -1117,6 +1128,19 @@ static struct tda18271_config tda18271_config = {
+       .gate = TDA18271_GATE_DIGITAL,
+ };
++static const struct m88ds3103_config s482_m88ds3103_config = {
++      .i2c_addr = 0x68,
++      .clock = 27000000,
++      .i2c_wr_max = 33,
++      .clock_out = 0,
++      .ts_mode = M88DS3103_TS_CI,
++      .ts_clk = 16000,
++      .ts_clk_pol = 0,
++      .agc = 0x99,
++      .lnb_hv_pol = 1,
++      .lnb_en_pol = 1,
++       };
++
+ static u8 m88rs2000_inittab[] = {
+       DEMOD_WRITE, 0x9a, 0x30,
+       DEMOD_WRITE, 0x00, 0x01,
+@@ -1386,6 +1410,83 @@ static int su3000_frontend_attach(struct dvb_usb_adapter *d)
+       return -EIO;
+ }
++static int m88ds3103_frontend_attach(struct dvb_usb_adapter *d)
++{
++      u8 obuf[3] = { 0xe, 0x80, 0 };
++      u8 ibuf[] = { 0 };
++
++      /* demod I2C adapter */
++      struct i2c_adapter *i2c_adapter;
++      struct i2c_client *client;
++      struct i2c_board_info info;
++      struct m88ts2022_config m88ts2022_config = {
++              .clock = 27000000,
++               };
++      memset(&info, 0, sizeof(struct i2c_board_info));
++      if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
++              err("command 0x0e transfer failed.");
++
++      obuf[0] = 0xe;
++      obuf[1] = 0x02;
++      obuf[2] = 1;
++
++      if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
++              err("command 0x0e transfer failed.");
++      msleep(300);
++
++      obuf[0] = 0xe;
++      obuf[1] = 0x83;
++      obuf[2] = 0;
++
++      if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
++              err("command 0x0e transfer failed.");
++
++      obuf[0] = 0xe;
++      obuf[1] = 0x83;
++      obuf[2] = 1;
++
++      if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
++              err("command 0x0e transfer failed.");
++
++      obuf[0] = 0x51;
++
++      if (dvb_usb_generic_rw(d->dev, obuf, 1, ibuf, 1, 0) < 0)
++              err("command 0x51 transfer failed.");
++      d->fe_adap[0].fe = dvb_attach(m88ds3103_attach,
++              &s482_m88ds3103_config,
++              &d->dev->i2c_adap,
++              &i2c_adapter);
++      if (d->fe_adap[0].fe == NULL)
++              return -EIO;
++      /* attach tuner */
++      m88ts2022_config.fe = d->fe_adap[0].fe;
++      strlcpy(info.type, "m88ts2022", I2C_NAME_SIZE);
++      info.addr = 0x60;
++      info.platform_data = &m88ts2022_config;
++      request_module("m88ts2022");
++      client = i2c_new_device(i2c_adapter, &info);
++      if (client == NULL || client->dev.driver == NULL) {
++              dvb_frontend_detach(d->fe_adap[0].fe);
++              goto fail_attach;
++      }
++      if (!try_module_get(client->dev.driver->owner)) {
++                      i2c_unregister_device(client);
++                              dvb_frontend_detach(d->fe_adap[0].fe);
++                      goto fail_attach;
++      }
++      info("attached m88ds3103/m88ts2022!\n");
++
++      /* delegate signal strength measurement to tuner */
++
++      d->fe_adap[0].fe->ops.read_signal_strength =
++              d->fe_adap[0].fe->ops.tuner_ops.get_rf_strength;
++
++      return 0;
++fail_attach:
++      info("Failed to attach m88ds3103/m88ts2022!\n");
++      return -EIO;
++}
++
+ static int t220_frontend_attach(struct dvb_usb_adapter *d)
+ {
+       u8 obuf[3] = { 0xe, 0x87, 0 };
+@@ -1557,6 +1658,8 @@ enum dw2102_table_entry {
+       TEVII_S480_2,
+       X3M_SPC1400HD,
+       TEVII_S421,
++      TEVII_S482_1,
++      TEVII_S482_2,
+       TEVII_S632,
+       TERRATEC_CINERGY_S2_R2,
+       GOTVIEW_SAT_HD,
+@@ -1580,7 +1683,9 @@ static struct usb_device_id dw2102_table[] = {
+       [TEVII_S480_2] = {USB_DEVICE(0x9022, USB_PID_TEVII_S480_2)},
+       [X3M_SPC1400HD] = {USB_DEVICE(0x1f4d, 0x3100)},
+       [TEVII_S421] = {USB_DEVICE(0x9022, USB_PID_TEVII_S421)},
+-      [TEVII_S632] = {USB_DEVICE(0x9022, USB_PID_TEVII_S632)},
++      [TEVII_S482_1] = { USB_DEVICE(0x9022, USB_PID_TEVII_S482_1) },
++      [TEVII_S482_2] = { USB_DEVICE(0x9022, USB_PID_TEVII_S482_2) },
++      [TEVII_S632] = { USB_DEVICE(0x9022, USB_PID_TEVII_S632) },
+       [TERRATEC_CINERGY_S2_R2] = {USB_DEVICE(USB_VID_TERRATEC, 0x00b0)},
+       [GOTVIEW_SAT_HD] = {USB_DEVICE(0x1FE1, USB_PID_GOTVIEW_SAT_HD)},
+       [GENIATECH_T220] = {USB_DEVICE(0x1f4d, 0xD220)},
+@@ -2012,6 +2117,59 @@ static struct dvb_usb_device_properties su3000_properties = {
+       }
+ };
++static struct dvb_usb_device_properties m88ds3103_properties = {
++      .caps = DVB_USB_IS_AN_I2C_ADAPTER,
++      .usb_ctrl = DEVICE_SPECIFIC,
++      .size_of_priv = sizeof(struct su3000_state),
++      .power_ctrl = su3000_power_ctrl,
++      .num_adapters = 1,
++      .identify_state = su3000_identify_state,
++      .i2c_algo = &su3000_i2c_algo,
++
++      .rc.core = {
++              .rc_interval = 150,
++              .rc_codes = RC_MAP_TEVII_NEC,
++              .module_name = "dw2102",
++              .allowed_protos = RC_BIT_NEC,
++              .rc_query = dw2102_rc_query,
++      },
++
++      .read_mac_address = su3000_read_mac_address,
++
++      .generic_bulk_ctrl_endpoint = 0x01,
++
++      .adapter = {
++              {
++                      .num_frontends = 1,
++                      .fe = { {
++                                      .streaming_ctrl = su3000_streaming_ctrl,
++                                      .frontend_attach = m88ds3103_frontend_attach,
++                                      .stream = {
++                                              .type = USB_BULK,
++                                              .count = 8,
++                                              .endpoint = 0x82,
++                                              .u = {
++                                                      .bulk = {
++                                                              .buffersize = 4096,
++                                                      }
++                                              }
++                                      }
++                              } },
++              }
++              },
++              .num_device_descs = 2,
++              .devices = {
++                      { "TeVii S482.1 USB",
++                      { &dw2102_table[TEVII_S482_1], NULL },
++                      { NULL },
++                      },
++                      { "TeVii S482.2 USB",
++                      { &dw2102_table[TEVII_S482_2], NULL },
++                      { NULL },
++                      },
++                      }
++};
++
+ static struct dvb_usb_device_properties t220_properties = {
+       .caps = DVB_USB_IS_AN_I2C_ADAPTER,
+       .usb_ctrl = DEVICE_SPECIFIC,
+@@ -2131,11 +2289,13 @@ static int dw2102_probe(struct usb_interface *intf,
+           0 == dvb_usb_device_init(intf, p7500,
+                       THIS_MODULE, NULL, adapter_nr) ||
+           0 == dvb_usb_device_init(intf, s421,
+-                      THIS_MODULE, NULL, adapter_nr) ||
+-          0 == dvb_usb_device_init(intf, &su3000_properties,
+-                       THIS_MODULE, NULL, adapter_nr) ||
++                      THIS_MODULE, NULL, adapter_nr)  ||
+           0 == dvb_usb_device_init(intf, &t220_properties,
+-                       THIS_MODULE, NULL, adapter_nr))
++                      THIS_MODULE, NULL, adapter_nr) ||
++              0 == dvb_usb_device_init(intf, &m88ds3103_properties,
++                      THIS_MODULE, NULL, adapter_nr) ||
++              0 == dvb_usb_device_init(intf, &su3000_properties,
++                      THIS_MODULE, NULL, adapter_nr))
+               return 0;
+       return -ENODEV;
+@@ -2153,7 +2313,7 @@ module_usb_driver(dw2102_driver);
+ MODULE_AUTHOR("Igor M. Liplianin (c) liplianin@me.by");
+ MODULE_DESCRIPTION("Driver for DVBWorld DVB-S 2101, 2102, DVB-S2 2104,"
+                       " DVB-C 3101 USB2.0,"
+-                      " TeVii S600, S630, S650, S660, S480, S421, S632"
++                      " TeVii S600, S630, S650, S660, S480, S482, S421, S632"
+                       " Prof 1100, 7500 USB2.0,"
+                       " Geniatech SU3000, T220 devices");
+ MODULE_VERSION("0.1");