add support for dm8000 onboard tuner linking
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Thu, 20 Mar 2008 17:20:32 +0000 (17:20 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Thu, 20 Mar 2008 17:20:32 +0000 (17:20 +0000)
lib/dvb/frontend.h
lib/dvb/sec.cpp
lib/python/Components/NimManager.py

index 41de874..6055da0 100644 (file)
@@ -132,6 +132,7 @@ public:
 
        int openFrontend();
        int closeFrontend();
+       const char *getDescription() const { return m_description; }
 };
 
 #endif // SWIG
index ff3f9bd..5db56b6 100644 (file)
@@ -814,6 +814,18 @@ RESULT eDVBSatelliteEquipmentControl::clear()
        //reset some tuner configuration
        for (eSmartPtrList<eDVBRegisteredFrontend>::iterator it(m_avail_frontends.begin()); it != m_avail_frontends.end(); ++it)
        {
+               int tmp;
+               if (!strcmp(it->m_frontend->getDescription(), "BCM4501 (internal)") && !it->m_frontend->getData(eDVBFrontend::LINKED_PREV_PTR, tmp) && tmp != -1)
+               {
+                       FILE *f=fopen("/proc/stb/tsmux/lnb_b_input", "w");
+                       if (!f || fwrite("B", 1, 1, f) != 1)
+                               eDebug("set /proc/stb/tsmux/lnb_b_input to B failed!! (%m)");
+                       else
+                       {
+                               eDebug("set /proc/stb/tsmux/lnb_b_input to B OK");
+                               fclose(f);
+                       }
+               }
                it->m_frontend->setData(eDVBFrontend::SATPOS_DEPENDS_PTR, -1);
                it->m_frontend->setData(eDVBFrontend::LINKED_PREV_PTR, -1);
                it->m_frontend->setData(eDVBFrontend::LINKED_NEXT_PTR, -1);
@@ -1257,6 +1269,17 @@ RESULT eDVBSatelliteEquipmentControl::setTunerLinked(int tu1, int tu2)
                {
                        p1->m_frontend->setData(eDVBFrontend::LINKED_PREV_PTR, (int)p2);
                        p2->m_frontend->setData(eDVBFrontend::LINKED_NEXT_PTR, (int)p1);
+                       if (!strcmp(p1->m_frontend->getDescription(), p2->m_frontend->getDescription()) && !strcmp(p1->m_frontend->getDescription(), "BCM4501 (internal)"))
+                       {
+                               FILE *f=fopen("/proc/stb/tsmux/lnb_b_input", "w");
+                               if (!f || fwrite("A", 1, 1, f) != 1)
+                                       eDebug("set /proc/stb/tsmux/lnb_b_input to A failed!! (%m)");
+                               else
+                               {
+                                       eDebug("set /proc/stb/tsmux/lnb_b_input to A OK");
+                                       fclose(f);
+                               }
+                       }
                        return 0;
                }
        }
index 5920166..ec7d46f 100644 (file)
@@ -105,6 +105,11 @@ class SecConfigure:
                used_nim_slots = [ ]
 
                for slot in nim_slots:
+                       if slot.type is not None:
+                               used_nim_slots.append((slot.slot, slot.description, slot.config.configMode.value != "nothing" and True or False))
+               eDVBResourceManager.getInstance().setFrontendSlotInformations(used_nim_slots)
+
+               for slot in nim_slots:
                        x = slot.slot
                        nim = slot.config
                        if slot.isCompatible("DVB-S"):
@@ -119,11 +124,6 @@ class SecConfigure:
                                        self.setSatposDepends(sec, x, int(nim.satposDependsTo.value))
                                        self.satposdepends[int(nim.satposDependsTo.value)]=x
 
-                       if slot.type is not None:
-                               used_nim_slots.append((slot.slot, slot.description, nim.configMode.value != "nothing" and True or False))
-
-               eDVBResourceManager.getInstance().setFrontendSlotInformations(used_nim_slots)
-
                for slot in nim_slots:
                        x = slot.slot
                        nim = slot.config