Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 61301
b: refs/heads/master
c: b208319
h: refs/heads/master
i:
  61299: aa55760
v: v3
  • Loading branch information
Michael Krufky authored and Mauro Carvalho Chehab committed Jul 18, 2007
1 parent 7c041e5 commit 4e2f8f3
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 73 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 56584c9ea9a6dcd672f97ebfeebc4903e8b903bc
refs/heads/master: b208319993ceff7ebfcc6bb914fe94d29e48a891
33 changes: 25 additions & 8 deletions trunk/drivers/media/video/mt20xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ static char *microtune_part[] = {
[ MT2050 ] = "MT2050",
};

struct microtune_priv {
unsigned int xogc;
unsigned int radio_if2;
};

// IsSpurInBand()?
static int mt2032_spurcheck(struct i2c_client *c,
int f1, int f2, int spectrum_from,int spectrum_to)
Expand Down Expand Up @@ -218,6 +223,7 @@ static void mt2032_set_if_freq(struct i2c_client *c, unsigned int rfin,
unsigned char buf[21];
int lint_try,ret,sel,lock=0;
struct tuner *t = i2c_get_clientdata(c);
struct microtune_priv *priv = t->priv;

tuner_dbg("mt2032_set_if_freq rfin=%d if1=%d if2=%d from=%d to=%d\n",
rfin,if1,if2,from,to);
Expand All @@ -227,7 +233,7 @@ static void mt2032_set_if_freq(struct i2c_client *c, unsigned int rfin,
i2c_master_recv(c,buf,21);

buf[0]=0;
ret=mt2032_compute_freq(c,rfin,if1,if2,from,to,&buf[1],&sel,t->xogc);
ret=mt2032_compute_freq(c,rfin,if1,if2,from,to,&buf[1],&sel,priv->xogc);
if (ret<0)
return;

Expand All @@ -251,10 +257,10 @@ static void mt2032_set_if_freq(struct i2c_client *c, unsigned int rfin,

tuner_dbg("mt2032: re-init PLLs by LINT\n");
buf[0]=7;
buf[1]=0x80 +8+t->xogc; // set LINT to re-init PLLs
buf[1]=0x80 +8+priv->xogc; // set LINT to re-init PLLs
i2c_master_send(c,buf,2);
mdelay(10);
buf[1]=8+t->xogc;
buf[1]=8+priv->xogc;
i2c_master_send(c,buf,2);
}

Expand Down Expand Up @@ -294,7 +300,8 @@ static void mt2032_set_tv_freq(struct i2c_client *c, unsigned int freq)
static void mt2032_set_radio_freq(struct i2c_client *c, unsigned int freq)
{
struct tuner *t = i2c_get_clientdata(c);
int if2 = t->radio_if2;
struct microtune_priv *priv = t->priv;
int if2 = priv->radio_if2;

// per Manual for FM tuning: first if center freq. 1085 MHz
mt2032_set_if_freq(c, freq * 1000 / 16,
Expand All @@ -305,6 +312,7 @@ static void mt2032_set_radio_freq(struct i2c_client *c, unsigned int freq)
static int mt2032_init(struct i2c_client *c)
{
struct tuner *t = i2c_get_clientdata(c);
struct microtune_priv *priv = t->priv;
unsigned char buf[21];
int ret,xogc,xok=0;

Expand Down Expand Up @@ -351,7 +359,7 @@ static int mt2032_init(struct i2c_client *c)
if (ret!=2)
tuner_warn("i2c i/o error: rc == %d (should be 2)\n",ret);
} while (xok != 1 );
t->xogc=xogc;
priv->xogc=xogc;

t->set_tv_freq = mt2032_set_tv_freq;
t->set_radio_freq = mt2032_set_radio_freq;
Expand Down Expand Up @@ -456,7 +464,8 @@ static void mt2050_set_tv_freq(struct i2c_client *c, unsigned int freq)
static void mt2050_set_radio_freq(struct i2c_client *c, unsigned int freq)
{
struct tuner *t = i2c_get_clientdata(c);
int if2 = t->radio_if2;
struct microtune_priv *priv = t->priv;
int if2 = priv->radio_if2;

mt2050_set_if_freq(c, freq * 1000 / 16, if2);
mt2050_set_antenna(c, radio_antenna);
Expand Down Expand Up @@ -488,21 +497,29 @@ static int mt2050_init(struct i2c_client *c)

int microtune_init(struct i2c_client *c)
{
struct microtune_priv *priv = NULL;
struct tuner *t = i2c_get_clientdata(c);
char *name;
unsigned char buf[21];
int company_code;

priv = kzalloc(sizeof(struct microtune_priv), GFP_KERNEL);
if (priv == NULL)
return -ENOMEM;
t->priv = priv;

priv->radio_if2 = 10700 * 1000; /* 10.7MHz - FM radio */

memset(buf,0,sizeof(buf));
t->set_tv_freq = NULL;
t->set_radio_freq = NULL;
t->standby = NULL;
if (t->std & V4L2_STD_525_60) {
tuner_dbg("pinnacle ntsc\n");
t->radio_if2 = 41300 * 1000;
priv->radio_if2 = 41300 * 1000;
} else {
tuner_dbg("pinnacle pal\n");
t->radio_if2 = 33300 * 1000;
priv->radio_if2 = 33300 * 1000;
}
name = "unknown";

Expand Down
Loading

0 comments on commit 4e2f8f3

Please sign in to comment.