aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2016-05-16 08:40:50 (GMT)
committerAntti Palosaari <crope@iki.fi>2016-09-15 12:35:41 (GMT)
commit2c1bdd79876310c50baee7f321d10b184509ee43 (patch)
tree4dd99c469ad98fc663e484c48826ca3c52bfa511
parent3420b24c449023e3701c1130ed84d0a0166e56bf (diff)
dvbsky: add MyGica T230mygica_t230_pt360
Moved from cxusb driver as that driver can handle FX2 FIFO issue. Signed-off-by: Antti Palosaari <crope@iki.fi>
-rw-r--r--drivers/media/usb/dvb-usb-v2/dvbsky.c83
1 files changed, 83 insertions, 0 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/dvbsky.c b/drivers/media/usb/dvb-usb-v2/dvbsky.c
index 02dbc6c..d41c603 100644
--- a/drivers/media/usb/dvb-usb-v2/dvbsky.c
+++ b/drivers/media/usb/dvb-usb-v2/dvbsky.c
@@ -665,6 +665,60 @@ fail_demod_device:
return ret;
}
+static int dvbsky_mygica_t230_frontend_attach(struct dvb_usb_adapter *adap)
+{
+ struct dvbsky_state *state = adap_to_priv(adap);
+ struct dvb_usb_device *d = adap_to_d(adap);
+ struct i2c_adapter *adapter;
+ struct i2c_client *client_demod, *client_tuner;
+ struct i2c_board_info board_info;
+ struct si2168_config si2168_config;
+ struct si2157_config si2157_config;
+
+ /* attach demod */
+ memset(&si2168_config, 0, sizeof(si2168_config));
+ si2168_config.i2c_adapter = &adapter;
+ si2168_config.fe = &adap->fe[0];
+ si2168_config.ts_mode = SI2168_TS_PARALLEL;
+ memset(&board_info, 0, sizeof(struct i2c_board_info));
+ strlcpy(board_info.type, "si2168", I2C_NAME_SIZE);
+ board_info.addr = 0x64;
+ board_info.platform_data = &si2168_config;
+ request_module("si2168");
+ client_demod = i2c_new_device(&d->i2c_adap, &board_info);
+ if (!client_demod || !client_demod->dev.driver)
+ goto err;
+ if (!try_module_get(client_demod->dev.driver->owner))
+ goto err_i2c_unregister_device_demod;
+
+ /* attach tuner */
+ memset(&si2157_config, 0, sizeof(si2157_config));
+ si2157_config.fe = adap->fe[0];
+ si2157_config.if_port = 1;
+ memset(&board_info, 0, sizeof(struct i2c_board_info));
+ strlcpy(board_info.type, "si2157", I2C_NAME_SIZE);
+ board_info.addr = 0x60;
+ board_info.platform_data = &si2157_config;
+ request_module("si2157");
+ client_tuner = i2c_new_device(adapter, &board_info);
+ if (!client_tuner || !client_tuner->dev.driver)
+ goto err_module_put_demod;
+ if (!try_module_get(client_tuner->dev.driver->owner))
+ goto err_i2c_unregister_device_tuner;
+
+ state->i2c_client_demod = client_demod;
+ state->i2c_client_tuner = client_tuner;
+ return 0;
+err_i2c_unregister_device_tuner:
+ i2c_unregister_device(client_tuner);
+err_module_put_demod:
+ module_put(client_demod->dev.driver->owner);
+err_i2c_unregister_device_demod:
+ i2c_unregister_device(client_demod);
+err:
+ return -ENODEV;
+}
+
static int dvbsky_identify_state(struct dvb_usb_device *d, const char **name)
{
dvbsky_gpio_ctrl(d, 0x04, 1);
@@ -830,6 +884,32 @@ static struct dvb_usb_device_properties dvbsky_t330_props = {
}
};
+static struct dvb_usb_device_properties dvbsky_mygica_t230_props = {
+ .driver_name = KBUILD_MODNAME,
+ .owner = THIS_MODULE,
+ .adapter_nr = adapter_nr,
+ .size_of_priv = sizeof(struct dvbsky_state),
+
+ .generic_bulk_ctrl_endpoint = 0x01,
+ .generic_bulk_ctrl_endpoint_response = 0x81,
+ .generic_bulk_ctrl_delay = DVBSKY_MSG_DELAY,
+
+ .i2c_algo = &dvbsky_i2c_algo,
+ .frontend_attach = dvbsky_mygica_t230_frontend_attach,
+ .init = dvbsky_init,
+ .get_rc_config = dvbsky_get_rc_config,
+ .streaming_ctrl = dvbsky_streaming_ctrl,
+ .identify_state = dvbsky_identify_state,
+ .exit = dvbsky_exit,
+
+ .num_adapters = 1,
+ .adapter = {
+ {
+ .stream = DVB_USB_STREAM_BULK(0x82, 8, 4096),
+ }
+ }
+};
+
static const struct usb_device_id dvbsky_id_table[] = {
{ DVB_USB_DEVICE(0x0572, 0x6831,
&dvbsky_s960_props, "DVBSky S960/S860", RC_MAP_DVBSKY) },
@@ -858,6 +938,9 @@ static const struct usb_device_id dvbsky_id_table[] = {
{ DVB_USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_CINERGY_S2_R4,
&dvbsky_s960_props, "Terratec Cinergy S2 Rev.4",
RC_MAP_DVBSKY) },
+ { DVB_USB_DEVICE(USB_VID_CONEXANT, 0xc688,
+ &dvbsky_mygica_t230_props, "MyGica T230",
+ RC_MAP_TOTAL_MEDIA_IN_HAND_02) },
{ }
};
MODULE_DEVICE_TABLE(usb, dvbsky_id_table);

Privacy Policy