1176struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe,
1177 struct xc2028_config *cfg)
1178{
1179 struct xc2028_data *priv;
1180 int instance;
1181
1182 if (debug)
1183 printk(KERN_DEBUG "xc2028: Xcv2028/3028 init called!\n");
1184
1185 if (NULL == cfg)
1186 return NULL;
1187
1188 if (!fe) {
1189 printk(KERN_ERR "xc2028: No frontend!\n");
1190 return NULL;
1191 }
1192
1193 mutex_lock(&xc2028_list_mutex);
1194
1195 instance = hybrid_tuner_request_state(struct xc2028_data, priv,
1196 hybrid_tuner_instance_list,
1197 cfg->i2c_adap, cfg->i2c_addr,
1198 "xc2028");
1199 switch (instance) {
1200 case 0:
1201
1202 goto fail;
1203 break;
1204 case 1:
1205
1206 priv->ctrl.max_len = 13;
1207
1208 mutex_init(&priv->lock);
1209
1210 fe->tuner_priv = priv;
1211 break;
1212 case 2:
1213
1214 fe->tuner_priv = priv;
1215 break;
1216 }