From patchwork Mon May 18 08:25:49 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Wong X-Patchwork-Id: 24416 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 n4I8PwOD021528 for ; Mon, 18 May 2009 08:25:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752334AbZERIZz (ORCPT ); Mon, 18 May 2009 04:25:55 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753813AbZERIZz (ORCPT ); Mon, 18 May 2009 04:25:55 -0400 Received: from mail-px0-f191.google.com ([209.85.216.191]:37331 "EHLO mail-px0-f191.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752334AbZERIZt (ORCPT ); Mon, 18 May 2009 04:25:49 -0400 Received: by pxi29 with SMTP id 29so1853874pxi.33 for ; Mon, 18 May 2009 01:25:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:cc:content-type; bh=FEg1QH+W8GhJZLmWF86MR/EhVGN2zSJgCV838vjJpoo=; b=M9knupUSQHV5jYE/1hiGeL13XjgbPHtnfjOu+b331L0Bao+VtG+UHTQjPmLXKSmFWQ zds4khBNCb6Jb5OOe4MkXDm+MgmdpO0l2cSfYtBhh0leNJTxUYTg3/AwnYrkILC+p7lO q2EiD5WoLjFx39CSoGL/Xku9AWme7dUEI3KF4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=QyH9RlnYQEd0qECmMFR17TeyMmBtCWB1H5QggXu2pGeTbV63eUmT1FZis8k26Uw+8M kajRQuxVBYHu/l+XThRzHPTa3bDFt3A/wtsSkziYyS4KOwDPxhjJf0RH5BNYJ3tbC1Dt 3AyojaAtnYgyi6GGAOTKzOzqIxcHaPI4S4PHg= MIME-Version: 1.0 Received: by 10.114.159.5 with SMTP id h5mr10927518wae.36.1242635149813; Mon, 18 May 2009 01:25:49 -0700 (PDT) Date: Mon, 18 May 2009 16:25:49 +0800 Message-ID: <15ed362e0905180125v649545f0t204ca843e72d2758@mail.gmail.com> Subject: [PATCH] cx23885: support for card Mygica X8506 DMB-TH From: David Wong To: linux-media@vger.kernel.org Cc: Mauro Carvalho Chehab Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patch add cx23885 support for card "Mygica X8506 DMB-TH". It should work on "Magic-Pro ProHDTV Extreme" as well, as they are same hardware with different branding. Cheers, David T.L. Wong diff -r c9e2fbabed11 linux/drivers/media/video/cx23885/cx23885-cards.c --- a/linux/drivers/media/video/cx23885/cx23885-cards.c Mon May 18 15:14:03 2009 +0800 +++ b/linux/drivers/media/video/cx23885/cx23885-cards.c Mon May 18 15:53:25 2009 +0800 @@ -198,6 +198,10 @@ .name = "Hauppauge WinTV-HVR1210", .portc = CX23885_MPEG_DVB, }, + [CX23885_BOARD_MYGICA_X8506] = { + .name = "Mygica X8506 DMB-TH", + .portb = CX23885_MPEG_DVB, + }, }; const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards); @@ -317,6 +321,10 @@ .subvendor = 0x0070, .subdevice = 0x2295, .card = CX23885_BOARD_HAUPPAUGE_HVR1210, + }, { + .subvendor = 0x14f1, + .subdevice = 0x8651, + .card = CX23885_BOARD_MYGICA_X8506, }, }; const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids); @@ -707,6 +715,15 @@ mdelay(20); cx23885_gpio_set(dev, GPIO_9); break; + case CX23885_BOARD_MYGICA_X8506: + /* GPIO-1 reset XC5000 */ + /* GPIO-2 reset LGS8GL5 */ + cx_set(GP0_IO, 0x00060000); + cx_clear(GP0_IO, 0x00000006); + mdelay(100); + cx_set(GP0_IO, 0x00060006); + mdelay(100); + break; } } @@ -810,6 +827,11 @@ ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */ ts2->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; break; + case CX23885_BOARD_MYGICA_X8506: + ts1->gen_ctrl_val = 0x5; /* Parallel */ + ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */ + ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; + break; case CX23885_BOARD_HAUPPAUGE_HVR1250: case CX23885_BOARD_HAUPPAUGE_HVR1500: case CX23885_BOARD_HAUPPAUGE_HVR1500Q: diff -r c9e2fbabed11 linux/drivers/media/video/cx23885/cx23885-dvb.c --- a/linux/drivers/media/video/cx23885/cx23885-dvb.c Mon May 18 15:14:03 2009 +0800 +++ b/linux/drivers/media/video/cx23885/cx23885-dvb.c Mon May 18 15:53:25 2009 +0800 @@ -50,6 +50,7 @@ #include "lnbh24.h" #include "cx24116.h" #include "cimax2.h" +#include "lgs8gxx.h" #include "netup-eeprom.h" #include "netup-init.h" #include "lgdt3305.h" @@ -417,10 +418,29 @@ .demod_address = 0x05, }; +static struct lgs8gxx_config mygica_x8506_lgs8gl5_config = { + .prod = LGS8GXX_PROD_LGS8GL5, + .demod_address = 0x19, + .serial_ts = 0, + .ts_clk_pol = 1, + .ts_clk_gated = 1, + .if_clk_freq = 30400, /* 30.4 MHz */ + .if_freq = 5380, /* 5.38 MHz */ + .if_neg_center = 1, + .ext_adc = 0, + .adc_signed = 0, + .if_neg_edge = 0, +}; + +static struct xc5000_config mygica_x8506_xc5000_config = { + .i2c_address = 0x61, + .if_khz = 5380, +}; + static int dvb_register(struct cx23885_tsport *port) { struct cx23885_dev *dev = port->dev; - struct cx23885_i2c *i2c_bus = NULL; + struct cx23885_i2c *i2c_bus = NULL, *i2c_bus2 = NULL; struct videobuf_dvb_frontend *fe0; int ret; @@ -742,6 +762,19 @@ break; } break; + case CX23885_BOARD_MYGICA_X8506: + i2c_bus = &dev->i2c_bus[0]; + i2c_bus2 = &dev->i2c_bus[1]; + fe0->dvb.frontend = dvb_attach(lgs8gxx_attach, + &mygica_x8506_lgs8gl5_config, + &i2c_bus->i2c_adap); + if (fe0->dvb.frontend != NULL) { + dvb_attach(xc5000_attach, + fe0->dvb.frontend, + &i2c_bus2->i2c_adap, + &mygica_x8506_xc5000_config); + } + break; default: printk(KERN_INFO "%s: The frontend of your DVB/ATSC card " " isn't supported yet\n", diff -r c9e2fbabed11 linux/drivers/media/video/cx23885/cx23885.h --- a/linux/drivers/media/video/cx23885/cx23885.h Mon May 18 15:14:03 2009 +0800 +++ b/linux/drivers/media/video/cx23885/cx23885.h Mon May 18 15:53:25 2009 +0800 @@ -76,6 +76,7 @@ #define CX23885_BOARD_HAUPPAUGE_HVR1275 19 #define CX23885_BOARD_HAUPPAUGE_HVR1255 20 #define CX23885_BOARD_HAUPPAUGE_HVR1210 21 +#define CX23885_BOARD_MYGICA_X8506 22 #define GPIO_0 0x00000001 #define GPIO_1 0x00000002