public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: "istvan_v@mailbox.hu" <istvan_v@mailbox.hu>
Cc: Devin Heitmueller <dheitmueller@kernellabs.com>,
	Dmitri Belimov <d.belimov@gmail.com>,
	thunder.m@email.cz,
	Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: XC4000: added card_type
Date: Fri, 03 Jun 2011 10:17:07 -0300	[thread overview]
Message-ID: <4DE8DED3.1010809@redhat.com> (raw)
In-Reply-To: <4DE8D5AC.7060002@mailbox.hu>

Em 03-06-2011 09:38, istvan_v@mailbox.hu escreveu:
> This patch adds support for selecting a card type in struct
> xc4000_config, to allow for implementing some card specific code
> in the driver.

Hi Istvan,

Please send your patches to linux-media@vger.kernel.org. The linux-dvb
ML is obsolete. I didn't remove it from the server just to avoid loosing
the mail history.

With respect to this specific patch, as Devin pointed, the proper way is to
set the configurable data via the boards entries, and not inside xc4000.

So, feel free to send us patches to cx88 and other bridge drivers whose
boards require different configs, in order to work with xc4000.

Thanks,
Mauro

> 
> Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
> 
> 
> xc4000_card_type.patch
> 
> 
> diff -uNr xc4000_orig/drivers/media/common/tuners/xc4000.c xc4000/drivers/media/common/tuners/xc4000.c
> --- xc4000_orig/drivers/media/common/tuners/xc4000.c	2011-06-03 11:54:19.000000000 +0200
> +++ xc4000/drivers/media/common/tuners/xc4000.c	2011-06-03 14:32:59.000000000 +0200
> @@ -85,6 +85,7 @@
>  	u32	bandwidth;
>  	u8	video_standard;
>  	u8	rf_mode;
> +	u8	card_type;
>  	u8	ignore_i2c_write_errors;
>   /*	struct xc2028_ctrl	ctrl; */
>  	struct firmware_properties cur_fw;
> @@ -1426,6 +1427,16 @@
>  	int	instance;
>  	u16	id = 0;
>  
> +	if (cfg->card_type != XC4000_CARD_GENERIC) {
> +		if (cfg->card_type == XC4000_CARD_WINFAST_CX88) {
> +			cfg->i2c_address = 0x61;
> +			cfg->if_khz = 4560;
> +		} else {			/* default to PCTV 340E */
> +			cfg->i2c_address = 0x61;
> +			cfg->if_khz = 5400;
> +		}
> +	}
> +
>  	dprintk(1, "%s(%d-%04x)\n", __func__,
>  		i2c ? i2c_adapter_id(i2c) : -1,
>  		cfg ? cfg->i2c_address : -1);
> @@ -1435,6 +1446,8 @@
>  	instance = hybrid_tuner_request_state(struct xc4000_priv, priv,
>  					      hybrid_tuner_instance_list,
>  					      i2c, cfg->i2c_address, "xc4000");
> +	if (cfg->card_type != XC4000_CARD_GENERIC)
> +		priv->card_type = cfg->card_type;
>  	switch (instance) {
>  	case 0:
>  		goto fail;
> @@ -1450,7 +1463,7 @@
>  		break;
>  	}
>  
> -	if (priv->if_khz == 0) {
> +	if (cfg->if_khz != 0) {
>  		/* If the IF hasn't been set yet, use the value provided by
>  		   the caller (occurs in hybrid devices where the analog
>  		   call to xc4000_attach occurs before the digital side) */
> diff -uNr xc4000_orig/drivers/media/common/tuners/xc4000.h xc4000/drivers/media/common/tuners/xc4000.h
> --- xc4000_orig/drivers/media/common/tuners/xc4000.h	2011-06-03 11:54:19.000000000 +0200
> +++ xc4000/drivers/media/common/tuners/xc4000.h	2011-06-03 14:29:32.000000000 +0200
> @@ -27,8 +27,13 @@
>  struct dvb_frontend;
>  struct i2c_adapter;
>  
> +#define XC4000_CARD_GENERIC		0
> +#define XC4000_CARD_PCTV_340E		1
> +#define XC4000_CARD_WINFAST_CX88	2
> +
>  struct xc4000_config {
> -	u8	i2c_address;
> +	u8	card_type;	/* if card type is not generic, all other */
> +	u8	i2c_address;	/* parameters are automatically set */
>  	u32	if_khz;
>  };
>  


  parent reply	other threads:[~2011-06-03 13:17 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-08 14:54 [linux-dvb] XC4000 patches for kernel 2.6.37.2 Mirek Slugeň
2011-05-31  2:48 ` Dmitri Belimov
2011-05-31  3:49   ` Devin Heitmueller
2011-05-31  7:43     ` Dmitri Belimov
2011-06-02 10:52       ` Devin Heitmueller
2011-06-02 14:41         ` Mauro Carvalho Chehab
2011-06-02 15:17           ` Devin Heitmueller
2011-06-02 16:35             ` Mauro Carvalho Chehab
2011-06-03  1:41           ` Dmitri Belimov
2011-06-03 12:12             ` Mauro Carvalho Chehab
2011-06-02 15:53         ` Mohammad Bahathir Hashim
2011-06-02 17:05           ` Mauro Carvalho Chehab
2011-06-03  3:54             ` Mohammad Bahathir Hashim
     [not found]         ` <4DE8D5AC.7060002@mailbox.hu>
2011-06-03 12:46           ` [linux-dvb] XC4000: added card_type Devin Heitmueller
     [not found]             ` <4DE8DEC6.6080008@mailbox.hu>
2011-06-03 14:00               ` Mauro Carvalho Chehab
2011-06-03 14:22                 ` istvan_v
2011-06-03 13:17           ` Mauro Carvalho Chehab [this message]
2011-06-03 13:55         ` XC4000: updated standards table istvan_v
2011-06-03 15:17         ` XC4000: added support for 7 MHz DVB-T istvan_v
2011-06-03 15:23         ` XC4000: added mutex istvan_v
2011-06-03 15:27         ` XC4000: fixed frequency error istvan_v
2011-06-04 14:48         ` XC4000: added firmware_name parameter istvan_v
2011-06-04 14:52         ` XC4000: simplified seek_firmware() istvan_v
2011-06-04 14:56         ` XC4000: simplified load_scode istvan_v
2011-06-04 14:59         ` XC4000: check_firmware() cleanup istvan_v
2011-06-04 15:03         ` XC4000: implemented power management istvan_v
2011-06-04 15:04         ` XC4000: firmware initialization istvan_v
2011-06-04 15:08         ` XC4000: debug message improvements istvan_v
2011-06-04 15:12         ` XC4000: setting registers istvan_v
2011-06-05 12:05           ` Mauro Carvalho Chehab
2011-06-05 12:28             ` Istvan Varga
2011-06-05 12:56               ` Mauro Carvalho Chehab
2011-06-05 14:30                 ` Istvan Varga
2011-06-04 15:15         ` XC4000: added audio_std module parameter istvan_v
2011-06-04 15:17         ` XC4000: implemented analog TV and radio istvan_v
2011-06-04 15:18         ` XC4000: xc_tune_channel() cleanup istvan_v
2011-06-04 15:21         ` XC4000: removed redundant tuner reset istvan_v
2011-06-04 15:25         ` XC4000: detect XC4100 istvan_v
2011-06-02  4:58     ` [linux-dvb] XC4000 patches for kernel 2.6.37.2 Mohammad Bahathir Hashim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DE8DED3.1010809@redhat.com \
    --to=mchehab@redhat.com \
    --cc=d.belimov@gmail.com \
    --cc=dheitmueller@kernellabs.com \
    --cc=istvan_v@mailbox.hu \
    --cc=linux-media@vger.kernel.org \
    --cc=thunder.m@email.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox