V4L/DVB (5788): Cx88-input: convert nested if's to switch..case
In the function, cx88_ir_handle_key: - convert nested if statement to a switch..case block Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
parent
e7d11ecbde
commit
829ea96477
|
@ -74,7 +74,8 @@ static void cx88_ir_handle_key(struct cx88_IR *ir)
|
||||||
|
|
||||||
/* read gpio value */
|
/* read gpio value */
|
||||||
gpio = cx_read(ir->gpio_addr);
|
gpio = cx_read(ir->gpio_addr);
|
||||||
if (core->board == CX88_BOARD_NPGTECH_REALTV_TOP10FM) {
|
switch (core->board) {
|
||||||
|
case CX88_BOARD_NPGTECH_REALTV_TOP10FM:
|
||||||
/* This board apparently uses a combination of 2 GPIO
|
/* This board apparently uses a combination of 2 GPIO
|
||||||
to represent the keys. Additionally, the second GPIO
|
to represent the keys. Additionally, the second GPIO
|
||||||
can be used for parity.
|
can be used for parity.
|
||||||
|
@ -90,12 +91,14 @@ static void cx88_ir_handle_key(struct cx88_IR *ir)
|
||||||
auxgpio = cx_read(MO_GP1_IO);
|
auxgpio = cx_read(MO_GP1_IO);
|
||||||
/* Take out the parity part */
|
/* Take out the parity part */
|
||||||
gpio=(gpio & 0x7fd) + (auxgpio & 0xef);
|
gpio=(gpio & 0x7fd) + (auxgpio & 0xef);
|
||||||
} else if (core->board == CX88_BOARD_WINFAST_DTV1000) {
|
break;
|
||||||
|
case CX88_BOARD_WINFAST_DTV1000:
|
||||||
gpio = (gpio & 0x6ff) | ((cx_read(MO_GP1_IO) << 8) & 0x900);
|
gpio = (gpio & 0x6ff) | ((cx_read(MO_GP1_IO) << 8) & 0x900);
|
||||||
auxgpio = gpio;
|
auxgpio = gpio;
|
||||||
} else
|
break;
|
||||||
|
default:
|
||||||
auxgpio = gpio;
|
auxgpio = gpio;
|
||||||
|
}
|
||||||
if (ir->polling) {
|
if (ir->polling) {
|
||||||
if (ir->last_gpio == auxgpio)
|
if (ir->last_gpio == auxgpio)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue