Re: [PATCH] [0905_23] Siano: gpio - use new implementation

2009-05-18 Thread Mauro Carvalho Chehab
Em Sun, 17 May 2009 01:57:45 -0700 (PDT)
Uri Shkolnik uri...@yahoo.com escreveu:

 
 # HG changeset patch
 # User Uri Shkolnik u...@siano-ms.com
 # Date 1242331325 -10800
 # Node ID 415ca02f74b960c02ddfa7ee719cf87726d97490
 # Parent  8b645aa2ab13f22b8d4dcd8e6353fce2c976cd34
 [0905_23] Siano: gpio - use new implementation
 
 From: Uri Shkolnik u...@siano-ms.com
 
 Start using the corrected gpio implementation

Hmm...

WARNING: smscore_configure_gpio [/home/v4l/master/v4l/sms1xxx.ko] undefined!
WARNING: smscore_set_gpio [/home/v4l/master/v4l/sms1xxx.ko] undefined!

Those functions weren't defined on any module. It seems that you forgot to
submit a previous patch.

Also, since Hauppauge complained about the gpio changes, I'd like to have
Michael's ack, especially if the patch affects the behavior of the existing
Hauppauge supported boards.

Cheers,
Mauro.


 
 Priority: normal
 
 Signed-off-by: Uri Shkolnik u...@siano-ms.com
 
 diff -r 8b645aa2ab13 -r 415ca02f74b9 linux/drivers/media/dvb/siano/sms-cards.c
 --- a/linux/drivers/media/dvb/siano/sms-cards.c   Thu May 14 22:28:38 
 2009 +0300
 +++ b/linux/drivers/media/dvb/siano/sms-cards.c   Thu May 14 23:02:05 
 2009 +0300
 @@ -17,6 +17,7 @@
   *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   */
  
 +#include smscoreapi.h
  #include sms-cards.h
  #include smsir.h
  
 @@ -155,6 +156,174 @@ struct sms_board *sms_get_board(int id)
  }
  EXPORT_SYMBOL_GPL(sms_get_board);
  
 +static inline void sms_gpio_assign_11xx_default_led_config(
 + struct smscore_gpio_config *pGpioConfig) {
 + pGpioConfig-Direction = SMS_GPIO_DIRECTION_OUTPUT;
 + pGpioConfig-InputCharacteristics =
 + SMS_GPIO_INPUTCHARACTERISTICS_NORMAL;
 + pGpioConfig-OutputDriving = SMS_GPIO_OUTPUTDRIVING_4mA;
 + pGpioConfig-OutputSlewRate = SMS_GPIO_OUTPUTSLEWRATE_0_45_V_NS;
 + pGpioConfig-PullUpDown = SMS_GPIO_PULLUPDOWN_NONE;
 +}
 +
 +int sms_board_event(struct smscore_device_t *coredev,
 + enum SMS_BOARD_EVENTS gevent) {
 + int board_id = smscore_get_board_id(coredev);
 + struct sms_board *board = sms_get_board(board_id);
 + struct smscore_gpio_config MyGpioConfig;
 +
 + sms_gpio_assign_11xx_default_led_config(MyGpioConfig);
 +
 + switch (gevent) {
 + case BOARD_EVENT_POWER_INIT: /* including hotplug */
 + switch (board_id) {
 + case SMS1XXX_BOARD_HAUPPAUGE_WINDHAM:
 + /* set I/O and turn off all LEDs */
 + smscore_gpio_configure(coredev,
 + board-board_cfg.leds_power,
 + MyGpioConfig);
 + smscore_gpio_set_level(coredev,
 + board-board_cfg.leds_power, 0);
 + smscore_gpio_configure(coredev, board-board_cfg.led0,
 + MyGpioConfig);
 + smscore_gpio_set_level(coredev,
 + board-board_cfg.led0, 0);
 + smscore_gpio_configure(coredev, board-board_cfg.led1,
 + MyGpioConfig);
 + smscore_gpio_set_level(coredev,
 + board-board_cfg.led1, 0);
 + break;
 + case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2:
 + case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD:
 + /* set I/O and turn off LNA */
 + smscore_gpio_configure(coredev,
 + board-board_cfg.foreign_lna0_ctrl,
 + MyGpioConfig);
 + smscore_gpio_set_level(coredev,
 + board-board_cfg.foreign_lna0_ctrl,
 + 0);
 + break;
 + }
 + break; /* BOARD_EVENT_BIND */
 +
 + case BOARD_EVENT_POWER_SUSPEND:
 + switch (board_id) {
 + case SMS1XXX_BOARD_HAUPPAUGE_WINDHAM:
 + smscore_gpio_set_level(coredev,
 + board-board_cfg.leds_power, 0);
 + smscore_gpio_set_level(coredev,
 + board-board_cfg.led0, 0);
 + smscore_gpio_set_level(coredev,
 + board-board_cfg.led1, 0);
 + break;
 + case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2:
 + case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD:
 + smscore_gpio_set_level(coredev,
 + board-board_cfg.foreign_lna0_ctrl,
 + 0);
 + break;
 + }
 + break; /* BOARD_EVENT_POWER_SUSPEND */
 +
 + case BOARD_EVENT_POWER_RESUME:
 + switch (board_id) {
 + case 

[PATCH] [0905_23] Siano: gpio - use new implementation

2009-05-17 Thread Uri Shkolnik

# HG changeset patch
# User Uri Shkolnik u...@siano-ms.com
# Date 1242331325 -10800
# Node ID 415ca02f74b960c02ddfa7ee719cf87726d97490
# Parent  8b645aa2ab13f22b8d4dcd8e6353fce2c976cd34
[0905_23] Siano: gpio - use new implementation

From: Uri Shkolnik u...@siano-ms.com

Start using the corrected gpio implementation

Priority: normal

Signed-off-by: Uri Shkolnik u...@siano-ms.com

diff -r 8b645aa2ab13 -r 415ca02f74b9 linux/drivers/media/dvb/siano/sms-cards.c
--- a/linux/drivers/media/dvb/siano/sms-cards.c Thu May 14 22:28:38 2009 +0300
+++ b/linux/drivers/media/dvb/siano/sms-cards.c Thu May 14 23:02:05 2009 +0300
@@ -17,6 +17,7 @@
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include smscoreapi.h
 #include sms-cards.h
 #include smsir.h
 
@@ -155,6 +156,174 @@ struct sms_board *sms_get_board(int id)
 }
 EXPORT_SYMBOL_GPL(sms_get_board);
 
+static inline void sms_gpio_assign_11xx_default_led_config(
+   struct smscore_gpio_config *pGpioConfig) {
+   pGpioConfig-Direction = SMS_GPIO_DIRECTION_OUTPUT;
+   pGpioConfig-InputCharacteristics =
+   SMS_GPIO_INPUTCHARACTERISTICS_NORMAL;
+   pGpioConfig-OutputDriving = SMS_GPIO_OUTPUTDRIVING_4mA;
+   pGpioConfig-OutputSlewRate = SMS_GPIO_OUTPUTSLEWRATE_0_45_V_NS;
+   pGpioConfig-PullUpDown = SMS_GPIO_PULLUPDOWN_NONE;
+}
+
+int sms_board_event(struct smscore_device_t *coredev,
+   enum SMS_BOARD_EVENTS gevent) {
+   int board_id = smscore_get_board_id(coredev);
+   struct sms_board *board = sms_get_board(board_id);
+   struct smscore_gpio_config MyGpioConfig;
+
+   sms_gpio_assign_11xx_default_led_config(MyGpioConfig);
+
+   switch (gevent) {
+   case BOARD_EVENT_POWER_INIT: /* including hotplug */
+   switch (board_id) {
+   case SMS1XXX_BOARD_HAUPPAUGE_WINDHAM:
+   /* set I/O and turn off all LEDs */
+   smscore_gpio_configure(coredev,
+   board-board_cfg.leds_power,
+   MyGpioConfig);
+   smscore_gpio_set_level(coredev,
+   board-board_cfg.leds_power, 0);
+   smscore_gpio_configure(coredev, board-board_cfg.led0,
+   MyGpioConfig);
+   smscore_gpio_set_level(coredev,
+   board-board_cfg.led0, 0);
+   smscore_gpio_configure(coredev, board-board_cfg.led1,
+   MyGpioConfig);
+   smscore_gpio_set_level(coredev,
+   board-board_cfg.led1, 0);
+   break;
+   case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2:
+   case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD:
+   /* set I/O and turn off LNA */
+   smscore_gpio_configure(coredev,
+   board-board_cfg.foreign_lna0_ctrl,
+   MyGpioConfig);
+   smscore_gpio_set_level(coredev,
+   board-board_cfg.foreign_lna0_ctrl,
+   0);
+   break;
+   }
+   break; /* BOARD_EVENT_BIND */
+
+   case BOARD_EVENT_POWER_SUSPEND:
+   switch (board_id) {
+   case SMS1XXX_BOARD_HAUPPAUGE_WINDHAM:
+   smscore_gpio_set_level(coredev,
+   board-board_cfg.leds_power, 0);
+   smscore_gpio_set_level(coredev,
+   board-board_cfg.led0, 0);
+   smscore_gpio_set_level(coredev,
+   board-board_cfg.led1, 0);
+   break;
+   case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2:
+   case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD:
+   smscore_gpio_set_level(coredev,
+   board-board_cfg.foreign_lna0_ctrl,
+   0);
+   break;
+   }
+   break; /* BOARD_EVENT_POWER_SUSPEND */
+
+   case BOARD_EVENT_POWER_RESUME:
+   switch (board_id) {
+   case SMS1XXX_BOARD_HAUPPAUGE_WINDHAM:
+   smscore_gpio_set_level(coredev,
+   board-board_cfg.leds_power, 1);
+   smscore_gpio_set_level(coredev,
+   board-board_cfg.led0, 1);
+   smscore_gpio_set_level(coredev,
+   board-board_cfg.led1, 0);
+   break;
+   case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2:
+