]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/media/dvb/mantis/mantis_vp1034.c
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq
[mv-sheeva.git] / drivers / media / dvb / mantis / mantis_vp1034.c
index 40778ec8f4609becaadb73098718f74e31223b23..8e6ae558ee57424b40f5622ce44ea86ca2c1a737 100644 (file)
@@ -1,7 +1,7 @@
 /*
        Mantis VP-1034 driver
 
-       Copyright (C) 2005, 2006 Manu Abraham (abraham.manu@gmail.com)
+       Copyright (C) Manu Abraham (abraham.manu@gmail.com)
 
        This program is free software; you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
@@ -18,7 +18,6 @@
        Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include <asm/irq.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
 #include <linux/interrupt.h>
@@ -32,6 +31,7 @@
 #include "mb86a16.h"
 #include "mantis_common.h"
 #include "mantis_ioc.h"
+#include "mantis_dvb.h"
 #include "mantis_vp1034.h"
 #include "mantis_reg.h"
 
@@ -62,7 +62,7 @@ int vp1034_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
                dprintk(MANTIS_ERROR, 1, "Frontend (dummy) POWERDOWN");
                break;
        default:
-               dprintk(MANTIS_ERROR, 1, "Invalid = (%d)", (u32 ) voltage);
+               dprintk(MANTIS_ERROR, 1, "Invalid = (%d)", (u32) voltage);
                return -EINVAL;
        }
        mmwrite(0x00, MANTIS_GPIF_DOUT);
@@ -74,17 +74,30 @@ static int vp1034_frontend_init(struct mantis_pci *mantis, struct dvb_frontend *
 {
        struct i2c_adapter *adapter     = &mantis->adapter;
 
-       dprintk(MANTIS_ERROR, 1, "Probing for MB86A16 (DVB-S/DSS)");
-       fe = mb86a16_attach(&vp1034_mb86a16_config, adapter);
-       if (fe) {
-               dprintk(MANTIS_ERROR, 1,
-               "found MB86A16 DVB-S/DSS frontend @0x%02x",
-               vp1034_mb86a16_config.demod_address);
+       int err = 0;
 
+       err = mantis_frontend_power(mantis, POWER_ON);
+       if (err == 0) {
+               mantis_frontend_soft_reset(mantis);
+               msleep(250);
+
+               dprintk(MANTIS_ERROR, 1, "Probing for MB86A16 (DVB-S/DSS)");
+               fe = mb86a16_attach(&vp1034_mb86a16_config, adapter);
+               if (fe) {
+                       dprintk(MANTIS_ERROR, 1,
+                       "found MB86A16 DVB-S/DSS frontend @0x%02x",
+                       vp1034_mb86a16_config.demod_address);
+
+               } else {
+                       return -1;
+               }
        } else {
-               return -1;
-       }
+               dprintk(MANTIS_ERROR, 1, "Frontend on <%s> POWER ON failed! <%d>",
+                       adapter->name,
+                       err);
 
+               return -EIO;
+       }
        mantis->fe = fe;
        dprintk(MANTIS_ERROR, 1, "Done!");
 
@@ -101,4 +114,6 @@ struct mantis_hwconfig vp1034_config = {
        .bytes          = 0,
 
        .frontend_init  = vp1034_frontend_init,
+       .power          = GPIF_A12,
+       .reset          = GPIF_A13,
 };