V4L/DVB (9254): cx24116: Checkpatch compliance #2
cx24116: Checkpatch compliance #2 Signed-off-by: Steven Toth <stoth@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
d93356a220
commit
f11ec7d4ee
@ -41,10 +41,14 @@
|
|||||||
#include "dvb_frontend.h"
|
#include "dvb_frontend.h"
|
||||||
#include "cx24116.h"
|
#include "cx24116.h"
|
||||||
|
|
||||||
static int debug = 0;
|
static int debug;
|
||||||
|
module_param(debug, int, 0644);
|
||||||
|
MODULE_PARM_DESC(debug, "Activates frontend debugging (default:0)");
|
||||||
|
|
||||||
#define dprintk(args...) \
|
#define dprintk(args...) \
|
||||||
do { \
|
do { \
|
||||||
if (debug) printk ("cx24116: " args); \
|
if (debug) \
|
||||||
|
printk("cx24116: " args); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define CX24116_DEFAULT_FIRMWARE "dvb-fe-cx24116.fw"
|
#define CX24116_DEFAULT_FIRMWARE "dvb-fe-cx24116.fw"
|
||||||
@ -116,12 +120,15 @@ static int debug = 0;
|
|||||||
|
|
||||||
/* DiSEqC tone burst */
|
/* DiSEqC tone burst */
|
||||||
static int toneburst = 1;
|
static int toneburst = 1;
|
||||||
|
module_param(toneburst, int, 0644);
|
||||||
|
MODULE_PARM_DESC(toneburst, "DiSEqC toneburst 0=OFF, 1=TONE CACHE, 2=MESSAGE CACHE (default:1)");
|
||||||
|
|
||||||
/* SNR measurements */
|
/* SNR measurements */
|
||||||
static int esno_snr = 0;
|
static int esno_snr;
|
||||||
|
module_param(esno_snr, int, 0644);
|
||||||
|
MODULE_PARM_DESC(debug, "SNR return units, 0=PERCENTAGE 0-100, 1=ESNO(db * 10) (default:0)");
|
||||||
|
|
||||||
enum cmds
|
enum cmds {
|
||||||
{
|
|
||||||
CMD_SET_VCO = 0x10,
|
CMD_SET_VCO = 0x10,
|
||||||
CMD_TUNEREQUEST = 0x11,
|
CMD_TUNEREQUEST = 0x11,
|
||||||
CMD_MPEGCONFIG = 0x13,
|
CMD_MPEGCONFIG = 0x13,
|
||||||
@ -138,8 +145,7 @@ enum cmds
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* The Demod/Tuner can't easily provide these, we cache them */
|
/* The Demod/Tuner can't easily provide these, we cache them */
|
||||||
struct cx24116_tuning
|
struct cx24116_tuning {
|
||||||
{
|
|
||||||
u32 frequency;
|
u32 frequency;
|
||||||
u32 symbol_rate;
|
u32 symbol_rate;
|
||||||
fe_spectral_inversion_t inversion;
|
fe_spectral_inversion_t inversion;
|
||||||
@ -158,14 +164,12 @@ struct cx24116_tuning
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Basic commands that are sent to the firmware */
|
/* Basic commands that are sent to the firmware */
|
||||||
struct cx24116_cmd
|
struct cx24116_cmd {
|
||||||
{
|
|
||||||
u8 len;
|
u8 len;
|
||||||
u8 args[CX24116_ARGLEN];
|
u8 args[CX24116_ARGLEN];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct cx24116_state
|
struct cx24116_state {
|
||||||
{
|
|
||||||
struct i2c_adapter *i2c;
|
struct i2c_adapter *i2c;
|
||||||
const struct cx24116_config *config;
|
const struct cx24116_config *config;
|
||||||
|
|
||||||
@ -190,7 +194,8 @@ static int cx24116_writereg(struct cx24116_state* state, int reg, int data)
|
|||||||
printk("cx24116: %s: write reg 0x%02x, value 0x%02x\n",
|
printk("cx24116: %s: write reg 0x%02x, value 0x%02x\n",
|
||||||
__func__, reg, data);
|
__func__, reg, data);
|
||||||
|
|
||||||
if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) {
|
err = i2c_transfer(state->i2c, &msg, 1);
|
||||||
|
if (err != 1) {
|
||||||
printk("%s: writereg error(err == %i, reg == 0x%02x,"
|
printk("%s: writereg error(err == %i, reg == 0x%02x,"
|
||||||
" value == 0x%02x)\n", __func__, err, reg, data);
|
" value == 0x%02x)\n", __func__, err, reg, data);
|
||||||
return -EREMOTEIO;
|
return -EREMOTEIO;
|
||||||
@ -200,7 +205,8 @@ static int cx24116_writereg(struct cx24116_state* state, int reg, int data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Bulk byte writes to a single I2C address, for 32k firmware load */
|
/* Bulk byte writes to a single I2C address, for 32k firmware load */
|
||||||
static int cx24116_writeregN(struct cx24116_state* state, int reg, u8 *data, u16 len)
|
static int cx24116_writeregN(struct cx24116_state *state, int reg,
|
||||||
|
u8 *data, u16 len)
|
||||||
{
|
{
|
||||||
int ret = -EREMOTEIO;
|
int ret = -EREMOTEIO;
|
||||||
struct i2c_msg msg;
|
struct i2c_msg msg;
|
||||||
@ -225,7 +231,8 @@ static int cx24116_writeregN(struct cx24116_state* state, int reg, u8 *data, u16
|
|||||||
printk("cx24116: %s: write regN 0x%02x, len = %d\n",
|
printk("cx24116: %s: write regN 0x%02x, len = %d\n",
|
||||||
__func__, reg, len);
|
__func__, reg, len);
|
||||||
|
|
||||||
if ((ret = i2c_transfer(state->i2c, &msg, 1)) != 1) {
|
ret = i2c_transfer(state->i2c, &msg, 1);
|
||||||
|
if (ret != 1) {
|
||||||
printk("%s: writereg error(err == %i, reg == 0x%02x\n",
|
printk("%s: writereg error(err == %i, reg == 0x%02x\n",
|
||||||
__func__, ret, reg);
|
__func__, ret, reg);
|
||||||
ret = -EREMOTEIO;
|
ret = -EREMOTEIO;
|
||||||
@ -243,8 +250,10 @@ static int cx24116_readreg(struct cx24116_state* state, u8 reg)
|
|||||||
u8 b0[] = { reg };
|
u8 b0[] = { reg };
|
||||||
u8 b1[] = { 0 };
|
u8 b1[] = { 0 };
|
||||||
struct i2c_msg msg[] = {
|
struct i2c_msg msg[] = {
|
||||||
{ .addr = state->config->demod_address, .flags = 0, .buf = b0, .len = 1 },
|
{ .addr = state->config->demod_address, .flags = 0,
|
||||||
{ .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = b1, .len = 1 }
|
.buf = b0, .len = 1 },
|
||||||
|
{ .addr = state->config->demod_address, .flags = I2C_M_RD,
|
||||||
|
.buf = b1, .len = 1 }
|
||||||
};
|
};
|
||||||
|
|
||||||
ret = i2c_transfer(state->i2c, msg, 2);
|
ret = i2c_transfer(state->i2c, msg, 2);
|
||||||
@ -255,7 +264,8 @@ static int cx24116_readreg(struct cx24116_state* state, u8 reg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (debug > 1)
|
if (debug > 1)
|
||||||
printk("cx24116: read reg 0x%02x, value 0x%02x\n",reg, b1[0]);
|
printk("cx24116: read reg 0x%02x, value 0x%02x\n",
|
||||||
|
reg, b1[0]);
|
||||||
|
|
||||||
return b1[0];
|
return b1[0];
|
||||||
}
|
}
|
||||||
@ -396,11 +406,9 @@ static int cx24116_lookup_fecmod(struct cx24116_state* state,
|
|||||||
|
|
||||||
dprintk("%s(0x%02x,0x%02x)\n", __func__, m, f);
|
dprintk("%s(0x%02x,0x%02x)\n", __func__, m, f);
|
||||||
|
|
||||||
for(i=0 ; i < sizeof(CX24116_MODFEC_MODES) / sizeof(struct cx24116_modfec) ; i++)
|
for (i = 0; i < ARRAY_SIZE(CX24116_MODFEC_MODES); i++) {
|
||||||
{
|
|
||||||
if ((m == CX24116_MODFEC_MODES[i].modulation) &&
|
if ((m == CX24116_MODFEC_MODES[i].modulation) &&
|
||||||
(f == CX24116_MODFEC_MODES[i].fec) )
|
(f == CX24116_MODFEC_MODES[i].fec)) {
|
||||||
{
|
|
||||||
ret = i;
|
ret = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -446,7 +454,8 @@ static int cx24116_set_symbolrate(struct cx24116_state* state, u32 rate)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cx24116_load_firmware (struct dvb_frontend* fe, const struct firmware *fw);
|
static int cx24116_load_firmware(struct dvb_frontend *fe,
|
||||||
|
const struct firmware *fw);
|
||||||
|
|
||||||
static int cx24116_firmware_ondemand(struct dvb_frontend *fe)
|
static int cx24116_firmware_ondemand(struct dvb_frontend *fe)
|
||||||
{
|
{
|
||||||
@ -456,8 +465,7 @@ static int cx24116_firmware_ondemand(struct dvb_frontend* fe)
|
|||||||
|
|
||||||
dprintk("%s()\n", __func__);
|
dprintk("%s()\n", __func__);
|
||||||
|
|
||||||
if (cx24116_readreg(state, 0x20) > 0)
|
if (cx24116_readreg(state, 0x20) > 0) {
|
||||||
{
|
|
||||||
|
|
||||||
if (state->skip_fw_load)
|
if (state->skip_fw_load)
|
||||||
return 0;
|
return 0;
|
||||||
@ -499,26 +507,23 @@ static int cx24116_cmd_execute(struct dvb_frontend* fe, struct cx24116_cmd *cmd)
|
|||||||
dprintk("%s()\n", __func__);
|
dprintk("%s()\n", __func__);
|
||||||
|
|
||||||
/* Load the firmware if required */
|
/* Load the firmware if required */
|
||||||
if ( (ret = cx24116_firmware_ondemand(fe)) != 0)
|
ret = cx24116_firmware_ondemand(fe);
|
||||||
{
|
if (ret != 0) {
|
||||||
printk("%s(): Unable initialise the firmware\n", __func__);
|
printk("%s(): Unable initialise the firmware\n", __func__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write the command */
|
/* Write the command */
|
||||||
for(i = 0; i < cmd->len ; i++)
|
for (i = 0; i < cmd->len ; i++) {
|
||||||
{
|
|
||||||
dprintk("%s: 0x%02x == 0x%02x\n", __func__, i, cmd->args[i]);
|
dprintk("%s: 0x%02x == 0x%02x\n", __func__, i, cmd->args[i]);
|
||||||
cx24116_writereg(state, i, cmd->args[i]);
|
cx24116_writereg(state, i, cmd->args[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Start execution and wait for cmd to terminate */
|
/* Start execution and wait for cmd to terminate */
|
||||||
cx24116_writereg(state, CX24116_REG_EXECUTE, 0x01);
|
cx24116_writereg(state, CX24116_REG_EXECUTE, 0x01);
|
||||||
while( cx24116_readreg(state, CX24116_REG_EXECUTE) )
|
while (cx24116_readreg(state, CX24116_REG_EXECUTE)) {
|
||||||
{
|
|
||||||
msleep(10);
|
msleep(10);
|
||||||
if(i++ > 64)
|
if (i++ > 64) {
|
||||||
{
|
|
||||||
/* Avoid looping forever if the firmware does no respond */
|
/* Avoid looping forever if the firmware does no respond */
|
||||||
printk("%s() Firmware not responding\n", __func__);
|
printk("%s() Firmware not responding\n", __func__);
|
||||||
return -EREMOTEIO;
|
return -EREMOTEIO;
|
||||||
@ -527,7 +532,8 @@ static int cx24116_cmd_execute(struct dvb_frontend* fe, struct cx24116_cmd *cmd)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cx24116_load_firmware (struct dvb_frontend* fe, const struct firmware *fw)
|
static int cx24116_load_firmware(struct dvb_frontend *fe,
|
||||||
|
const struct firmware *fw)
|
||||||
{
|
{
|
||||||
struct cx24116_state *state = fe->demodulator_priv;
|
struct cx24116_state *state = fe->demodulator_priv;
|
||||||
struct cx24116_cmd cmd;
|
struct cx24116_cmd cmd;
|
||||||
@ -535,13 +541,12 @@ static int cx24116_load_firmware (struct dvb_frontend* fe, const struct firmware
|
|||||||
unsigned char vers[4];
|
unsigned char vers[4];
|
||||||
|
|
||||||
dprintk("%s\n", __func__);
|
dprintk("%s\n", __func__);
|
||||||
dprintk("Firmware is %zu bytes (%02x %02x .. %02x %02x)\n"
|
dprintk("Firmware is %zu bytes (%02x %02x .. %02x %02x)\n",
|
||||||
,fw->size
|
fw->size,
|
||||||
,fw->data[0]
|
fw->data[0],
|
||||||
,fw->data[1]
|
fw->data[1],
|
||||||
,fw->data[ fw->size-2 ]
|
fw->data[fw->size-2],
|
||||||
,fw->data[ fw->size-1 ]
|
fw->data[fw->size-1]);
|
||||||
);
|
|
||||||
|
|
||||||
/* Toggle 88x SRST pin to reset demod */
|
/* Toggle 88x SRST pin to reset demod */
|
||||||
if (state->config->reset_device)
|
if (state->config->reset_device)
|
||||||
@ -636,10 +641,12 @@ static int cx24116_load_firmware (struct dvb_frontend* fe, const struct firmware
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cx24116_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage)
|
static int cx24116_set_voltage(struct dvb_frontend *fe,
|
||||||
|
fe_sec_voltage_t voltage)
|
||||||
{
|
{
|
||||||
/* The isl6421 module will override this function in the fops. */
|
/* The isl6421 module will override this function in the fops. */
|
||||||
dprintk("%s() This should never appear if the isl6421 module is loaded correctly\n",__func__);
|
dprintk("%s() This should never appear if the isl6421 module "
|
||||||
|
"is loaded correctly\n", __func__);
|
||||||
|
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
@ -681,7 +688,8 @@ static int cx24116_read_ber(struct dvb_frontend* fe, u32* ber)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* TODO Determine function and scale appropriately */
|
/* TODO Determine function and scale appropriately */
|
||||||
static int cx24116_read_signal_strength(struct dvb_frontend* fe, u16* signal_strength)
|
static int cx24116_read_signal_strength(struct dvb_frontend *fe,
|
||||||
|
u16 *signal_strength)
|
||||||
{
|
{
|
||||||
struct cx24116_state *state = fe->demodulator_priv;
|
struct cx24116_state *state = fe->demodulator_priv;
|
||||||
struct cx24116_cmd cmd;
|
struct cx24116_cmd cmd;
|
||||||
@ -697,11 +705,14 @@ static int cx24116_read_signal_strength(struct dvb_frontend* fe, u16* signal_str
|
|||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
sig_reading = ( cx24116_readreg(state, CX24116_REG_SSTATUS) & CX24116_SIGNAL_MASK ) |
|
sig_reading =
|
||||||
|
(cx24116_readreg(state,
|
||||||
|
CX24116_REG_SSTATUS) & CX24116_SIGNAL_MASK) |
|
||||||
(cx24116_readreg(state, CX24116_REG_SIGNAL) << 6);
|
(cx24116_readreg(state, CX24116_REG_SIGNAL) << 6);
|
||||||
*signal_strength = 0 - sig_reading;
|
*signal_strength = 0 - sig_reading;
|
||||||
|
|
||||||
dprintk("%s: raw / cooked = 0x%04x / 0x%04x\n", __func__, sig_reading, *signal_strength);
|
dprintk("%s: raw / cooked = 0x%04x / 0x%04x\n",
|
||||||
|
__func__, sig_reading, *signal_strength);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -714,7 +725,8 @@ static int cx24116_read_snr_pct(struct dvb_frontend* fe, u16* snr)
|
|||||||
static const u32 snr_tab[] = { /* 10 x Table (rounded up) */
|
static const u32 snr_tab[] = { /* 10 x Table (rounded up) */
|
||||||
0x00000, 0x0199A, 0x03333, 0x04ccD, 0x06667,
|
0x00000, 0x0199A, 0x03333, 0x04ccD, 0x06667,
|
||||||
0x08000, 0x0999A, 0x0b333, 0x0cccD, 0x0e667,
|
0x08000, 0x0999A, 0x0b333, 0x0cccD, 0x0e667,
|
||||||
0x10000,0x1199A,0x13333,0x14ccD,0x16667,0x18000 };
|
0x10000, 0x1199A, 0x13333, 0x14ccD, 0x16667,
|
||||||
|
0x18000 };
|
||||||
|
|
||||||
dprintk("%s()\n", __func__);
|
dprintk("%s()\n", __func__);
|
||||||
|
|
||||||
@ -798,7 +810,8 @@ static int cx24116_wait_for_lnb(struct dvb_frontend* fe)
|
|||||||
return -ETIMEDOUT; /* -EBUSY ? */
|
return -ETIMEDOUT; /* -EBUSY ? */
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cx24116_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone)
|
static int cx24116_set_tone(struct dvb_frontend *fe,
|
||||||
|
fe_sec_tone_mode_t tone)
|
||||||
{
|
{
|
||||||
struct cx24116_cmd cmd;
|
struct cx24116_cmd cmd;
|
||||||
int ret;
|
int ret;
|
||||||
@ -890,7 +903,8 @@ static int cx24116_diseqc_init(struct dvb_frontend* fe)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Send DiSEqC message with derived burst (hack) || previous burst */
|
/* Send DiSEqC message with derived burst (hack) || previous burst */
|
||||||
static int cx24116_send_diseqc_msg(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd *d)
|
static int cx24116_send_diseqc_msg(struct dvb_frontend *fe,
|
||||||
|
struct dvb_diseqc_master_cmd *d)
|
||||||
{
|
{
|
||||||
struct cx24116_state *state = fe->demodulator_priv;
|
struct cx24116_state *state = fe->demodulator_priv;
|
||||||
int i, ret;
|
int i, ret;
|
||||||
@ -918,7 +932,8 @@ static int cx24116_send_diseqc_msg(struct dvb_frontend* fe, struct dvb_diseqc_ma
|
|||||||
state->dsec_cmd.args[CX24116_DISEQC_MSGLEN] = d->msg_len;
|
state->dsec_cmd.args[CX24116_DISEQC_MSGLEN] = d->msg_len;
|
||||||
|
|
||||||
/* Command length */
|
/* Command length */
|
||||||
state->dsec_cmd.len= CX24116_DISEQC_MSGOFS + state->dsec_cmd.args[CX24116_DISEQC_MSGLEN];
|
state->dsec_cmd.len = CX24116_DISEQC_MSGOFS +
|
||||||
|
state->dsec_cmd.args[CX24116_DISEQC_MSGLEN];
|
||||||
|
|
||||||
/* DiSEqC toneburst */
|
/* DiSEqC toneburst */
|
||||||
if (toneburst == CX24116_DISEQC_MESGCACHE)
|
if (toneburst == CX24116_DISEQC_MESGCACHE)
|
||||||
@ -949,9 +964,11 @@ static int cx24116_send_diseqc_msg(struct dvb_frontend* fe, struct dvb_diseqc_ma
|
|||||||
* Z = BAND (0=LOW, 1=HIGH(22K))
|
* Z = BAND (0=LOW, 1=HIGH(22K))
|
||||||
*/
|
*/
|
||||||
if (d->msg_len >= 4 && d->msg[2] == 0x38)
|
if (d->msg_len >= 4 && d->msg[2] == 0x38)
|
||||||
state->dsec_cmd.args[CX24116_DISEQC_BURST] = ((d->msg[3] & 4) >> 2);
|
state->dsec_cmd.args[CX24116_DISEQC_BURST] =
|
||||||
|
((d->msg[3] & 4) >> 2);
|
||||||
if (debug)
|
if (debug)
|
||||||
dprintk("%s burst=%d\n", __func__, state->dsec_cmd.args[CX24116_DISEQC_BURST]);
|
dprintk("%s burst=%d\n", __func__,
|
||||||
|
state->dsec_cmd.args[CX24116_DISEQC_BURST]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Wait for LNB ready */
|
/* Wait for LNB ready */
|
||||||
@ -976,13 +993,15 @@ static int cx24116_send_diseqc_msg(struct dvb_frontend* fe, struct dvb_diseqc_ma
|
|||||||
* 12.5ms burst +
|
* 12.5ms burst +
|
||||||
* >15ms delay (XXX determine if FW does this, see set_tone)
|
* >15ms delay (XXX determine if FW does this, see set_tone)
|
||||||
*/
|
*/
|
||||||
msleep( (state->dsec_cmd.args[CX24116_DISEQC_MSGLEN] << 4) + ((toneburst == CX24116_DISEQC_TONEOFF) ? 30 : 60) );
|
msleep((state->dsec_cmd.args[CX24116_DISEQC_MSGLEN] << 4) +
|
||||||
|
((toneburst == CX24116_DISEQC_TONEOFF) ? 30 : 60));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Send DiSEqC burst */
|
/* Send DiSEqC burst */
|
||||||
static int cx24116_diseqc_send_burst(struct dvb_frontend* fe, fe_sec_mini_cmd_t burst)
|
static int cx24116_diseqc_send_burst(struct dvb_frontend *fe,
|
||||||
|
fe_sec_mini_cmd_t burst)
|
||||||
{
|
{
|
||||||
struct cx24116_state *state = fe->demodulator_priv;
|
struct cx24116_state *state = fe->demodulator_priv;
|
||||||
int ret;
|
int ret;
|
||||||
@ -991,9 +1010,11 @@ static int cx24116_diseqc_send_burst(struct dvb_frontend* fe, fe_sec_mini_cmd_t
|
|||||||
|
|
||||||
/* DiSEqC burst */
|
/* DiSEqC burst */
|
||||||
if (burst == SEC_MINI_A)
|
if (burst == SEC_MINI_A)
|
||||||
state->dsec_cmd.args[CX24116_DISEQC_BURST] = CX24116_DISEQC_MINI_A;
|
state->dsec_cmd.args[CX24116_DISEQC_BURST] =
|
||||||
|
CX24116_DISEQC_MINI_A;
|
||||||
else if (burst == SEC_MINI_B)
|
else if (burst == SEC_MINI_B)
|
||||||
state->dsec_cmd.args[CX24116_DISEQC_BURST] = CX24116_DISEQC_MINI_B;
|
state->dsec_cmd.args[CX24116_DISEQC_BURST] =
|
||||||
|
CX24116_DISEQC_MINI_B;
|
||||||
else
|
else
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
@ -1077,6 +1098,8 @@ struct dvb_frontend* cx24116_attach(const struct cx24116_config* config,
|
|||||||
error2: kfree(state);
|
error2: kfree(state);
|
||||||
error1: return NULL;
|
error1: return NULL;
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL(cx24116_attach);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialise or wake up device
|
* Initialise or wake up device
|
||||||
*
|
*
|
||||||
@ -1133,13 +1156,15 @@ static int cx24116_sleep(struct dvb_frontend* fe)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cx24116_set_property(struct dvb_frontend *fe, struct dtv_property* tvp)
|
static int cx24116_set_property(struct dvb_frontend *fe,
|
||||||
|
struct dtv_property *tvp)
|
||||||
{
|
{
|
||||||
dprintk("%s(..)\n", __func__);
|
dprintk("%s(..)\n", __func__);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cx24116_get_property(struct dvb_frontend *fe, struct dtv_property* tvp)
|
static int cx24116_get_property(struct dvb_frontend *fe,
|
||||||
|
struct dtv_property *tvp)
|
||||||
{
|
{
|
||||||
dprintk("%s(..)\n", __func__);
|
dprintk("%s(..)\n", __func__);
|
||||||
return 0;
|
return 0;
|
||||||
@ -1148,7 +1173,8 @@ static int cx24116_get_property(struct dvb_frontend *fe, struct dtv_property* tv
|
|||||||
/* dvb-core told us to tune, the tv property cache will be complete,
|
/* dvb-core told us to tune, the tv property cache will be complete,
|
||||||
* it's safe for is to pull values and use them for tuning purposes.
|
* it's safe for is to pull values and use them for tuning purposes.
|
||||||
*/
|
*/
|
||||||
static int cx24116_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p)
|
static int cx24116_set_frontend(struct dvb_frontend *fe,
|
||||||
|
struct dvb_frontend_parameters *p)
|
||||||
{
|
{
|
||||||
struct cx24116_state *state = fe->demodulator_priv;
|
struct cx24116_state *state = fe->demodulator_priv;
|
||||||
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
|
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
|
||||||
@ -1238,14 +1264,17 @@ static int cx24116_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
|
|||||||
state->dnxt.pilot = c->pilot;
|
state->dnxt.pilot = c->pilot;
|
||||||
state->dnxt.rolloff = c->rolloff;
|
state->dnxt.rolloff = c->rolloff;
|
||||||
|
|
||||||
if ((ret = cx24116_set_inversion(state, c->inversion)) != 0)
|
ret = cx24116_set_inversion(state, c->inversion);
|
||||||
|
if (ret != 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
/* FEC_NONE/AUTO for DVB-S2 is not supported and detected here */
|
/* FEC_NONE/AUTO for DVB-S2 is not supported and detected here */
|
||||||
if ((ret = cx24116_set_fec(state, c->modulation, c->fec_inner)) != 0)
|
ret = cx24116_set_fec(state, c->modulation, c->fec_inner);
|
||||||
|
if (ret != 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if ((ret = cx24116_set_symbolrate(state, c->symbol_rate)) != 0)
|
ret = cx24116_set_symbolrate(state, c->symbol_rate);
|
||||||
|
if (ret != 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
/* discard the 'current' tuning parameters and prepare to tune */
|
/* discard the 'current' tuning parameters and prepare to tune */
|
||||||
@ -1327,7 +1356,8 @@ static int cx24116_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
|
|||||||
*/
|
*/
|
||||||
do {
|
do {
|
||||||
/* Reset status register */
|
/* Reset status register */
|
||||||
status = cx24116_readreg(state, CX24116_REG_SSTATUS) & CX24116_SIGNAL_MASK;
|
status = cx24116_readreg(state, CX24116_REG_SSTATUS)
|
||||||
|
& CX24116_SIGNAL_MASK;
|
||||||
cx24116_writereg(state, CX24116_REG_SSTATUS, status);
|
cx24116_writereg(state, CX24116_REG_SSTATUS, status);
|
||||||
|
|
||||||
/* Tune */
|
/* Tune */
|
||||||
@ -1356,8 +1386,7 @@ static int cx24116_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par
|
|||||||
/* Toggle pilot bit when in auto-pilot */
|
/* Toggle pilot bit when in auto-pilot */
|
||||||
if (state->dcur.pilot == PILOT_AUTO)
|
if (state->dcur.pilot == PILOT_AUTO)
|
||||||
cmd.args[0x07] ^= CX24116_PILOT_ON;
|
cmd.args[0x07] ^= CX24116_PILOT_ON;
|
||||||
}
|
} while (--retune);
|
||||||
while(--retune);
|
|
||||||
|
|
||||||
tuned: /* Set/Reset B/W */
|
tuned: /* Set/Reset B/W */
|
||||||
cmd.args[0x00] = CMD_BANDWIDTH;
|
cmd.args[0x00] = CMD_BANDWIDTH;
|
||||||
@ -1407,17 +1436,7 @@ static struct dvb_frontend_ops cx24116_ops = {
|
|||||||
.set_frontend = cx24116_set_frontend,
|
.set_frontend = cx24116_set_frontend,
|
||||||
};
|
};
|
||||||
|
|
||||||
module_param(debug, int, 0644);
|
|
||||||
MODULE_PARM_DESC(debug, "Activates frontend debugging (default:0)");
|
|
||||||
|
|
||||||
module_param(toneburst, int, 0644);
|
|
||||||
MODULE_PARM_DESC(toneburst, "DiSEqC toneburst 0=OFF, 1=TONE CACHE, 2=MESSAGE CACHE (default:1)");
|
|
||||||
|
|
||||||
module_param(esno_snr, int, 0644);
|
|
||||||
MODULE_PARM_DESC(debug, "SNR return units, 0=PERCENTAGE 0-100, 1=ESNO(db * 10) (default:0)");
|
|
||||||
|
|
||||||
MODULE_DESCRIPTION("DVB Frontend module for Conexant cx24116/cx24118 hardware");
|
MODULE_DESCRIPTION("DVB Frontend module for Conexant cx24116/cx24118 hardware");
|
||||||
MODULE_AUTHOR("Steven Toth");
|
MODULE_AUTHOR("Steven Toth");
|
||||||
MODULE_LICENSE("GPL");
|
MODULE_LICENSE("GPL");
|
||||||
|
|
||||||
EXPORT_SYMBOL(cx24116_attach);
|
|
||||||
|
@ -23,8 +23,7 @@
|
|||||||
|
|
||||||
#include <linux/dvb/frontend.h>
|
#include <linux/dvb/frontend.h>
|
||||||
|
|
||||||
struct cx24116_config
|
struct cx24116_config {
|
||||||
{
|
|
||||||
/* the demodulator's i2c address */
|
/* the demodulator's i2c address */
|
||||||
u8 demod_address;
|
u8 demod_address;
|
||||||
|
|
||||||
@ -39,15 +38,17 @@ struct cx24116_config
|
|||||||
};
|
};
|
||||||
|
|
||||||
#if defined(CONFIG_DVB_CX24116) || defined(CONFIG_DVB_CX24116_MODULE)
|
#if defined(CONFIG_DVB_CX24116) || defined(CONFIG_DVB_CX24116_MODULE)
|
||||||
extern struct dvb_frontend* cx24116_attach(const struct cx24116_config* config,
|
extern struct dvb_frontend *cx24116_attach(
|
||||||
|
const struct cx24116_config *config,
|
||||||
struct i2c_adapter *i2c);
|
struct i2c_adapter *i2c);
|
||||||
#else
|
#else
|
||||||
static inline struct dvb_frontend* cx24116_attach(const struct cx24116_config* config,
|
static inline struct dvb_frontend *cx24116_attach(
|
||||||
|
const struct cx24116_config *config,
|
||||||
struct i2c_adapter *i2c)
|
struct i2c_adapter *i2c)
|
||||||
{
|
{
|
||||||
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
|
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif // CONFIG_DVB_CX24116
|
#endif
|
||||||
|
|
||||||
#endif /* CX24116_H */
|
#endif /* CX24116_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user