aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2011-07-24 08:11:36 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-07-27 16:56:04 -0400
commit119faf90ed79adfd4a8930f62c3b9592adf5d250 (patch)
treeff2db81bf1aaf8e922ebefac663f4c33a24d423a /drivers/media
parentf07a0bc111829707f1277c19467a7129ddb5aeb1 (diff)
[media] drxk: Fix the logic that selects between DVB-C annex A and C
Fix the DRX-K logic that selects between DVB-C annex A and C Fix a typo where DVB-C annex type is set via setEnvParameters, but the driver, uses, instead, setParamParameters[2]. While here, cleans up the code, fixing a bad identation at the fallback code for other types of firmware, and put the multiple-line comments into the Linux CodingStyle. Acked-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/frontends/drxk_hard.c56
1 files changed, 26 insertions, 30 deletions
diff --git a/drivers/media/dvb/frontends/drxk_hard.c b/drivers/media/dvb/frontends/drxk_hard.c
index 85332e830447..41b083820dae 100644
--- a/drivers/media/dvb/frontends/drxk_hard.c
+++ b/drivers/media/dvb/frontends/drxk_hard.c
@@ -5382,18 +5382,16 @@ static int SetQAM(struct drxk_state *state, u16 IntermediateFreqkHz,
5382 s32 tunerFreqOffset) 5382 s32 tunerFreqOffset)
5383{ 5383{
5384 int status; 5384 int status;
5385 u8 parameterLen;
5386 u16 setEnvParameters[5] = { 0, 0, 0, 0, 0 };
5387 u16 setParamParameters[4] = { 0, 0, 0, 0 }; 5385 u16 setParamParameters[4] = { 0, 0, 0, 0 };
5388 u16 cmdResult; 5386 u16 cmdResult;
5389 5387
5390 dprintk(1, "\n"); 5388 dprintk(1, "\n");
5391 /* 5389 /*
5392 STEP 1: reset demodulator 5390 * STEP 1: reset demodulator
5393 resets FEC DI and FEC RS 5391 * resets FEC DI and FEC RS
5394 resets QAM block 5392 * resets QAM block
5395 resets SCU variables 5393 * resets SCU variables
5396 */ 5394 */
5397 status = write16(state, FEC_DI_COMM_EXEC__A, FEC_DI_COMM_EXEC_STOP); 5395 status = write16(state, FEC_DI_COMM_EXEC__A, FEC_DI_COMM_EXEC_STOP);
5398 if (status < 0) 5396 if (status < 0)
5399 goto error; 5397 goto error;
@@ -5405,23 +5403,14 @@ static int SetQAM(struct drxk_state *state, u16 IntermediateFreqkHz,
5405 goto error; 5403 goto error;
5406 5404
5407 /* 5405 /*
5408 STEP 2: configure demodulator 5406 * STEP 2: configure demodulator
5409 -set env 5407 * -set params; resets IQM,QAM,FEC HW; initializes some
5410 -set params; resets IQM,QAM,FEC HW; initializes some SCU variables 5408 * SCU variables
5411 */ 5409 */
5412 status = QAMSetSymbolrate(state); 5410 status = QAMSetSymbolrate(state);
5413 if (status < 0) 5411 if (status < 0)
5414 goto error; 5412 goto error;
5415 5413
5416 /* Env parameters */
5417 setEnvParameters[2] = QAM_TOP_ANNEX_A; /* Annex */
5418 if (state->m_OperationMode == OM_QAM_ITU_C)
5419 setEnvParameters[2] = QAM_TOP_ANNEX_C; /* Annex */
5420 setParamParameters[3] |= (QAM_MIRROR_AUTO_ON);
5421 /* check for LOCKRANGE Extented */
5422 /* setParamParameters[3] |= QAM_LOCKRANGE_NORMAL; */
5423 parameterLen = 4;
5424
5425 /* Set params */ 5414 /* Set params */
5426 switch (state->param.u.qam.modulation) { 5415 switch (state->param.u.qam.modulation) {
5427 case QAM_256: 5416 case QAM_256:
@@ -5448,30 +5437,37 @@ static int SetQAM(struct drxk_state *state, u16 IntermediateFreqkHz,
5448 goto error; 5437 goto error;
5449 setParamParameters[0] = state->m_Constellation; /* constellation */ 5438 setParamParameters[0] = state->m_Constellation; /* constellation */
5450 setParamParameters[1] = DRXK_QAM_I12_J17; /* interleave mode */ 5439 setParamParameters[1] = DRXK_QAM_I12_J17; /* interleave mode */
5440 if (state->m_OperationMode == OM_QAM_ITU_C)
5441 setParamParameters[2] = QAM_TOP_ANNEX_C;
5442 else
5443 setParamParameters[2] = QAM_TOP_ANNEX_A;
5444 setParamParameters[3] |= (QAM_MIRROR_AUTO_ON);
5445 /* Env parameters */
5446 /* check for LOCKRANGE Extented */
5447 /* setParamParameters[3] |= QAM_LOCKRANGE_NORMAL; */
5451 5448
5452 status = scu_command(state, SCU_RAM_COMMAND_STANDARD_QAM | SCU_RAM_COMMAND_CMD_DEMOD_SET_PARAM, 4, setParamParameters, 1, &cmdResult); 5449 status = scu_command(state, SCU_RAM_COMMAND_STANDARD_QAM | SCU_RAM_COMMAND_CMD_DEMOD_SET_PARAM, 4, setParamParameters, 1, &cmdResult);
5453 if (status < 0) { 5450 if (status < 0) {
5454 /* Fall-back to the simpler call */ 5451 /* Fall-back to the simpler call */
5455 setParamParameters[0] = QAM_TOP_ANNEX_A;
5456 if (state->m_OperationMode == OM_QAM_ITU_C) 5452 if (state->m_OperationMode == OM_QAM_ITU_C)
5457 setEnvParameters[0] = QAM_TOP_ANNEX_C; /* Annex */ 5453 setParamParameters[0] = QAM_TOP_ANNEX_C;
5458 else 5454 else
5459 setEnvParameters[0] = 0; 5455 setParamParameters[0] = QAM_TOP_ANNEX_A;
5460 5456 status = scu_command(state, SCU_RAM_COMMAND_STANDARD_QAM | SCU_RAM_COMMAND_CMD_DEMOD_SET_ENV, 1, setParamParameters, 1, &cmdResult);
5461 status = scu_command(state, SCU_RAM_COMMAND_STANDARD_QAM | SCU_RAM_COMMAND_CMD_DEMOD_SET_ENV, 1, setEnvParameters, 1, &cmdResult); 5457 if (status < 0)
5462 if (status < 0) 5458 goto error;
5463 goto error;
5464 5459
5465 setParamParameters[0] = state->m_Constellation; /* constellation */ 5460 setParamParameters[0] = state->m_Constellation; /* constellation */
5466 setParamParameters[1] = DRXK_QAM_I12_J17; /* interleave mode */ 5461 setParamParameters[1] = DRXK_QAM_I12_J17; /* interleave mode */
5467
5468 status = scu_command(state, SCU_RAM_COMMAND_STANDARD_QAM | SCU_RAM_COMMAND_CMD_DEMOD_SET_PARAM, 2, setParamParameters, 1, &cmdResult); 5462 status = scu_command(state, SCU_RAM_COMMAND_STANDARD_QAM | SCU_RAM_COMMAND_CMD_DEMOD_SET_PARAM, 2, setParamParameters, 1, &cmdResult);
5469 } 5463 }
5470 if (status < 0) 5464 if (status < 0)
5471 goto error; 5465 goto error;
5472 5466
5473 /* STEP 3: enable the system in a mode where the ADC provides valid signal 5467 /*
5474 setup constellation independent registers */ 5468 * STEP 3: enable the system in a mode where the ADC provides valid
5469 * signal setup constellation independent registers
5470 */
5475#if 0 5471#if 0
5476 status = SetFrequency(channel, tunerFreqOffset)); 5472 status = SetFrequency(channel, tunerFreqOffset));
5477 if (status < 0) 5473 if (status < 0)