Commit 6e7b9ea0 authored by Robert Krakora's avatar Robert Krakora Committed by Mauro Carvalho Chehab

V4L/DVB (10257): em28xx: Fix for KWorld 330U Board

Fix for KWorld 330U Board

Many thanks to Devin and Mauro!!!
Signed-off-by: default avatarRobert Krakora <rob.krakora@messagenetsystems.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 7e4b15e4
...@@ -102,6 +102,18 @@ static struct em28xx_reg_seq em2880_msi_digivox_ad_analog[] = { ...@@ -102,6 +102,18 @@ static struct em28xx_reg_seq em2880_msi_digivox_ad_analog[] = {
/* Board - EM2870 Kworld 355u /* Board - EM2870 Kworld 355u
Analog - No input analog */ Analog - No input analog */
static struct em28xx_reg_seq kworld_330u_analog[] = {
{EM28XX_R08_GPIO, 0x6d, ~EM_GPIO_4, 10},
{EM2880_R04_GPO, 0x00, 0xff, 10},
{ -1, -1, -1, -1},
};
static struct em28xx_reg_seq kworld_330u_digital[] = {
{EM28XX_R08_GPIO, 0x6e, ~EM_GPIO_4, 10},
{EM2880_R04_GPO, 0x08, 0xff, 10},
{ -1, -1, -1, -1},
};
/* Callback for the most boards */ /* Callback for the most boards */
static struct em28xx_reg_seq default_tuner_gpio[] = { static struct em28xx_reg_seq default_tuner_gpio[] = {
{EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10}, {EM28XX_R08_GPIO, EM_GPIO_4, EM_GPIO_4, 10},
...@@ -1177,29 +1189,33 @@ struct em28xx_board em28xx_boards[] = { ...@@ -1177,29 +1189,33 @@ struct em28xx_board em28xx_boards[] = {
.gpio = hauppauge_wintv_hvr_900_analog, .gpio = hauppauge_wintv_hvr_900_analog,
} }, } },
}, },
[EM2883_BOARD_KWORLD_HYBRID_A316] = { [EM2883_BOARD_KWORLD_HYBRID_330U] = {
.name = "Kworld PlusTV HD Hybrid 330", .name = "Kworld PlusTV HD Hybrid 330",
.tuner_type = TUNER_XC2028, .tuner_type = TUNER_XC2028,
.tuner_gpio = default_tuner_gpio, .tuner_gpio = default_tuner_gpio,
.decoder = EM28XX_TVP5150, .decoder = EM28XX_TVP5150,
.mts_firmware = 1, .mts_firmware = 1,
.has_dvb = 1, .has_dvb = 1,
.dvb_gpio = default_digital, .dvb_gpio = kworld_330u_digital,
.xclk = EM28XX_XCLK_FREQUENCY_12MHZ,
.i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_EEPROM_ON_BOARD | EM28XX_I2C_EEPROM_KEY_VALID,
.input = { { .input = { {
.type = EM28XX_VMUX_TELEVISION, .type = EM28XX_VMUX_TELEVISION,
.vmux = TVP5150_COMPOSITE0, .vmux = TVP5150_COMPOSITE0,
.amux = EM28XX_AMUX_VIDEO, .amux = EM28XX_AMUX_VIDEO,
.gpio = default_analog, .gpio = kworld_330u_analog,
.aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
}, { }, {
.type = EM28XX_VMUX_COMPOSITE1, .type = EM28XX_VMUX_COMPOSITE1,
.vmux = TVP5150_COMPOSITE1, .vmux = TVP5150_COMPOSITE1,
.amux = EM28XX_AMUX_LINE_IN, .amux = EM28XX_AMUX_LINE_IN,
.gpio = hauppauge_wintv_hvr_900_analog, .gpio = kworld_330u_analog,
.aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO,
}, { }, {
.type = EM28XX_VMUX_SVIDEO, .type = EM28XX_VMUX_SVIDEO,
.vmux = TVP5150_SVIDEO, .vmux = TVP5150_SVIDEO,
.amux = EM28XX_AMUX_LINE_IN, .amux = EM28XX_AMUX_LINE_IN,
.gpio = hauppauge_wintv_hvr_900_analog, .gpio = kworld_330u_analog,
} }, } },
}, },
[EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU] = { [EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU] = {
...@@ -1249,7 +1265,7 @@ struct usb_device_id em28xx_id_table [] = { ...@@ -1249,7 +1265,7 @@ struct usb_device_id em28xx_id_table [] = {
{ USB_DEVICE(0xeb1a, 0xe310), { USB_DEVICE(0xeb1a, 0xe310),
.driver_info = EM2880_BOARD_MSI_DIGIVOX_AD }, .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD },
{ USB_DEVICE(0xeb1a, 0xa316), { USB_DEVICE(0xeb1a, 0xa316),
.driver_info = EM2883_BOARD_KWORLD_HYBRID_A316 }, .driver_info = EM2883_BOARD_KWORLD_HYBRID_330U },
{ USB_DEVICE(0xeb1a, 0xe320), { USB_DEVICE(0xeb1a, 0xe320),
.driver_info = EM2880_BOARD_MSI_DIGIVOX_AD_II }, .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD_II },
{ USB_DEVICE(0xeb1a, 0xe323), { USB_DEVICE(0xeb1a, 0xe323),
...@@ -1526,6 +1542,10 @@ static void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl) ...@@ -1526,6 +1542,10 @@ static void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl)
/* FIXME: Better to specify the needed IF */ /* FIXME: Better to specify the needed IF */
ctl->demod = XC3028_FE_DEFAULT; ctl->demod = XC3028_FE_DEFAULT;
break; break;
case EM2883_BOARD_KWORLD_HYBRID_330U:
ctl->demod = XC3028_FE_CHINA;
ctl->fname = XC2028_DEFAULT_FIRMWARE;
break;
default: default:
ctl->demod = XC3028_FE_OREN538; ctl->demod = XC3028_FE_OREN538;
} }
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "lgdt330x.h" #include "lgdt330x.h"
#include "zl10353.h" #include "zl10353.h"
#include "s5h1409.h"
#ifdef EM28XX_DRX397XD_SUPPORT #ifdef EM28XX_DRX397XD_SUPPORT
#include "drx397xD.h" #include "drx397xD.h"
#endif #endif
...@@ -232,6 +233,15 @@ static struct zl10353_config em28xx_zl10353_with_xc3028 = { ...@@ -232,6 +233,15 @@ static struct zl10353_config em28xx_zl10353_with_xc3028 = {
.if2 = 45600, .if2 = 45600,
}; };
static struct s5h1409_config em28xx_s5h1409_with_xc3028 = {
.demod_address = 0x32 >> 1,
.output_mode = S5H1409_PARALLEL_OUTPUT,
.gpio = S5H1409_GPIO_OFF,
.inversion = S5H1409_INVERSION_OFF,
.status_mode = S5H1409_DEMODLOCKING,
.mpeg_timing = S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK
};
#ifdef EM28XX_DRX397XD_SUPPORT #ifdef EM28XX_DRX397XD_SUPPORT
/* [TODO] djh - not sure yet what the device config needs to contain */ /* [TODO] djh - not sure yet what the device config needs to contain */
static struct drx397xD_config em28xx_drx397xD_with_xc3028 = { static struct drx397xD_config em28xx_drx397xD_with_xc3028 = {
...@@ -412,7 +422,6 @@ static int dvb_init(struct em28xx *dev) ...@@ -412,7 +422,6 @@ static int dvb_init(struct em28xx *dev)
case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850: case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850:
case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950: case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
case EM2880_BOARD_PINNACLE_PCTV_HD_PRO: case EM2880_BOARD_PINNACLE_PCTV_HD_PRO:
case EM2883_BOARD_KWORLD_HYBRID_A316:
case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600: case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600:
dvb->frontend = dvb_attach(lgdt330x_attach, dvb->frontend = dvb_attach(lgdt330x_attach,
&em2880_lgdt3303_dev, &em2880_lgdt3303_dev,
...@@ -433,6 +442,15 @@ static int dvb_init(struct em28xx *dev) ...@@ -433,6 +442,15 @@ static int dvb_init(struct em28xx *dev)
goto out_free; goto out_free;
} }
break; break;
case EM2883_BOARD_KWORLD_HYBRID_330U:
dvb->frontend = dvb_attach(s5h1409_attach,
&em28xx_s5h1409_with_xc3028,
&dev->i2c_adap);
if (attach_xc3028(0x61, dev) < 0) {
result = -EINVAL;
goto out_free;
}
break;
case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2: case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
#ifdef EM28XX_DRX397XD_SUPPORT #ifdef EM28XX_DRX397XD_SUPPORT
/* We don't have the config structure properly populated, so /* We don't have the config structure properly populated, so
......
...@@ -1956,6 +1956,7 @@ static struct video_device *em28xx_vdev_init(struct em28xx *dev, ...@@ -1956,6 +1956,7 @@ static struct video_device *em28xx_vdev_init(struct em28xx *dev,
int em28xx_register_analog_devices(struct em28xx *dev) int em28xx_register_analog_devices(struct em28xx *dev)
{ {
u8 val;
int ret; int ret;
printk(KERN_INFO "%s: v4l2 driver version %d.%d.%d\n", printk(KERN_INFO "%s: v4l2 driver version %d.%d.%d\n",
...@@ -1983,7 +1984,8 @@ int em28xx_register_analog_devices(struct em28xx *dev) ...@@ -1983,7 +1984,8 @@ int em28xx_register_analog_devices(struct em28xx *dev)
/* enable vbi capturing */ /* enable vbi capturing */
/* em28xx_write_reg(dev, EM28XX_R0E_AUDIOSRC, 0xc0); audio register */ /* em28xx_write_reg(dev, EM28XX_R0E_AUDIOSRC, 0xc0); audio register */
/* em28xx_write_reg(dev, EM28XX_R0F_XCLK, 0x80); clk register */ val = (u8)em28xx_read_reg(dev, EM28XX_R0F_XCLK);
em28xx_write_reg(dev, EM28XX_R0F_XCLK, (EM28XX_XCLK_AUDIO_UNMUTE | val));
em28xx_write_reg(dev, EM28XX_R11_VINCTRL, 0x51); em28xx_write_reg(dev, EM28XX_R11_VINCTRL, 0x51);
em28xx_set_outfmt(dev); em28xx_set_outfmt(dev);
......
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
#define EM2882_BOARD_KWORLD_VS_DVBT 54 #define EM2882_BOARD_KWORLD_VS_DVBT 54
#define EM2882_BOARD_TERRATEC_HYBRID_XS 55 #define EM2882_BOARD_TERRATEC_HYBRID_XS 55
#define EM2882_BOARD_PINNACLE_HYBRID_PRO 56 #define EM2882_BOARD_PINNACLE_HYBRID_PRO 56
#define EM2883_BOARD_KWORLD_HYBRID_A316 57 #define EM2883_BOARD_KWORLD_HYBRID_330U 57
#define EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU 58 #define EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU 58
#define EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850 60 #define EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850 60
#define EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2 61 #define EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2 61
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment