aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2011-07-24 13:59:20 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-01-04 19:49:10 -0500
commit534e04810304a9c6715220b392aa387197d5fa15 (patch)
tree32ca6f83d678ec979a84d6c7b149e7dbb7f480e7 /drivers/media/dvb/frontends
parent0d3e6fe7cb1b80719dbacfbfb0f668e2971e8a5f (diff)
[media] drxk: Add support for parallel mode and prints mpeg mode
While the driver has support for both serial and parallel mode, There's was way to select serial mode via configuration. Add a config option for that, while keeping the default in serial mode. Also, at debug mode, it will now print a message when mpeg is enabled/disabled, and showing if parallel or serial mode were selected, helping developers to double-check if the DRX-K is at the right mode. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends')
-rw-r--r--drivers/media/dvb/frontends/drxk.h3
-rw-r--r--drivers/media/dvb/frontends/drxk_hard.c14
2 files changed, 11 insertions, 6 deletions
diff --git a/drivers/media/dvb/frontends/drxk.h b/drivers/media/dvb/frontends/drxk.h
index e6d42e271b89..870432ffcce1 100644
--- a/drivers/media/dvb/frontends/drxk.h
+++ b/drivers/media/dvb/frontends/drxk.h
@@ -8,6 +8,8 @@
8 * struct drxk_config - Configure the initial parameters for DRX-K 8 * struct drxk_config - Configure the initial parameters for DRX-K
9 * 9 *
10 * adr: I2C Address of the DRX-K 10 * adr: I2C Address of the DRX-K
11 * parallel_ts: true means that the device uses parallel TS,
12 * Serial otherwise.
11 * single_master: Device is on the single master mode 13 * single_master: Device is on the single master mode
12 * no_i2c_bridge: Don't switch the I2C bridge to talk with tuner 14 * no_i2c_bridge: Don't switch the I2C bridge to talk with tuner
13 * antenna_gpio: GPIO bit used to control the antenna 15 * antenna_gpio: GPIO bit used to control the antenna
@@ -22,6 +24,7 @@ struct drxk_config {
22 u8 adr; 24 u8 adr;
23 bool single_master; 25 bool single_master;
24 bool no_i2c_bridge; 26 bool no_i2c_bridge;
27 bool parallel_ts;
25 28
26 bool antenna_dvbt; 29 bool antenna_dvbt;
27 u16 antenna_gpio; 30 u16 antenna_gpio;
diff --git a/drivers/media/dvb/frontends/drxk_hard.c b/drivers/media/dvb/frontends/drxk_hard.c
index 817d3ec2be49..c8213f61effb 100644
--- a/drivers/media/dvb/frontends/drxk_hard.c
+++ b/drivers/media/dvb/frontends/drxk_hard.c
@@ -660,7 +660,6 @@ static int init_state(struct drxk_state *state)
660 /* io_pad_cfg_mode output mode is drive always */ 660 /* io_pad_cfg_mode output mode is drive always */
661 /* io_pad_cfg_drive is set to power 2 (23 mA) */ 661 /* io_pad_cfg_drive is set to power 2 (23 mA) */
662 u32 ulGPIOCfg = 0x0113; 662 u32 ulGPIOCfg = 0x0113;
663 u32 ulSerialMode = 1;
664 u32 ulInvertTSClock = 0; 663 u32 ulInvertTSClock = 0;
665 u32 ulTSDataStrength = DRXK_MPEG_SERIAL_OUTPUT_PIN_DRIVE_STRENGTH; 664 u32 ulTSDataStrength = DRXK_MPEG_SERIAL_OUTPUT_PIN_DRIVE_STRENGTH;
666 u32 ulTSClockkStrength = DRXK_MPEG_OUTPUT_CLK_DRIVE_STRENGTH; 665 u32 ulTSClockkStrength = DRXK_MPEG_OUTPUT_CLK_DRIVE_STRENGTH;
@@ -811,8 +810,6 @@ static int init_state(struct drxk_state *state)
811 /* MPEG output configuration */ 810 /* MPEG output configuration */
812 state->m_enableMPEGOutput = true; /* If TRUE; enable MPEG ouput */ 811 state->m_enableMPEGOutput = true; /* If TRUE; enable MPEG ouput */
813 state->m_insertRSByte = false; /* If TRUE; insert RS byte */ 812 state->m_insertRSByte = false; /* If TRUE; insert RS byte */
814 state->m_enableParallel = true; /* If TRUE;
815 parallel out otherwise serial */
816 state->m_invertDATA = false; /* If TRUE; invert DATA signals */ 813 state->m_invertDATA = false; /* If TRUE; invert DATA signals */
817 state->m_invertERR = false; /* If TRUE; invert ERR signal */ 814 state->m_invertERR = false; /* If TRUE; invert ERR signal */
818 state->m_invertSTR = false; /* If TRUE; invert STR signals */ 815 state->m_invertSTR = false; /* If TRUE; invert STR signals */
@@ -857,8 +854,6 @@ static int init_state(struct drxk_state *state)
857 state->m_bPowerDown = false; 854 state->m_bPowerDown = false;
858 state->m_currentPowerMode = DRX_POWER_DOWN; 855 state->m_currentPowerMode = DRX_POWER_DOWN;
859 856
860 state->m_enableParallel = (ulSerialMode == 0);
861
862 state->m_rfmirror = (ulRfMirror == 0); 857 state->m_rfmirror = (ulRfMirror == 0);
863 state->m_IfAgcPol = false; 858 state->m_IfAgcPol = false;
864 return 0; 859 return 0;
@@ -1195,7 +1190,9 @@ static int MPEGTSConfigurePins(struct drxk_state *state, bool mpegEnable)
1195 u16 sioPdrMclkCfg = 0; 1190 u16 sioPdrMclkCfg = 0;
1196 u16 sioPdrMdxCfg = 0; 1191 u16 sioPdrMdxCfg = 0;
1197 1192
1198 dprintk(1, "\n"); 1193 dprintk(1, ": mpeg %s, %s mode\n",
1194 mpegEnable ? "enable" : "disable",
1195 state->m_enableParallel ? "parallel" : "serial");
1199 1196
1200 /* stop lock indicator process */ 1197 /* stop lock indicator process */
1201 status = write16(state, SCU_RAM_GPIO__A, SCU_RAM_GPIO_HW_LOCK_IND_DISABLE); 1198 status = write16(state, SCU_RAM_GPIO__A, SCU_RAM_GPIO_HW_LOCK_IND_DISABLE);
@@ -6432,6 +6429,11 @@ struct dvb_frontend *drxk_attach(const struct drxk_config *config,
6432 state->antenna_dvbt = config->antenna_dvbt; 6429 state->antenna_dvbt = config->antenna_dvbt;
6433 state->m_ChunkSize = config->chunk_size; 6430 state->m_ChunkSize = config->chunk_size;
6434 6431
6432 if (config->parallel_ts)
6433 state->m_enableParallel = true;
6434 else
6435 state->m_enableParallel = false;
6436
6435 /* NOTE: as more UIO bits will be used, add them to the mask */ 6437 /* NOTE: as more UIO bits will be used, add them to the mask */
6436 state->UIO_mask = config->antenna_gpio; 6438 state->UIO_mask = config->antenna_gpio;
6437 6439