Skip to contentSkip to conversation

[09051_57] Siano: smscards - remove redundant code

PATCH Uri Shkolnik 1 participant 1 message May 19, 2009 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw
Quoted 198 lines · Michael Krufky

From: Michael Krufky <[email protected]>
Subject: Re: [PATCH] [09051_57] Siano: smscards - remove redundant code
To: "Uri Shkolnik" <[email protected]>
Cc: "LinuxML" <[email protected]>, "Mauro Carvalho Chehab" <[email protected]>
Date: Tuesday, May 19, 2009, 8:04 PM

Quoted 11 lines · Uri Shkolnik

# HG changeset patch
# User Uri Shkolnik <[email protected]>
# Date 1242751824 -10800
# Node ID fd16bcd8b9f1fffe0b605ca5b3b2138fc920e927 # Parent  f78cbc153c82ebe58a1bbe82271b91f5a4a90642 [09051_57] Siano: smscards - remove redundant code

From: Uri Shkolnik <[email protected]>

Remove code that has been duplicate with the new

boards events manager

Quoted 6 lines

Priority: normal

diff -r f78cbc153c82 -r fd16bcd8b9f1

linux/drivers/media/dvb/siano/sms-cards.c

Quoted 1 line

--- a/linux/drivers/media/dvb/siano/sms-cards.c Tue

May 19 19:45:05 2009 +0300
Quoted 1 line

+++ b/linux/drivers/media/dvb/siano/sms-cards.c Tue

May 19 19:50:24 2009 +0300

Review int sms_board_event(struct

Quoted 1 line
(quoted diff) +0 -0
@@ -281,98 +281,3 @@ int sms_board_event(struct

smscore_devic

Review int sms_board_event(struct · line 285

Quoted 5 lines
(quoted diff) +0 -2
        return 0;
  }
  EXPORT_SYMBOL_GPL(sms_board_event);
-
-static int sms_set_gpio(struct smscore_device_t

*coredev, int pin, int enable)

Review int sms_board_event(struct · line 290

Quoted 5 lines
(quoted diff) +0 -5
-{
-       int lvl, ret;
-       u32 gpio;
-       struct smscore_config_gpio gpioconfig = {
-               .direction            =

SMS_GPIO_DIRECTION_OUTPUT,

Review int sms_board_event(struct · line 291

Quoted 1 line
(quoted diff) +0 -1
-               .pullupdown           =

SMS_GPIO_PULLUPDOWN_NONE,

Review int sms_board_event(struct · line 292

Quoted 1 line
(quoted diff) +0 -1
-               .inputcharacteristics =

SMS_GPIO_INPUTCHARACTERISTICS_NORMAL,

Review int sms_board_event(struct · line 293

Quoted 1 line
(quoted diff) +0 -1
-               .outputslewrate       =

SMS_GPIO_OUTPUTSLEWRATE_FAST,

Review int sms_board_event(struct · line 294

Quoted 1 line
(quoted diff) +0 -1
-               .outputdriving        =

SMS_GPIO_OUTPUTDRIVING_4mA,

Quoted 5 lines
(quoted diff) +0 -5
-       };
-
-       if (pin == 0)
-               return -EINVAL;
-

Review int sms_board_event(struct · line 309

Quoted 10 lines
(quoted diff) +0 -10
-       if (pin < 0) {
-               /* inverted gpio */
-               gpio = pin * -1;
-               lvl = enable ? 0 : 1;
-       } else {
-               gpio = pin;
-               lvl = enable ? 1 : 0;
-       }
-
-       ret = smscore_configure_gpio(coredev, gpio,

&gpioconfig);

Review int sms_board_event(struct · line 313

Quoted 4 lines
(quoted diff) +0 -4
-       if (ret < 0)
-               return ret;
-
-       return smscore_set_gpio(coredev, gpio,

lvl);

Review int sms_board_event(struct · line 316

Quoted 3 lines
(quoted diff) +0 -3
-}
-
-int sms_board_power(struct smscore_device_t *coredev,

int onoff)

Review int sms_board_event(struct · line 318

Quoted 2 lines
(quoted diff) +0 -2
-{
-       int board_id =

smscore_get_board_id(coredev);

Review int sms_board_event(struct · line 319

Quoted 1 line
(quoted diff) +0 -1
-       struct sms_board *board =

sms_get_board(board_id);

Review int sms_board_event(struct · line 325

Quoted 6 lines
(quoted diff) +0 -6
-
-       switch (board_id) {
-       case SMS1XXX_BOARD_HAUPPAUGE_WINDHAM:
-               /* power LED */
-               sms_set_gpio(coredev,
-                          

 board->led_power, onoff ? 1 : 0);

Review int sms_board_event(struct · line 327

Quoted 2 lines
(quoted diff) +0 -2
-               break;
-       case

SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2:

Review int sms_board_event(struct · line 328

Quoted 1 line
(quoted diff) +0 -1
-       case

SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD:

Review int sms_board_event(struct · line 331

Quoted 3 lines
(quoted diff) +0 -3
-               /* LNA */
-               if (!onoff)
-                      

sms_set_gpio(coredev, board->lna_ctrl, 0);

Review int sms_board_event(struct · line 338

Quoted 7 lines
(quoted diff) +0 -7
-               break;
-       }
-       return 0;
-}
-EXPORT_SYMBOL_GPL(sms_board_power);
-
-int sms_board_led_feedback(struct smscore_device_t

*coredev, int led)

Review int sms_board_event(struct · line 340

Quoted 2 lines
(quoted diff) +0 -2
-{
-       int board_id =

smscore_get_board_id(coredev);

Review int sms_board_event(struct · line 341

Quoted 1 line
(quoted diff) +0 -1
-       struct sms_board *board =

sms_get_board(board_id);

Review int sms_board_event(struct · line 343

Quoted 2 lines
(quoted diff) +0 -2
-
-       /* dont touch GPIO if LEDs are already set

*/

Review int sms_board_event(struct · line 350

Quoted 7 lines
(quoted diff) +0 -7
-       if (smscore_led_state(coredev, -1) == led)
-               return 0;
-
-       switch (board_id) {
-       case SMS1XXX_BOARD_HAUPPAUGE_WINDHAM:
-               sms_set_gpio(coredev,
-                          

 board->led_lo, (led & SMS_LED_LO) ? 1 : 0);

Review int sms_board_event(struct · line 352

Quoted 2 lines
(quoted diff) +0 -2
-               sms_set_gpio(coredev,
-                          

 board->led_hi, (led & SMS_LED_HI) ? 1 : 0);

Review int sms_board_event(struct · line 354

Quoted 2 lines
(quoted diff) +0 -2
-
-               smscore_led_state(coredev,

led);

Review int sms_board_event(struct · line 361

Quoted 7 lines
(quoted diff) +0 -7
-               break;
-       }
-       return 0;
-}
-EXPORT_SYMBOL_GPL(sms_board_led_feedback);
-
-int sms_board_lna_control(struct smscore_device_t

*coredev, int onoff)

Review int sms_board_event(struct · line 363

Quoted 2 lines
(quoted diff) +0 -2
-{
-       int board_id =

smscore_get_board_id(coredev);

Review int sms_board_event(struct · line 364

Quoted 1 line
(quoted diff) +0 -1
-       struct sms_board *board =

sms_get_board(board_id);

Review int sms_board_event(struct · line 366

Quoted 2 lines
(quoted diff) +0 -2
-
-       sms_debug("%s: LNA %s", __func__, onoff ?

"enabled" : "disabled");

Review int sms_board_event(struct · line 369

Quoted 3 lines
(quoted diff) +0 -3
-
-       switch (board_id) {
-       case

SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2:

Review int sms_board_event(struct · line 370

Quoted 1 line
(quoted diff) +0 -1
-       case

SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD:

Review int sms_board_event(struct · line 372

Quoted 2 lines
(quoted diff) +0 -2
-               sms_set_gpio(coredev,
-                          

 board->rf_switch, onoff ? 1 : 0);

Review int sms_board_event(struct · line 374

Quoted 2 lines
(quoted diff) +0 -2
-               return sms_set_gpio(coredev,
-                                  

board->lna_ctrl, onoff ? 1 : 0);

Quoted 5 lines
(quoted diff) +0 -4
-       }
-       return -EINVAL;
-}
-EXPORT_SYMBOL_GPL(sms_board_lna_control);

diff -r f78cbc153c82 -r fd16bcd8b9f1

linux/drivers/media/dvb/siano/sms-cards.h

Quoted 1 line

--- a/linux/drivers/media/dvb/siano/sms-cards.h Tue

May 19 19:45:05 2009 +0300
Quoted 1 line

+++ b/linux/drivers/media/dvb/siano/sms-cards.h Tue

May 19 19:50:24 2009 +0300

Review int sms_board_event(struct

Quoted 1 line
(quoted diff) +0 -0
@@ -110,11 +110,4 @@ int sms_board_event(struct

smscore_devic

Quoted 1 line

 int sms_board_event(struct smscore_device_t

*coredev,

Review

Quoted 6 lines

               enum SMS_BOARD_EVENTS gevent);

(quoted diff) +0 -4
-#define SMS_LED_OFF 0
-#define SMS_LED_LO  1
-#define SMS_LED_HI  2
-int sms_board_led_feedback(struct smscore_device_t

*coredev, int led);

Quoted 1 line

-int sms_board_power(struct smscore_device_t *coredev,

int onoff);

Quoted 1 line

-int sms_board_lna_control(struct smscore_device_t

*coredev, int onoff);

Quoted 8 lines

-
 #endif /* __SMS_CARDS_H__ */

--
To unsubscribe from this list: send the line

"unsubscribe linux-media" in

Quoted 3 lines

the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

NACK.

Quoted 8 lines

Again, this breaks the Hauppauge devices...  As I have said, lets deal
with that separately after the core changesets are merged.

Regards,

Mike

And again Mike, the core changesets ARE ALREADY merged.

Uri