diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-07-21 02:29:06 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-01-04 19:20:01 -0500 |
commit | 8c64f93285e81e7595d169aac9636d215ba5bcb7 (patch) | |
tree | 1894604611a771cd72adbe74b4106dd7dbd51e70 /drivers/media/common | |
parent | 01e0dafc6460096c0ef5a548fbc99b64a8b58ba4 (diff) |
[media] mt2063: Don't violate the DVB API
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common')
-rw-r--r-- | drivers/media/common/tuners/mt2063.c | 51 |
1 files changed, 9 insertions, 42 deletions
diff --git a/drivers/media/common/tuners/mt2063.c b/drivers/media/common/tuners/mt2063.c index c5e95ddd11f9..6c73bfd31c47 100644 --- a/drivers/media/common/tuners/mt2063.c +++ b/drivers/media/common/tuners/mt2063.c | |||
@@ -10,10 +10,6 @@ module_param(verbose, int, 0644); | |||
10 | 10 | ||
11 | /* Internal structures and types */ | 11 | /* Internal structures and types */ |
12 | 12 | ||
13 | /* FIXME: we probably don't need these new FE get/set property types for tuner */ | ||
14 | #define DVBFE_TUNER_SOFTWARE_SHUTDOWN 100 | ||
15 | #define DVBFE_TUNER_CLEAR_POWER_MASKBITS 101 | ||
16 | |||
17 | /* FIXME: Those two error codes need conversion*/ | 13 | /* FIXME: Those two error codes need conversion*/ |
18 | /* Error: Upconverter PLL is not locked */ | 14 | /* Error: Upconverter PLL is not locked */ |
19 | #define MT2063_UPC_UNLOCK (0x80000002) | 15 | #define MT2063_UPC_UNLOCK (0x80000002) |
@@ -411,6 +407,9 @@ static u32 MT2063_GetParam(struct mt2063_state *state, enum MT2063_Param param, | |||
411 | static u32 MT2063_SetReg(struct mt2063_state *state, u8 reg, u8 val); | 407 | static u32 MT2063_SetReg(struct mt2063_state *state, u8 reg, u8 val); |
412 | static u32 MT2063_SetParam(struct mt2063_state *state, enum MT2063_Param param, | 408 | static u32 MT2063_SetParam(struct mt2063_state *state, enum MT2063_Param param, |
413 | enum MT2063_DNC_Output_Enable nValue); | 409 | enum MT2063_DNC_Output_Enable nValue); |
410 | static u32 MT2063_SoftwareShutdown(struct mt2063_state *state, u8 Shutdown); | ||
411 | static u32 MT2063_ClearPowerMaskBits(struct mt2063_state *state, enum MT2063_Mask_Bits Bits); | ||
412 | |||
414 | 413 | ||
415 | /*****************/ | 414 | /*****************/ |
416 | /* From drivers/media/common/tuners/mt2063_cfg.h */ | 415 | /* From drivers/media/common/tuners/mt2063_cfg.h */ |
@@ -466,34 +465,12 @@ unsigned int mt2063_lockStatus(struct dvb_frontend *fe) | |||
466 | return err; | 465 | return err; |
467 | } | 466 | } |
468 | 467 | ||
469 | unsigned int tuner_MT2063_Open(struct dvb_frontend *fe) | ||
470 | { | ||
471 | struct dvb_frontend_ops *frontend_ops = &fe->ops; | ||
472 | struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops; | ||
473 | struct tuner_state t_state; | ||
474 | int err = 0; | ||
475 | |||
476 | if (&fe->ops) | ||
477 | frontend_ops = &fe->ops; | ||
478 | if (&frontend_ops->tuner_ops) | ||
479 | tuner_ops = &frontend_ops->tuner_ops; | ||
480 | if (tuner_ops->set_state) { | ||
481 | if ((err = | ||
482 | tuner_ops->set_state(fe, DVBFE_TUNER_OPEN, | ||
483 | &t_state)) < 0) { | ||
484 | printk("%s: Invalid parameter\n", __func__); | ||
485 | return err; | ||
486 | } | ||
487 | } | ||
488 | |||
489 | return err; | ||
490 | } | ||
491 | 468 | ||
492 | unsigned int tuner_MT2063_SoftwareShutdown(struct dvb_frontend *fe) | 469 | unsigned int tuner_MT2063_SoftwareShutdown(struct dvb_frontend *fe) |
493 | { | 470 | { |
471 | struct mt2063_state *state = fe->tuner_priv; | ||
494 | struct dvb_frontend_ops *frontend_ops = &fe->ops; | 472 | struct dvb_frontend_ops *frontend_ops = &fe->ops; |
495 | struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops; | 473 | struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops; |
496 | struct tuner_state t_state; | ||
497 | int err = 0; | 474 | int err = 0; |
498 | 475 | ||
499 | if (&fe->ops) | 476 | if (&fe->ops) |
@@ -501,9 +478,8 @@ unsigned int tuner_MT2063_SoftwareShutdown(struct dvb_frontend *fe) | |||
501 | if (&frontend_ops->tuner_ops) | 478 | if (&frontend_ops->tuner_ops) |
502 | tuner_ops = &frontend_ops->tuner_ops; | 479 | tuner_ops = &frontend_ops->tuner_ops; |
503 | if (tuner_ops->set_state) { | 480 | if (tuner_ops->set_state) { |
504 | if ((err = | 481 | err = MT2063_SoftwareShutdown(state, 1); |
505 | tuner_ops->set_state(fe, DVBFE_TUNER_SOFTWARE_SHUTDOWN, | 482 | if (err < 0) { |
506 | &t_state)) < 0) { | ||
507 | printk("%s: Invalid parameter\n", __func__); | 483 | printk("%s: Invalid parameter\n", __func__); |
508 | return err; | 484 | return err; |
509 | } | 485 | } |
@@ -514,9 +490,9 @@ unsigned int tuner_MT2063_SoftwareShutdown(struct dvb_frontend *fe) | |||
514 | 490 | ||
515 | unsigned int tuner_MT2063_ClearPowerMaskBits(struct dvb_frontend *fe) | 491 | unsigned int tuner_MT2063_ClearPowerMaskBits(struct dvb_frontend *fe) |
516 | { | 492 | { |
493 | struct mt2063_state *state = fe->tuner_priv; | ||
517 | struct dvb_frontend_ops *frontend_ops = &fe->ops; | 494 | struct dvb_frontend_ops *frontend_ops = &fe->ops; |
518 | struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops; | 495 | struct dvb_tuner_ops *tuner_ops = &frontend_ops->tuner_ops; |
519 | struct tuner_state t_state; | ||
520 | int err = 0; | 496 | int err = 0; |
521 | 497 | ||
522 | if (&fe->ops) | 498 | if (&fe->ops) |
@@ -524,9 +500,8 @@ unsigned int tuner_MT2063_ClearPowerMaskBits(struct dvb_frontend *fe) | |||
524 | if (&frontend_ops->tuner_ops) | 500 | if (&frontend_ops->tuner_ops) |
525 | tuner_ops = &frontend_ops->tuner_ops; | 501 | tuner_ops = &frontend_ops->tuner_ops; |
526 | if (tuner_ops->set_state) { | 502 | if (tuner_ops->set_state) { |
527 | if ((err = | 503 | err = MT2063_ClearPowerMaskBits(state, MT2063_ALL_SD); |
528 | tuner_ops->set_state(fe, DVBFE_TUNER_CLEAR_POWER_MASKBITS, | 504 | if (err < 0) { |
529 | &t_state)) < 0) { | ||
530 | printk("%s: Invalid parameter\n", __func__); | 505 | printk("%s: Invalid parameter\n", __func__); |
531 | return err; | 506 | return err; |
532 | } | 507 | } |
@@ -3771,14 +3746,6 @@ static int mt2063_set_state(struct dvb_frontend *fe, | |||
3771 | case DVBFE_TUNER_REFCLOCK: | 3746 | case DVBFE_TUNER_REFCLOCK: |
3772 | 3747 | ||
3773 | break; | 3748 | break; |
3774 | case DVBFE_TUNER_SOFTWARE_SHUTDOWN: | ||
3775 | status = MT2063_SoftwareShutdown(state, 1); | ||
3776 | break; | ||
3777 | case DVBFE_TUNER_CLEAR_POWER_MASKBITS: | ||
3778 | status = | ||
3779 | MT2063_ClearPowerMaskBits(state, | ||
3780 | MT2063_ALL_SD); | ||
3781 | break; | ||
3782 | default: | 3749 | default: |
3783 | break; | 3750 | break; |
3784 | } | 3751 | } |