Commit 7db5e3cb authored by Jens Taprogge's avatar Jens Taprogge Committed by Greg Kroah-Hartman

Staging: ipack: Move device ids from ipoctal.c to ipack_ids.h.

Rename them in the process.
Signed-off-by: default avatarJens Taprogge <jens.taprogge@taprogge.org>
Signed-off-by: default avatarSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e8ed3276
...@@ -25,11 +25,6 @@ ...@@ -25,11 +25,6 @@
#include "ipoctal.h" #include "ipoctal.h"
#include "scc2698.h" #include "scc2698.h"
#define IP_OCTAL_MANUFACTURER_ID 0xF0
#define IP_OCTAL_232_ID 0x22
#define IP_OCTAL_422_ID 0x2A
#define IP_OCTAL_485_ID 0x48
#define IP_OCTAL_ID_SPACE_VECTOR 0x41 #define IP_OCTAL_ID_SPACE_VECTOR 0x41
#define IP_OCTAL_NB_BLOCKS 4 #define IP_OCTAL_NB_BLOCKS 4
...@@ -231,7 +226,7 @@ static int ipoctal_irq_handler(void *arg) ...@@ -231,7 +226,7 @@ static int ipoctal_irq_handler(void *arg)
/* In case of RS-485, change from TX to RX when finishing TX. /* In case of RS-485, change from TX to RX when finishing TX.
* Half-duplex. * Half-duplex.
*/ */
if ((ipoctal->board_id == IP_OCTAL_485_ID) && if ((ipoctal->board_id == IPACK1_DEVICE_ID_SBS_OCTAL_485) &&
(sr & SR_TX_EMPTY) && (sr & SR_TX_EMPTY) &&
(ipoctal->nb_bytes[channel] == 0)) { (ipoctal->nb_bytes[channel] == 0)) {
ipoctal_write_io_reg(ipoctal, ipoctal_write_io_reg(ipoctal,
...@@ -304,7 +299,7 @@ static int ipoctal_irq_handler(void *arg) ...@@ -304,7 +299,7 @@ static int ipoctal_irq_handler(void *arg)
if ((ipoctal->nb_bytes[channel] == 0) && if ((ipoctal->nb_bytes[channel] == 0) &&
(waitqueue_active(&ipoctal->queue[channel]))) { (waitqueue_active(&ipoctal->queue[channel]))) {
if (ipoctal->board_id != IP_OCTAL_485_ID) { if (ipoctal->board_id != IPACK1_DEVICE_ID_SBS_OCTAL_485) {
ipoctal->write = 1; ipoctal->write = 1;
wake_up_interruptible(&ipoctal->queue[channel]); wake_up_interruptible(&ipoctal->queue[channel]);
} }
...@@ -322,15 +317,16 @@ static int ipoctal_check_model(struct ipack_device *dev, unsigned char *id) ...@@ -322,15 +317,16 @@ static int ipoctal_check_model(struct ipack_device *dev, unsigned char *id)
unsigned char manufacturerID; unsigned char manufacturerID;
unsigned char board_id; unsigned char board_id;
manufacturerID = ioread8(dev->id_space.address + IPACK_IDPROM_OFFSET_MANUFACTURER_ID); manufacturerID = ioread8(dev->id_space.address + IPACK_IDPROM_OFFSET_MANUFACTURER_ID);
if (manufacturerID != IP_OCTAL_MANUFACTURER_ID) if (manufacturerID != IPACK1_VENDOR_ID_SBS)
return -ENODEV; return -ENODEV;
board_id = ioread8(dev->id_space.address + IPACK_IDPROM_OFFSET_MODEL); board_id = ioread8(dev->id_space.address + IPACK_IDPROM_OFFSET_MODEL);
switch (board_id) { switch (board_id) {
case IP_OCTAL_232_ID: case IPACK1_DEVICE_ID_SBS_OCTAL_232:
case IP_OCTAL_422_ID: case IPACK1_DEVICE_ID_SBS_OCTAL_422:
case IP_OCTAL_485_ID: case IPACK1_DEVICE_ID_SBS_OCTAL_485:
*id = board_id; *id = board_id;
break; break;
default: default:
...@@ -543,7 +539,7 @@ static int ipoctal_write(struct ipoctal *ipoctal, unsigned int channel, ...@@ -543,7 +539,7 @@ static int ipoctal_write(struct ipoctal *ipoctal, unsigned int channel,
ipoctal_copy_write_buffer(ipoctal, channel, buf, count); ipoctal_copy_write_buffer(ipoctal, channel, buf, count);
/* As the IP-OCTAL 485 only supports half duplex, do it manually */ /* As the IP-OCTAL 485 only supports half duplex, do it manually */
if (ipoctal->board_id == IP_OCTAL_485_ID) { if (ipoctal->board_id == IPACK1_DEVICE_ID_SBS_OCTAL_485) {
ipoctal_write_io_reg(ipoctal, ipoctal_write_io_reg(ipoctal,
&ipoctal->chan_regs[channel].w.cr, &ipoctal->chan_regs[channel].w.cr,
CR_DISABLE_RX); CR_DISABLE_RX);
...@@ -654,7 +650,7 @@ static void ipoctal_set_termios(struct tty_struct *tty, ...@@ -654,7 +650,7 @@ static void ipoctal_set_termios(struct tty_struct *tty,
/* Set the flow control */ /* Set the flow control */
switch (ipoctal->board_id) { switch (ipoctal->board_id) {
case IP_OCTAL_232_ID: case IPACK1_DEVICE_ID_SBS_OCTAL_232:
if (cflag & CRTSCTS) { if (cflag & CRTSCTS) {
mr1 |= MR1_RxRTS_CONTROL_ON; mr1 |= MR1_RxRTS_CONTROL_ON;
mr2 |= MR2_TxRTS_CONTROL_OFF | MR2_CTS_ENABLE_TX_ON; mr2 |= MR2_TxRTS_CONTROL_OFF | MR2_CTS_ENABLE_TX_ON;
...@@ -663,11 +659,11 @@ static void ipoctal_set_termios(struct tty_struct *tty, ...@@ -663,11 +659,11 @@ static void ipoctal_set_termios(struct tty_struct *tty,
mr2 |= MR2_TxRTS_CONTROL_OFF | MR2_CTS_ENABLE_TX_OFF; mr2 |= MR2_TxRTS_CONTROL_OFF | MR2_CTS_ENABLE_TX_OFF;
} }
break; break;
case IP_OCTAL_422_ID: case IPACK1_DEVICE_ID_SBS_OCTAL_422:
mr1 |= MR1_RxRTS_CONTROL_OFF; mr1 |= MR1_RxRTS_CONTROL_OFF;
mr2 |= MR2_TxRTS_CONTROL_OFF | MR2_CTS_ENABLE_TX_OFF; mr2 |= MR2_TxRTS_CONTROL_OFF | MR2_CTS_ENABLE_TX_OFF;
break; break;
case IP_OCTAL_485_ID: case IPACK1_DEVICE_ID_SBS_OCTAL_485:
mr1 |= MR1_RxRTS_CONTROL_OFF; mr1 |= MR1_RxRTS_CONTROL_OFF;
mr2 |= MR2_TxRTS_CONTROL_ON | MR2_CTS_ENABLE_TX_OFF; mr2 |= MR2_TxRTS_CONTROL_ON | MR2_CTS_ENABLE_TX_OFF;
break; break;
......
...@@ -25,3 +25,8 @@ ...@@ -25,3 +25,8 @@
#define IPACK1_VENDOR_ID_UNREGISTRED13 0x0D #define IPACK1_VENDOR_ID_UNREGISTRED13 0x0D
#define IPACK1_VENDOR_ID_UNREGISTRED14 0x0E #define IPACK1_VENDOR_ID_UNREGISTRED14 0x0E
#define IPACK1_VENDOR_ID_UNREGISTRED15 0x0F #define IPACK1_VENDOR_ID_UNREGISTRED15 0x0F
#define IPACK1_VENDOR_ID_SBS 0xF0
#define IPACK1_DEVICE_ID_SBS_OCTAL_232 0x22
#define IPACK1_DEVICE_ID_SBS_OCTAL_422 0x2A
#define IPACK1_DEVICE_ID_SBS_OCTAL_485 0x48
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment