From patchwork Fri Jan 16 14:25:47 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Krakora X-Patchwork-Id: 2819 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n0GEM5K1021175 for ; Fri, 16 Jan 2009 06:22:05 -0800 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936195AbZAPOZx (ORCPT ); Fri, 16 Jan 2009 09:25:53 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S935983AbZAPOZw (ORCPT ); Fri, 16 Jan 2009 09:25:52 -0500 Received: from ey-out-2122.google.com ([74.125.78.24]:15868 "EHLO ey-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935902AbZAPOZt (ORCPT ); Fri, 16 Jan 2009 09:25:49 -0500 Received: by ey-out-2122.google.com with SMTP id 22so306920eye.37 for ; Fri, 16 Jan 2009 06:25:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=axzDFsaAX6JHYo5OAY9DVa9Jg9A8YNTWA/h92YiE3xo=; b=OuRMWKk5xF9gpyJDv/4tdaGEoqaQUuNiQnczbOf1elS61F5Lx3N8ZCemPzX0aWO3/a TGNs/7OPqQQOUFmXTgwvWaE3wjfyES/ZbSTt0GkqtOPXtu4LKrJ1kfrWKHWsGI55LPIU LgBmv5rDtgBwKeMr1EWF0vK6x1k5nEn+Bs0U0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=OwTOLePPoV+taczkxl3NbW8mSMSD0B/FDZKp/nr3dOMg8ZbxTrD1C5bSV3UyBDGuyK usPiQoXH9kZ81ga7zSs/cBkozva7lQnR/XlNushCWNXTkrOREv5xS4NCG6aFqmdCI0w5 52T31J6weg9e0Ui1FU32cgQZ2zGwXRWCjIjAE= Received: by 10.210.87.14 with SMTP id k14mr3214204ebb.159.1232115947823; Fri, 16 Jan 2009 06:25:47 -0800 (PST) Received: by 10.210.128.10 with HTTP; Fri, 16 Jan 2009 06:25:47 -0800 (PST) Message-ID: Date: Fri, 16 Jan 2009 09:25:47 -0500 From: "Robert Krakora" To: linux-media@vger.kernel.org Subject: [PATCH 3/4] em28xx: Fix for KWorld 330U Board In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline References: X-Google-Sender-Auth: 25e0ffb5c971f52e Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org em28xx: Fix for KWorld 330U Board From: Robert Krakora Fix for KWorld 330U Board Many thanks to Devin and Mauro!!! Priority: normal Signed-off-by: Robert Krakora diff -r 6896782d783d linux/drivers/media/video/em28xx/em28xx-cards.c --- a/linux/drivers/media/video/em28xx/em28xx-cards.c Wed Jan 14 10:06:12 2009 -0200 +++ b/linux/drivers/media/video/em28xx/em28xx-cards.c Wed Jan 14 12:46:43 2009 -0500 @@ -114,6 +114,18 @@ { -1, -1, -1, -1}, }; #endif + +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 */ static struct em28xx_reg_seq default_tuner_gpio[] = { @@ -1242,29 +1254,33 @@ .gpio = hauppauge_wintv_hvr_900_analog, } }, }, - [EM2883_BOARD_KWORLD_HYBRID_A316] = { + [EM2883_BOARD_KWORLD_HYBRID_330U] = { .name = "Kworld PlusTV HD Hybrid 330", .tuner_type = TUNER_XC2028, .tuner_gpio = default_tuner_gpio, .decoder = EM28XX_TVP5150, .mts_firmware = 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 = { { .type = EM28XX_VMUX_TELEVISION, .vmux = TVP5150_COMPOSITE0, .amux = EM28XX_AMUX_VIDEO, - .gpio = default_analog, + .gpio = kworld_330u_analog, + .aout = EM28XX_AOUT_PCM_IN | EM28XX_AOUT_PCM_STEREO, }, { .type = EM28XX_VMUX_COMPOSITE1, .vmux = TVP5150_COMPOSITE1, .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, .vmux = TVP5150_SVIDEO, .amux = EM28XX_AMUX_LINE_IN, - .gpio = hauppauge_wintv_hvr_900_analog, + .gpio = kworld_330u_analog, } }, }, [EM2820_BOARD_COMPRO_VIDEOMATE_FORYOU] = { @@ -1318,7 +1334,7 @@ .driver_info = EM2880_BOARD_KWORLD_DVB_310U }, #endif { USB_DEVICE(0xeb1a, 0xa316), - .driver_info = EM2883_BOARD_KWORLD_HYBRID_A316 }, + .driver_info = EM2883_BOARD_KWORLD_HYBRID_330U }, { USB_DEVICE(0xeb1a, 0xe320), .driver_info = EM2880_BOARD_MSI_DIGIVOX_AD_II }, { USB_DEVICE(0xeb1a, 0xe323), @@ -1594,6 +1610,10 @@ case EM2880_BOARD_PINNACLE_PCTV_HD_PRO: /* FIXME: Better to specify the needed IF */ ctl->demod = XC3028_FE_DEFAULT; + break; + case EM2883_BOARD_KWORLD_HYBRID_330U: + ctl->demod = XC3028_FE_CHINA; + ctl->fname = XC2028_DEFAULT_FIRMWARE; break; default: ctl->demod = XC3028_FE_OREN538; diff -r 6896782d783d linux/drivers/media/video/em28xx/em28xx-dvb.c --- a/linux/drivers/media/video/em28xx/em28xx-dvb.c Wed Jan 14 10:06:12 2009 -0200 +++ b/linux/drivers/media/video/em28xx/em28xx-dvb.c Wed Jan 14 12:47:00 2009 -0500 @@ -29,6 +29,7 @@ #include "lgdt330x.h" #include "zl10353.h" +#include "s5h1409.h" #ifdef EM28XX_DRX397XD_SUPPORT #include "drx397xD.h" #endif @@ -231,6 +232,15 @@ .no_tuner = 1, .parallel_ts = 1, .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 @@ -413,7 +423,6 @@ case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850: case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950: case EM2880_BOARD_PINNACLE_PCTV_HD_PRO: - case EM2883_BOARD_KWORLD_HYBRID_A316: case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600: dvb->frontend = dvb_attach(lgdt330x_attach, &em2880_lgdt3303_dev, @@ -434,6 +443,15 @@ goto out_free; } 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: #ifdef EM28XX_DRX397XD_SUPPORT /* We don't have the config structure properly populated, so diff -r 6896782d783d linux/drivers/media/video/em28xx/em28xx-video.c --- a/linux/drivers/media/video/em28xx/em28xx-video.c Wed Jan 14 10:06:12 2009 -0200 +++ b/linux/drivers/media/video/em28xx/em28xx-video.c Wed Jan 14 12:47:00 2009 -0500 @@ -2023,6 +2023,7 @@ int em28xx_register_analog_devices(struct em28xx *dev) { + u8 val; int ret; printk(KERN_INFO "%s: v4l2 driver version %d.%d.%d\n", @@ -2051,7 +2052,8 @@ /* enable vbi capturing */ /* 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); #endif --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -r 6896782d783d linux/drivers/media/video/em28xx/em28xx.h --- a/linux/drivers/media/video/em28xx/em28xx.h Wed Jan 14 10:06:12 2009 -0200 +++ b/linux/drivers/media/video/em28xx/em28xx.h Wed Jan 14 12:47:00 2009 -0500 @@ -95,7 +95,7 @@ #define EM2882_BOARD_KWORLD_VS_DVBT 54 #define EM2882_BOARD_TERRATEC_HYBRID_XS 55 #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 EM2883_BOARD_HAUPPAUGE_WINTV_HVR_850 60 #define EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2