提交 5c2a164a 编写于 作者: S Steven Toth 提交者: Mauro Carvalho Chehab

V4L/DVB (9255): tda10048: Checkpatch compliance

tda10048: Checkpatch compliance
Signed-off-by: NSteven Toth <stoth@linuxtv.org>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 f11ec7d4
...@@ -195,7 +195,7 @@ static struct init_tab { ...@@ -195,7 +195,7 @@ static struct init_tab {
static int tda10048_writereg(struct tda10048_state *state, u8 reg, u8 data) static int tda10048_writereg(struct tda10048_state *state, u8 reg, u8 data)
{ {
int ret; int ret;
u8 buf [] = { reg, data }; u8 buf[] = { reg, data };
struct i2c_msg msg = { struct i2c_msg msg = {
.addr = state->config->demod_address, .addr = state->config->demod_address,
.flags = 0, .buf = buf, .len = 2 }; .flags = 0, .buf = buf, .len = 2 };
...@@ -213,9 +213,9 @@ static int tda10048_writereg(struct tda10048_state *state, u8 reg, u8 data) ...@@ -213,9 +213,9 @@ static int tda10048_writereg(struct tda10048_state *state, u8 reg, u8 data)
static u8 tda10048_readreg(struct tda10048_state *state, u8 reg) static u8 tda10048_readreg(struct tda10048_state *state, u8 reg)
{ {
int ret; int ret;
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, { .addr = state->config->demod_address,
.flags = 0, .buf = b0, .len = 1 }, .flags = 0, .buf = b0, .len = 1 },
{ .addr = state->config->demod_address, { .addr = state->config->demod_address,
...@@ -393,43 +393,89 @@ static int tda10048_get_tps(struct tda10048_state *state, ...@@ -393,43 +393,89 @@ static int tda10048_get_tps(struct tda10048_state *state,
val = tda10048_readreg(state, TDA10048_OUT_CONF2); val = tda10048_readreg(state, TDA10048_OUT_CONF2);
switch ((val & 0x60) >> 5) { switch ((val & 0x60) >> 5) {
case 0: p->constellation = QPSK; break; case 0:
case 1: p->constellation = QAM_16; break; p->constellation = QPSK;
case 2: p->constellation = QAM_64; break; break;
case 1:
p->constellation = QAM_16;
break;
case 2:
p->constellation = QAM_64;
break;
} }
switch ((val & 0x18) >> 3) { switch ((val & 0x18) >> 3) {
case 0: p->hierarchy_information = HIERARCHY_NONE; break; case 0:
case 1: p->hierarchy_information = HIERARCHY_1; break; p->hierarchy_information = HIERARCHY_NONE;
case 2: p->hierarchy_information = HIERARCHY_2; break; break;
case 3: p->hierarchy_information = HIERARCHY_4; break; case 1:
p->hierarchy_information = HIERARCHY_1;
break;
case 2:
p->hierarchy_information = HIERARCHY_2;
break;
case 3:
p->hierarchy_information = HIERARCHY_4;
break;
} }
switch (val & 0x07) { switch (val & 0x07) {
case 0: p->code_rate_HP = FEC_1_2; break; case 0:
case 1: p->code_rate_HP = FEC_2_3; break; p->code_rate_HP = FEC_1_2;
case 2: p->code_rate_HP = FEC_3_4; break; break;
case 3: p->code_rate_HP = FEC_5_6; break; case 1:
case 4: p->code_rate_HP = FEC_7_8; break; p->code_rate_HP = FEC_2_3;
break;
case 2:
p->code_rate_HP = FEC_3_4;
break;
case 3:
p->code_rate_HP = FEC_5_6;
break;
case 4:
p->code_rate_HP = FEC_7_8;
break;
} }
val = tda10048_readreg(state, TDA10048_OUT_CONF3); val = tda10048_readreg(state, TDA10048_OUT_CONF3);
switch (val & 0x07) { switch (val & 0x07) {
case 0: p->code_rate_LP = FEC_1_2; break; case 0:
case 1: p->code_rate_LP = FEC_2_3; break; p->code_rate_LP = FEC_1_2;
case 2: p->code_rate_LP = FEC_3_4; break; break;
case 3: p->code_rate_LP = FEC_5_6; break; case 1:
case 4: p->code_rate_LP = FEC_7_8; break; p->code_rate_LP = FEC_2_3;
break;
case 2:
p->code_rate_LP = FEC_3_4;
break;
case 3:
p->code_rate_LP = FEC_5_6;
break;
case 4:
p->code_rate_LP = FEC_7_8;
break;
} }
val = tda10048_readreg(state, TDA10048_OUT_CONF1); val = tda10048_readreg(state, TDA10048_OUT_CONF1);
switch ((val & 0x0c) >> 2) { switch ((val & 0x0c) >> 2) {
case 0: p->guard_interval = GUARD_INTERVAL_1_32; break; case 0:
case 1: p->guard_interval = GUARD_INTERVAL_1_16; break; p->guard_interval = GUARD_INTERVAL_1_32;
case 2: p->guard_interval = GUARD_INTERVAL_1_8; break; break;
case 3: p->guard_interval = GUARD_INTERVAL_1_4; break; case 1:
p->guard_interval = GUARD_INTERVAL_1_16;
break;
case 2:
p->guard_interval = GUARD_INTERVAL_1_8;
break;
case 3:
p->guard_interval = GUARD_INTERVAL_1_4;
break;
} }
switch (val & 0x02) { switch (val & 0x02) {
case 0: p->transmission_mode = TRANSMISSION_MODE_2K; break; case 0:
case 1: p->transmission_mode = TRANSMISSION_MODE_8K; break; p->transmission_mode = TRANSMISSION_MODE_2K;
break;
case 1:
p->transmission_mode = TRANSMISSION_MODE_8K;
break;
} }
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册