···111If you have problems with this please do ask on the mailing list.112113--114-Authors: Richard Walker, Jamie Honan, Michael Hunold, Manu Abraham0000
···111If you have problems with this please do ask on the mailing list.112113--114+Authors: Richard Walker,115+ Jamie Honan,116+ Michael Hunold,117+ Manu Abraham,118+ Michael Krufky
···29 A DVB-S tuner module. Say Y when you want to support this frontend.3031config DVB_MT31232- tristate "Zarlink MT312 based"33 depends on DVB_CORE34 help35 A DVB-S tuner module. Say Y when you want to support this frontend.
···29 A DVB-S tuner module. Say Y when you want to support this frontend.3031config DVB_MT31232+ tristate "Zarlink VP310/MT312 based"33 depends on DVB_CORE34 help35 A DVB-S tuner module. Say Y when you want to support this frontend.
+44-72
drivers/media/dvb/frontends/mt312.c
···612 kfree(state);613}614615-static struct dvb_frontend_ops vp310_mt312_ops;616-617-struct dvb_frontend* vp310_attach(const struct mt312_config* config,618- struct i2c_adapter* i2c)619-{620- struct mt312_state* state = NULL;621-622- /* allocate memory for the internal state */623- state = kmalloc(sizeof(struct mt312_state), GFP_KERNEL);624- if (state == NULL)625- goto error;626-627- /* setup the state */628- state->config = config;629- state->i2c = i2c;630- memcpy(&state->ops, &vp310_mt312_ops, sizeof(struct dvb_frontend_ops));631- strcpy(state->ops.info.name, "Zarlink VP310 DVB-S");632-633- /* check if the demod is there */634- if (mt312_readreg(state, ID, &state->id) < 0)635- goto error;636- if (state->id != ID_VP310) {637- goto error;638- }639-640- /* create dvb_frontend */641- state->frequency = 90;642- state->frontend.ops = &state->ops;643- state->frontend.demodulator_priv = state;644- return &state->frontend;645-646-error:647- kfree(state);648- return NULL;649-}650-651-struct dvb_frontend* mt312_attach(const struct mt312_config* config,652- struct i2c_adapter* i2c)653-{654- struct mt312_state* state = NULL;655-656- /* allocate memory for the internal state */657- state = kmalloc(sizeof(struct mt312_state), GFP_KERNEL);658- if (state == NULL)659- goto error;660-661- /* setup the state */662- state->config = config;663- state->i2c = i2c;664- memcpy(&state->ops, &vp310_mt312_ops, sizeof(struct dvb_frontend_ops));665- strcpy(state->ops.info.name, "Zarlink MT312 DVB-S");666-667- /* check if the demod is there */668- if (mt312_readreg(state, ID, &state->id) < 0)669- goto error;670- if (state->id != ID_MT312) {671- goto error;672- }673-674- /* create dvb_frontend */675- state->frequency = 60;676- state->frontend.ops = &state->ops;677- state->frontend.demodulator_priv = state;678- return &state->frontend;679-680-error:681- kfree(state);682- return NULL;683-}684-685static struct dvb_frontend_ops vp310_mt312_ops = {686687 .info = {···650 .set_voltage = mt312_set_voltage,651};6520000000000000000000000000000000000000000000653module_param(debug, int, 0644);654MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off).");655···700MODULE_AUTHOR("Andreas Oberritter <obi@linuxtv.org>");701MODULE_LICENSE("GPL");702703-EXPORT_SYMBOL(mt312_attach);704-EXPORT_SYMBOL(vp310_attach);
···612 kfree(state);613}6140000000000000000000000000000000000000000000000000000000000000000000000615static struct dvb_frontend_ops vp310_mt312_ops = {616617 .info = {···720 .set_voltage = mt312_set_voltage,721};722723+struct dvb_frontend* vp310_mt312_attach(const struct mt312_config* config,724+ struct i2c_adapter* i2c)725+{726+ struct mt312_state* state = NULL;727+728+ /* allocate memory for the internal state */729+ state = kmalloc(sizeof(struct mt312_state), GFP_KERNEL);730+ if (state == NULL)731+ goto error;732+733+ /* setup the state */734+ state->config = config;735+ state->i2c = i2c;736+ memcpy(&state->ops, &vp310_mt312_ops, sizeof(struct dvb_frontend_ops));737+738+ /* check if the demod is there */739+ if (mt312_readreg(state, ID, &state->id) < 0)740+ goto error;741+742+ switch (state->id) {743+ case ID_VP310:744+ strcpy(state->ops.info.name, "Zarlink VP310 DVB-S");745+ state->frequency = 90;746+ break;747+ case ID_MT312:748+ strcpy(state->ops.info.name, "Zarlink MT312 DVB-S");749+ state->frequency = 60;750+ break;751+ default:752+ printk (KERN_WARNING "Only Zarlink VP310/MT312 are supported chips.\n");753+ goto error;754+ }755+756+ /* create dvb_frontend */757+ state->frontend.ops = &state->ops;758+ state->frontend.demodulator_priv = state;759+ return &state->frontend;760+761+error:762+ kfree(state);763+ return NULL;764+}765+766module_param(debug, int, 0644);767MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off).");768···727MODULE_AUTHOR("Andreas Oberritter <obi@linuxtv.org>");728MODULE_LICENSE("GPL");729730+EXPORT_SYMBOL(vp310_mt312_attach);0