if (data[0] == 1) {
i_MaxChannel = 8;
- }
- else {
+ } else {
if (data[0] == 2) {
i_MaxChannel = 6;
- }
- else {
+ } else {
dev_warn(dev->hw_dev,
"The specified port event does not exist\n");
return -EINVAL;
devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER);
- }
- else {
+ } else {
dev_warn(dev->hw_dev,
"The choice for interrupt logic does not exist\n");
return -EINVAL;
outb(0xF4,
devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER);
- }
- else {
+ } else {
dev_warn(dev->hw_dev,
"The choice for interrupt logic does not exist\n");
return -EINVAL;
devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER);
- }
- else {
+ } else {
dev_warn(dev->hw_dev,
"Event 1 not initialised\n");
return -EINVAL;
devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER);
i_Event2InterruptStatus = 1;
- }
- else {
+ } else {
dev_warn(dev->hw_dev,
"Event 2 not initialised\n");
return -EINVAL;
}
}
- }
- else {
+ } else {
dev_warn(dev->hw_dev,
"The port parameter is in error\n");
return -EINVAL;
devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER);
i_Event1InterruptStatus = 0;
- }
- else {
+ } else {
dev_warn(dev->hw_dev,
"Event 1 not initialised\n");
return -EINVAL;
devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER);
i_Event2InterruptStatus = 0;
- }
- else {
+ } else {
+
dev_warn(dev->hw_dev,
"Event 2 not initialised\n");
return -EINVAL;
}
}
- }
- else {
+ } else {
dev_warn(dev->hw_dev,
"The port parameter is in error\n");
return -EINVAL;
data[0] = (data[0] << ui_NoOfChannel) | ui_Temp;
outw(data[0],
devpriv->i_IobaseAddon + APCI1500_DIGITAL_OP);
- }
- else {
+ } else {
if (data[1] == 1) {
switch (ui_NoOfChannel) {
outw(data[0],
devpriv->i_IobaseAddon +
APCI1500_DIGITAL_OP);
- }
- else {
+ } else {
dev_warn(dev->hw_dev,
"Specified channel not supported\n");
return -EINVAL;
}
}
- }
- else {
+ } else {
if (data[3] == 1) {
if (data[1] == 0) {
data[0] = ~data[0] & 0x1;
outw(data[0],
devpriv->i_IobaseAddon +
APCI1500_DIGITAL_OP);
- }
- else {
+ } else {
if (data[1] == 1) {
switch (ui_NoOfChannel) {
outw(data[0],
devpriv->i_IobaseAddon +
APCI1500_DIGITAL_OP);
- }
- else {
+ } else {
dev_warn(dev->hw_dev,
"Specified channel not supported\n");
return -EINVAL;
}
}
- }
- else {
+ } else {
dev_warn(dev->hw_dev,
"Specified functionality does not exist\n");
return -EINVAL;
/* Selection of the input clock */
if (data[0] == 0 || data[0] == 1 || data[0] == 2) {
outw(data[0], devpriv->i_IobaseAddon + APCI1500_CLK_SELECT);
- }
- else {
+ } else {
if (data[0] != 3) {
dev_warn(dev->hw_dev,
"The option for input clock selection does not exist\n");
outb(0x2,
devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER);
- }
- else {
+ } else {
dev_warn(dev->hw_dev,
"Error in selection of interrupt enable or disable\n");
return -EINVAL;
}
- }
- else {
+ } else {
dev_warn(dev->hw_dev,
"Error in selection of reload value\n");
return -EINVAL;
outb(0x2,
devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER);
- }
- else {
+ } else {
dev_warn(dev->hw_dev,
"Error in selection of interrupt enable or disable\n");
return -EINVAL;
}
- }
- else {
+ } else {
dev_warn(dev->hw_dev,
"Error in selection of reload value\n");
return -EINVAL;
/* - Enables retrigger */
/* - Pulses output */
i_TimerCounterMode = data[2] | data[4] | 0x54;
- }
- else {
+ } else {
i_TimerCounterMode = data[2] | data[4] | data[6] | 7;
}
/* Test the reload value */
}
- }
- else {
+ } else {
+
dev_warn(dev->hw_dev,
"Error in selection of interrupt enable or disable\n");
return -EINVAL;
}
- }
- else {
+ } else {
dev_warn(dev->hw_dev,
"Error in selection of reload value\n");
return -EINVAL;
outb(i_CommandAndStatusValue,
devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER);
- }
- else {
+ } else {
dev_warn(dev->hw_dev,
"Counter/Timer1 not configured\n");
return -EINVAL;
/* Set Trigger and gate */
i_CommandAndStatusValue = 0x6;
- }
- else {
+ } else {
/* Set Trigger */
i_CommandAndStatusValue = 0x2;
outb(i_CommandAndStatusValue,
devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER);
- }
- else {
+ } else {
dev_warn(dev->hw_dev,
"Counter/Timer1 not configured\n");
return -EINVAL;
outb(i_CommandAndStatusValue,
devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER);
- }
- else {
+ } else {
dev_warn(dev->hw_dev,
"Counter/Timer2 not configured\n");
return -EINVAL;
/* Set Trigger and gate */
i_CommandAndStatusValue = 0x6;
- }
- else {
+ } else {
/* Set Trigger */
i_CommandAndStatusValue = 0x2;
outb(i_CommandAndStatusValue,
devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER);
- }
- else {
+ } else {
dev_warn(dev->hw_dev,
"Counter/Timer2 not configured\n");
return -EINVAL;
devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER);
- }
- else {
+ } else {
dev_warn(dev->hw_dev,
"Watchdog/Counter3 not configured\n");
return -EINVAL;
/* Set Trigger and gate */
i_CommandAndStatusValue = 0x6;
- }
- else {
+ } else {
/* Set Trigger */
i_CommandAndStatusValue = 0x2;
outb(i_CommandAndStatusValue,
devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER);
- }
- else {
+ } else {
dev_warn(dev->hw_dev,
"Counter3 not configured\n");
return -EINVAL;
outb(0x6,
devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER);
- }
- else {
+ } else {
dev_warn(dev->hw_dev,
"Watchdog 3 not configured\n");
return -EINVAL;
/* Set RCC and gate */
i_CommandAndStatusValue = 0xC;
- }
- else {
+ } else {
/* Set RCC */
i_CommandAndStatusValue = 0x8;
data[0] =
data[0] | inb(devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER);
- }
- else {
+ } else {
dev_warn(dev->hw_dev,
"Timer/Counter1 not configured\n");
return -EINVAL;
/* Set RCC and gate */
i_CommandAndStatusValue = 0xC;
- }
- else {
+ } else {
/* Set RCC */
i_CommandAndStatusValue = 0x8;
data[0] =
data[0] | inb(devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER);
- } /* if( i_TimerCounter2Init==1) */
- else {
+ } else {
dev_warn(dev->hw_dev,
"Timer/Counter2 not configured\n");
return -EINVAL;
/* Set RCC and gate */
i_CommandAndStatusValue = 0xC;
- }
- else {
+ } else {
/* Set RCC */
i_CommandAndStatusValue = 0x8;
data[0] =
data[0] | inb(devpriv->iobase +
APCI1500_Z8536_CONTROL_REGISTER);
- }
- else {
+ } else {
dev_warn(dev->hw_dev,
"WatchdogCounter3 not configured\n");
return -EINVAL;
outl(0x0, devpriv->i_IobaseAmcc + 0x38);
if (data[0] == 1) {
i_Constant = 0xC0;
- }
- else {
+ } else {
if (data[0] == 0) {
i_Constant = 0x00;
- }
- else {
+ } else {
dev_warn(dev->hw_dev,
"The parameter passed to driver is in error for enabling the voltage interrupt\n");
return -EINVAL;
struct addi_private *devpriv = dev->private;
unsigned int ui_InterruptStatus = 0;
int i_RegValue = 0;
+
+ /* Clear the interrupt mask */
i_InterruptMask = 0;
/* Read the board interrupt status */
i_InputChannel = 1 + (i_RegValue >> 1);
- }
- else {
+ } else {
i_InputChannel = 0;
}
}
i_InterruptMask =
i_InterruptMask | 0x80;
}
- }
- else {
+ } else {
i_InterruptMask = i_InterruptMask | 2;
}
}
devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER);
/* Authorizes the main interrupt on the board */
outb(0xD0, devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER);
- }
- else {
+ } else {
dev_warn(dev->hw_dev,
"Interrupt from unknown source\n");