2 * linux/drivers/net/irda/sa1100_ir.c
4 * Copyright (C) 2000-2001 Russell King
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * Infra-red driver for the StrongARM SA1100 embedded microprocessor
12 * Note that we don't have to worry about the SA1111's DMA bugs in here,
13 * so we use the straight forward dma_map_* functions with a null pointer.
15 * This driver takes one kernel command line parameter, sa1100ir=, with
16 * the following options:
17 * max_rate:baudrate - set the maximum baud rate
18 * power_level:level - set the transmitter power level
19 * tx_lpm:0|1 - set transmit low power mode
21 #include <linux/module.h>
22 #include <linux/moduleparam.h>
23 #include <linux/types.h>
24 #include <linux/init.h>
25 #include <linux/errno.h>
26 #include <linux/netdevice.h>
27 #include <linux/slab.h>
28 #include <linux/rtnetlink.h>
29 #include <linux/interrupt.h>
30 #include <linux/delay.h>
31 #include <linux/platform_device.h>
32 #include <linux/dma-mapping.h>
34 #include <net/irda/irda.h>
35 #include <net/irda/wrapper.h>
36 #include <net/irda/irda_device.h>
39 #include <mach/hardware.h>
40 #include <asm/mach/irda.h>
42 static int power_level = 3;
44 static int max_rate = 4000000;
49 struct scatterlist sg;
61 struct sa1100_buf dma_rx;
62 struct sa1100_buf dma_tx;
65 struct irda_platform_data *pdata;
66 struct irlap_cb *irlap;
72 int (*tx_start)(struct sk_buff *, struct net_device *, struct sa1100_irda *);
73 irqreturn_t (*irq)(struct net_device *, struct sa1100_irda *);
76 static int sa1100_irda_set_speed(struct sa1100_irda *, int);
78 #define IS_FIR(si) ((si)->speed >= 4000000)
80 #define HPSIR_MAX_RXLEN 2047
83 * Allocate and map the receive buffer, unless it is already allocated.
85 static int sa1100_irda_rx_alloc(struct sa1100_irda *si)
90 si->dma_rx.skb = alloc_skb(HPSIR_MAX_RXLEN + 1, GFP_ATOMIC);
91 if (!si->dma_rx.skb) {
92 printk(KERN_ERR "sa1100_ir: out of memory for RX SKB\n");
97 * Align any IP headers that may be contained
100 skb_reserve(si->dma_rx.skb, 1);
102 sg_set_buf(&si->dma_rx.sg, si->dma_rx.skb->data, HPSIR_MAX_RXLEN);
103 if (dma_map_sg(si->dma_rx.dev, &si->dma_rx.sg, 1, DMA_FROM_DEVICE) == 0) {
104 dev_kfree_skb_any(si->dma_rx.skb);
112 * We want to get here as soon as possible, and get the receiver setup.
113 * We use the existing buffer.
115 static void sa1100_irda_rx_dma_start(struct sa1100_irda *si)
117 if (!si->dma_rx.skb) {
118 printk(KERN_ERR "sa1100_ir: rx buffer went missing\n");
123 * First empty receive FIFO
125 Ser2HSCR0 = HSCR0_HSSP;
128 * Enable the DMA, receiver and receive interrupt.
130 sa1100_clear_dma(si->dma_rx.regs);
131 sa1100_start_dma(si->dma_rx.regs, sg_dma_address(&si->dma_rx.sg),
132 sg_dma_len(&si->dma_rx.sg));
133 Ser2HSCR0 = HSCR0_HSSP | HSCR0_RXE;
136 static void sa1100_irda_check_speed(struct sa1100_irda *si)
139 sa1100_irda_set_speed(si, si->newspeed);
145 * HP-SIR format support.
147 static int sa1100_irda_sir_tx_start(struct sk_buff *skb, struct net_device *dev,
148 struct sa1100_irda *si)
150 si->tx_buff.data = si->tx_buff.head;
151 si->tx_buff.len = async_wrap_skb(skb, si->tx_buff.data,
152 si->tx_buff.truesize);
155 * Set the transmit interrupt enable. This will fire off an
156 * interrupt immediately. Note that we disable the receiver
157 * so we won't get spurious characters received.
159 Ser2UTCR3 = UTCR3_TIE | UTCR3_TXE;
166 static irqreturn_t sa1100_irda_sir_irq(struct net_device *dev, struct sa1100_irda *si)
173 * Deal with any receive errors first. The bytes in error may be
174 * the only bytes in the receive FIFO, so we do this first.
176 while (status & UTSR0_EIF) {
182 if (stat & (UTSR1_FRE | UTSR1_ROR)) {
183 dev->stats.rx_errors++;
184 if (stat & UTSR1_FRE)
185 dev->stats.rx_frame_errors++;
186 if (stat & UTSR1_ROR)
187 dev->stats.rx_fifo_errors++;
189 async_unwrap_char(dev, &dev->stats, &si->rx_buff, data);
195 * We must clear certain bits.
197 Ser2UTSR0 = status & (UTSR0_RID | UTSR0_RBB | UTSR0_REB);
199 if (status & UTSR0_RFS) {
201 * There are at least 4 bytes in the FIFO. Read 3 bytes
202 * and leave the rest to the block below.
204 async_unwrap_char(dev, &dev->stats, &si->rx_buff, Ser2UTDR);
205 async_unwrap_char(dev, &dev->stats, &si->rx_buff, Ser2UTDR);
206 async_unwrap_char(dev, &dev->stats, &si->rx_buff, Ser2UTDR);
209 if (status & (UTSR0_RFS | UTSR0_RID)) {
211 * Fifo contains more than 1 character.
214 async_unwrap_char(dev, &dev->stats, &si->rx_buff,
216 } while (Ser2UTSR1 & UTSR1_RNE);
220 if (status & UTSR0_TFS && si->tx_buff.len) {
222 * Transmitter FIFO is not full
225 Ser2UTDR = *si->tx_buff.data++;
226 si->tx_buff.len -= 1;
227 } while (Ser2UTSR1 & UTSR1_TNF && si->tx_buff.len);
229 if (si->tx_buff.len == 0) {
230 dev->stats.tx_packets++;
231 dev->stats.tx_bytes += si->tx_buff.data -
235 * We need to ensure that the transmitter has
240 while (Ser2UTSR1 & UTSR1_TBY);
243 * Ok, we've finished transmitting. Now enable
244 * the receiver. Sometimes we get a receive IRQ
245 * immediately after a transmit...
247 Ser2UTSR0 = UTSR0_REB | UTSR0_RBB | UTSR0_RID;
248 Ser2UTCR3 = UTCR3_RIE | UTCR3_RXE | UTCR3_TXE;
250 sa1100_irda_check_speed(si);
253 netif_wake_queue(dev);
261 * FIR format support.
263 static void sa1100_irda_firtxdma_irq(void *id)
265 struct net_device *dev = id;
266 struct sa1100_irda *si = netdev_priv(dev);
270 * Wait for the transmission to complete. Unfortunately,
271 * the hardware doesn't give us an interrupt to indicate
276 while (!(Ser2HSSR0 & HSSR0_TUR) || Ser2HSSR1 & HSSR1_TBY);
279 * Clear the transmit underrun bit.
281 Ser2HSSR0 = HSSR0_TUR;
284 * Do we need to change speed? Note that we're lazy
285 * here - we don't free the old dma_rx.skb. We don't need
286 * to allocate a buffer either.
288 sa1100_irda_check_speed(si);
291 * Start reception. This disables the transmitter for
292 * us. This will be using the existing RX buffer.
294 sa1100_irda_rx_dma_start(si);
296 /* Account and free the packet. */
297 skb = si->dma_tx.skb;
299 dma_unmap_sg(si->dma_tx.dev, &si->dma_tx.sg, 1,
301 dev->stats.tx_packets ++;
302 dev->stats.tx_bytes += skb->len;
303 dev_kfree_skb_irq(skb);
304 si->dma_tx.skb = NULL;
308 * Make sure that the TX queue is available for sending
309 * (for retries). TX has priority over RX at all times.
311 netif_wake_queue(dev);
314 static int sa1100_irda_fir_tx_start(struct sk_buff *skb, struct net_device *dev,
315 struct sa1100_irda *si)
317 int mtt = irda_get_mtt(skb);
319 si->dma_tx.skb = skb;
320 sg_set_buf(&si->dma_tx.sg, skb->data, skb->len);
321 if (dma_map_sg(si->dma_tx.dev, &si->dma_tx.sg, 1, DMA_TO_DEVICE) == 0) {
322 si->dma_tx.skb = NULL;
323 netif_wake_queue(dev);
324 dev->stats.tx_dropped++;
329 sa1100_start_dma(si->dma_tx.regs, sg_dma_address(&si->dma_tx.sg),
330 sg_dma_len(&si->dma_tx.sg));
333 * If we have a mean turn-around time, impose the specified
334 * specified delay. We could shorten this by timing from
335 * the point we received the packet.
340 Ser2HSCR0 = HSCR0_HSSP | HSCR0_TXE;
345 static void sa1100_irda_fir_error(struct sa1100_irda *si, struct net_device *dev)
347 struct sk_buff *skb = si->dma_rx.skb;
349 unsigned int len, stat, data;
352 printk(KERN_ERR "sa1100_ir: SKB is NULL!\n");
357 * Get the current data position.
359 dma_addr = sa1100_get_dma_pos(si->dma_rx.regs);
360 len = dma_addr - sg_dma_address(&si->dma_rx.sg);
361 if (len > HPSIR_MAX_RXLEN)
362 len = HPSIR_MAX_RXLEN;
363 dma_unmap_sg(si->dma_rx.dev, &si->dma_rx.sg, 1, DMA_FROM_DEVICE);
367 * Read Status, and then Data.
373 if (stat & (HSSR1_CRE | HSSR1_ROR)) {
374 dev->stats.rx_errors++;
375 if (stat & HSSR1_CRE)
376 dev->stats.rx_crc_errors++;
377 if (stat & HSSR1_ROR)
378 dev->stats.rx_frame_errors++;
380 skb->data[len++] = data;
383 * If we hit the end of frame, there's
384 * no point in continuing.
386 if (stat & HSSR1_EOF)
388 } while (Ser2HSSR0 & HSSR0_EIF);
390 if (stat & HSSR1_EOF) {
391 si->dma_rx.skb = NULL;
395 skb_reset_mac_header(skb);
396 skb->protocol = htons(ETH_P_IRDA);
397 dev->stats.rx_packets++;
398 dev->stats.rx_bytes += len;
401 * Before we pass the buffer up, allocate a new one.
403 sa1100_irda_rx_alloc(si);
408 * Remap the buffer - it was previously mapped, and we
409 * hope that this succeeds.
411 dma_map_sg(si->dma_rx.dev, &si->dma_rx.sg, 1, DMA_FROM_DEVICE);
416 * We only have to handle RX events here; transmit events go via the TX
417 * DMA handler. We disable RX, process, and the restart RX.
419 static irqreturn_t sa1100_irda_fir_irq(struct net_device *dev, struct sa1100_irda *si)
424 sa1100_stop_dma(si->dma_rx.regs);
427 * Framing error - we throw away the packet completely.
428 * Clearing RXE flushes the error conditions and data
431 if (Ser2HSSR0 & (HSSR0_FRE | HSSR0_RAB)) {
432 dev->stats.rx_errors++;
434 if (Ser2HSSR0 & HSSR0_FRE)
435 dev->stats.rx_frame_errors++;
438 * Clear out the DMA...
440 Ser2HSCR0 = HSCR0_HSSP;
443 * Clear selected status bits now, so we
444 * don't miss them next time around.
446 Ser2HSSR0 = HSSR0_FRE | HSSR0_RAB;
450 * Deal with any receive errors. The any of the lowest
451 * 8 bytes in the FIFO may contain an error. We must read
452 * them one by one. The "error" could even be the end of
455 if (Ser2HSSR0 & HSSR0_EIF)
456 sa1100_irda_fir_error(si, dev);
459 * No matter what happens, we must restart reception.
461 sa1100_irda_rx_dma_start(si);
467 * Set the IrDA communications speed.
469 static int sa1100_irda_set_speed(struct sa1100_irda *si, int speed)
472 int brd, ret = -EINVAL;
475 case 9600: case 19200: case 38400:
476 case 57600: case 115200:
477 brd = 3686400 / (16 * speed) - 1;
480 * Stop the receive DMA.
483 sa1100_stop_dma(si->dma_rx.regs);
485 local_irq_save(flags);
488 Ser2HSCR0 = HSCR0_UART;
490 Ser2UTCR1 = brd >> 8;
494 * Clear status register
496 Ser2UTSR0 = UTSR0_REB | UTSR0_RBB | UTSR0_RID;
497 Ser2UTCR3 = UTCR3_RIE | UTCR3_RXE | UTCR3_TXE;
499 if (si->pdata->set_speed)
500 si->pdata->set_speed(si->dev, speed);
503 si->tx_start = sa1100_irda_sir_tx_start;
504 si->irq = sa1100_irda_sir_irq;
506 local_irq_restore(flags);
511 local_irq_save(flags);
514 Ser2HSCR0 = HSCR0_HSSP;
518 si->tx_start = sa1100_irda_fir_tx_start;
519 si->irq = sa1100_irda_fir_irq;
521 if (si->pdata->set_speed)
522 si->pdata->set_speed(si->dev, speed);
524 sa1100_irda_rx_alloc(si);
525 sa1100_irda_rx_dma_start(si);
527 local_irq_restore(flags);
539 * Control the power state of the IrDA transmitter.
542 * 1 - short range, lowest power
543 * 2 - medium range, medium power
544 * 3 - maximum range, high power
546 * Currently, only assabet is known to support this.
549 __sa1100_irda_set_power(struct sa1100_irda *si, unsigned int state)
552 if (si->pdata->set_power)
553 ret = si->pdata->set_power(si->dev, state);
558 sa1100_set_power(struct sa1100_irda *si, unsigned int state)
562 ret = __sa1100_irda_set_power(si, state);
569 static irqreturn_t sa1100_irda_irq(int irq, void *dev_id)
571 struct net_device *dev = dev_id;
572 struct sa1100_irda *si = netdev_priv(dev);
574 return si->irq(dev, si);
577 static int sa1100_irda_hard_xmit(struct sk_buff *skb, struct net_device *dev)
579 struct sa1100_irda *si = netdev_priv(dev);
580 int speed = irda_get_next_speed(skb);
583 * Does this packet contain a request to change the interface
584 * speed? If so, remember it until we complete the transmission
587 if (speed != si->speed && speed != -1)
588 si->newspeed = speed;
590 /* If this is an empty frame, we can bypass a lot. */
592 sa1100_irda_check_speed(si);
597 netif_stop_queue(dev);
599 /* We must not already have a skb to transmit... */
600 BUG_ON(si->dma_tx.skb);
602 return si->tx_start(skb, dev, si);
606 sa1100_irda_ioctl(struct net_device *dev, struct ifreq *ifreq, int cmd)
608 struct if_irda_req *rq = (struct if_irda_req *)ifreq;
609 struct sa1100_irda *si = netdev_priv(dev);
610 int ret = -EOPNOTSUPP;
614 if (capable(CAP_NET_ADMIN)) {
616 * We are unable to set the speed if the
617 * device is not running.
620 ret = sa1100_irda_set_speed(si,
623 printk("sa1100_irda_ioctl: SIOCSBANDWIDTH: !netif_running\n");
631 if (capable(CAP_NET_ADMIN)) {
632 irda_device_set_media_busy(dev, TRUE);
638 rq->ifr_receiving = IS_FIR(si) ? 0
639 : si->rx_buff.state != OUTSIDE_FRAME;
649 static int sa1100_irda_startup(struct sa1100_irda *si)
654 * Ensure that the ports for this device are setup correctly.
656 if (si->pdata->startup) {
657 ret = si->pdata->startup(si->dev);
663 * Configure PPC for IRDA - we want to drive TXD2 low.
664 * We also want to drive this pin low during sleep.
671 * Enable HP-SIR modulation, and ensure that the port is disabled.
674 Ser2HSCR0 = HSCR0_UART;
675 Ser2UTCR4 = si->utcr4;
676 Ser2UTCR0 = UTCR0_8BitData;
677 Ser2HSCR2 = HSCR2_TrDataH | HSCR2_RcDataL;
680 * Clear status register
682 Ser2UTSR0 = UTSR0_REB | UTSR0_RBB | UTSR0_RID;
684 ret = sa1100_irda_set_speed(si, si->speed = 9600);
689 if (si->pdata->shutdown)
690 si->pdata->shutdown(si->dev);
696 static void sa1100_irda_shutdown(struct sa1100_irda *si)
699 * Stop all DMA activity.
701 sa1100_stop_dma(si->dma_rx.regs);
702 sa1100_stop_dma(si->dma_tx.regs);
704 /* Disable the port. */
708 if (si->pdata->shutdown)
709 si->pdata->shutdown(si->dev);
712 static int sa1100_irda_start(struct net_device *dev)
714 struct sa1100_irda *si = netdev_priv(dev);
719 err = sa1100_request_dma(DMA_Ser2HSSPRd, "IrDA receive",
720 NULL, NULL, &si->dma_rx.regs);
724 err = sa1100_request_dma(DMA_Ser2HSSPWr, "IrDA transmit",
725 sa1100_irda_firtxdma_irq, dev,
730 si->dma_rx.dev = si->dev;
731 si->dma_tx.dev = si->dev;
734 * Setup the serial port for the specified speed.
736 err = sa1100_irda_startup(si);
741 * Open a new IrLAP layer instance.
743 si->irlap = irlap_open(dev, &si->qos, "sa1100");
748 err = request_irq(dev->irq, sa1100_irda_irq, 0, dev->name, dev);
753 * Now enable the interrupt and start the queue
756 sa1100_set_power(si, power_level); /* low power mode */
758 netif_start_queue(dev);
762 irlap_close(si->irlap);
765 sa1100_irda_shutdown(si);
767 sa1100_free_dma(si->dma_tx.regs);
769 sa1100_free_dma(si->dma_rx.regs);
774 static int sa1100_irda_stop(struct net_device *dev)
776 struct sa1100_irda *si = netdev_priv(dev);
779 netif_stop_queue(dev);
782 sa1100_irda_shutdown(si);
785 * If we have been doing any DMA activity, make sure we
786 * tidy that up cleanly.
788 skb = si->dma_rx.skb;
790 dma_unmap_sg(si->dma_rx.dev, &si->dma_rx.sg, 1,
793 si->dma_rx.skb = NULL;
796 skb = si->dma_tx.skb;
798 dma_unmap_sg(si->dma_tx.dev, &si->dma_tx.sg, 1,
801 si->dma_tx.skb = NULL;
806 irlap_close(si->irlap);
813 sa1100_free_dma(si->dma_tx.regs);
814 sa1100_free_dma(si->dma_rx.regs);
815 free_irq(dev->irq, dev);
817 sa1100_set_power(si, 0);
822 static int sa1100_irda_init_iobuf(iobuff_t *io, int size)
824 io->head = kmalloc(size, GFP_KERNEL | GFP_DMA);
825 if (io->head != NULL) {
827 io->in_frame = FALSE;
828 io->state = OUTSIDE_FRAME;
831 return io->head ? 0 : -ENOMEM;
834 static const struct net_device_ops sa1100_irda_netdev_ops = {
835 .ndo_open = sa1100_irda_start,
836 .ndo_stop = sa1100_irda_stop,
837 .ndo_start_xmit = sa1100_irda_hard_xmit,
838 .ndo_do_ioctl = sa1100_irda_ioctl,
841 static int sa1100_irda_probe(struct platform_device *pdev)
843 struct net_device *dev;
844 struct sa1100_irda *si;
845 unsigned int baudrate_mask;
848 if (!pdev->dev.platform_data)
851 irq = platform_get_irq(pdev, 0);
853 return irq < 0 ? irq : -ENXIO;
855 err = request_mem_region(__PREG(Ser2UTCR0), 0x24, "IrDA") ? 0 : -EBUSY;
858 err = request_mem_region(__PREG(Ser2HSCR0), 0x1c, "IrDA") ? 0 : -EBUSY;
861 err = request_mem_region(__PREG(Ser2HSCR2), 0x04, "IrDA") ? 0 : -EBUSY;
865 dev = alloc_irdadev(sizeof(struct sa1100_irda));
869 SET_NETDEV_DEV(dev, &pdev->dev);
871 si = netdev_priv(dev);
872 si->dev = &pdev->dev;
873 si->pdata = pdev->dev.platform_data;
875 sg_init_table(&si->dma_rx.sg, 1);
876 sg_init_table(&si->dma_tx.sg, 1);
879 * Initialise the HP-SIR buffers
881 err = sa1100_irda_init_iobuf(&si->rx_buff, 14384);
884 err = sa1100_irda_init_iobuf(&si->tx_buff, IRDA_SIR_MAX_FRAME);
888 dev->netdev_ops = &sa1100_irda_netdev_ops;
891 irda_init_max_qos_capabilies(&si->qos);
894 * We support original IRDA up to 115k2. (we don't currently
895 * support 4Mbps). Min Turn Time set to 1ms or greater.
897 baudrate_mask = IR_9600;
900 case 4000000: baudrate_mask |= IR_4000000 << 8;
901 case 115200: baudrate_mask |= IR_115200;
902 case 57600: baudrate_mask |= IR_57600;
903 case 38400: baudrate_mask |= IR_38400;
904 case 19200: baudrate_mask |= IR_19200;
907 si->qos.baud_rate.bits &= baudrate_mask;
908 si->qos.min_turn_time.bits = 7;
910 irda_qos_bits_to_value(&si->qos);
912 si->utcr4 = UTCR4_HPSIR;
914 si->utcr4 |= UTCR4_Z1_6us;
917 * Initially enable HP-SIR modulation, and ensure that the port
921 Ser2UTCR4 = si->utcr4;
922 Ser2HSCR0 = HSCR0_UART;
924 err = register_netdev(dev);
926 platform_set_drvdata(pdev, dev);
930 kfree(si->tx_buff.head);
931 kfree(si->rx_buff.head);
934 release_mem_region(__PREG(Ser2HSCR2), 0x04);
936 release_mem_region(__PREG(Ser2HSCR0), 0x1c);
938 release_mem_region(__PREG(Ser2UTCR0), 0x24);
944 static int sa1100_irda_remove(struct platform_device *pdev)
946 struct net_device *dev = platform_get_drvdata(pdev);
949 struct sa1100_irda *si = netdev_priv(dev);
950 unregister_netdev(dev);
951 kfree(si->tx_buff.head);
952 kfree(si->rx_buff.head);
956 release_mem_region(__PREG(Ser2HSCR2), 0x04);
957 release_mem_region(__PREG(Ser2HSCR0), 0x1c);
958 release_mem_region(__PREG(Ser2UTCR0), 0x24);
965 * Suspend the IrDA interface.
967 static int sa1100_irda_suspend(struct platform_device *pdev, pm_message_t state)
969 struct net_device *dev = platform_get_drvdata(pdev);
970 struct sa1100_irda *si;
975 si = netdev_priv(dev);
978 * Stop the transmit queue
980 netif_device_detach(dev);
981 disable_irq(dev->irq);
982 sa1100_irda_shutdown(si);
983 __sa1100_irda_set_power(si, 0);
990 * Resume the IrDA interface.
992 static int sa1100_irda_resume(struct platform_device *pdev)
994 struct net_device *dev = platform_get_drvdata(pdev);
995 struct sa1100_irda *si;
1000 si = netdev_priv(dev);
1003 * If we missed a speed change, initialise at the new speed
1004 * directly. It is debatable whether this is actually
1005 * required, but in the interests of continuing from where
1006 * we left off it is desirable. The converse argument is
1007 * that we should re-negotiate at 9600 baud again.
1010 si->speed = si->newspeed;
1014 sa1100_irda_startup(si);
1015 __sa1100_irda_set_power(si, si->power);
1016 enable_irq(dev->irq);
1019 * This automatically wakes up the queue
1021 netif_device_attach(dev);
1027 #define sa1100_irda_suspend NULL
1028 #define sa1100_irda_resume NULL
1031 static struct platform_driver sa1100ir_driver = {
1032 .probe = sa1100_irda_probe,
1033 .remove = sa1100_irda_remove,
1034 .suspend = sa1100_irda_suspend,
1035 .resume = sa1100_irda_resume,
1037 .name = "sa11x0-ir",
1038 .owner = THIS_MODULE,
1042 static int __init sa1100_irda_init(void)
1045 * Limit power level a sensible range.
1047 if (power_level < 1)
1049 if (power_level > 3)
1052 return platform_driver_register(&sa1100ir_driver);
1055 static void __exit sa1100_irda_exit(void)
1057 platform_driver_unregister(&sa1100ir_driver);
1060 module_init(sa1100_irda_init);
1061 module_exit(sa1100_irda_exit);
1062 module_param(power_level, int, 0);
1063 module_param(tx_lpm, int, 0);
1064 module_param(max_rate, int, 0);
1066 MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>");
1067 MODULE_DESCRIPTION("StrongARM SA1100 IrDA driver");
1068 MODULE_LICENSE("GPL");
1069 MODULE_PARM_DESC(power_level, "IrDA power level, 1 (low) to 3 (high)");
1070 MODULE_PARM_DESC(tx_lpm, "Enable transmitter low power (1.6us) mode");
1071 MODULE_PARM_DESC(max_rate, "Maximum baud rate (4000000, 115200, 57600, 38400, 19200, 9600)");
1072 MODULE_ALIAS("platform:sa11x0-ir");