aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/ttpci
diff options
context:
space:
mode:
authorAndreas Oberritter <obi@linuxtv.org>2005-09-09 16:02:30 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-09 16:57:38 -0400
commitcfbfce1566f11c0dbad8a16173f0448b0c78cecb (patch)
treecd090616b3a13c130b72238f92390761bda71e39 /drivers/media/dvb/ttpci
parent4ff4ac1beae58a2fea7ec2ad43d6c3b60d90ec61 (diff)
[PATCH] dvb: frontend: stv0299: pass i2c bus to pll callback
Pass a pointer to the i2c bus to the pll callbacks (stv0299 only). It was not possible to tell which i2c bus should be used if an adapter has multiple frontends on multiple i2c buses. Signed-off-by: Andreas Oberritter <obi@linuxtv.org> Signed-off-by: Johannes Stezenbach <js@linuxtv.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/dvb/ttpci')
-rw-r--r--drivers/media/dvb/ttpci/av7110.c10
-rw-r--r--drivers/media/dvb/ttpci/budget-av.c4
-rw-r--r--drivers/media/dvb/ttpci/budget-ci.c9
-rw-r--r--drivers/media/dvb/ttpci/budget-patch.c5
-rw-r--r--drivers/media/dvb/ttpci/budget.c5
5 files changed, 14 insertions, 19 deletions
diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c
index e4c6e87f6c5d..c91cf8958b38 100644
--- a/drivers/media/dvb/ttpci/av7110.c
+++ b/drivers/media/dvb/ttpci/av7110.c
@@ -1668,9 +1668,8 @@ static int alps_bsru6_set_symbol_rate(struct dvb_frontend* fe, u32 srate, u32 ra
1668 return 0; 1668 return 0;
1669} 1669}
1670 1670
1671static int alps_bsru6_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params) 1671static int alps_bsru6_pll_set(struct dvb_frontend* fe, struct i2c_adapter *i2c, struct dvb_frontend_parameters* params)
1672{ 1672{
1673 struct av7110* av7110 = (struct av7110*) fe->dvb->priv;
1674 int ret; 1673 int ret;
1675 u8 data[4]; 1674 u8 data[4];
1676 u32 div; 1675 u32 div;
@@ -1687,7 +1686,7 @@ static int alps_bsru6_pll_set(struct dvb_frontend* fe, struct dvb_frontend_param
1687 1686
1688 if (params->frequency > 1530000) data[3] = 0xc0; 1687 if (params->frequency > 1530000) data[3] = 0xc0;
1689 1688
1690 ret = i2c_transfer(&av7110->i2c_adap, &msg, 1); 1689 ret = i2c_transfer(i2c, &msg, 1);
1691 if (ret != 1) 1690 if (ret != 1)
1692 return -EIO; 1691 return -EIO;
1693 return 0; 1692 return 0;
@@ -1751,9 +1750,8 @@ static u8 alps_bsbe1_inittab[] = {
1751 0xff, 0xff 1750 0xff, 0xff
1752}; 1751};
1753 1752
1754static int alps_bsbe1_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params) 1753static int alps_bsbe1_pll_set(struct dvb_frontend* fe, struct i2c_adapter *i2c, struct dvb_frontend_parameters* params)
1755{ 1754{
1756 struct av7110* av7110 = (struct av7110*) fe->dvb->priv;
1757 int ret; 1755 int ret;
1758 u8 data[4]; 1756 u8 data[4];
1759 u32 div; 1757 u32 div;
@@ -1768,7 +1766,7 @@ static int alps_bsbe1_pll_set(struct dvb_frontend* fe, struct dvb_frontend_param
1768 data[2] = 0x80 | ((div & 0x18000) >> 10) | 4; 1766 data[2] = 0x80 | ((div & 0x18000) >> 10) | 4;
1769 data[3] = (params->frequency > 1530000) ? 0xE0 : 0xE4; 1767 data[3] = (params->frequency > 1530000) ? 0xE0 : 0xE4;
1770 1768
1771 ret = i2c_transfer(&av7110->i2c_adap, &msg, 1); 1769 ret = i2c_transfer(i2c, &msg, 1);
1772 return (ret != 1) ? -EIO : 0; 1770 return (ret != 1) ? -EIO : 0;
1773} 1771}
1774 1772
diff --git a/drivers/media/dvb/ttpci/budget-av.c b/drivers/media/dvb/ttpci/budget-av.c
index 9746d2bb916f..311be50b2fce 100644
--- a/drivers/media/dvb/ttpci/budget-av.c
+++ b/drivers/media/dvb/ttpci/budget-av.c
@@ -453,9 +453,9 @@ static int philips_su1278_ty_ci_set_symbol_rate(struct dvb_frontend *fe, u32 sra
453} 453}
454 454
455static int philips_su1278_ty_ci_pll_set(struct dvb_frontend *fe, 455static int philips_su1278_ty_ci_pll_set(struct dvb_frontend *fe,
456 struct i2c_adapter *i2c,
456 struct dvb_frontend_parameters *params) 457 struct dvb_frontend_parameters *params)
457{ 458{
458 struct budget_av *budget_av = (struct budget_av *) fe->dvb->priv;
459 u32 div; 459 u32 div;
460 u8 buf[4]; 460 u8 buf[4];
461 struct i2c_msg msg = {.addr = 0x61,.flags = 0,.buf = buf,.len = sizeof(buf) }; 461 struct i2c_msg msg = {.addr = 0x61,.flags = 0,.buf = buf,.len = sizeof(buf) };
@@ -481,7 +481,7 @@ static int philips_su1278_ty_ci_pll_set(struct dvb_frontend *fe,
481 else if (params->frequency < 2150000) 481 else if (params->frequency < 2150000)
482 buf[3] |= 0xC0; 482 buf[3] |= 0xC0;
483 483
484 if (i2c_transfer(&budget_av->budget.i2c_adap, &msg, 1) != 1) 484 if (i2c_transfer(i2c, &msg, 1) != 1)
485 return -EIO; 485 return -EIO;
486 return 0; 486 return 0;
487} 487}
diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c
index a1267054bc01..88f27a532163 100644
--- a/drivers/media/dvb/ttpci/budget-ci.c
+++ b/drivers/media/dvb/ttpci/budget-ci.c
@@ -548,9 +548,8 @@ static int alps_bsru6_set_symbol_rate(struct dvb_frontend *fe, u32 srate, u32 ra
548 return 0; 548 return 0;
549} 549}
550 550
551static int alps_bsru6_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) 551static int alps_bsru6_pll_set(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct dvb_frontend_parameters *params)
552{ 552{
553 struct budget_ci *budget_ci = (struct budget_ci *) fe->dvb->priv;
554 u8 buf[4]; 553 u8 buf[4];
555 u32 div; 554 u32 div;
556 struct i2c_msg msg = {.addr = 0x61,.flags = 0,.buf = buf,.len = sizeof(buf) }; 555 struct i2c_msg msg = {.addr = 0x61,.flags = 0,.buf = buf,.len = sizeof(buf) };
@@ -567,7 +566,7 @@ static int alps_bsru6_pll_set(struct dvb_frontend *fe, struct dvb_frontend_param
567 if (params->frequency > 1530000) 566 if (params->frequency > 1530000)
568 buf[3] = 0xc0; 567 buf[3] = 0xc0;
569 568
570 if (i2c_transfer(&budget_ci->budget.i2c_adap, &msg, 1) != 1) 569 if (i2c_transfer(i2c, &msg, 1) != 1)
571 return -EIO; 570 return -EIO;
572 return 0; 571 return 0;
573} 572}
@@ -669,9 +668,9 @@ static int philips_su1278_tt_set_symbol_rate(struct dvb_frontend *fe, u32 srate,
669} 668}
670 669
671static int philips_su1278_tt_pll_set(struct dvb_frontend *fe, 670static int philips_su1278_tt_pll_set(struct dvb_frontend *fe,
671 struct i2c_adapter *i2c,
672 struct dvb_frontend_parameters *params) 672 struct dvb_frontend_parameters *params)
673{ 673{
674 struct budget_ci *budget_ci = (struct budget_ci *) fe->dvb->priv;
675 u32 div; 674 u32 div;
676 u8 buf[4]; 675 u8 buf[4];
677 struct i2c_msg msg = {.addr = 0x60,.flags = 0,.buf = buf,.len = sizeof(buf) }; 676 struct i2c_msg msg = {.addr = 0x60,.flags = 0,.buf = buf,.len = sizeof(buf) };
@@ -697,7 +696,7 @@ static int philips_su1278_tt_pll_set(struct dvb_frontend *fe,
697 else if (params->frequency < 2150000) 696 else if (params->frequency < 2150000)
698 buf[3] |= 0xC0; 697 buf[3] |= 0xC0;
699 698
700 if (i2c_transfer(&budget_ci->budget.i2c_adap, &msg, 1) != 1) 699 if (i2c_transfer(i2c, &msg, 1) != 1)
701 return -EIO; 700 return -EIO;
702 return 0; 701 return 0;
703} 702}
diff --git a/drivers/media/dvb/ttpci/budget-patch.c b/drivers/media/dvb/ttpci/budget-patch.c
index 8142e26b47f5..b1f21ef0e3b3 100644
--- a/drivers/media/dvb/ttpci/budget-patch.c
+++ b/drivers/media/dvb/ttpci/budget-patch.c
@@ -353,9 +353,8 @@ static int alps_bsru6_set_symbol_rate(struct dvb_frontend* fe, u32 srate, u32 ra
353 return 0; 353 return 0;
354} 354}
355 355
356static int alps_bsru6_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params) 356static int alps_bsru6_pll_set(struct dvb_frontend* fe, struct i2c_adapter *i2c, struct dvb_frontend_parameters* params)
357{ 357{
358 struct budget_patch* budget = (struct budget_patch*) fe->dvb->priv;
359 u8 data[4]; 358 u8 data[4];
360 u32 div; 359 u32 div;
361 struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = data, .len = sizeof(data) }; 360 struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = data, .len = sizeof(data) };
@@ -370,7 +369,7 @@ static int alps_bsru6_pll_set(struct dvb_frontend* fe, struct dvb_frontend_param
370 369
371 if (params->frequency > 1530000) data[3] = 0xc0; 370 if (params->frequency > 1530000) data[3] = 0xc0;
372 371
373 if (i2c_transfer (&budget->i2c_adap, &msg, 1) != 1) return -EIO; 372 if (i2c_transfer(i2c, &msg, 1) != 1) return -EIO;
374 return 0; 373 return 0;
375} 374}
376 375
diff --git a/drivers/media/dvb/ttpci/budget.c b/drivers/media/dvb/ttpci/budget.c
index 9961917e8a7f..5552ef501996 100644
--- a/drivers/media/dvb/ttpci/budget.c
+++ b/drivers/media/dvb/ttpci/budget.c
@@ -332,9 +332,8 @@ static int alps_bsru6_set_symbol_rate(struct dvb_frontend* fe, u32 srate, u32 ra
332 return 0; 332 return 0;
333} 333}
334 334
335static int alps_bsru6_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params) 335static int alps_bsru6_pll_set(struct dvb_frontend* fe, struct i2c_adapter *i2c, struct dvb_frontend_parameters* params)
336{ 336{
337 struct budget* budget = (struct budget*) fe->dvb->priv;
338 u8 data[4]; 337 u8 data[4];
339 u32 div; 338 u32 div;
340 struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = data, .len = sizeof(data) }; 339 struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = data, .len = sizeof(data) };
@@ -349,7 +348,7 @@ static int alps_bsru6_pll_set(struct dvb_frontend* fe, struct dvb_frontend_param
349 348
350 if (params->frequency > 1530000) data[3] = 0xc0; 349 if (params->frequency > 1530000) data[3] = 0xc0;
351 350
352 if (i2c_transfer (&budget->i2c_adap, &msg, 1) != 1) return -EIO; 351 if (i2c_transfer(i2c, &msg, 1) != 1) return -EIO;
353 return 0; 352 return 0;
354} 353}
355 354