diff options
Diffstat (limited to 'drivers/media/dvb/dvb-usb')
-rw-r--r-- | drivers/media/dvb/dvb-usb/af9015.c | 33 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/af9015.h | 140 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/anysee.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/cinergyT2-core.c | 3 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/cinergyT2.h | 10 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb-ids.h | 1 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dw2102.c | 15 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/gp8psk-fe.c | 140 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/gp8psk.c | 16 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/gp8psk.h | 1 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/usb-urb.c | 3 |
11 files changed, 323 insertions, 41 deletions
diff --git a/drivers/media/dvb/dvb-usb/af9015.c b/drivers/media/dvb/dvb-usb/af9015.c index e9ab0249d13..e1e9aa5c6b8 100644 --- a/drivers/media/dvb/dvb-usb/af9015.c +++ b/drivers/media/dvb/dvb-usb/af9015.c @@ -733,9 +733,19 @@ static int af9015_read_config(struct usb_device *udev) af9015_config.ir_table_size = ARRAY_SIZE(af9015_ir_table_mygictv); break; + case AF9015_REMOTE_DIGITTRADE_DVB_T: + af9015_properties[i].rc_key_map = + af9015_rc_keys_digittrade; + af9015_properties[i].rc_key_map_size = + ARRAY_SIZE(af9015_rc_keys_digittrade); + af9015_config.ir_table = + af9015_ir_table_digittrade; + af9015_config.ir_table_size = + ARRAY_SIZE(af9015_ir_table_digittrade); + break; } } else { - switch (udev->descriptor.idVendor) { + switch (le16_to_cpu(udev->descriptor.idVendor)) { case USB_VID_LEADTEK: af9015_properties[i].rc_key_map = af9015_rc_keys_leadtek; @@ -748,7 +758,7 @@ static int af9015_read_config(struct usb_device *udev) break; case USB_VID_VISIONPLUS: if (udev->descriptor.idProduct == - USB_PID_AZUREWAVE_AD_TU700) { + cpu_to_le16(USB_PID_AZUREWAVE_AD_TU700)) { af9015_properties[i].rc_key_map = af9015_rc_keys_twinhan; af9015_properties[i].rc_key_map_size = @@ -800,6 +810,16 @@ static int af9015_read_config(struct usb_device *udev) ARRAY_SIZE(af9015_ir_table_msi); } break; + case USB_VID_AVERMEDIA: + af9015_properties[i].rc_key_map = + af9015_rc_keys_avermedia; + af9015_properties[i].rc_key_map_size = + ARRAY_SIZE(af9015_rc_keys_avermedia); + af9015_config.ir_table = + af9015_ir_table_avermedia; + af9015_config.ir_table_size = + ARRAY_SIZE(af9015_ir_table_avermedia); + break; } } } @@ -1191,6 +1211,7 @@ static struct usb_device_id af9015_usb_table[] = { {USB_DEVICE(USB_VID_TELESTAR, USB_PID_TELESTAR_STARSTICK_2)}, {USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_A309)}, /* 15 */{USB_DEVICE(USB_VID_MSI_2, USB_PID_MSI_DIGI_VOX_MINI_III)}, + {USB_DEVICE(USB_VID_KWORLD_2, USB_PID_KWORLD_395U)}, {0}, }; MODULE_DEVICE_TABLE(usb, af9015_usb_table); @@ -1343,7 +1364,7 @@ static struct dvb_usb_device_properties af9015_properties[] = { .i2c_algo = &af9015_i2c_algo, - .num_device_descs = 6, + .num_device_descs = 7, .devices = { { .name = "Xtensions XD-380", @@ -1375,6 +1396,12 @@ static struct dvb_usb_device_properties af9015_properties[] = { .cold_ids = {&af9015_usb_table[15], NULL}, .warm_ids = {NULL}, }, + { + .name = "KWorld USB DVB-T TV Stick II " \ + "(VS-DVB-T 395U)", + .cold_ids = {&af9015_usb_table[16], NULL}, + .warm_ids = {NULL}, + }, } } }; diff --git a/drivers/media/dvb/dvb-usb/af9015.h b/drivers/media/dvb/dvb-usb/af9015.h index 6c3c9729331..21c7782f488 100644 --- a/drivers/media/dvb/dvb-usb/af9015.h +++ b/drivers/media/dvb/dvb-usb/af9015.h @@ -123,6 +123,7 @@ enum af9015_remote { AF9015_REMOTE_A_LINK_DTU_M, AF9015_REMOTE_MSI_DIGIVOX_MINI_II_V3, AF9015_REMOTE_MYGICTV_U718, + AF9015_REMOTE_DIGITTRADE_DVB_T, }; /* Leadtek WinFast DTV Dongle Gold */ @@ -520,4 +521,143 @@ static u8 af9015_ir_table_kworld[] = { 0x86, 0x6b, 0x23, 0xdc, 0x45, 0x07, 0x00, }; +/* AverMedia Volar X */ +static struct dvb_usb_rc_key af9015_rc_keys_avermedia[] = { + { 0x05, 0x3d, KEY_PROG1 }, /* SOURCE */ + { 0x05, 0x12, KEY_POWER }, /* POWER */ + { 0x05, 0x1e, KEY_1 }, /* 1 */ + { 0x05, 0x1f, KEY_2 }, /* 2 */ + { 0x05, 0x20, KEY_3 }, /* 3 */ + { 0x05, 0x21, KEY_4 }, /* 4 */ + { 0x05, 0x22, KEY_5 }, /* 5 */ + { 0x05, 0x23, KEY_6 }, /* 6 */ + { 0x05, 0x24, KEY_7 }, /* 7 */ + { 0x05, 0x25, KEY_8 }, /* 8 */ + { 0x05, 0x26, KEY_9 }, /* 9 */ + { 0x05, 0x3f, KEY_LEFT }, /* L / DISPLAY */ + { 0x05, 0x27, KEY_0 }, /* 0 */ + { 0x05, 0x0f, KEY_RIGHT }, /* R / CH RTN */ + { 0x05, 0x18, KEY_PROG2 }, /* SNAP SHOT */ + { 0x05, 0x1c, KEY_PROG3 }, /* 16-CH PREV */ + { 0x05, 0x2d, KEY_VOLUMEDOWN }, /* VOL DOWN */ + { 0x05, 0x3e, KEY_ZOOM }, /* FULL SCREEN */ + { 0x05, 0x2e, KEY_VOLUMEUP }, /* VOL UP */ + { 0x05, 0x10, KEY_MUTE }, /* MUTE */ + { 0x05, 0x04, KEY_AUDIO }, /* AUDIO */ + { 0x05, 0x15, KEY_RECORD }, /* RECORD */ + { 0x05, 0x11, KEY_PLAY }, /* PLAY */ + { 0x05, 0x16, KEY_STOP }, /* STOP */ + { 0x05, 0x0c, KEY_PLAYPAUSE }, /* TIMESHIFT / PAUSE */ + { 0x05, 0x05, KEY_BACK }, /* << / RED */ + { 0x05, 0x09, KEY_FORWARD }, /* >> / YELLOW */ + { 0x05, 0x17, KEY_TEXT }, /* TELETEXT */ + { 0x05, 0x0a, KEY_EPG }, /* EPG */ + { 0x05, 0x13, KEY_MENU }, /* MENU */ + + { 0x05, 0x0e, KEY_CHANNELUP }, /* CH UP */ + { 0x05, 0x0d, KEY_CHANNELDOWN }, /* CH DOWN */ + { 0x05, 0x19, KEY_FIRST }, /* |<< / GREEN */ + { 0x05, 0x08, KEY_LAST }, /* >>| / BLUE */ +}; + +static u8 af9015_ir_table_avermedia[] = { + 0x02, 0xfd, 0x00, 0xff, 0x12, 0x05, 0x00, + 0x02, 0xfd, 0x01, 0xfe, 0x3d, 0x05, 0x00, + 0x02, 0xfd, 0x03, 0xfc, 0x17, 0x05, 0x00, + 0x02, 0xfd, 0x04, 0xfb, 0x0a, 0x05, 0x00, + 0x02, 0xfd, 0x05, 0xfa, 0x1e, 0x05, 0x00, + 0x02, 0xfd, 0x06, 0xf9, 0x1f, 0x05, 0x00, + 0x02, 0xfd, 0x07, 0xf8, 0x20, 0x05, 0x00, + 0x02, 0xfd, 0x09, 0xf6, 0x21, 0x05, 0x00, + 0x02, 0xfd, 0x0a, 0xf5, 0x22, 0x05, 0x00, + 0x02, 0xfd, 0x0b, 0xf4, 0x23, 0x05, 0x00, + 0x02, 0xfd, 0x0d, 0xf2, 0x24, 0x05, 0x00, + 0x02, 0xfd, 0x0e, 0xf1, 0x25, 0x05, 0x00, + 0x02, 0xfd, 0x0f, 0xf0, 0x26, 0x05, 0x00, + 0x02, 0xfd, 0x11, 0xee, 0x27, 0x05, 0x00, + 0x02, 0xfd, 0x08, 0xf7, 0x04, 0x05, 0x00, + 0x02, 0xfd, 0x0c, 0xf3, 0x3e, 0x05, 0x00, + 0x02, 0xfd, 0x10, 0xef, 0x1c, 0x05, 0x00, + 0x02, 0xfd, 0x12, 0xed, 0x3f, 0x05, 0x00, + 0x02, 0xfd, 0x13, 0xec, 0x0f, 0x05, 0x00, + 0x02, 0xfd, 0x14, 0xeb, 0x10, 0x05, 0x00, + 0x02, 0xfd, 0x15, 0xea, 0x13, 0x05, 0x00, + 0x02, 0xfd, 0x17, 0xe8, 0x18, 0x05, 0x00, + 0x02, 0xfd, 0x18, 0xe7, 0x11, 0x05, 0x00, + 0x02, 0xfd, 0x19, 0xe6, 0x15, 0x05, 0x00, + 0x02, 0xfd, 0x1a, 0xe5, 0x0c, 0x05, 0x00, + 0x02, 0xfd, 0x1b, 0xe4, 0x16, 0x05, 0x00, + 0x02, 0xfd, 0x1c, 0xe3, 0x09, 0x05, 0x00, + 0x02, 0xfd, 0x1d, 0xe2, 0x05, 0x05, 0x00, + 0x02, 0xfd, 0x1e, 0xe1, 0x2d, 0x05, 0x00, + 0x02, 0xfd, 0x1f, 0xe0, 0x2e, 0x05, 0x00, + 0x03, 0xfc, 0x00, 0xff, 0x08, 0x05, 0x00, + 0x03, 0xfc, 0x01, 0xfe, 0x19, 0x05, 0x00, + 0x03, 0xfc, 0x02, 0xfd, 0x0d, 0x05, 0x00, + 0x03, 0xfc, 0x03, 0xfc, 0x0e, 0x05, 0x00, +}; + +/* Digittrade DVB-T USB Stick */ +static struct dvb_usb_rc_key af9015_rc_keys_digittrade[] = { + { 0x01, 0x0f, KEY_LAST }, /* RETURN */ + { 0x05, 0x17, KEY_TEXT }, /* TELETEXT */ + { 0x01, 0x08, KEY_EPG }, /* EPG */ + { 0x05, 0x13, KEY_POWER }, /* POWER */ + { 0x01, 0x09, KEY_ZOOM }, /* FULLSCREEN */ + { 0x00, 0x40, KEY_AUDIO }, /* DUAL SOUND */ + { 0x00, 0x2c, KEY_PRINT }, /* SNAPSHOT */ + { 0x05, 0x16, KEY_SUBTITLE }, /* SUBTITLE */ + { 0x00, 0x52, KEY_CHANNELUP }, /* CH Up */ + { 0x00, 0x51, KEY_CHANNELDOWN },/* Ch Dn */ + { 0x00, 0x57, KEY_VOLUMEUP }, /* Vol Up */ + { 0x00, 0x56, KEY_VOLUMEDOWN }, /* Vol Dn */ + { 0x01, 0x10, KEY_MUTE }, /* MUTE */ + { 0x00, 0x27, KEY_0 }, + { 0x00, 0x1e, KEY_1 }, + { 0x00, 0x1f, KEY_2 }, + { 0x00, 0x20, KEY_3 }, + { 0x00, 0x21, KEY_4 }, + { 0x00, 0x22, KEY_5 }, + { 0x00, 0x23, KEY_6 }, + { 0x00, 0x24, KEY_7 }, + { 0x00, 0x25, KEY_8 }, + { 0x00, 0x26, KEY_9 }, + { 0x01, 0x17, KEY_PLAYPAUSE }, /* TIMESHIFT */ + { 0x01, 0x15, KEY_RECORD }, /* RECORD */ + { 0x03, 0x13, KEY_PLAY }, /* PLAY */ + { 0x01, 0x16, KEY_STOP }, /* STOP */ + { 0x01, 0x13, KEY_PAUSE }, /* PAUSE */ +}; + +static u8 af9015_ir_table_digittrade[] = { + 0x00, 0xff, 0x06, 0xf9, 0x13, 0x05, 0x00, + 0x00, 0xff, 0x4d, 0xb2, 0x17, 0x01, 0x00, + 0x00, 0xff, 0x1f, 0xe0, 0x2c, 0x00, 0x00, + 0x00, 0xff, 0x0a, 0xf5, 0x15, 0x01, 0x00, + 0x00, 0xff, 0x0e, 0xf1, 0x16, 0x01, 0x00, + 0x00, 0xff, 0x09, 0xf6, 0x09, 0x01, 0x00, + 0x00, 0xff, 0x01, 0xfe, 0x08, 0x01, 0x00, + 0x00, 0xff, 0x05, 0xfa, 0x10, 0x01, 0x00, + 0x00, 0xff, 0x02, 0xfd, 0x56, 0x00, 0x00, + 0x00, 0xff, 0x40, 0xbf, 0x57, 0x00, 0x00, + 0x00, 0xff, 0x19, 0xe6, 0x52, 0x00, 0x00, + 0x00, 0xff, 0x17, 0xe8, 0x51, 0x00, 0x00, + 0x00, 0xff, 0x10, 0xef, 0x0f, 0x01, 0x00, + 0x00, 0xff, 0x54, 0xab, 0x27, 0x00, 0x00, + 0x00, 0xff, 0x1b, 0xe4, 0x1e, 0x00, 0x00, + 0x00, 0xff, 0x11, 0xee, 0x1f, 0x00, 0x00, + 0x00, 0xff, 0x15, 0xea, 0x20, 0x00, 0x00, + 0x00, 0xff, 0x12, 0xed, 0x21, 0x00, 0x00, + 0x00, 0xff, 0x16, 0xe9, 0x22, 0x00, 0x00, + 0x00, 0xff, 0x4c, 0xb3, 0x23, 0x00, 0x00, + 0x00, 0xff, 0x48, 0xb7, 0x24, 0x00, 0x00, + 0x00, 0xff, 0x04, 0xfb, 0x25, 0x00, 0x00, + 0x00, 0xff, 0x00, 0xff, 0x26, 0x00, 0x00, + 0x00, 0xff, 0x1e, 0xe1, 0x13, 0x03, 0x00, + 0x00, 0xff, 0x1a, 0xe5, 0x13, 0x01, 0x00, + 0x00, 0xff, 0x03, 0xfc, 0x17, 0x05, 0x00, + 0x00, 0xff, 0x0d, 0xf2, 0x16, 0x05, 0x00, + 0x00, 0xff, 0x1d, 0xe2, 0x40, 0x00, 0x00, +}; + #endif diff --git a/drivers/media/dvb/dvb-usb/anysee.c b/drivers/media/dvb/dvb-usb/anysee.c index cd2edbcaa09..5017f08b14a 100644 --- a/drivers/media/dvb/dvb-usb/anysee.c +++ b/drivers/media/dvb/dvb-usb/anysee.c @@ -153,7 +153,7 @@ static int anysee_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msg, int num) { struct dvb_usb_device *d = i2c_get_adapdata(adap); - int ret, inc, i = 0; + int ret = 0, inc, i = 0; if (mutex_lock_interruptible(&d->i2c_mutex) < 0) return -EAGAIN; diff --git a/drivers/media/dvb/dvb-usb/cinergyT2-core.c b/drivers/media/dvb/dvb-usb/cinergyT2-core.c index 3ac9f74e9fb..80e37a0d089 100644 --- a/drivers/media/dvb/dvb-usb/cinergyT2-core.c +++ b/drivers/media/dvb/dvb-usb/cinergyT2-core.c @@ -32,7 +32,6 @@ /* debug */ int dvb_usb_cinergyt2_debug; -int disable_remote; module_param_named(debug, dvb_usb_cinergyt2_debug, int, 0644); MODULE_PARM_DESC(debug, "set debugging level (1=info, xfer=2, rc=4 " @@ -45,7 +44,7 @@ struct cinergyt2_state { }; /* We are missing a release hook with usb_device data */ -struct dvb_usb_device *cinergyt2_usb_device; +static struct dvb_usb_device *cinergyt2_usb_device; static struct dvb_usb_device_properties cinergyt2_properties; diff --git a/drivers/media/dvb/dvb-usb/cinergyT2.h b/drivers/media/dvb/dvb-usb/cinergyT2.h index 11d79eb384c..84efe03771e 100644 --- a/drivers/media/dvb/dvb-usb/cinergyT2.h +++ b/drivers/media/dvb/dvb-usb/cinergyT2.h @@ -70,11 +70,11 @@ struct dvbt_get_status_msg { uint8_t bandwidth; uint16_t tps; uint8_t flags; - uint16_t gain; + __le16 gain; uint8_t snr; - uint32_t viterbi_error_rate; + __le32 viterbi_error_rate; uint32_t rs_error_rate; - uint32_t uncorrected_block_count; + __le32 uncorrected_block_count; uint8_t lock_bits; uint8_t prev_lock_bits; } __attribute__((packed)); @@ -82,9 +82,9 @@ struct dvbt_get_status_msg { struct dvbt_set_parameters_msg { uint8_t cmd; - uint32_t freq; + __le32 freq; uint8_t bandwidth; - uint16_t tps; + __le16 tps; uint8_t flags; } __attribute__((packed)); diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h index 7380b94b3b3..a4fca3fca5e 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h @@ -96,6 +96,7 @@ #define USB_PID_GRANDTEC_DVBT_USB_COLD 0x0fa0 #define USB_PID_GRANDTEC_DVBT_USB_WARM 0x0fa1 #define USB_PID_KWORLD_399U 0xe399 +#define USB_PID_KWORLD_395U 0xe396 #define USB_PID_KWORLD_PC160_2T 0xc160 #define USB_PID_KWORLD_VSTREAM_COLD 0x17de #define USB_PID_KWORLD_VSTREAM_WARM 0x17df diff --git a/drivers/media/dvb/dvb-usb/dw2102.c b/drivers/media/dvb/dvb-usb/dw2102.c index 6286fbbe7fb..c65f273ff31 100644 --- a/drivers/media/dvb/dvb-usb/dw2102.c +++ b/drivers/media/dvb/dvb-usb/dw2102.c @@ -9,7 +9,6 @@ * * see Documentation/dvb/README.dvb-usb for more information */ -#include <linux/version.h> #include "dw2102.h" #include "si21xx.h" #include "stv0299.h" @@ -27,6 +26,10 @@ #define USB_PID_DW2104 0x2104 #endif +#ifndef USB_PID_CINERGY_S +#define USB_PID_CINERGY_S 0x0064 +#endif + #define DW210X_READ_MSG 0 #define DW210X_WRITE_MSG 1 @@ -578,6 +581,7 @@ static struct usb_device_id dw2102_table[] = { {USB_DEVICE(USB_VID_CYPRESS, 0x2101)}, {USB_DEVICE(USB_VID_CYPRESS, 0x2104)}, {USB_DEVICE(0x9022, 0xd650)}, + {USB_DEVICE(USB_VID_TERRATEC, USB_PID_CINERGY_S)}, { } }; @@ -647,6 +651,7 @@ static int dw2102_load_firmware(struct usb_device *dev, dw210x_op_rw(dev, 0xbf, 0x0040, 0, &reset, 0, DW210X_WRITE_MSG); break; + case USB_PID_CINERGY_S: case USB_PID_DW2102: dw210x_op_rw(dev, 0xbf, 0x0040, 0, &reset, 0, DW210X_WRITE_MSG); @@ -655,7 +660,7 @@ static int dw2102_load_firmware(struct usb_device *dev, /* check STV0299 frontend */ dw210x_op_rw(dev, 0xb5, 0, 0, &reset16[0], 2, DW210X_READ_MSG); - if (reset16[0] == 0xa1) { + if ((reset16[0] == 0xa1) || (reset16[0] == 0x80)) { dw2102_properties.i2c_algo = &dw2102_i2c_algo; dw2102_properties.adapter->tuner_attach = &dw2102_tuner_attach; break; @@ -726,7 +731,7 @@ static struct dvb_usb_device_properties dw2102_properties = { }, } }, - .num_device_descs = 2, + .num_device_descs = 3, .devices = { {"DVBWorld DVB-S 2102 USB2.0", {&dw2102_table[0], NULL}, @@ -736,6 +741,10 @@ static struct dvb_usb_device_properties dw2102_properties = { {&dw2102_table[1], NULL}, {NULL}, }, + {"TerraTec Cinergy S USB", + {&dw2102_table[4], NULL}, + {NULL}, + }, } }; diff --git a/drivers/media/dvb/dvb-usb/gp8psk-fe.c b/drivers/media/dvb/dvb-usb/gp8psk-fe.c index 262a858c306..20eadf9318e 100644 --- a/drivers/media/dvb/dvb-usb/gp8psk-fe.c +++ b/drivers/media/dvb/dvb-usb/gp8psk-fe.c @@ -25,6 +25,20 @@ struct gp8psk_fe_state { unsigned long status_check_interval; }; +static int gp8psk_tuned_to_DCII(struct dvb_frontend *fe) +{ + struct gp8psk_fe_state *st = fe->demodulator_priv; + u8 status; + gp8psk_usb_in_op(st->d, GET_8PSK_CONFIG, 0, 0, &status, 1); + return status & bmDCtuned; +} + +static int gp8psk_set_tuner_mode(struct dvb_frontend *fe, int mode) +{ + struct gp8psk_fe_state *state = fe->demodulator_priv; + return gp8psk_usb_out_op(state->d, SET_8PSK_CONFIG, mode, 0, NULL, 0); +} + static int gp8psk_fe_update_status(struct gp8psk_fe_state *st) { u8 buf[6]; @@ -99,39 +113,114 @@ static int gp8psk_fe_get_tune_settings(struct dvb_frontend* fe, struct dvb_front return 0; } +static int gp8psk_fe_set_property(struct dvb_frontend *fe, + struct dtv_property *tvp) +{ + deb_fe("%s(..)\n", __func__); + return 0; +} + +static int gp8psk_fe_get_property(struct dvb_frontend *fe, + struct dtv_property *tvp) +{ + deb_fe("%s(..)\n", __func__); + return 0; +} + + static int gp8psk_fe_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *fep) { struct gp8psk_fe_state *state = fe->demodulator_priv; + struct dtv_frontend_properties *c = &fe->dtv_property_cache; u8 cmd[10]; u32 freq = fep->frequency * 1000; + int gp_product_id = le16_to_cpu(state->d->udev->descriptor.idProduct); + + deb_fe("%s()\n", __func__); cmd[4] = freq & 0xff; cmd[5] = (freq >> 8) & 0xff; cmd[6] = (freq >> 16) & 0xff; cmd[7] = (freq >> 24) & 0xff; - switch(fe->ops.info.type) { - case FE_QPSK: - cmd[0] = fep->u.qpsk.symbol_rate & 0xff; - cmd[1] = (fep->u.qpsk.symbol_rate >> 8) & 0xff; - cmd[2] = (fep->u.qpsk.symbol_rate >> 16) & 0xff; - cmd[3] = (fep->u.qpsk.symbol_rate >> 24) & 0xff; - cmd[8] = ADV_MOD_DVB_QPSK; - cmd[9] = 0x03; /*ADV_MOD_FEC_XXX*/ + switch (c->delivery_system) { + case SYS_DVBS: + /* Only QPSK is supported for DVB-S */ + if (c->modulation != QPSK) { + deb_fe("%s: unsupported modulation selected (%d)\n", + __func__, c->modulation); + return -EOPNOTSUPP; + } + c->fec_inner = FEC_AUTO; break; + case SYS_DVBS2: + deb_fe("%s: DVB-S2 delivery system selected\n", __func__); + break; + default: - // other modes are unsuported right now - cmd[0] = 0; - cmd[1] = 0; - cmd[2] = 0; - cmd[3] = 0; - cmd[8] = 0; + deb_fe("%s: unsupported delivery system selected (%d)\n", + __func__, c->delivery_system); + return -EOPNOTSUPP; + } + + cmd[0] = c->symbol_rate & 0xff; + cmd[1] = (c->symbol_rate >> 8) & 0xff; + cmd[2] = (c->symbol_rate >> 16) & 0xff; + cmd[3] = (c->symbol_rate >> 24) & 0xff; + switch (c->modulation) { + case QPSK: + if (gp_product_id == USB_PID_GENPIX_8PSK_REV_1_WARM) + if (gp8psk_tuned_to_DCII(fe)) + gp8psk_bcm4500_reload(state->d); + switch (c->fec_inner) { + case FEC_1_2: + cmd[9] = 0; break; + case FEC_2_3: + cmd[9] = 1; break; + case FEC_3_4: + cmd[9] = 2; break; + case FEC_5_6: + cmd[9] = 3; break; + case FEC_7_8: + cmd[9] = 4; break; + case FEC_AUTO: + cmd[9] = 5; break; + default: + cmd[9] = 5; break; + } + cmd[8] = ADV_MOD_DVB_QPSK; + break; + case PSK_8: /* PSK_8 is for compatibility with DN */ + cmd[8] = ADV_MOD_TURBO_8PSK; + switch (c->fec_inner) { + case FEC_2_3: + cmd[9] = 0; break; + case FEC_3_4: + cmd[9] = 1; break; + case FEC_3_5: + cmd[9] = 2; break; + case FEC_5_6: + cmd[9] = 3; break; + case FEC_8_9: + cmd[9] = 4; break; + default: + cmd[9] = 0; break; + } + break; + case QAM_16: /* QAM_16 is for compatibility with DN */ + cmd[8] = ADV_MOD_TURBO_16QAM; cmd[9] = 0; break; + default: /* Unknown modulation */ + deb_fe("%s: unsupported modulation selected (%d)\n", + __func__, c->modulation); + return -EOPNOTSUPP; } - gp8psk_usb_out_op(state->d,TUNE_8PSK,0,0,cmd,10); + if (gp_product_id == USB_PID_GENPIX_8PSK_REV_1_WARM) + gp8psk_set_tuner_mode(fe, 0); + gp8psk_usb_out_op(state->d, TUNE_8PSK, 0, 0, cmd, 10); state->lock = 0; state->next_status_check = jiffies; @@ -140,13 +229,6 @@ static int gp8psk_fe_set_frontend(struct dvb_frontend* fe, return 0; } -static int gp8psk_fe_get_frontend(struct dvb_frontend* fe, - struct dvb_frontend_parameters *fep) -{ - return 0; -} - - static int gp8psk_fe_send_diseqc_msg (struct dvb_frontend* fe, struct dvb_diseqc_master_cmd *m) { @@ -261,9 +343,13 @@ static struct dvb_frontend_ops gp8psk_fe_ops = { .symbol_rate_max = 45000000, .symbol_rate_tolerance = 500, /* ppm */ .caps = FE_CAN_INVERSION_AUTO | - FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | - FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | - FE_CAN_QPSK + FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | + FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | + /* + * FE_CAN_QAM_16 is for compatibility + * (Myth incorrectly detects Turbo-QPSK as plain QAM-16) + */ + FE_CAN_QPSK | FE_CAN_QAM_16 }, .release = gp8psk_fe_release, @@ -271,8 +357,10 @@ static struct dvb_frontend_ops gp8psk_fe_ops = { .init = NULL, .sleep = NULL, + .set_property = gp8psk_fe_set_property, + .get_property = gp8psk_fe_get_property, .set_frontend = gp8psk_fe_set_frontend, - .get_frontend = gp8psk_fe_get_frontend, + .get_tune_settings = gp8psk_fe_get_tune_settings, .read_status = gp8psk_fe_read_status, diff --git a/drivers/media/dvb/dvb-usb/gp8psk.c b/drivers/media/dvb/dvb-usb/gp8psk.c index d965a923f39..c1da962cc88 100644 --- a/drivers/media/dvb/dvb-usb/gp8psk.c +++ b/drivers/media/dvb/dvb-usb/gp8psk.c @@ -174,6 +174,22 @@ static int gp8psk_power_ctrl(struct dvb_usb_device *d, int onoff) return 0; } +int gp8psk_bcm4500_reload(struct dvb_usb_device *d) +{ + u8 buf; + int gp_product_id = le16_to_cpu(d->udev->descriptor.idProduct); + /* Turn off 8psk power */ + if (gp8psk_usb_in_op(d, BOOT_8PSK, 0, 0, &buf, 1)) + return -EINVAL; + /* Turn On 8psk power */ + if (gp8psk_usb_in_op(d, BOOT_8PSK, 1, 0, &buf, 1)) + return -EINVAL; + /* load BCM4500 firmware */ + if (gp_product_id == USB_PID_GENPIX_8PSK_REV_1_WARM) + if (gp8psk_load_bcm4500fw(d)) + return EINVAL; + return 0; +} static int gp8psk_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) { diff --git a/drivers/media/dvb/dvb-usb/gp8psk.h b/drivers/media/dvb/dvb-usb/gp8psk.h index e5cd8149c23..e83a57506cf 100644 --- a/drivers/media/dvb/dvb-usb/gp8psk.h +++ b/drivers/media/dvb/dvb-usb/gp8psk.h @@ -92,5 +92,6 @@ extern struct dvb_frontend * gp8psk_fe_attach(struct dvb_usb_device *d); extern int gp8psk_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8 *b, int blen); extern int gp8psk_usb_out_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8 *b, int blen); +extern int gp8psk_bcm4500_reload(struct dvb_usb_device *d); #endif diff --git a/drivers/media/dvb/dvb-usb/usb-urb.c b/drivers/media/dvb/dvb-usb/usb-urb.c index da93b9e982c..9da2cc95ca1 100644 --- a/drivers/media/dvb/dvb-usb/usb-urb.c +++ b/drivers/media/dvb/dvb-usb/usb-urb.c @@ -156,7 +156,8 @@ static int usb_bulk_urb_init(struct usb_data_stream *stream) stream->props.u.bulk.buffersize, usb_urb_complete, stream); - stream->urb_list[i]->transfer_flags = 0; + stream->urb_list[i]->transfer_flags = URB_NO_TRANSFER_DMA_MAP; + stream->urb_list[i]->transfer_dma = stream->dma_addr[i]; stream->urbs_initialized++; } return 0; |