diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-07-10 15:24:26 +0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-07-28 00:55:50 +0400 |
commit | 147e110bb69a5eaee83bab133d7f7cc4ee050808 (patch) | |
tree | 0be0f35588712e984ba3d5859690c8eb516e365b /drivers/media/dvb/frontends/drxk_hard.c | |
parent | d6a054057781044712bfb0114d2d62d37781ffe9 (diff) | |
download | linux-147e110bb69a5eaee83bab133d7f7cc4ee050808.tar.xz |
[media] drxk: Fix the antenna switch logic
Terratec H5 doesn't require to switch mode, but generates
an error due to this logic. Also, GPIO's are board-dependent.
So, add it at the board config struct.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends/drxk_hard.c')
-rw-r--r-- | drivers/media/dvb/frontends/drxk_hard.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/media/dvb/frontends/drxk_hard.c b/drivers/media/dvb/frontends/drxk_hard.c index 1d29ed23154f..91f3296917fa 100644 --- a/drivers/media/dvb/frontends/drxk_hard.c +++ b/drivers/media/dvb/frontends/drxk_hard.c @@ -618,6 +618,10 @@ error: static int init_state(struct drxk_state *state) { + /* + * FIXME: most (all?) of the values bellow should be moved into + * struct drxk_config, as they are probably board-specific + */ u32 ulVSBIfAgcMode = DRXK_AGC_CTRL_AUTO; u32 ulVSBIfAgcOutputLevel = 0; u32 ulVSBIfAgcMinLevel = 0; @@ -672,10 +676,6 @@ static int init_state(struct drxk_state *state) u32 ulRfMirror = 1; u32 ulPowerDown = 0; - u32 ulAntennaDVBT = 1; - u32 ulAntennaDVBC = 0; - u32 ulAntennaSwitchDVBTDVBC = 0; - dprintk(1, "\n"); state->m_hasLNA = false; @@ -858,11 +858,6 @@ static int init_state(struct drxk_state *state) state->m_GPIOCfg = (ulGPIOCfg); state->m_GPIO = (ulGPIO == 0 ? 0 : 1); - state->m_AntennaDVBT = (ulAntennaDVBT == 0 ? 0 : 1); - state->m_AntennaDVBC = (ulAntennaDVBC == 0 ? 0 : 1); - state->m_AntennaSwitchDVBTDVBC = - (ulAntennaSwitchDVBTDVBC == 0 ? 0 : 1); - state->m_bPowerDown = false; state->m_currentPowerMode = DRX_POWER_DOWN; @@ -5819,9 +5814,10 @@ error: static int SwitchAntennaToQAM(struct drxk_state *state) { - int status = -EINVAL; + int status = 0; dprintk(1, "\n"); + if (state->m_AntennaSwitchDVBTDVBC != 0) { if (state->m_GPIO != state->m_AntennaDVBC) { state->m_GPIO = state->m_AntennaDVBC; @@ -5835,7 +5831,7 @@ static int SwitchAntennaToQAM(struct drxk_state *state) static int SwitchAntennaToDVBT(struct drxk_state *state) { - int status = -EINVAL; + int status = 0; dprintk(1, "\n"); if (state->m_AntennaSwitchDVBTDVBC != 0) { @@ -6344,6 +6340,9 @@ struct dvb_frontend *drxk_attach(const struct drxk_config *config, state->single_master = config->single_master; state->microcode_name = config->microcode_name; state->no_i2c_bridge = config->no_i2c_bridge; + state->m_AntennaSwitchDVBTDVBC = config->antenna_uses_gpio; + state->m_AntennaDVBC = config->antenna_dvbc; + state->m_AntennaDVBT = config->antenna_dvbt; mutex_init(&state->mutex); mutex_init(&state->ctlock); |