summaryrefslogtreecommitdiff
path: root/xhfc
diff options
context:
space:
mode:
authorGuillaume Knispel <gknispel@proformatique.com>2012-02-01 17:59:53 +0100
committerGuillaume Knispel <gknispel@proformatique.com>2012-02-01 17:59:53 +0100
commit0e7486d3eff5dfb00de73d7a1e4cd098559d2c60 (patch)
tree3cfe6afb0585a1038b88b391cc4b3369a2fa54a9 /xhfc
parent5f609455bd9701cc52ccd8ddf5508664c1b25695 (diff)
cleanup and add xhfc pnp device
Diffstat (limited to 'xhfc')
-rw-r--r--xhfc/Makefile6
-rw-r--r--xhfc/base.c262
-rw-r--r--xhfc/xhfc.h17
-rw-r--r--xhfc/xhfc_leb.c2
4 files changed, 175 insertions, 112 deletions
diff --git a/xhfc/Makefile b/xhfc/Makefile
index 558c296..63b3a7f 100644
--- a/xhfc/Makefile
+++ b/xhfc/Makefile
@@ -2,8 +2,14 @@ PWD := $(shell pwd)
KSRC ?= /bad__ksrc__not_set
DAHDI_INCLUDE ?= /bad__dahdi_include__not_set
+DAHDI_SYMVERS ?= /bad__dahdi_symvers__not_set
+
CFLAGS_MODULE += -I$(DAHDI_INCLUDE) -I$(abspath $(src)/../) -DUSE_GPIO -DAUDIO
+KBUILD_EXTRA_SYMBOLS += $(DAHDI_SYMVERS) \
+ $(src)/../gpio/Module.symvers \
+ $(src)/../tdm/Module.symvers
+
ifeq (1,$(XIVO_AUDIO))
CFLAGS_MODULE += -DAUDIO
endif
diff --git a/xhfc/base.c b/xhfc/base.c
index cb76918..6d0afe0 100644
--- a/xhfc/base.c
+++ b/xhfc/base.c
@@ -19,11 +19,20 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/* BUGBUG: pnp vs. pci driver registration / unregistration could be racy
+ * (if the bind / unbind mechanism in /sys is used by user or another reason
+ * results in a .remove method to be called)
+ *
+ * TODO: resource management strategy has been designed under influence,
+ * clean it
+ */
+
#include <linux/acpi.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/pci.h>
+#include <linux/pnp.h>
#ifdef USE_GPIO
#include <gpio/gpio.h>
@@ -33,7 +42,7 @@
#include "xhfc.h"
#include "xhfc_leb.h"
-static const char xhfc_rev[] = "$Revision: 1.22 $";
+static const char xhfc_rev[] = "42"; // XXX
static int card_cnt = 0;
MODULE_LICENSE("GPL");
@@ -42,17 +51,17 @@ MODULE_LICENSE("GPL");
#define GPIO_NONE (-1)
-int reset_gpio = 27;
+static int reset_gpio = 27;
-int port1_ntte_gpio = GPIO_NONE;
-int port2_ntte_gpio = GPIO_NONE;
-int port3_ntte_gpio = GPIO_NONE;
-int port4_ntte_gpio = GPIO_NONE;
+static int port1_ntte_gpio = GPIO_NONE;
+static int port2_ntte_gpio = GPIO_NONE;
+static int port3_ntte_gpio = GPIO_NONE;
+static int port4_ntte_gpio = GPIO_NONE;
-int port1_term_gpio = GPIO_NONE;
-int port2_term_gpio = GPIO_NONE;
-int port3_term_gpio = GPIO_NONE;
-int port4_term_gpio = GPIO_NONE;
+static int port1_term_gpio = GPIO_NONE;
+static int port2_term_gpio = GPIO_NONE;
+static int port3_term_gpio = GPIO_NONE;
+static int port4_term_gpio = GPIO_NONE;
module_param(reset_gpio, int, S_IRUGO);
module_param(port1_ntte_gpio, int, S_IRUGO);
@@ -84,10 +93,12 @@ MODULE_PARM_DESC(port4_term_gpio, "GPIO used for line termination on port 4 "
"(default: -1 = none)");
#endif
+static struct xhfc_pi *g_pi;
+
uint debug = 0;
uint dbg_spanfilter = 0xFFFFFFFF;
-int exit_after_reset = 0;
-uint ntte = 0x3;
+static int exit_after_reset = 0;
+static uint ntte = 0x3;
module_param(debug, uint, S_IRUGO | S_IWUSR);
module_param(dbg_spanfilter, uint, S_IRUGO | S_IWUSR);
@@ -109,13 +120,13 @@ MODULE_PARM_DESC(ntte, "bitfield, configuration of the physical ports. "
"ex: 0x3 = 0 NT, 1 NT, 2 TE, 3 TE.");
MODULE_PARM_DESC(exit_after_reset, "Exit after hard reset");
-void xhfc_waitbusy(struct xhfc *xhfc)
+static void xhfc_waitbusy(struct xhfc *xhfc)
{
while (read_xhfc(xhfc, R_STATUS) & M_BUSY)
cpu_relax();
}
-void xhfc_selfifo(struct xhfc *xhfc, int fifo, int receive)
+static void xhfc_selfifo(struct xhfc *xhfc, int fifo, int receive)
{
u8 r_fifo = 0x00;
SET_V_FIFO_NUM(r_fifo, fifo);
@@ -124,7 +135,7 @@ void xhfc_selfifo(struct xhfc *xhfc, int fifo, int receive)
xhfc_waitbusy(xhfc);
}
-void xhfc_inc_f(struct xhfc *xhfc)
+static void xhfc_inc_f(struct xhfc *xhfc)
{
write_xhfc(xhfc, A_INC_RES_FIFO, M_INC_F);
xhfc_waitbusy(xhfc);
@@ -136,7 +147,7 @@ static inline void xhfc_resetfifo(struct xhfc *xhfc)
xhfc_waitbusy(xhfc);
}
-int xhfc_reset(struct xhfc *xhfc)
+static int xhfc_reset(struct xhfc *xhfc)
{
int timeout = 0x2000;
@@ -154,14 +165,14 @@ int xhfc_reset(struct xhfc *xhfc)
if (!(timeout)) {
printk(KERN_ERR
"%s %s: initialization sequence could not finish\n",
- xhfc->pi->name, __func__);
+ DRIVER_NAME, __func__);
return -EIO;
}
return 0;
}
-void xhfc_config_st(struct xhfc *x, int port, int nt)
+static void xhfc_config_st(struct xhfc *x, int port, int nt)
{
u8 r_su_sel, a_su_ctrl0, a_su_ctrl1, a_su_ctrl2, a_su_wr_sta,
a_su_clk_dly;
@@ -202,7 +213,7 @@ void xhfc_config_st(struct xhfc *x, int port, int nt)
/* configures PCM master mode
*/
-int xhfc_config_pcm(struct xhfc *xhfc, int master_or_slave)
+static int xhfc_config_pcm(struct xhfc *xhfc, int master_or_slave)
{
u8 r_pcm_md0 = 0;
@@ -264,7 +275,7 @@ return len; \
DEFINE_GET_LEN(F)
DEFINE_GET_LEN(Z)
-void xhfc_config_d_chan_on_fifo(struct xhfc *x, int fifo, int direction)
+static void xhfc_config_d_chan_on_fifo(struct xhfc *x, int fifo, int direction)
{
u8 r_fifo, a_con_hdlc, a_channel, a_subch_cfg, a_inc_res_fifo;
r_fifo = a_con_hdlc = a_channel = a_subch_cfg = a_inc_res_fifo = 0x00;
@@ -294,7 +305,7 @@ void xhfc_config_d_chan_on_fifo(struct xhfc *x, int fifo, int direction)
xhfc_waitbusy(x);
}
-void xhfc_config_b_chan_on_fifo(struct xhfc *x, int fifo, int slot,
+static void xhfc_config_b_chan_on_fifo(struct xhfc *x, int fifo, int slot,
int direction)
{
u8 r_fifo, a_con_hdlc, r_slot, a_sl_cfg;
@@ -324,7 +335,7 @@ void xhfc_config_b_chan_on_fifo(struct xhfc *x, int fifo, int slot,
write_xhfc(x, A_SL_CFG, a_sl_cfg);
}
-void xhfc_config_data_flow(struct xhfc* x)
+static void xhfc_config_data_flow(struct xhfc* x)
{
int i;
for (i = 0; i < SPANS_PER_CHIP; i++) {
@@ -556,7 +567,7 @@ static int hdlc_tx_frame(struct xhfc_span *xhfc_span)
}
/* DAHDI calls this when it has data it wants to send to the HDLC controller */
-void xhfc_hdlc_hard_xmit(struct dahdi_chan *chan)
+static void xhfc_hdlc_hard_xmit(struct dahdi_chan *chan)
{
struct dahdi_span *dahdi_span = chan->span;
struct xhfc_span *xhfc_span =
@@ -583,7 +594,7 @@ void xhfc_hdlc_hard_xmit(struct dahdi_chan *chan)
#define fifo_test(reg, fifonum, dir) \
(reg[fifonum/4] & (1 << (((fifonum % 4) * 2) + dir)))
-irqreturn_t xhfc_interrupt(int irq, void *dev_id)
+static irqreturn_t xhfc_interrupt(int irq, void *dev_id)
{
struct xhfc_pi *pi = dev_id;
@@ -610,7 +621,7 @@ irqreturn_t xhfc_interrupt(int irq, void *dev_id)
if (misc_irq & M_TI_IRQMSK)
xhfc->ticks++;
- for(i = 0; i < SPANS_PER_CHIP; i++) {
+ for (i = 0; i < SPANS_PER_CHIP; i++) {
fifo_irq[i] = read_xhfc(xhfc, R_FIFO_BL0_IRQ + i);
fifo_fill[i] = read_xhfc(xhfc, R_FILL_BL0 + i);
}
@@ -672,7 +683,7 @@ static void xhfc_rxtx(void *data)
if ((s->span.flags & DAHDI_FLAG_RUNNING) && s->sigchan) { // XXX s->sigchan?
dahdi_receive(&s->span);
- if(s->span.alarms == DAHDI_ALARM_NONE)
+ if (s->span.alarms == DAHDI_ALARM_NONE)
dahdi_transmit(&s->span);
dahdi_ec_span(&s->span);
}
@@ -696,8 +707,8 @@ static void xhfc_rxtx(void *data)
/*****************************************************/
static void disable_interrupts(struct xhfc * xhfc)
{
- if(DBG)
- printk(KERN_INFO "%s %s\n", xhfc->name, __func__);
+ if (DBG)
+ printk(KERN_INFO "%s %s\n", DRIVER_NAME, __func__);
write_xhfc(xhfc, R_IRQ_CTRL, 0);
read_xhfc(xhfc, R_CHIP_ID);
@@ -713,8 +724,8 @@ static void disable_interrupts(struct xhfc * xhfc)
static void enable_interrupts(struct xhfc * xhfc)
{
u8 r_irq_ctrl = 0;
- if(DBG)
- printk(KERN_INFO "%s %s\n", xhfc->name, __func__);
+ if (DBG)
+ printk(KERN_INFO "%s %s\n", DRIVER_NAME, __func__);
set_mb(xhfc->running, 1);
@@ -741,19 +752,19 @@ static void enable_interrupts(struct xhfc * xhfc)
/* initialise the XHFC ISDN Chip */
/* return 0 on success. */
/***********************************/
-int xhfc_collect_chip_id(struct xhfc * xhfc)
+static int xhfc_collect_chip_id(struct xhfc * xhfc)
{
u8 chip_id = read_xhfc(xhfc, R_CHIP_ID);
switch (chip_id) {
case CHIP_ID_4SU:
printk(KERN_INFO "%s ChipID: 0x%x\n",
- xhfc->name, chip_id);
+ DRIVER_NAME, chip_id);
return 0;
case CHIP_ID_1SU:
case CHIP_ID_2SU:
case CHIP_ID_2S4U:
printk(KERN_ERR "%s %s: unsupported device XHFC-%s\n",
- xhfc->name, __func__,
+ DRIVER_NAME, __func__,
chip_id == CHIP_ID_1SU ? "1SU" :
chip_id == CHIP_ID_2SU ? "2SU" :
"2S4U");
@@ -761,14 +772,14 @@ int xhfc_collect_chip_id(struct xhfc * xhfc)
}
printk(KERN_ERR "%s %s: unkown Chip ID 0x%x\n",
- xhfc->name, __func__, chip_id);
+ DRIVER_NAME, __func__, chip_id);
return -EIO;
}
-void xhfc_hard_reset(void)
+static void xhfc_hard_reset(void)
{
#ifdef USE_GPIO
- if(reset_gpio == GPIO_NONE) {
+ if (reset_gpio == GPIO_NONE) {
printk(KERN_NOTICE DRIVER_NAME ": No hard reset performed "
"(no GPIO configured)\n");
return;
@@ -781,7 +792,7 @@ void xhfc_hard_reset(void)
#endif
}
-void configure_ntte(int port, int nt)
+static void configure_ntte(int port, int nt)
{
static int *ntte_gpio[] = {
&port1_ntte_gpio,
@@ -802,7 +813,7 @@ void configure_ntte(int port, int nt)
gpio_set_level(*ntte_gpio[port], nt);
}
-void configure_term(int port, int lineterm)
+static void configure_term(int port, int lineterm)
{
static int *term_gpio[] = {
&port1_term_gpio,
@@ -824,7 +835,7 @@ void configure_term(int port, int lineterm)
gpio_set_level(*term_gpio[port], lineterm);
}
-void xhfc_init_and_configure(struct xhfc* x)
+static void xhfc_init_and_configure(struct xhfc* x)
{
u8 r_fifo_thres = 0;
/* In DAHDI's driver's this part is "stage 1" */
@@ -848,7 +859,7 @@ static void xhfc_span_set_ntte(struct xhfc_span* s, int ntte)
s->span.spantype = ntte ? "NT" : "TE";
}
-int xhfc_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc)
+static int xhfc_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc)
{
struct xhfc_span *xhfc_span;
struct xhfc *xhfc;
@@ -893,7 +904,7 @@ int xhfc_spanconfig(struct dahdi_span *span, struct dahdi_lineconfig *lc)
return 0;
}
-int xhfc_chanconfig(struct dahdi_chan *chan, int sigtype)
+static int xhfc_chanconfig(struct dahdi_chan *chan, int sigtype)
{
int alreadyrunning;
struct xhfc_span *xhfc_span = container_of(chan->span, struct xhfc_span,
@@ -972,7 +983,7 @@ static const struct dahdi_span_ops xhfc_span_ops = {
/************************************************************************
* Responsible for initializing the xhfc_span and dahdi_span structures *
************************************************************************/
-void init_spans(struct xhfc* x)
+static void init_spans(struct xhfc* x)
{
int i, j;
struct xhfc_span *xhfc_span;
@@ -1058,7 +1069,7 @@ static void xhfc_shutdown(struct pci_dev *pdev)
}
/* pci.txt: called from process context */
-int __devinit xhfc_init_one(struct pci_dev *pdev,
+static int __devinit xhfc_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
int span;
@@ -1071,23 +1082,10 @@ int __devinit xhfc_init_one(struct pci_dev *pdev,
u8 **writechunk_ptrs[XIVO_TDM_TS_NUM] = { 0 };
#endif
- if(DBG)
- printk(KERN_DEBUG "entering xhfc_init_one\n");
+ pi = g_pi;
-
- /****************
- * Memory alloc *
- ****************/
-
- pi = kzalloc(sizeof(struct xhfc_pi), GFP_KERNEL);
- if (pi == NULL)
- goto err_alloc;
-
- sprintf(pi->name, "%s", DRIVER_NAME); /* ? */
-
- printk(KERN_INFO "%s %s: adapter '%s' found on PCI bus %02x dev %02x\n",
- pi->name, __func__, pi->name,
- pdev->bus->number, pdev->devfn);
+ printk(KERN_INFO "%s %s: LEB PI found on PCI bus %02x dev %02x\n",
+ DRIVER_NAME, __func__, pdev->bus->number, pdev->devfn);
/************
@@ -1099,7 +1097,7 @@ int __devinit xhfc_init_one(struct pci_dev *pdev,
if (rc)
goto err_enable_device;
- if(DBG)
+ if (DBG)
printk(KERN_DEBUG "pci_enable_device succeeded\n");
rc = pci_request_regions(pdev, DRIVER_NAME);
@@ -1154,18 +1152,6 @@ int __devinit xhfc_init_one(struct pci_dev *pdev,
********************/
pi->pci_dev = pdev;
- pi->xhfc.pi = pi;
-
- /* only adress one xhfc per PI */
- pi->xhfc.name = pi->name;
-
- /* init interrupt engine */
- rc = pi->irq = acpi_register_gsi(
- IRQ_TLP_GPIO_24,
- ACPI_LEVEL_SENSITIVE,
- ACPI_ACTIVE_LOW);
- if (rc < 0)
- goto err_acpi_register;
/********
@@ -1185,7 +1171,7 @@ int __devinit xhfc_init_one(struct pci_dev *pdev,
if ((rc = request_irq(pi->irq, &xhfc_interrupt, 0, "XHFC", pi))) {
printk(KERN_WARNING "%s %s: couldn't get interrupt %d\n",
- pi->name, __func__, pi->irq);
+ DRIVER_NAME, __func__, pi->irq);
goto err_request_irq;
}
@@ -1195,15 +1181,19 @@ int __devinit xhfc_init_one(struct pci_dev *pdev,
#ifdef AUDIO
/* TDM started on the XHFC side, XHFC is MASTER */
/* Now it's possible to start the TDM bus on the EP80579 side, as SLAVE: */
- if ((rc = xivo_tdm_config_port(pi->tdm_port, XHFC_MEGREZ_PROTO_XIVO_CONFIG)) < 0) {
- printk(KERN_ERR "%s %s: xivo_tdm_config_port failed (err=%d)\n", pi->name, __func__, rc);
+ if ((rc = xivo_tdm_config_port(pi->tdm_port,
+ XHFC_MEGREZ_PROTO_XIVO_CONFIG)) < 0) {
+ printk(KERN_ERR "%s %s: xivo_tdm_config_port failed (err=%d)\n",
+ DRIVER_NAME, __func__, rc);
goto err_tdm_config_port;
}
#endif
for (span = 0; span < SPANS_PER_CHIP; span++)
- if ((rc = dahdi_register(&pi->xhfc.spans[span].span, /*prefmaster*/ 0)) < 0) {
- printk(KERN_WARNING "%s %s: couldn't register spans\n", pi->name, __func__);
+ if ((rc = dahdi_register(&pi->xhfc.spans[span].span,
+ /*prefmaster*/ 0)) < 0) {
+ printk(KERN_WARNING "%s %s: couldn't register spans\n",
+ DRIVER_NAME, __func__);
goto err_in_dahdi_register;
}
@@ -1237,8 +1227,6 @@ err_tdm_config_port:
free_irq(pi->irq, pi);
err_request_irq:
err_collect_chip_id:
- //acpi_unregister_gsi(IRQ_TLP_GPIO_30); /* symbol doesn't exist??? */
-err_acpi_register:
#ifdef AUDIO
xivo_tdm_put_port(pi->tdm_port);
err_tdm_get_port:
@@ -1253,11 +1241,10 @@ err_request_regions:
pci_disable_device(pdev);
err_enable_device:
kfree(pi);
-err_alloc:
return rc;
}
-void __devexit xhfc_remove_one(struct pci_dev *pdev)
+static void __devexit xhfc_remove_one(struct pci_dev *pdev)
{
int i;
struct xhfc_pi *pi;
@@ -1266,7 +1253,7 @@ void __devexit xhfc_remove_one(struct pci_dev *pdev)
if (DBG)
printk(KERN_INFO "%s %s: removing card\n",
- pi->name, __func__);
+ DRIVER_NAME, __func__);
for (i = 0; i < SPANS_PER_CHIP; i++)
dahdi_unregister(&pi->xhfc.spans[i].span);
@@ -1285,15 +1272,20 @@ void __devexit xhfc_remove_one(struct pci_dev *pdev)
pci_set_drvdata(pdev, NULL);
kfree(pi);
- if(DBG)
+ if (DBG)
printk(KERN_DEBUG "%s: bye-bye\n", __func__);
}
static const struct pci_device_id tlp_leb_pci_tbl[] = {
- { 0x8086, 0x503d, PCI_ANY_ID, PCI_ANY_ID, }, /* Intel Tolapai LEB controler */
- { }
+ /* Intel Tolapai LEB controler: */
+ { 0x8086, 0x503d, PCI_ANY_ID, PCI_ANY_ID, },
+ { 0 }
};
-MODULE_DEVICE_TABLE(pci, tlp_leb_pci_tbl);
+// this PCI "device" conceptually is an internal interface of our
+// XHFC device.
+// It is a generic simple parallel bus provided by the EP80579 SoC.
+// So don't export it.
+// MODULE_DEVICE_TABLE(pci, tlp_leb_pci_tbl);
static struct pci_driver xhfc_driver = {
.name = DRIVER_NAME,
@@ -1303,31 +1295,105 @@ static struct pci_driver xhfc_driver = {
.shutdown = xhfc_shutdown,
};
+static int __devinit
+xhfc_pnp_init_one(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
+{
+ static int xhfc_pnp_num = 0;
+
+ struct xhfc_pi *pi;
+ resource_size_t irq;
+ int err;
+
+ if (xhfc_pnp_num >= 1) {
+ printk(KERN_DEBUG DRIVER_NAME
+ ": ignoring spurious additional pnp device %s "
+ "(dev_id=%s)\n",
+ pnp_dev_name(dev), dev_id->id);
+ return -1;
+ }
+
+ printk(KERN_DEBUG DRIVER_NAME
+ ": xhfc_pnp_init_one: pnp device %s (dev_id=%s)\n",
+ pnp_dev_name(dev), dev_id->id);
+
+ irq = pnp_irq(dev, 0);
+ if (irq == (resource_size_t)-1) {
+ printk(KERN_ERR DRIVER_NAME
+ ": failed to get irq for pnp device %s (dev_id=%s)\n",
+ pnp_dev_name(dev), dev_id->id);
+ return -1;
+ }
+
+ /* External resources validated, all subsequent failures
+ * in this function are internal */
+ xhfc_pnp_num++;
+
+ pi = kzalloc(sizeof(struct xhfc_pi), GFP_KERNEL);
+ if (pi == NULL) {
+ printk(KERN_ERR DRIVER_NAME ": allocation failed\n");
+ goto err_alloc;
+ }
+
+ pi->xhfc.pi = pi;
+
+ pi->irq = irq;
+ pi->pnp_dev = dev;
+
+ g_pi = pi;
+
+ err = pci_register_driver(&xhfc_driver);
+ if (err < 0) {
+ printk(KERN_ERR DRIVER_NAME
+ ": LEB PCI driver registration failed\n");
+ goto err_pci_reg;
+ }
+
+ pnp_set_drvdata(dev, pi);
+
+ return 0;
+
+ err_pci_reg:
+ kfree(pi);
+ err_alloc:
+ return -1;
+}
+
+static void __devexit xhfc_pnp_remove_one(struct pnp_dev *dev)
+{
+ pci_unregister_driver(&xhfc_driver);
+}
+
+static const struct pnp_device_id xivo_xhfc_pnp_dev_table[] = {
+ { "AEN0001", 0 },
+ { "", 0 }
+};
+MODULE_DEVICE_TABLE(pnp, xivo_xhfc_pnp_dev_table);
+
+static struct pnp_driver xhfc_pnp_driver = {
+ .name = DRIVER_NAME,
+ .id_table = xivo_xhfc_pnp_dev_table,
+ .probe = xhfc_pnp_init_one,
+ .remove = __devexit_p(xhfc_pnp_remove_one),
+};
+
/***************/
/* Module init */
/***************/
static int __init xhfc_init(void)
{
- int err;
-
if (DBG)
printk(KERN_INFO DRIVER_NAME " driver Rev. %s\n", xhfc_rev);
- err = dahdi_pci_module(&xhfc_driver);
- if (err < 0)
- goto out;
-
- /* XXX fail with error if no cards detected */
+ /* XXX fail with error if no cards detected
+ * (by checking a real device counter, not just success of
+ * driver registration) */
- return 0;
-
- out:
- return (err);
+ return pnp_register_driver(&xhfc_pnp_driver);
}
static void __exit xhfc_cleanup(void)
{
- pci_unregister_driver(&xhfc_driver);
+ pnp_unregister_driver(&xhfc_pnp_driver);
if (DBG)
printk(KERN_INFO "%s: driver removed\n", __func__);
}
diff --git a/xhfc/xhfc.h b/xhfc/xhfc.h
index 6179b45..92e889f 100644
--- a/xhfc/xhfc.h
+++ b/xhfc/xhfc.h
@@ -139,7 +139,6 @@ struct xhfc_span {
};
struct xhfc {
- char *name;
struct xhfc_pi *pi; /* backpointer to xhfc_pi */
struct xhfc_span spans[SPANS_PER_CHIP];
@@ -154,10 +153,13 @@ struct xhfc_pi {
u8 __iomem *cs_n0;
int irq;
- char name[16]; /* 'XHFC_PI0' = ProcessorInterface no. 0 */
struct xhfc xhfc; /* mem for one XHFC */
struct pci_dev *pci_dev;
+
+ /* maybe should be in struct xhfc but mainly used to retrieve the irq,
+ * so for now it ends up here */
+ struct pnp_dev *pnp_dev;
#ifdef AUDIO
struct xivo_tdm_port *tdm_port;
#endif
@@ -166,17 +168,6 @@ struct xhfc_pi {
#define dchan_fifo(span) ((span)->port * 4 + 2)
#define portno(span) ((span)->port + 1) /* used for traces */
-void xhfc_flush_fifo(struct xhfc* x, int fifo);
-int xhfc_hdlc_init(struct xhfc* x);
-int xhfc_hdlc_interrupt(struct xhfc* x);
-
-void xhfc_waitbusy(struct xhfc * xhfc);
-void xhfc_selfifo(struct xhfc * xhfc, int fifo, int receive);
-void xhfc_inc_f(struct xhfc * xhfc);
-int xhfc_reset(struct xhfc * xhfc);
-int xhfc_chipid(struct xhfc * xhfc);
-int xhfc_cfg_pcm(struct xhfc * xhfc, __u8 pcm);
-
void start_state_machine(struct xhfc_span* s);
void activate_request(struct xhfc_span* s);
void deactivate_request(struct xhfc_span* s);
diff --git a/xhfc/xhfc_leb.c b/xhfc/xhfc_leb.c
index bf0620c..cf10a87 100644
--- a/xhfc/xhfc_leb.c
+++ b/xhfc/xhfc_leb.c
@@ -67,7 +67,7 @@
/* Synchronous Intel StrataFlash: */
#define LEB_TCS_SYNC_INTEL ( 1u << 8)
-/* Target device is an EP80579 (hm, WTF??? TODONE ask Intel <- the conf is correct ) */
+/* Target device is an EP80579 (unsupported) */
#define LEB_TCS_EXP_CHIP ( 1u << 7)
/* Byte read access to half-word device */