aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorAndreas Regel <andreas.regel@gmx.de>2010-01-05 17:22:07 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-02-26 13:10:36 -0500
commitf91e59cb5e6add13d4e45c5cc8d45a614e1dc8e4 (patch)
treede4b04afb55fcaf55885dd725d891a4a86215766 /drivers/media
parentc369b7c2820dcad91b1354362097f6d8f9cf9307 (diff)
V4L/DVB (13979): [STV090x] Added possibility to set a fixed TS output clock.
This could be useful for p.e. Common Interface applications where data rate is limited. Signed-off-by: Andreas Regel <andreas.regel@gmx.de> Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/frontends/stv090x.c65
-rw-r--r--drivers/media/dvb/frontends/stv090x.h2
2 files changed, 67 insertions, 0 deletions
diff --git a/drivers/media/dvb/frontends/stv090x.c b/drivers/media/dvb/frontends/stv090x.c
index 2a25dd15b7fd..93be76ced896 100644
--- a/drivers/media/dvb/frontends/stv090x.c
+++ b/drivers/media/dvb/frontends/stv090x.c
@@ -4199,6 +4199,71 @@ static int stv090x_set_tspath(struct stv090x_state *state)
4199 default: 4199 default:
4200 break; 4200 break;
4201 } 4201 }
4202
4203 if (state->config->ts1_clk > 0) {
4204 u32 speed;
4205
4206 switch (state->config->ts1_mode) {
4207 case STV090x_TSMODE_PARALLEL_PUNCTURED:
4208 case STV090x_TSMODE_DVBCI:
4209 default:
4210 speed = state->internal->mclk /
4211 (state->config->ts1_clk / 4);
4212 if (speed < 0x08)
4213 speed = 0x08;
4214 if (speed > 0xFF)
4215 speed = 0xFF;
4216 break;
4217 case STV090x_TSMODE_SERIAL_PUNCTURED:
4218 case STV090x_TSMODE_SERIAL_CONTINUOUS:
4219 speed = state->internal->mclk /
4220 (state->config->ts1_clk / 32);
4221 if (speed < 0x20)
4222 speed = 0x20;
4223 if (speed > 0xFF)
4224 speed = 0xFF;
4225 break;
4226 }
4227 reg = stv090x_read_reg(state, STV090x_P1_TSCFGM);
4228 STV090x_SETFIELD_Px(reg, TSFIFO_MANSPEED_FIELD, 3);
4229 if (stv090x_write_reg(state, STV090x_P1_TSCFGM, reg) < 0)
4230 goto err;
4231 if (stv090x_write_reg(state, STV090x_P1_TSSPEED, speed) < 0)
4232 goto err;
4233 }
4234
4235 if (state->config->ts2_clk > 0) {
4236 u32 speed;
4237
4238 switch (state->config->ts2_mode) {
4239 case STV090x_TSMODE_PARALLEL_PUNCTURED:
4240 case STV090x_TSMODE_DVBCI:
4241 default:
4242 speed = state->internal->mclk /
4243 (state->config->ts2_clk / 4);
4244 if (speed < 0x08)
4245 speed = 0x08;
4246 if (speed > 0xFF)
4247 speed = 0xFF;
4248 break;
4249 case STV090x_TSMODE_SERIAL_PUNCTURED:
4250 case STV090x_TSMODE_SERIAL_CONTINUOUS:
4251 speed = state->internal->mclk /
4252 (state->config->ts2_clk / 32);
4253 if (speed < 0x20)
4254 speed = 0x20;
4255 if (speed > 0xFF)
4256 speed = 0xFF;
4257 break;
4258 }
4259 reg = stv090x_read_reg(state, STV090x_P2_TSCFGM);
4260 STV090x_SETFIELD_Px(reg, TSFIFO_MANSPEED_FIELD, 3);
4261 if (stv090x_write_reg(state, STV090x_P2_TSCFGM, reg) < 0)
4262 goto err;
4263 if (stv090x_write_reg(state, STV090x_P2_TSSPEED, speed) < 0)
4264 goto err;
4265 }
4266
4202 reg = stv090x_read_reg(state, STV090x_P2_TSCFGH); 4267 reg = stv090x_read_reg(state, STV090x_P2_TSCFGH);
4203 STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 0x01); 4268 STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 0x01);
4204 if (stv090x_write_reg(state, STV090x_P2_TSCFGH, reg) < 0) 4269 if (stv090x_write_reg(state, STV090x_P2_TSCFGH, reg) < 0)
diff --git a/drivers/media/dvb/frontends/stv090x.h b/drivers/media/dvb/frontends/stv090x.h
index e009183ad772..96e3dc758e08 100644
--- a/drivers/media/dvb/frontends/stv090x.h
+++ b/drivers/media/dvb/frontends/stv090x.h
@@ -70,6 +70,8 @@ struct stv090x_config {
70 70
71 u8 ts1_mode; 71 u8 ts1_mode;
72 u8 ts2_mode; 72 u8 ts2_mode;
73 u32 ts1_clk;
74 u32 ts2_clk;
73 75
74 enum stv090x_i2crpt repeater_level; 76 enum stv090x_i2crpt repeater_level;
75 77