diff options
author | Olivier Grenie <olivier.grenie@dibcom.fr> | 2011-08-09 03:48:25 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-11-24 17:50:49 -0500 |
commit | b293f304c52c4e7a3473dad4d4d0f3bc3c3cd32f (patch) | |
tree | 45ad71168657ce20de8dbe8491faf849331018a9 /drivers | |
parent | 1f6bfcc752445ea03cb63c0c6bf5ee54d0fa73d5 (diff) |
[media] dib7090: add the reference board TFE7790E
The intend of this patch is to add the support for the DiBcom reference
board TFE7790E.
Signed-off-by: Olivier Grenie <olivier.grenie@dibcom.fr>
Signed-off-by: Patrick Boettcher <patrick.boettcher@dibcom.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/dvb/dvb-usb/dib0700_devices.c | 154 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/dvb-usb-ids.h | 1 |
2 files changed, 155 insertions, 0 deletions
diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c index d82740a8569..845b11acfb5 100644 --- a/drivers/media/dvb/dvb-usb/dib0700_devices.c +++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c | |||
@@ -2428,6 +2428,71 @@ static const struct dib0090_config tfe7090e_dib0090_config = { | |||
2428 | .is_dib7090e = 1, | 2428 | .is_dib7090e = 1, |
2429 | }; | 2429 | }; |
2430 | 2430 | ||
2431 | static struct dib7000p_config tfe7790e_dib7000p_config = { | ||
2432 | .output_mpeg2_in_188_bytes = 1, | ||
2433 | .hostbus_diversity = 1, | ||
2434 | .tuner_is_baseband = 1, | ||
2435 | .update_lna = dib7090e_update_lna, | ||
2436 | |||
2437 | .agc_config_count = 2, | ||
2438 | .agc = dib7090_agc_config, | ||
2439 | |||
2440 | .bw = &dib7090_clock_config_12_mhz, | ||
2441 | |||
2442 | .gpio_dir = DIB7000P_GPIO_DEFAULT_DIRECTIONS, | ||
2443 | .gpio_val = DIB7000P_GPIO_DEFAULT_VALUES, | ||
2444 | .gpio_pwm_pos = DIB7000P_GPIO_DEFAULT_PWM_POS, | ||
2445 | |||
2446 | .pwm_freq_div = 0, | ||
2447 | |||
2448 | .agc_control = dib7090_agc_restart, | ||
2449 | |||
2450 | .spur_protect = 0, | ||
2451 | .disable_sample_and_hold = 0, | ||
2452 | .enable_current_mirror = 0, | ||
2453 | .diversity_delay = 0, | ||
2454 | |||
2455 | .output_mode = OUTMODE_MPEG2_PAR_GATED_CLK, | ||
2456 | .enMpegOutput = 1, | ||
2457 | }; | ||
2458 | |||
2459 | static const struct dib0090_config tfe7790e_dib0090_config = { | ||
2460 | .io.clock_khz = 12000, | ||
2461 | .io.pll_bypass = 0, | ||
2462 | .io.pll_range = 0, | ||
2463 | .io.pll_prediv = 3, | ||
2464 | .io.pll_loopdiv = 6, | ||
2465 | .io.adc_clock_ratio = 0, | ||
2466 | .io.pll_int_loop_filt = 0, | ||
2467 | .reset = dib7090_tuner_sleep, | ||
2468 | .sleep = dib7090_tuner_sleep, | ||
2469 | |||
2470 | .freq_offset_khz_uhf = 0, | ||
2471 | .freq_offset_khz_vhf = 0, | ||
2472 | |||
2473 | .get_adc_power = dib7090_get_adc_power, | ||
2474 | |||
2475 | .clkouttobamse = 1, | ||
2476 | .analog_output = 0, | ||
2477 | |||
2478 | .wbd_vhf_offset = 0, | ||
2479 | .wbd_cband_offset = 0, | ||
2480 | .use_pwm_agc = 1, | ||
2481 | .clkoutdrive = 0, | ||
2482 | |||
2483 | .fref_clock_ratio = 0, | ||
2484 | |||
2485 | .wbd = dib7090e_wbd_table, | ||
2486 | |||
2487 | .ls_cfg_pad_drv = 0, | ||
2488 | .data_tx_drv = 0, | ||
2489 | .low_if = NULL, | ||
2490 | .in_soc = 1, | ||
2491 | .force_cband_input = 1, | ||
2492 | .is_dib7090e = 1, | ||
2493 | .force_crystal_mode = 1, | ||
2494 | }; | ||
2495 | |||
2431 | static const struct dib0090_config tfe7090pvr_dib0090_config[2] = { | 2496 | static const struct dib0090_config tfe7090pvr_dib0090_config[2] = { |
2432 | { | 2497 | { |
2433 | .io.clock_khz = 12000, | 2498 | .io.clock_khz = 12000, |
@@ -2646,6 +2711,54 @@ static int tfe7090e_frontend_attach(struct dvb_usb_adapter *adap) | |||
2646 | return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; | 2711 | return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; |
2647 | } | 2712 | } |
2648 | 2713 | ||
2714 | static int tfe7790e_frontend_attach(struct dvb_usb_adapter *adap) | ||
2715 | { | ||
2716 | struct dib0700_state *st = adap->dev->priv; | ||
2717 | |||
2718 | /* The TFE7790E requires the dib0700 to not be in master mode */ | ||
2719 | st->disable_streaming_master_mode = 1; | ||
2720 | |||
2721 | dib0700_set_gpio(adap->dev, GPIO6, GPIO_OUT, 1); | ||
2722 | msleep(20); | ||
2723 | dib0700_set_gpio(adap->dev, GPIO9, GPIO_OUT, 1); | ||
2724 | dib0700_set_gpio(adap->dev, GPIO4, GPIO_OUT, 1); | ||
2725 | dib0700_set_gpio(adap->dev, GPIO7, GPIO_OUT, 1); | ||
2726 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 0); | ||
2727 | msleep(20); | ||
2728 | dib0700_ctrl_clock(adap->dev, 72, 1); | ||
2729 | dib0700_set_gpio(adap->dev, GPIO10, GPIO_OUT, 1); | ||
2730 | msleep(20); | ||
2731 | dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1); | ||
2732 | |||
2733 | if (dib7000p_i2c_enumeration(&adap->dev->i2c_adap, | ||
2734 | 1, 0x10, &tfe7790e_dib7000p_config) != 0) { | ||
2735 | err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", | ||
2736 | __func__); | ||
2737 | return -ENODEV; | ||
2738 | } | ||
2739 | adap->fe_adap[0].fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, | ||
2740 | 0x80, &tfe7790e_dib7000p_config); | ||
2741 | |||
2742 | return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; | ||
2743 | } | ||
2744 | |||
2745 | static int tfe7790e_tuner_attach(struct dvb_usb_adapter *adap) | ||
2746 | { | ||
2747 | struct dib0700_adapter_state *st = adap->priv; | ||
2748 | struct i2c_adapter *tun_i2c = | ||
2749 | dib7090_get_i2c_tuner(adap->fe_adap[0].fe); | ||
2750 | |||
2751 | if (dvb_attach(dib0090_register, adap->fe_adap[0].fe, tun_i2c, | ||
2752 | &tfe7790e_dib0090_config) == NULL) | ||
2753 | return -ENODEV; | ||
2754 | |||
2755 | dib7000p_set_gpio(adap->fe_adap[0].fe, 8, 0, 1); | ||
2756 | |||
2757 | st->set_param_save = adap->fe_adap[0].fe->ops.tuner_ops.set_params; | ||
2758 | adap->fe_adap[0].fe->ops.tuner_ops.set_params = dib7090_agc_startup; | ||
2759 | return 0; | ||
2760 | } | ||
2761 | |||
2649 | static int tfe7090e_tuner_attach(struct dvb_usb_adapter *adap) | 2762 | static int tfe7090e_tuner_attach(struct dvb_usb_adapter *adap) |
2650 | { | 2763 | { |
2651 | struct dib0700_adapter_state *st = adap->priv; | 2764 | struct dib0700_adapter_state *st = adap->priv; |
@@ -3120,6 +3233,7 @@ struct usb_device_id dib0700_usb_id_table[] = { | |||
3120 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV340E) }, | 3233 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV340E) }, |
3121 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV340E_SE) }, | 3234 | { USB_DEVICE(USB_VID_PINNACLE, USB_PID_PINNACLE_PCTV340E_SE) }, |
3122 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_TFE7090E) }, | 3235 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_TFE7090E) }, |
3236 | { USB_DEVICE(USB_VID_DIBCOM, USB_PID_DIBCOM_TFE7790E) }, | ||
3123 | { 0 } /* Terminating entry */ | 3237 | { 0 } /* Terminating entry */ |
3124 | }; | 3238 | }; |
3125 | MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table); | 3239 | MODULE_DEVICE_TABLE(usb, dib0700_usb_id_table); |
@@ -4225,6 +4339,46 @@ struct dvb_usb_device_properties dib0700_devices[] = { | |||
4225 | RC_TYPE_NEC, | 4339 | RC_TYPE_NEC, |
4226 | .change_protocol = dib0700_change_protocol, | 4340 | .change_protocol = dib0700_change_protocol, |
4227 | }, | 4341 | }, |
4342 | }, { DIB0700_DEFAULT_DEVICE_PROPERTIES, | ||
4343 | .num_adapters = 1, | ||
4344 | .adapter = { | ||
4345 | { | ||
4346 | .num_frontends = 1, | ||
4347 | .fe = {{ | ||
4348 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | | ||
4349 | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, | ||
4350 | .pid_filter_count = 32, | ||
4351 | .pid_filter = stk70x0p_pid_filter, | ||
4352 | .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, | ||
4353 | .frontend_attach = tfe7790e_frontend_attach, | ||
4354 | .tuner_attach = tfe7790e_tuner_attach, | ||
4355 | |||
4356 | DIB0700_DEFAULT_STREAMING_CONFIG(0x03), | ||
4357 | } }, | ||
4358 | |||
4359 | .size_of_priv = | ||
4360 | sizeof(struct dib0700_adapter_state), | ||
4361 | }, | ||
4362 | }, | ||
4363 | |||
4364 | .num_device_descs = 1, | ||
4365 | .devices = { | ||
4366 | { "DiBcom TFE7790E reference design", | ||
4367 | { &dib0700_usb_id_table[79], NULL }, | ||
4368 | { NULL }, | ||
4369 | }, | ||
4370 | }, | ||
4371 | |||
4372 | .rc.core = { | ||
4373 | .rc_interval = DEFAULT_RC_INTERVAL, | ||
4374 | .rc_codes = RC_MAP_DIB0700_RC5_TABLE, | ||
4375 | .module_name = "dib0700", | ||
4376 | .rc_query = dib0700_rc_query_old_firmware, | ||
4377 | .allowed_protos = RC_TYPE_RC5 | | ||
4378 | RC_TYPE_RC6 | | ||
4379 | RC_TYPE_NEC, | ||
4380 | .change_protocol = dib0700_change_protocol, | ||
4381 | }, | ||
4228 | }, | 4382 | }, |
4229 | }; | 4383 | }; |
4230 | 4384 | ||
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h index 908a61627b8..3f437eb4c68 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-ids.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb-ids.h | |||
@@ -114,6 +114,7 @@ | |||
114 | #define USB_PID_DIBCOM_NIM7090 0x1bb2 | 114 | #define USB_PID_DIBCOM_NIM7090 0x1bb2 |
115 | #define USB_PID_DIBCOM_TFE7090PVR 0x1bb4 | 115 | #define USB_PID_DIBCOM_TFE7090PVR 0x1bb4 |
116 | #define USB_PID_DIBCOM_TFE7090E 0x1bb7 | 116 | #define USB_PID_DIBCOM_TFE7090E 0x1bb7 |
117 | #define USB_PID_DIBCOM_TFE7790E 0x1e6e | ||
117 | #define USB_PID_DIBCOM_NIM9090M 0x2383 | 118 | #define USB_PID_DIBCOM_NIM9090M 0x2383 |
118 | #define USB_PID_DIBCOM_NIM9090MD 0x2384 | 119 | #define USB_PID_DIBCOM_NIM9090MD 0x2384 |
119 | #define USB_PID_DPOSH_M9206_COLD 0x9206 | 120 | #define USB_PID_DPOSH_M9206_COLD 0x9206 |