From patchwork Mon Apr 11 22:57:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?M=C3=A1rcio_Alves?= X-Patchwork-Id: 699031 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3BMvJ1q014635 for ; Mon, 11 Apr 2011 22:57:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752242Ab1DKW5R (ORCPT ); Mon, 11 Apr 2011 18:57:17 -0400 Received: from mail-qy0-f174.google.com ([209.85.216.174]:52384 "EHLO mail-qy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751844Ab1DKW5Q (ORCPT ); Mon, 11 Apr 2011 18:57:16 -0400 Received: by qyk7 with SMTP id 7so1635630qyk.19 for ; Mon, 11 Apr 2011 15:57:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=KkZ4HRFRo4M/vT5RQ7dBrwMt65LefI0tweTPgGZeGAw=; b=U/ZiuUP5+yvYlJN+QQXwR9Hp+BwFcO6+V5B+QcXMs9t/6llAlCkt91ZC1ycrhzRmpu cNLm3hsUXJ+lcH6GS9/aIdQVAzSQAq2POPG4B9kRkt9IQ29MDwOUGimQS7ecMM1ZILGK J0cAax7Z1WbODOEBjItSB8GhzX6JU/bmskhaA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=VNKZcHqP7JTzrxYeMwI439NoVrUYfs7uiE9S3fdANmtb+pao4TJW0k5hsa+itLyiOT ql7CslY67bFT+au5RMuIGUPZPqRHiKRC7W6xclQk9vgizvSk00N0VrJBcze5rAJq4/ab D8Zx2jxtAYngEs8KMCkbtYZ6ti7ZW/bzXinao= MIME-Version: 1.0 Received: by 10.229.40.9 with SMTP id i9mr4720709qce.57.1302562635129; Mon, 11 Apr 2011 15:57:15 -0700 (PDT) Received: by 10.229.188.136 with HTTP; Mon, 11 Apr 2011 15:57:15 -0700 (PDT) In-Reply-To: References: Date: Mon, 11 Apr 2011 19:57:15 -0300 Message-ID: Subject: cx231xx: add support for Kworld.. From: =?ISO-8859-1?Q?M=E1rcio_Alves?= To: linux-media@vger.kernel.org Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 11 Apr 2011 22:57:19 +0000 (UTC) patch to cx231xx: add support for Kworld UB430 Signed-off-by: Márcio A Alves diff -upr ../new_build2/linux//drivers/media/dvb/dvb-usb/dvb-usb-ids.h linux//drivers/media/dvb/dvb-usb/dvb-usb-ids.h --- ../new_build2/linux//drivers/media/dvb/dvb-usb/dvb-usb-ids.h 2011-02-28 01:45:23.000000000 -0300 +++ linux//drivers/media/dvb/dvb-usb/dvb-usb-ids.h 2011-04-11 14:23:31.836858001 -0300 @@ -125,6 +125,7 @@ #define USB_PID_GRANDTEC_DVBT_USB_COLD 0x0fa0 #define USB_PID_GRANDTEC_DVBT_USB_WARM 0x0fa1 #define USB_PID_INTEL_CE9500 0x9500 +#define USB_PID_KWORLD_UB430 0xe424 #define USB_PID_KWORLD_399U 0xe399 #define USB_PID_KWORLD_399U_2 0xe400 #define USB_PID_KWORLD_395U 0xe396 diff -upr ../new_build2/linux//drivers/media/video/cx231xx/cx231xx-cards.c linux//drivers/media/video/cx231xx/cx231xx-cards.c --- ../new_build2/linux//drivers/media/video/cx231xx/cx231xx-cards.c 2011-02-25 01:45:17.000000000 -0300 +++ linux//drivers/media/video/cx231xx/cx231xx-cards.c 2011-04-11 15:15:42.776857999 -0300 @@ -401,6 +401,44 @@ struct cx231xx_board cx231xx_boards[] = .gpio = NULL, } }, }, + [CX231XX_BOARD_KWORLD_UB430_USB_HYBRID] = { + .name = "Kworld UB430 USB Hybrid", + .tuner_type = TUNER_NXP_TDA18271, + .tuner_addr = 0x60, + .decoder = CX231XX_AVDECODER, + .output_mode = OUT_MODE_VIP11, + .demod_xfer_mode = 0, + .ctl_pin_status_mask = 0xFFFFFFC4, + .agc_analog_digital_select_gpio = 0x11, /* According with PV cxPolaris.inf file */ + .tuner_sif_gpio = -1, + .tuner_scl_gpio = -1, + .tuner_sda_gpio = -1, + .gpio_pin_status_mask = 0x4001000, + .tuner_i2c_master = 2, + .demod_i2c_master = 1, + .ir_i2c_master = 2, + .has_dvb = 1, + .demod_addr = 0x10, + .norm = V4L2_STD_PAL_M, + .input = {{ + .type = CX231XX_VMUX_TELEVISION, + .vmux = CX231XX_VIN_3_1, + .amux = CX231XX_AMUX_VIDEO, + .gpio = NULL, + }, { + .type = CX231XX_VMUX_COMPOSITE1, + .vmux = CX231XX_VIN_2_1, + .amux = CX231XX_AMUX_LINE_IN, + .gpio = NULL, + }, { + .type = CX231XX_VMUX_SVIDEO, + .vmux = CX231XX_VIN_1_1 | + (CX231XX_VIN_1_2 << 8) | + CX25840_SVIDEO_ON, + .amux = CX231XX_AMUX_LINE_IN, + .gpio = NULL, + } }, + }, [CX231XX_BOARD_PV_PLAYTV_USB_HYBRID] = { .name = "Pixelview PlayTV USB Hybrid", .tuner_type = TUNER_NXP_TDA18271, @@ -500,6 +538,8 @@ struct usb_device_id cx231xx_id_table[] .driver_info = CX231XX_BOARD_PV_PLAYTV_USB_HYBRID}, {USB_DEVICE(USB_VID_PIXELVIEW, 0x5014), .driver_info = CX231XX_BOARD_PV_XCAPTURE_USB}, + {USB_DEVICE(0x1b80, 0xe424), + .driver_info = CX231XX_BOARD_KWORLD_UB430_USB_HYBRID}, {}, }; @@ -534,12 +574,13 @@ int cx231xx_tuner_callback(void *ptr, in case TDA18271_CALLBACK_CMD_AGC_ENABLE: if (dev->model == CX231XX_BOARD_PV_PLAYTV_USB_HYBRID) rc = cx231xx_set_agc_analog_digital_mux_select(dev, arg); + break; default: rc = -EINVAL; break; } - } + } return rc; } EXPORT_SYMBOL_GPL(cx231xx_tuner_callback); diff -upr ../new_build2/linux//drivers/media/video/cx231xx/cx231xx-dvb.c linux//drivers/media/video/cx231xx/cx231xx-dvb.c --- ../new_build2/linux//drivers/media/video/cx231xx/cx231xx-dvb.c 2011-01-17 01:45:24.000000000 -0300 +++ linux//drivers/media/video/cx231xx/cx231xx-dvb.c 2011-04-11 14:16:15.986858003 -0300 @@ -703,6 +703,30 @@ static int dvb_init(struct cx231xx *dev) &hcw_tda18271_config); break; + case CX231XX_BOARD_KWORLD_UB430_USB_HYBRID: + + printk(KERN_INFO "%s: looking for demod on i2c bus: %d\n", + __func__, i2c_adapter_id(&dev->i2c_bus[dev->board.tuner_i2c_master].i2c_adap)); + + dev->dvb->frontend = dvb_attach(mb86a20s_attach, + &pv_mb86a20s_config, + &dev->i2c_bus[dev->board.demod_i2c_master].i2c_adap); + + if (dev->dvb->frontend == NULL) { + printk(DRIVER_NAME + ": Failed to attach mb86a20s demod\n"); + result = -EINVAL; + goto out_free; + } + + /* define general-purpose callback pointer */ + dvb->frontend->callback = cx231xx_tuner_callback; + + dvb_attach(tda18271_attach, dev->dvb->frontend, + 0x60, &dev->i2c_bus[dev->board.tuner_i2c_master].i2c_adap, + &pv_tda18271_config); + break; + case CX231XX_BOARD_PV_PLAYTV_USB_HYBRID: printk(KERN_INFO "%s: looking for demod on i2c bus: %d\n", diff -upr ../new_build2/linux//drivers/media/video/cx231xx/cx231xx.h linux//drivers/media/video/cx231xx/cx231xx.h --- ../new_build2/linux//drivers/media/video/cx231xx/cx231xx.h 2011-03-11 13:25:49.000000000 -0300 +++ linux//drivers/media/video/cx231xx/cx231xx.h 2011-04-11 14:20:30.616858003 -0300 @@ -64,7 +64,8 @@ #define CX231XX_BOARD_HAUPPAUGE_EXETER 8 #define CX231XX_BOARD_HAUPPAUGE_USBLIVE2 9 #define CX231XX_BOARD_PV_PLAYTV_USB_HYBRID 10 -#define CX231XX_BOARD_PV_XCAPTURE_USB 11 +#define CX231XX_BOARD_KWORLD_UB430_USB_HYBRID 11 +#define CX231XX_BOARD_PV_XCAPTURE_USB 12 /* Limits minimum and default number of buffers */ #define CX231XX_MIN_BUF 4