Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 261515
b: refs/heads/master
c: 147e110
h: refs/heads/master
i:
  261513: 86f6b38
  261511: 691cc0b
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Jul 27, 2011
1 parent 445355f commit 7c37db8
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 19 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: d6a054057781044712bfb0114d2d62d37781ffe9
refs/heads/master: 147e110bb69a5eaee83bab133d7f7cc4ee050808
21 changes: 18 additions & 3 deletions trunk/drivers/media/dvb/frontends/drxk.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,25 @@
#include <linux/types.h>
#include <linux/i2c.h>

/**
* struct drxk_config - Configure the initial parameters for DRX-K
*
* adr: I2C Address of the DRX-K
* single_master: Device is on the single master mode
* no_i2c_bridge: Don't switch the I2C bridge to talk with tuner
* antenna_uses_gpio: Use GPIO to control the antenna
* antenna_dvbc: GPIO for changing antenna to DVB-C
* antenna_dvbt: GPIO for changing antenna to DVB-T
* microcode_name: Name of the firmware file with the microcode
*/
struct drxk_config {
u8 adr;
u32 single_master : 1;
u32 no_i2c_bridge : 1;
u8 adr;
bool single_master;
bool no_i2c_bridge;

bool antenna_uses_gpio;
u16 antenna_dvbc, antenna_dvbt;

const char *microcode_name;
};

Expand Down
21 changes: 10 additions & 11 deletions trunk/drivers/media/dvb/frontends/drxk_hard.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,10 @@ int PowerUpDevice(struct drxk_state *state)

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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -5819,9 +5814,10 @@ static int WriteGPIO(struct drxk_state *state)

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;
Expand All @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down
9 changes: 5 additions & 4 deletions trunk/drivers/media/dvb/frontends/drxk_hard.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,16 +321,17 @@ struct drxk_state {
u8 m_deviceSpin;
u32 m_iqmRcRate;

u16 m_AntennaDVBC;
u16 m_AntennaDVBT;
u16 m_AntennaSwitchDVBTDVBC;

enum DRXPowerMode m_currentPowerMode;

/* Configurable parameters at the driver */

bool m_AntennaSwitchDVBTDVBC;
u16 m_AntennaDVBC;
u16 m_AntennaDVBT;

u32 single_master : 1; /* Use single master i2c mode */
u32 no_i2c_bridge : 1; /* Tuner is not on port 1, don't use I2C bridge */

const char *microcode_name;

};
Expand Down

0 comments on commit 7c37db8

Please sign in to comment.