static int vp3028_frontend_init(struct mantis_pci *mantis, struct dvb_frontend *fe) { struct i2c_adapter *adapter = &mantis->adapter; struct mantis_hwconfig *config = mantis->hwconfig; int err = 0; gpio_set_bits(mantis, config->reset, 0); msleep(100); err = mantis_frontend_power(mantis, POWER_ON); msleep(100); gpio_set_bits(mantis, config->reset, 1); err = mantis_frontend_power(mantis, POWER_ON); if (err == 0) { msleep(250); dprintk(MANTIS_ERROR, 1, "Probing for 10353 (DVB-T)"); fe = zl10353_attach(&hopper_vp3028_config, adapter); if (!fe) return -1; } else { dprintk(MANTIS_ERROR, 1, "Frontend on <%s> POWER ON failed! <%d>", adapter->name, err); return -EIO; } dprintk(MANTIS_ERROR, 1, "Done!"); return 0; }
int mantis_frontend_power(struct mantis_pci *mantis, enum mantis_power power) { struct mantis_hwconfig *config = mantis->hwconfig; switch (power) { case POWER_ON: dprintk(MANTIS_DEBUG, 1, "Power ON"); gpio_set_bits(mantis, config->power, POWER_ON); msleep(100); gpio_set_bits(mantis, config->power, POWER_ON); msleep(100); break; case POWER_OFF: dprintk(MANTIS_DEBUG, 1, "Power OFF"); gpio_set_bits(mantis, config->power, POWER_OFF); msleep(100); break; default: dprintk(MANTIS_DEBUG, 1, "Unknown state <%02x>", power); return -1; } return 0; }
int vp1034_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage) { struct mantis_pci *mantis = fe->dvb->priv; switch (voltage) { case SEC_VOLTAGE_13: dprintk(verbose, MANTIS_ERROR, 1, "Polarization=[13V]"); gpio_set_bits(mantis, 13, 1); gpio_set_bits(mantis, 14, 0); break; case SEC_VOLTAGE_18: dprintk(verbose, MANTIS_ERROR, 1, "Polarization=[18V]"); gpio_set_bits(mantis, 13, 1); gpio_set_bits(mantis, 14, 1); break; case SEC_VOLTAGE_OFF: dprintk(verbose, MANTIS_ERROR, 1, "Frontend (dummy) POWERDOWN"); break; default: dprintk(verbose, MANTIS_ERROR, 1, "Invalid = (%d)", (u32 ) voltage); return -EINVAL; } mmwrite(0x00, MANTIS_GPIF_DOUT); return 0; }
void mantis_frontend_soft_reset(struct mantis_pci *mantis) { struct mantis_hwconfig *config = mantis->hwconfig; dprintk(MANTIS_DEBUG, 1, "Frontend RESET"); gpio_set_bits(mantis, config->reset, 0); msleep(100); gpio_set_bits(mantis, config->reset, 0); msleep(100); gpio_set_bits(mantis, config->reset, 1); msleep(100); gpio_set_bits(mantis, config->reset, 1); msleep(100); return; }