4 * driver for the GE IP-OCTAL boards
6 * Copyright (C) 2009-2012 CERN (www.cern.ch)
7 * Author: Nicolas Serafini, EIC2 SA
8 * Author: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the Free
12 * Software Foundation; version 2 of the License.
15 #include <linux/device.h>
16 #include <linux/module.h>
17 #include <linux/interrupt.h>
18 #include <linux/sched.h>
19 #include <linux/tty.h>
20 #include <linux/serial.h>
21 #include <linux/tty_flip.h>
22 #include <linux/slab.h>
23 #include <linux/atomic.h>
25 #include <linux/ipack.h>
29 #define IP_OCTAL_ID_SPACE_VECTOR 0x41
30 #define IP_OCTAL_NB_BLOCKS 4
32 static const struct tty_operations ipoctal_fops
;
34 struct ipoctal_channel
{
35 struct ipoctal_stats stats
;
36 unsigned int nb_bytes
;
37 wait_queue_head_t queue
;
39 unsigned int pointer_read
;
40 unsigned int pointer_write
;
42 struct tty_port tty_port
;
43 union scc2698_channel __iomem
*regs
;
44 union scc2698_block __iomem
*block_regs
;
45 unsigned int board_id
;
46 unsigned char *board_write
;
52 struct ipack_device
*dev
;
53 unsigned int board_id
;
54 struct ipoctal_channel channel
[NR_CHANNELS
];
56 struct tty_driver
*tty_drv
;
57 u8 __iomem
*mem8_space
;
58 u8 __iomem
*int_space
;
61 static int ipoctal_port_activate(struct tty_port
*port
, struct tty_struct
*tty
)
63 struct ipoctal_channel
*channel
;
65 channel
= dev_get_drvdata(tty
->dev
);
67 iowrite8(CR_ENABLE_RX
, &channel
->regs
->w
.cr
);
71 static int ipoctal_open(struct tty_struct
*tty
, struct file
*file
)
74 struct ipoctal_channel
*channel
;
76 channel
= dev_get_drvdata(tty
->dev
);
78 if (atomic_read(&channel
->open
))
81 tty
->driver_data
= channel
;
83 res
= tty_port_open(&channel
->tty_port
, tty
, file
);
87 atomic_inc(&channel
->open
);
91 static void ipoctal_reset_stats(struct ipoctal_stats
*stats
)
96 stats
->framing_err
= 0;
97 stats
->overrun_err
= 0;
98 stats
->parity_err
= 0;
101 static void ipoctal_free_channel(struct ipoctal_channel
*channel
)
103 ipoctal_reset_stats(&channel
->stats
);
104 channel
->pointer_read
= 0;
105 channel
->pointer_write
= 0;
106 channel
->nb_bytes
= 0;
109 static void ipoctal_close(struct tty_struct
*tty
, struct file
*filp
)
111 struct ipoctal_channel
*channel
= tty
->driver_data
;
113 tty_port_close(&channel
->tty_port
, tty
, filp
);
115 if (atomic_dec_and_test(&channel
->open
))
116 ipoctal_free_channel(channel
);
119 static int ipoctal_get_icount(struct tty_struct
*tty
,
120 struct serial_icounter_struct
*icount
)
122 struct ipoctal_channel
*channel
= tty
->driver_data
;
128 icount
->rx
= channel
->stats
.rx
;
129 icount
->tx
= channel
->stats
.tx
;
130 icount
->frame
= channel
->stats
.framing_err
;
131 icount
->parity
= channel
->stats
.parity_err
;
132 icount
->brk
= channel
->stats
.rcv_break
;
136 static void ipoctal_irq_rx(struct ipoctal_channel
*channel
, u8 sr
)
138 struct tty_port
*port
= &channel
->tty_port
;
140 unsigned char flag
= TTY_NORMAL
;
144 value
= ioread8(&channel
->regs
->r
.rhr
);
145 /* Error: count statistics */
147 iowrite8(CR_CMD_RESET_ERR_STATUS
, &channel
->regs
->w
.cr
);
149 if (sr
& SR_OVERRUN_ERROR
) {
150 channel
->stats
.overrun_err
++;
151 /* Overrun doesn't affect the current character*/
152 tty_insert_flip_char(port
, 0, TTY_OVERRUN
);
154 if (sr
& SR_PARITY_ERROR
) {
155 channel
->stats
.parity_err
++;
158 if (sr
& SR_FRAMING_ERROR
) {
159 channel
->stats
.framing_err
++;
162 if (sr
& SR_RECEIVED_BREAK
) {
163 iowrite8(CR_CMD_RESET_BREAK_CHANGE
, &channel
->regs
->w
.cr
);
164 channel
->stats
.rcv_break
++;
168 tty_insert_flip_char(port
, value
, flag
);
170 /* Check if there are more characters in RX FIFO
171 * If there are more, the isr register for this channel
172 * has enabled the RxRDY|FFULL bit.
174 isr
= ioread8(&channel
->block_regs
->r
.isr
);
175 sr
= ioread8(&channel
->regs
->r
.sr
);
176 } while (isr
& channel
->isr_rx_rdy_mask
);
178 tty_flip_buffer_push(port
);
181 static void ipoctal_irq_tx(struct ipoctal_channel
*channel
)
184 unsigned int *pointer_write
= &channel
->pointer_write
;
186 if (channel
->nb_bytes
<= 0) {
187 channel
->nb_bytes
= 0;
191 value
= channel
->tty_port
.xmit_buf
[*pointer_write
];
192 iowrite8(value
, &channel
->regs
->w
.thr
);
195 *pointer_write
= *pointer_write
% PAGE_SIZE
;
198 if ((channel
->nb_bytes
== 0) &&
199 (waitqueue_active(&channel
->queue
))) {
201 if (channel
->board_id
!= IPACK1_DEVICE_ID_SBS_OCTAL_485
) {
202 *channel
->board_write
= 1;
203 wake_up_interruptible(&channel
->queue
);
208 static void ipoctal_irq_channel(struct ipoctal_channel
*channel
)
212 /* If there is no client, skip the check */
213 if (!atomic_read(&channel
->open
))
216 /* The HW is organized in pair of channels. See which register we need
218 isr
= ioread8(&channel
->block_regs
->r
.isr
);
219 sr
= ioread8(&channel
->regs
->r
.sr
);
221 /* In case of RS-485, change from TX to RX when finishing TX.
223 if ((channel
->board_id
== IPACK1_DEVICE_ID_SBS_OCTAL_485
) &&
224 (sr
& SR_TX_EMPTY
) && (channel
->nb_bytes
== 0)) {
225 iowrite8(CR_DISABLE_TX
, &channel
->regs
->w
.cr
);
226 iowrite8(CR_CMD_NEGATE_RTSN
, &channel
->regs
->w
.cr
);
227 iowrite8(CR_ENABLE_RX
, &channel
->regs
->w
.cr
);
228 *channel
->board_write
= 1;
229 wake_up_interruptible(&channel
->queue
);
233 if ((isr
& channel
->isr_rx_rdy_mask
) && (sr
& SR_RX_READY
))
234 ipoctal_irq_rx(channel
, sr
);
236 /* TX of each character */
237 if ((isr
& channel
->isr_tx_rdy_mask
) && (sr
& SR_TX_READY
))
238 ipoctal_irq_tx(channel
);
240 tty_flip_buffer_push(&channel
->tty_port
);
243 static irqreturn_t
ipoctal_irq_handler(void *arg
)
246 struct ipoctal
*ipoctal
= (struct ipoctal
*) arg
;
248 /* Check all channels */
249 for (i
= 0; i
< NR_CHANNELS
; i
++)
250 ipoctal_irq_channel(&ipoctal
->channel
[i
]);
252 /* Clear the IPack device interrupt */
253 readw(ipoctal
->int_space
+ ACK_INT_REQ0
);
254 readw(ipoctal
->int_space
+ ACK_INT_REQ1
);
259 static const struct tty_port_operations ipoctal_tty_port_ops
= {
261 .activate
= ipoctal_port_activate
,
264 static int ipoctal_inst_slot(struct ipoctal
*ipoctal
, unsigned int bus_nr
,
269 struct tty_driver
*tty
;
271 struct ipoctal_channel
*channel
;
272 struct ipack_region
*region
;
274 union scc2698_channel __iomem
*chan_regs
;
275 union scc2698_block __iomem
*block_regs
;
277 ipoctal
->board_id
= ipoctal
->dev
->id_device
;
279 region
= &ipoctal
->dev
->region
[IPACK_IO_SPACE
];
280 addr
= devm_ioremap_nocache(&ipoctal
->dev
->dev
,
281 region
->start
, region
->size
);
283 dev_err(&ipoctal
->dev
->dev
,
284 "Unable to map slot [%d:%d] IO space!\n",
286 return -EADDRNOTAVAIL
;
288 /* Save the virtual address to access the registers easily */
290 (union scc2698_channel __iomem
*) addr
;
292 (union scc2698_block __iomem
*) addr
;
294 region
= &ipoctal
->dev
->region
[IPACK_INT_SPACE
];
296 devm_ioremap_nocache(&ipoctal
->dev
->dev
,
297 region
->start
, region
->size
);
298 if (!ipoctal
->int_space
) {
299 dev_err(&ipoctal
->dev
->dev
,
300 "Unable to map slot [%d:%d] INT space!\n",
302 return -EADDRNOTAVAIL
;
305 region
= &ipoctal
->dev
->region
[IPACK_MEM8_SPACE
];
306 ipoctal
->mem8_space
=
307 devm_ioremap_nocache(&ipoctal
->dev
->dev
,
308 region
->start
, 0x8000);
310 dev_err(&ipoctal
->dev
->dev
,
311 "Unable to map slot [%d:%d] MEM8 space!\n",
313 return -EADDRNOTAVAIL
;
317 /* Disable RX and TX before touching anything */
318 for (i
= 0; i
< NR_CHANNELS
; i
++) {
319 struct ipoctal_channel
*channel
= &ipoctal
->channel
[i
];
320 channel
->regs
= chan_regs
+ i
;
321 channel
->block_regs
= block_regs
+ (i
>> 1);
322 channel
->board_write
= &ipoctal
->write
;
323 channel
->board_id
= ipoctal
->board_id
;
325 channel
->isr_tx_rdy_mask
= ISR_TxRDY_B
;
326 channel
->isr_rx_rdy_mask
= ISR_RxRDY_FFULL_B
;
328 channel
->isr_tx_rdy_mask
= ISR_TxRDY_A
;
329 channel
->isr_rx_rdy_mask
= ISR_RxRDY_FFULL_A
;
332 iowrite8(CR_DISABLE_RX
| CR_DISABLE_TX
, &channel
->regs
->w
.cr
);
333 iowrite8(CR_CMD_RESET_RX
, &channel
->regs
->w
.cr
);
334 iowrite8(CR_CMD_RESET_TX
, &channel
->regs
->w
.cr
);
335 iowrite8(MR1_CHRL_8_BITS
| MR1_ERROR_CHAR
| MR1_RxINT_RxRDY
,
336 &channel
->regs
->w
.mr
); /* mr1 */
337 iowrite8(0, &channel
->regs
->w
.mr
); /* mr2 */
338 iowrite8(TX_CLK_9600
| RX_CLK_9600
, &channel
->regs
->w
.csr
);
341 for (i
= 0; i
< IP_OCTAL_NB_BLOCKS
; i
++) {
342 iowrite8(ACR_BRG_SET2
, &block_regs
[i
].w
.acr
);
343 iowrite8(OPCR_MPP_OUTPUT
| OPCR_MPOa_RTSN
| OPCR_MPOb_RTSN
,
344 &block_regs
[i
].w
.opcr
);
345 iowrite8(IMR_TxRDY_A
| IMR_RxRDY_FFULL_A
| IMR_DELTA_BREAK_A
|
346 IMR_TxRDY_B
| IMR_RxRDY_FFULL_B
| IMR_DELTA_BREAK_B
,
347 &block_regs
[i
].w
.imr
);
351 * IP-OCTAL has different addresses to copy its IRQ vector.
352 * Depending of the carrier these addresses are accesible or not.
353 * More info in the datasheet.
355 ipoctal
->dev
->bus
->ops
->request_irq(ipoctal
->dev
,
356 ipoctal_irq_handler
, ipoctal
);
358 iowrite8(1, ipoctal
->mem8_space
+ 1);
360 /* Register the TTY device */
362 /* Each IP-OCTAL channel is a TTY port */
363 tty
= alloc_tty_driver(NR_CHANNELS
);
368 /* Fill struct tty_driver with ipoctal data */
369 tty
->owner
= THIS_MODULE
;
370 tty
->driver_name
= KBUILD_MODNAME
;
371 sprintf(name
, KBUILD_MODNAME
".%d.%d.", bus_nr
, slot
);
375 tty
->minor_start
= 0;
376 tty
->type
= TTY_DRIVER_TYPE_SERIAL
;
377 tty
->subtype
= SERIAL_TYPE_NORMAL
;
378 tty
->flags
= TTY_DRIVER_REAL_RAW
| TTY_DRIVER_DYNAMIC_DEV
;
379 tty
->init_termios
= tty_std_termios
;
380 tty
->init_termios
.c_cflag
= B9600
| CS8
| CREAD
| HUPCL
| CLOCAL
;
381 tty
->init_termios
.c_ispeed
= 9600;
382 tty
->init_termios
.c_ospeed
= 9600;
384 tty_set_operations(tty
, &ipoctal_fops
);
385 res
= tty_register_driver(tty
);
387 dev_err(&ipoctal
->dev
->dev
, "Can't register tty driver.\n");
392 /* Save struct tty_driver for use it when uninstalling the device */
393 ipoctal
->tty_drv
= tty
;
395 for (i
= 0; i
< NR_CHANNELS
; i
++) {
396 struct device
*tty_dev
;
398 channel
= &ipoctal
->channel
[i
];
399 tty_port_init(&channel
->tty_port
);
400 tty_port_alloc_xmit_buf(&channel
->tty_port
);
401 channel
->tty_port
.ops
= &ipoctal_tty_port_ops
;
403 ipoctal_reset_stats(&channel
->stats
);
404 channel
->nb_bytes
= 0;
405 init_waitqueue_head(&channel
->queue
);
407 spin_lock_init(&channel
->lock
);
408 channel
->pointer_read
= 0;
409 channel
->pointer_write
= 0;
410 tty_dev
= tty_port_register_device(&channel
->tty_port
, tty
, i
, NULL
);
411 if (IS_ERR(tty_dev
)) {
412 dev_err(&ipoctal
->dev
->dev
, "Failed to register tty device.\n");
413 tty_port_destroy(&channel
->tty_port
);
416 dev_set_drvdata(tty_dev
, channel
);
419 * Enable again the RX. TX will be enabled when
420 * there is something to send
422 iowrite8(CR_ENABLE_RX
, &channel
->regs
->w
.cr
);
428 static inline int ipoctal_copy_write_buffer(struct ipoctal_channel
*channel
,
429 const unsigned char *buf
,
434 unsigned int *pointer_read
= &channel
->pointer_read
;
436 /* Copy the bytes from the user buffer to the internal one */
437 for (i
= 0; i
< count
; i
++) {
438 if (i
<= (PAGE_SIZE
- channel
->nb_bytes
)) {
439 spin_lock_irqsave(&channel
->lock
, flags
);
440 channel
->tty_port
.xmit_buf
[*pointer_read
] = buf
[i
];
441 *pointer_read
= (*pointer_read
+ 1) % PAGE_SIZE
;
443 spin_unlock_irqrestore(&channel
->lock
, flags
);
451 static int ipoctal_write_tty(struct tty_struct
*tty
,
452 const unsigned char *buf
, int count
)
454 struct ipoctal_channel
*channel
= tty
->driver_data
;
455 unsigned int char_copied
;
457 char_copied
= ipoctal_copy_write_buffer(channel
, buf
, count
);
459 /* As the IP-OCTAL 485 only supports half duplex, do it manually */
460 if (channel
->board_id
== IPACK1_DEVICE_ID_SBS_OCTAL_485
) {
461 iowrite8(CR_DISABLE_RX
, &channel
->regs
->w
.cr
);
462 iowrite8(CR_CMD_ASSERT_RTSN
, &channel
->regs
->w
.cr
);
466 * Send a packet and then disable TX to avoid failure after several send
469 iowrite8(CR_ENABLE_TX
, &channel
->regs
->w
.cr
);
470 wait_event_interruptible(channel
->queue
, *channel
->board_write
);
471 iowrite8(CR_DISABLE_TX
, &channel
->regs
->w
.cr
);
473 *channel
->board_write
= 0;
477 static int ipoctal_write_room(struct tty_struct
*tty
)
479 struct ipoctal_channel
*channel
= tty
->driver_data
;
481 return PAGE_SIZE
- channel
->nb_bytes
;
484 static int ipoctal_chars_in_buffer(struct tty_struct
*tty
)
486 struct ipoctal_channel
*channel
= tty
->driver_data
;
488 return channel
->nb_bytes
;
491 static void ipoctal_set_termios(struct tty_struct
*tty
,
492 struct ktermios
*old_termios
)
495 unsigned char mr1
= 0;
496 unsigned char mr2
= 0;
497 unsigned char csr
= 0;
498 struct ipoctal_channel
*channel
= tty
->driver_data
;
501 cflag
= tty
->termios
.c_cflag
;
503 /* Disable and reset everything before change the setup */
504 iowrite8(CR_DISABLE_RX
| CR_DISABLE_TX
, &channel
->regs
->w
.cr
);
505 iowrite8(CR_CMD_RESET_RX
, &channel
->regs
->w
.cr
);
506 iowrite8(CR_CMD_RESET_TX
, &channel
->regs
->w
.cr
);
507 iowrite8(CR_CMD_RESET_ERR_STATUS
, &channel
->regs
->w
.cr
);
508 iowrite8(CR_CMD_RESET_MR
, &channel
->regs
->w
.cr
);
510 /* Set Bits per chars */
511 switch (cflag
& CSIZE
) {
513 mr1
|= MR1_CHRL_6_BITS
;
516 mr1
|= MR1_CHRL_7_BITS
;
520 mr1
|= MR1_CHRL_8_BITS
;
521 /* By default, select CS8 */
522 tty
->termios
.c_cflag
= (cflag
& ~CSIZE
) | CS8
;
529 mr1
|= MR1_PARITY_ON
| MR1_PARITY_ODD
;
531 mr1
|= MR1_PARITY_ON
| MR1_PARITY_EVEN
;
533 mr1
|= MR1_PARITY_OFF
;
535 /* Mark or space parity is not supported */
536 tty
->termios
.c_cflag
&= ~CMSPAR
;
540 mr2
|= MR2_STOP_BITS_LENGTH_2
;
542 mr2
|= MR2_STOP_BITS_LENGTH_1
;
544 /* Set the flow control */
545 switch (channel
->board_id
) {
546 case IPACK1_DEVICE_ID_SBS_OCTAL_232
:
547 if (cflag
& CRTSCTS
) {
548 mr1
|= MR1_RxRTS_CONTROL_ON
;
549 mr2
|= MR2_TxRTS_CONTROL_OFF
| MR2_CTS_ENABLE_TX_ON
;
551 mr1
|= MR1_RxRTS_CONTROL_OFF
;
552 mr2
|= MR2_TxRTS_CONTROL_OFF
| MR2_CTS_ENABLE_TX_OFF
;
555 case IPACK1_DEVICE_ID_SBS_OCTAL_422
:
556 mr1
|= MR1_RxRTS_CONTROL_OFF
;
557 mr2
|= MR2_TxRTS_CONTROL_OFF
| MR2_CTS_ENABLE_TX_OFF
;
559 case IPACK1_DEVICE_ID_SBS_OCTAL_485
:
560 mr1
|= MR1_RxRTS_CONTROL_OFF
;
561 mr2
|= MR2_TxRTS_CONTROL_ON
| MR2_CTS_ENABLE_TX_OFF
;
568 baud
= tty_get_baud_rate(tty
);
569 tty_termios_encode_baud_rate(&tty
->termios
, baud
, baud
);
574 csr
|= TX_CLK_75
| RX_CLK_75
;
577 csr
|= TX_CLK_110
| RX_CLK_110
;
580 csr
|= TX_CLK_150
| RX_CLK_150
;
583 csr
|= TX_CLK_300
| RX_CLK_300
;
586 csr
|= TX_CLK_600
| RX_CLK_600
;
589 csr
|= TX_CLK_1200
| RX_CLK_1200
;
592 csr
|= TX_CLK_1800
| RX_CLK_1800
;
595 csr
|= TX_CLK_2000
| RX_CLK_2000
;
598 csr
|= TX_CLK_2400
| RX_CLK_2400
;
601 csr
|= TX_CLK_4800
| RX_CLK_4800
;
604 csr
|= TX_CLK_9600
| RX_CLK_9600
;
607 csr
|= TX_CLK_19200
| RX_CLK_19200
;
611 csr
|= TX_CLK_38400
| RX_CLK_38400
;
612 /* In case of default, we establish 38400 bps */
613 tty_termios_encode_baud_rate(&tty
->termios
, 38400, 38400);
617 mr1
|= MR1_ERROR_CHAR
;
618 mr1
|= MR1_RxINT_RxRDY
;
620 /* Write the control registers */
621 iowrite8(mr1
, &channel
->regs
->w
.mr
);
622 iowrite8(mr2
, &channel
->regs
->w
.mr
);
623 iowrite8(csr
, &channel
->regs
->w
.csr
);
625 /* Enable again the RX */
626 iowrite8(CR_ENABLE_RX
, &channel
->regs
->w
.cr
);
629 static void ipoctal_hangup(struct tty_struct
*tty
)
632 struct ipoctal_channel
*channel
= tty
->driver_data
;
637 spin_lock_irqsave(&channel
->lock
, flags
);
638 channel
->nb_bytes
= 0;
639 channel
->pointer_read
= 0;
640 channel
->pointer_write
= 0;
641 spin_unlock_irqrestore(&channel
->lock
, flags
);
643 tty_port_hangup(&channel
->tty_port
);
645 iowrite8(CR_DISABLE_RX
| CR_DISABLE_TX
, &channel
->regs
->w
.cr
);
646 iowrite8(CR_CMD_RESET_RX
, &channel
->regs
->w
.cr
);
647 iowrite8(CR_CMD_RESET_TX
, &channel
->regs
->w
.cr
);
648 iowrite8(CR_CMD_RESET_ERR_STATUS
, &channel
->regs
->w
.cr
);
649 iowrite8(CR_CMD_RESET_MR
, &channel
->regs
->w
.cr
);
651 clear_bit(ASYNCB_INITIALIZED
, &channel
->tty_port
.flags
);
652 wake_up_interruptible(&channel
->tty_port
.open_wait
);
655 static const struct tty_operations ipoctal_fops
= {
657 .open
= ipoctal_open
,
658 .close
= ipoctal_close
,
659 .write
= ipoctal_write_tty
,
660 .set_termios
= ipoctal_set_termios
,
661 .write_room
= ipoctal_write_room
,
662 .chars_in_buffer
= ipoctal_chars_in_buffer
,
663 .get_icount
= ipoctal_get_icount
,
664 .hangup
= ipoctal_hangup
,
667 static int ipoctal_probe(struct ipack_device
*dev
)
670 struct ipoctal
*ipoctal
;
672 ipoctal
= kzalloc(sizeof(struct ipoctal
), GFP_KERNEL
);
677 res
= ipoctal_inst_slot(ipoctal
, dev
->bus
->bus_nr
, dev
->slot
);
681 dev_set_drvdata(&dev
->dev
, ipoctal
);
689 static void __ipoctal_remove(struct ipoctal
*ipoctal
)
693 ipoctal
->dev
->bus
->ops
->free_irq(ipoctal
->dev
);
695 for (i
= 0; i
< NR_CHANNELS
; i
++) {
696 struct ipoctal_channel
*channel
= &ipoctal
->channel
[i
];
697 tty_unregister_device(ipoctal
->tty_drv
, i
);
698 tty_port_free_xmit_buf(&channel
->tty_port
);
699 tty_port_destroy(&channel
->tty_port
);
702 tty_unregister_driver(ipoctal
->tty_drv
);
703 put_tty_driver(ipoctal
->tty_drv
);
707 static void ipoctal_remove(struct ipack_device
*idev
)
709 __ipoctal_remove(dev_get_drvdata(&idev
->dev
));
712 static DEFINE_IPACK_DEVICE_TABLE(ipoctal_ids
) = {
713 { IPACK_DEVICE(IPACK_ID_VERSION_1
, IPACK1_VENDOR_ID_SBS
,
714 IPACK1_DEVICE_ID_SBS_OCTAL_232
) },
715 { IPACK_DEVICE(IPACK_ID_VERSION_1
, IPACK1_VENDOR_ID_SBS
,
716 IPACK1_DEVICE_ID_SBS_OCTAL_422
) },
717 { IPACK_DEVICE(IPACK_ID_VERSION_1
, IPACK1_VENDOR_ID_SBS
,
718 IPACK1_DEVICE_ID_SBS_OCTAL_485
) },
722 MODULE_DEVICE_TABLE(ipack
, ipoctal_ids
);
724 static const struct ipack_driver_ops ipoctal_drv_ops
= {
725 .probe
= ipoctal_probe
,
726 .remove
= ipoctal_remove
,
729 static struct ipack_driver driver
= {
730 .ops
= &ipoctal_drv_ops
,
731 .id_table
= ipoctal_ids
,
734 static int __init
ipoctal_init(void)
736 return ipack_driver_register(&driver
, THIS_MODULE
, KBUILD_MODNAME
);
739 static void __exit
ipoctal_exit(void)
741 ipack_driver_unregister(&driver
);
744 MODULE_DESCRIPTION("IP-Octal 232, 422 and 485 device driver");
745 MODULE_LICENSE("GPL");
747 module_init(ipoctal_init
);
748 module_exit(ipoctal_exit
);