V4L/DVB (3218): Whitespace cleanups
[firefly-linux-kernel-4.4.55.git] / drivers / media / dvb / ttpci / av7110.c
index 7dae91e5863c002c885e4247b8b253dfe37dc90c..0bef1edf00180c18872d1f00ae4232d353cd9673 100644 (file)
@@ -133,7 +133,13 @@ static void init_av7110_av(struct av7110 *av7110)
        /* remaining inits according to card and frontend type */
        av7110->analog_tuner_flags = 0;
        av7110->current_input = 0;
-       if (i2c_writereg(av7110, 0x20, 0x00, 0x00) == 1) {
+       if (dev->pci->subsystem_vendor == 0x13c2 && dev->pci->subsystem_device == 0x000a) {
+               printk("dvb-ttpci: MSP3415 audio DAC @ card %d\n",
+                       av7110->dvb_adapter.num);
+               av7110->adac_type = DVB_ADAC_MSP34x5;
+               av7110_fw_cmd(av7110, COMTYPE_AUDIODAC, ADSwitch, 1, 0); // SPDIF on
+       }
+       else if (i2c_writereg(av7110, 0x20, 0x00, 0x00) == 1) {
                printk ("dvb-ttpci: Crystal audio DAC @ card %d detected\n",
                        av7110->dvb_adapter.num);
                av7110->adac_type = DVB_ADAC_CRYSTAL;
@@ -156,10 +162,10 @@ static void init_av7110_av(struct av7110 *av7110)
        else {
                av7110->adac_type = adac;
                printk("dvb-ttpci: adac type set to %d @ card %d\n",
-                       av7110->dvb_adapter.num, av7110->adac_type);
+                       av7110->adac_type, av7110->dvb_adapter.num);
        }
 
-       if (av7110->adac_type == DVB_ADAC_NONE || av7110->adac_type == DVB_ADAC_MSP) {
+       if (av7110->adac_type == DVB_ADAC_NONE || av7110->adac_type == DVB_ADAC_MSP34x0) {
                // switch DVB SCART on
                ret = av7110_fw_cmd(av7110, COMTYPE_AUDIODAC, MainSwitch, 1, 0);
                if (ret < 0)
@@ -714,6 +720,8 @@ static struct dvb_device dvbdev_osd = {
 static inline int SetPIDs(struct av7110 *av7110, u16 vpid, u16 apid, u16 ttpid,
                          u16 subpid, u16 pcrpid)
 {
+       u16 aflags = 0;
+
        dprintk(4, "%p\n", av7110);
 
        if (vpid == 0x1fff || apid == 0x1fff ||
@@ -725,8 +733,11 @@ static inline int SetPIDs(struct av7110 *av7110, u16 vpid, u16 apid, u16 ttpid,
                av7110->pids[DMX_PES_PCR] = 0;
        }
 
-       return av7110_fw_cmd(av7110, COMTYPE_PIDFILTER, MultiPID, 5,
-                            pcrpid, vpid, apid, ttpid, subpid);
+       if (av7110->audiostate.bypass_mode)
+               aflags |= 0x8000;
+
+       return av7110_fw_cmd(av7110, COMTYPE_PIDFILTER, MultiPID, 6,
+                            pcrpid, vpid, apid, ttpid, subpid, aflags);
 }
 
 int ChangePIDs(struct av7110 *av7110, u16 vpid, u16 apid, u16 ttpid,
@@ -2248,7 +2259,7 @@ static int frontend_init(struct av7110 *av7110)
                        }
 
                        // Try the grundig 29504-451
-                       av7110->fe = tda8083_attach(&grundig_29504_451_config, &av7110->i2c_adap);
+                       av7110->fe = tda8083_attach(&grundig_29504_451_config, &av7110->i2c_adap);
                        if (av7110->fe) {
                                av7110->fe->ops->diseqc_send_master_cmd = av7110_diseqc_send_master_cmd;
                                av7110->fe->ops->diseqc_send_burst = av7110_diseqc_send_burst;
@@ -2274,12 +2285,12 @@ static int frontend_init(struct av7110 *av7110)
                case 0x0001: // Hauppauge/TT Nexus-T premium rev1.X
 
                        // ALPS TDLB7
-                       av7110->fe = sp8870_attach(&alps_tdlb7_config, &av7110->i2c_adap);
+                       av7110->fe = sp8870_attach(&alps_tdlb7_config, &av7110->i2c_adap);
                        break;
 
                case 0x0002: // Hauppauge/TT DVB-C premium rev2.X
 
-                       av7110->fe = ves1820_attach(&alps_tdbe2_config, &av7110->i2c_adap, read_pwm(av7110));
+                       av7110->fe = ves1820_attach(&alps_tdbe2_config, &av7110->i2c_adap, read_pwm(av7110));
                        break;
 
                case 0x0006: /* Fujitsu-Siemens DVB-S rev 1.6 */
@@ -2314,8 +2325,10 @@ static int frontend_init(struct av7110 *av7110)
                case 0x000E: /* Hauppauge/TT Nexus-S rev 2.3 */
                        /* ALPS BSBE1 */
                        av7110->fe = stv0299_attach(&alps_bsbe1_config, &av7110->i2c_adap);
-                       if (av7110->fe)
+                       if (av7110->fe) {
                                av7110->fe->ops->set_voltage = lnbp21_set_voltage;
+                               av7110->fe->ops->dishnetwork_send_legacy_command = NULL;
+                       }
                        break;
                }
        }