Commit ad4da674 authored by Martin Diehl's avatar Martin Diehl Committed by Stephen Hemminger

[IRDA]: vlsi_ir v0.5 update, 7/7.

* correct mtt bits to indicate 1msec or more
* rename IRENABLE_IREN to IRENABLE_PHYANDCLOCK
* rearrange driver metadata and header
* driver version 0.5
parent 326f6e22
...@@ -21,18 +21,20 @@ ...@@ -21,18 +21,20 @@
* *
********************************************************************/ ********************************************************************/
#include <linux/config.h>
#include <linux/module.h> #include <linux/module.h>
MODULE_DESCRIPTION("IrDA SIR/MIR/FIR driver for VLSI 82C147"); #define DRIVER_NAME "vlsi_ir"
MODULE_AUTHOR("Martin Diehl <info@mdiehl.de>"); #define DRIVER_VERSION "v0.5"
MODULE_LICENSE("GPL"); #define DRIVER_DESCRIPTION "IrDA SIR/MIR/FIR driver for VLSI 82C147"
#define DRIVER_AUTHOR "Martin Diehl <info@mdiehl.de>"
#define DRIVER_NAME "vlsi_ir" MODULE_DESCRIPTION(DRIVER_DESCRIPTION);
#define DRIVER_VERSION "v0.4a" MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_LICENSE("GPL");
/********************************************************/ /********************************************************/
#include <linux/config.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/pci.h> #include <linux/pci.h>
...@@ -118,7 +120,7 @@ static int sirpulse = 1; /* default is 3/16 bittime */ ...@@ -118,7 +120,7 @@ static int sirpulse = 1; /* default is 3/16 bittime */
MODULE_PARM(qos_mtt_bits, "i"); MODULE_PARM(qos_mtt_bits, "i");
MODULE_PARM_DESC(qos_mtt_bits, "IrLAP bitfield representing min-turn-time"); MODULE_PARM_DESC(qos_mtt_bits, "IrLAP bitfield representing min-turn-time");
static int qos_mtt_bits = 0x04; /* default is 1 ms */ static int qos_mtt_bits = 0x07; /* default is 1 ms or more */
/********************************************************/ /********************************************************/
...@@ -258,7 +260,7 @@ static int vlsi_proc_ndev(struct net_device *ndev, char *buf, int len) ...@@ -258,7 +260,7 @@ static int vlsi_proc_ndev(struct net_device *ndev, char *buf, int len)
(word&IRCFG_RXPOL) ? " RXPOL" : ""); (word&IRCFG_RXPOL) ? " RXPOL" : "");
word = inw(iobase+VLSI_PIO_IRENABLE); word = inw(iobase+VLSI_PIO_IRENABLE);
out += sprintf(out, "IRENABLE:%s%s%s%s%s%s%s%s\n", out += sprintf(out, "IRENABLE:%s%s%s%s%s%s%s%s\n",
(word&IRENABLE_IREN) ? " IRENABLE" : "", (word&IRENABLE_PHYANDCLOCK) ? " PHYANDCLOCK" : "",
(word&IRENABLE_CFGER) ? " CFGERR" : "", (word&IRENABLE_CFGER) ? " CFGERR" : "",
(word&IRENABLE_FIR_ON) ? " FIR_ON" : "", (word&IRENABLE_FIR_ON) ? " FIR_ON" : "",
(word&IRENABLE_MIR_ON) ? " MIR_ON" : "", (word&IRENABLE_MIR_ON) ? " MIR_ON" : "",
...@@ -926,7 +928,7 @@ static int vlsi_set_baud(vlsi_irda_dev_t *idev, unsigned iobase) ...@@ -926,7 +928,7 @@ static int vlsi_set_baud(vlsi_irda_dev_t *idev, unsigned iobase)
outw(config, iobase+VLSI_PIO_IRCFG); outw(config, iobase+VLSI_PIO_IRCFG);
outw(nphyctl, iobase+VLSI_PIO_NPHYCTL); outw(nphyctl, iobase+VLSI_PIO_NPHYCTL);
wmb(); wmb();
outw(IRENABLE_IREN, iobase+VLSI_PIO_IRENABLE); outw(IRENABLE_PHYANDCLOCK, iobase+VLSI_PIO_IRENABLE);
mb(); mb();
udelay(1); /* chip applies IRCFG on next rising edge of its 8MHz clock */ udelay(1); /* chip applies IRCFG on next rising edge of its 8MHz clock */
...@@ -942,7 +944,7 @@ static int vlsi_set_baud(vlsi_irda_dev_t *idev, unsigned iobase) ...@@ -942,7 +944,7 @@ static int vlsi_set_baud(vlsi_irda_dev_t *idev, unsigned iobase)
else else
config ^= IRENABLE_SIR_ON; config ^= IRENABLE_SIR_ON;
if (config != (IRENABLE_IREN|IRENABLE_ENRXST)) { if (config != (IRENABLE_PHYANDCLOCK|IRENABLE_ENRXST)) {
WARNING("%s: failed to set %s mode!\n", __FUNCTION__, WARNING("%s: failed to set %s mode!\n", __FUNCTION__,
(mode==IFF_SIR)?"SIR":((mode==IFF_MIR)?"MIR":"FIR")); (mode==IFF_SIR)?"SIR":((mode==IFF_MIR)?"MIR":"FIR"));
ret = -1; ret = -1;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* vlsi_ir.h: VLSI82C147 PCI IrDA controller driver for Linux * vlsi_ir.h: VLSI82C147 PCI IrDA controller driver for Linux
* *
* Version: 0.4a * Version: 0.5
* *
* Copyright (c) 2001-2003 Martin Diehl * Copyright (c) 2001-2003 Martin Diehl
* *
...@@ -191,7 +191,7 @@ enum vlsi_pci_clkctl { ...@@ -191,7 +191,7 @@ enum vlsi_pci_clkctl {
* - IRMISC_UARTSEL configured * - IRMISC_UARTSEL configured
* - IRCFG_MASTER must be cleared * - IRCFG_MASTER must be cleared
* - IRCFG_SIR must be set * - IRCFG_SIR must be set
* - IRENABLE_IREN must be asserted 0->1 (and hence IRENABLE_SIR_ON) * - IRENABLE_PHYANDCLOCK must be asserted 0->1 (and hence IRENABLE_SIR_ON)
*/ */
enum vlsi_pci_irmisc { enum vlsi_pci_irmisc {
...@@ -351,7 +351,7 @@ enum vlsi_pio_irintr { ...@@ -351,7 +351,7 @@ enum vlsi_pio_irintr {
/* notes: /* notes:
* - not more than one SIR/MIR/FIR bit must be set at any time * - not more than one SIR/MIR/FIR bit must be set at any time
* - SIR, MIR, FIR and CRC16 select the configuration which will * - SIR, MIR, FIR and CRC16 select the configuration which will
* be applied on next 0->1 transition of IRENABLE_IREN (see below). * be applied on next 0->1 transition of IRENABLE_PHYANDCLOCK (see below).
* - besides allowing the PCI interface to execute busmaster cycles * - besides allowing the PCI interface to execute busmaster cycles
* and therefore the ring SM to operate, the MSTR bit has side-effects: * and therefore the ring SM to operate, the MSTR bit has side-effects:
* when MSTR is cleared, the RINGPTR's get reset and the legacy UART mode * when MSTR is cleared, the RINGPTR's get reset and the legacy UART mode
...@@ -402,7 +402,7 @@ enum vlsi_pio_ircfg { ...@@ -402,7 +402,7 @@ enum vlsi_pio_ircfg {
*/ */
enum vlsi_pio_irenable { enum vlsi_pio_irenable {
IRENABLE_IREN = 0x8000, /* enable IR phy and gate the mode config (rw) */ IRENABLE_PHYANDCLOCK = 0x8000, /* enable IR phy and gate the mode config (rw) */
IRENABLE_CFGER = 0x4000, /* mode configuration error (ro) */ IRENABLE_CFGER = 0x4000, /* mode configuration error (ro) */
IRENABLE_FIR_ON = 0x2000, /* FIR on status (ro) */ IRENABLE_FIR_ON = 0x2000, /* FIR on status (ro) */
IRENABLE_MIR_ON = 0x1000, /* MIR on status (ro) */ IRENABLE_MIR_ON = 0x1000, /* MIR on status (ro) */
...@@ -419,7 +419,7 @@ enum vlsi_pio_irenable { ...@@ -419,7 +419,7 @@ enum vlsi_pio_irenable {
/* VLSI_PIO_PHYCTL: IR Physical Layer Current Control Register (u16, ro) */ /* VLSI_PIO_PHYCTL: IR Physical Layer Current Control Register (u16, ro) */
/* read-back of the currently applied physical layer status. /* read-back of the currently applied physical layer status.
* applied from VLSI_PIO_NPHYCTL at rising edge of IRENABLE_IREN * applied from VLSI_PIO_NPHYCTL at rising edge of IRENABLE_PHYANDCLOCK
* contents identical to VLSI_PIO_NPHYCTL (see below) * contents identical to VLSI_PIO_NPHYCTL (see below)
*/ */
...@@ -427,7 +427,7 @@ enum vlsi_pio_irenable { ...@@ -427,7 +427,7 @@ enum vlsi_pio_irenable {
/* VLSI_PIO_NPHYCTL: IR Physical Layer Next Control Register (u16, rw) */ /* VLSI_PIO_NPHYCTL: IR Physical Layer Next Control Register (u16, rw) */
/* latched during IRENABLE_IREN=0 and applied at 0-1 transition /* latched during IRENABLE_PHYANDCLOCK=0 and applied at 0-1 transition
* *
* consists of BAUD[15:10], PLSWID[9:5] and PREAMB[4:0] bits defined as follows: * consists of BAUD[15:10], PLSWID[9:5] and PREAMB[4:0] bits defined as follows:
* *
......
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