http://downloads.netgear.com/files/GPL/GPL_Source_V361j_DM111PSP_series_consumer_rele...
[bcm963xx.git] / bcmdrivers / opensource / char / board / bcm963xx / impl1 / bcm63xx_led.c
index 2936f1c..9b8858c 100755 (executable)
@@ -349,12 +349,46 @@ void __init boardLedInit(PLED_MAP_PAIR cLedMapping)
     GPIO->LEDCtrl |= LED_INTERVAL_SET_80MS;
 #endif
 #if defined(CONFIG_BCM96358)
+#ifdef BRCM_ORIGINAL   //swda modify,05/30/2006
     /* Enable LED Outputs */
     GPIO->GPIOMode |= GPIO_MODE_LED_OVERLAY;
     GPIO->GPIODir |= 0x000f;
     /* Enable Serial LED Outputs */
     GPIO->GPIOMode |= GPIO_MODE_SERIAL_LED_OVERLAY;
     GPIO->GPIODir |= 0x00c0;
+#elif defined(IAD_VDSL_6358)
+       /* Disable LED Outputs, use standard GPIO defination */
+       GPIO->GPIOMode &= (~GPIO_MODE_LED_OVERLAY);
+    /* Enable Serial LED Outputs */
+    GPIO->GPIOMode |= GPIO_MODE_SERIAL_LED_OVERLAY;
+    GPIO->GPIODir |= 0x00c0;//gpio6,7 were used to control serial led, so set gpio 6,7 as output pins
+       //turn off VOIP Led,SLIC_ACT1 Led,SLIC_ACT2 Led : Serial LED GPIO 5,6,7(active low)
+       while (GPIO->SerialLedCtrl & SER_LED_BUSY);
+       GPIO->SerialLed  |= 0x000000e0;
+#elif defined(IAD_GPON_6358)
+       /* Disable LED Outputs, use standard GPIO defination */
+       GPIO->GPIOMode &= (~GPIO_MODE_LED_OVERLAY);
+       /* Disable Serial LED Outputs, use standard GPIO defination */
+       GPIO->GPIOMode &= (~GPIO_MODE_SERIAL_LED_OVERLAY);
+#else
+       /* Disable LED Outputs, use standard GPIO defination */
+       GPIO->GPIOMode &= (~GPIO_MODE_LED_OVERLAY);
+       /* Disable Serial LED Outputs, use standard GPIO defination */
+       GPIO->GPIOMode &= (~GPIO_MODE_SERIAL_LED_OVERLAY);
+       printk("GPIO->GPIOMode = 0x%08X\n",GPIO->GPIOMode);
+       //turn off FXO Led  : GPIO 7(active low)
+       GPIO->GPIODir |= GPIO_NUM_TO_MASK(7);
+       GPIO->GPIOio |= GPIO_NUM_TO_MASK(7); 
+       //turn off VOIP Led : GPIO 15(active low)
+       GPIO->GPIODir |= GPIO_NUM_TO_MASK(15);
+       GPIO->GPIOio |= GPIO_NUM_TO_MASK(15);
+       //turn off SLIC_ACT1 Led: GPIO 26(active low)
+       GPIO->GPIODir |= GPIO_NUM_TO_MASK(26);
+       GPIO->GPIOio |= GPIO_NUM_TO_MASK(26);
+       //turn off SLIC_ACT2 Led: GPIO 6(active low)
+       GPIO->GPIODir |= GPIO_NUM_TO_MASK(6);
+       GPIO->GPIOio |= GPIO_NUM_TO_MASK(6);
+#endif //swda modify end
 #endif
 
     memset( gpVirtLeds, 0x00, sizeof(gpVirtLeds) );
@@ -550,8 +584,8 @@ void boardLedCtrl(BOARD_LED_NAME ledName, BOARD_LED_STATE ledState)
     // If the state is kLedStateFail and there is not a failure LED defined
     // in the board parameters, change the state to kLedStateSlowBlinkContinues.
     if( ledState == kLedStateFail && ledInfoPtr->ledMaskFail == 0 )
-        ledState = kLedStateSlowBlinkContinues;
-
+        //ledState = kLedStateSlowBlinkContinues;//swda remove,05/03/2005
+        ledState = kLedStateOff;//swda add,05/03/2005
     switch (ledState)
     {
         case kLedStateOn: