2 * timberdale.c timberdale FPGA MFD driver
3 * Copyright (c) 2009 Intel Corporation
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include <linux/kernel.h>
24 #include <linux/module.h>
25 #include <linux/pci.h>
26 #include <linux/msi.h>
27 #include <linux/mfd/core.h>
28 #include <linux/slab.h>
30 #include <linux/timb_gpio.h>
32 #include <linux/i2c.h>
33 #include <linux/i2c-ocores.h>
34 #include <linux/i2c-xiic.h>
35 #include <linux/i2c/tsc2007.h>
37 #include <linux/spi/spi.h>
38 #include <linux/spi/xilinx_spi.h>
39 #include <linux/spi/max7301.h>
40 #include <linux/spi/mc33880.h>
42 #include <media/timb_radio.h>
44 #include <linux/timb_dma.h>
46 #include <linux/ks8842.h>
48 #include "timberdale.h"
50 #define DRIVER_NAME "timberdale"
52 struct timberdale_device
{
53 resource_size_t ctl_mapbase
;
54 unsigned char __iomem
*ctl_membase
;
62 /*--------------------------------------------------------------------------*/
64 static struct tsc2007_platform_data timberdale_tsc2007_platform_data
= {
69 static struct i2c_board_info timberdale_i2c_board_info
[] = {
71 I2C_BOARD_INFO("tsc2007", 0x48),
72 .platform_data
= &timberdale_tsc2007_platform_data
,
73 .irq
= IRQ_TIMBERDALE_TSC_INT
77 static __devinitdata
struct xiic_i2c_platform_data
78 timberdale_xiic_platform_data
= {
79 .devices
= timberdale_i2c_board_info
,
80 .num_devices
= ARRAY_SIZE(timberdale_i2c_board_info
)
83 static __devinitdata
struct ocores_i2c_platform_data
84 timberdale_ocores_platform_data
= {
87 .devices
= timberdale_i2c_board_info
,
88 .num_devices
= ARRAY_SIZE(timberdale_i2c_board_info
)
91 static const __devinitconst
struct resource timberdale_xiic_resources
[] = {
95 .flags
= IORESOURCE_MEM
,
98 .start
= IRQ_TIMBERDALE_I2C
,
99 .end
= IRQ_TIMBERDALE_I2C
,
100 .flags
= IORESOURCE_IRQ
,
104 static const __devinitconst
struct resource timberdale_ocores_resources
[] = {
106 .start
= OCORESOFFSET
,
108 .flags
= IORESOURCE_MEM
,
111 .start
= IRQ_TIMBERDALE_I2C
,
112 .end
= IRQ_TIMBERDALE_I2C
,
113 .flags
= IORESOURCE_IRQ
,
117 const struct max7301_platform_data timberdale_max7301_platform_data
= {
121 const struct mc33880_platform_data timberdale_mc33880_platform_data
= {
125 static struct spi_board_info timberdale_spi_16bit_board_info
[] = {
127 .modalias
= "max7301",
128 .max_speed_hz
= 26000,
131 .platform_data
= &timberdale_max7301_platform_data
135 static struct spi_board_info timberdale_spi_8bit_board_info
[] = {
137 .modalias
= "mc33880",
138 .max_speed_hz
= 4000,
141 .platform_data
= &timberdale_mc33880_platform_data
145 static __devinitdata
struct xspi_platform_data timberdale_xspi_platform_data
= {
147 .little_endian
= true,
148 /* bits per word and devices will be filled in runtime depending
153 static const __devinitconst
struct resource timberdale_spi_resources
[] = {
157 .flags
= IORESOURCE_MEM
,
160 .start
= IRQ_TIMBERDALE_SPI
,
161 .end
= IRQ_TIMBERDALE_SPI
,
162 .flags
= IORESOURCE_IRQ
,
166 static __devinitdata
struct ks8842_platform_data
167 timberdale_ks8842_platform_data
= {
168 .rx_dma_channel
= DMA_ETH_RX
,
169 .tx_dma_channel
= DMA_ETH_TX
172 static const __devinitconst
struct resource timberdale_eth_resources
[] = {
176 .flags
= IORESOURCE_MEM
,
179 .start
= IRQ_TIMBERDALE_ETHSW_IF
,
180 .end
= IRQ_TIMBERDALE_ETHSW_IF
,
181 .flags
= IORESOURCE_IRQ
,
185 static __devinitdata
struct timbgpio_platform_data
186 timberdale_gpio_platform_data
= {
188 .nr_pins
= GPIO_NR_PINS
,
192 static const __devinitconst
struct resource timberdale_gpio_resources
[] = {
196 .flags
= IORESOURCE_MEM
,
199 .start
= IRQ_TIMBERDALE_GPIO
,
200 .end
= IRQ_TIMBERDALE_GPIO
,
201 .flags
= IORESOURCE_IRQ
,
205 static const __devinitconst
struct resource timberdale_mlogicore_resources
[] = {
207 .start
= MLCOREOFFSET
,
209 .flags
= IORESOURCE_MEM
,
212 .start
= IRQ_TIMBERDALE_MLCORE
,
213 .end
= IRQ_TIMBERDALE_MLCORE
,
214 .flags
= IORESOURCE_IRQ
,
217 .start
= IRQ_TIMBERDALE_MLCORE_BUF
,
218 .end
= IRQ_TIMBERDALE_MLCORE_BUF
,
219 .flags
= IORESOURCE_IRQ
,
223 static const __devinitconst
struct resource timberdale_uart_resources
[] = {
227 .flags
= IORESOURCE_MEM
,
230 .start
= IRQ_TIMBERDALE_UART
,
231 .end
= IRQ_TIMBERDALE_UART
,
232 .flags
= IORESOURCE_IRQ
,
236 static const __devinitconst
struct resource timberdale_uartlite_resources
[] = {
238 .start
= UARTLITEOFFSET
,
240 .flags
= IORESOURCE_MEM
,
243 .start
= IRQ_TIMBERDALE_UARTLITE
,
244 .end
= IRQ_TIMBERDALE_UARTLITE
,
245 .flags
= IORESOURCE_IRQ
,
249 static const __devinitconst
struct resource timberdale_radio_resources
[] = {
253 .flags
= IORESOURCE_MEM
,
256 .start
= IRQ_TIMBERDALE_RDS
,
257 .end
= IRQ_TIMBERDALE_RDS
,
258 .flags
= IORESOURCE_IRQ
,
262 static __devinitdata
struct i2c_board_info timberdale_tef6868_i2c_board_info
= {
263 I2C_BOARD_INFO("tef6862", 0x60)
266 static __devinitdata
struct i2c_board_info timberdale_saa7706_i2c_board_info
= {
267 I2C_BOARD_INFO("saa7706h", 0x1C)
270 static __devinitdata
struct timb_radio_platform_data
271 timberdale_radio_platform_data
= {
274 .module_name
= "tef6862",
275 .info
= &timberdale_tef6868_i2c_board_info
278 .module_name
= "saa7706h",
279 .info
= &timberdale_saa7706_i2c_board_info
283 static __devinitdata
struct timb_dma_platform_data timb_dma_platform_data
= {
290 .descriptor_elements
= 1
296 .descriptor_elements
= 1
302 .descriptor_elements
= 1
308 .descriptor_elements
= 1
313 .bytes_per_line
= 1440,
315 .descriptor_elements
= 16
318 /* Video framedrop */
331 .descriptor_elements
= 1
337 .descriptor_elements
= 1
342 static const __devinitconst
struct resource timberdale_dma_resources
[] = {
346 .flags
= IORESOURCE_MEM
,
349 .start
= IRQ_TIMBERDALE_DMA
,
350 .end
= IRQ_TIMBERDALE_DMA
,
351 .flags
= IORESOURCE_IRQ
,
355 static __devinitdata
struct mfd_cell timberdale_cells_bar0_cfg0
[] = {
358 .num_resources
= ARRAY_SIZE(timberdale_dma_resources
),
359 .resources
= timberdale_dma_resources
,
360 .platform_data
= &timb_dma_platform_data
,
361 .data_size
= sizeof(timb_dma_platform_data
),
365 .num_resources
= ARRAY_SIZE(timberdale_uart_resources
),
366 .resources
= timberdale_uart_resources
,
370 .num_resources
= ARRAY_SIZE(timberdale_xiic_resources
),
371 .resources
= timberdale_xiic_resources
,
372 .platform_data
= &timberdale_xiic_platform_data
,
373 .data_size
= sizeof(timberdale_xiic_platform_data
),
377 .num_resources
= ARRAY_SIZE(timberdale_gpio_resources
),
378 .resources
= timberdale_gpio_resources
,
379 .platform_data
= &timberdale_gpio_platform_data
,
380 .data_size
= sizeof(timberdale_gpio_platform_data
),
383 .name
= "timb-radio",
384 .num_resources
= ARRAY_SIZE(timberdale_radio_resources
),
385 .resources
= timberdale_radio_resources
,
386 .platform_data
= &timberdale_radio_platform_data
,
387 .data_size
= sizeof(timberdale_radio_platform_data
),
390 .name
= "xilinx_spi",
391 .num_resources
= ARRAY_SIZE(timberdale_spi_resources
),
392 .resources
= timberdale_spi_resources
,
393 .platform_data
= &timberdale_xspi_platform_data
,
394 .data_size
= sizeof(timberdale_xspi_platform_data
),
398 .num_resources
= ARRAY_SIZE(timberdale_eth_resources
),
399 .resources
= timberdale_eth_resources
,
400 .platform_data
= &timberdale_ks8842_platform_data
,
401 .data_size
= sizeof(timberdale_ks8842_platform_data
)
405 static __devinitdata
struct mfd_cell timberdale_cells_bar0_cfg1
[] = {
408 .num_resources
= ARRAY_SIZE(timberdale_dma_resources
),
409 .resources
= timberdale_dma_resources
,
410 .platform_data
= &timb_dma_platform_data
,
411 .data_size
= sizeof(timb_dma_platform_data
),
415 .num_resources
= ARRAY_SIZE(timberdale_uart_resources
),
416 .resources
= timberdale_uart_resources
,
420 .num_resources
= ARRAY_SIZE(timberdale_uartlite_resources
),
421 .resources
= timberdale_uartlite_resources
,
425 .num_resources
= ARRAY_SIZE(timberdale_xiic_resources
),
426 .resources
= timberdale_xiic_resources
,
427 .platform_data
= &timberdale_xiic_platform_data
,
428 .data_size
= sizeof(timberdale_xiic_platform_data
),
432 .num_resources
= ARRAY_SIZE(timberdale_gpio_resources
),
433 .resources
= timberdale_gpio_resources
,
434 .platform_data
= &timberdale_gpio_platform_data
,
435 .data_size
= sizeof(timberdale_gpio_platform_data
),
438 .name
= "timb-mlogicore",
439 .num_resources
= ARRAY_SIZE(timberdale_mlogicore_resources
),
440 .resources
= timberdale_mlogicore_resources
,
443 .name
= "timb-radio",
444 .num_resources
= ARRAY_SIZE(timberdale_radio_resources
),
445 .resources
= timberdale_radio_resources
,
446 .platform_data
= &timberdale_radio_platform_data
,
447 .data_size
= sizeof(timberdale_radio_platform_data
),
450 .name
= "xilinx_spi",
451 .num_resources
= ARRAY_SIZE(timberdale_spi_resources
),
452 .resources
= timberdale_spi_resources
,
453 .platform_data
= &timberdale_xspi_platform_data
,
454 .data_size
= sizeof(timberdale_xspi_platform_data
),
458 .num_resources
= ARRAY_SIZE(timberdale_eth_resources
),
459 .resources
= timberdale_eth_resources
,
460 .platform_data
= &timberdale_ks8842_platform_data
,
461 .data_size
= sizeof(timberdale_ks8842_platform_data
)
465 static __devinitdata
struct mfd_cell timberdale_cells_bar0_cfg2
[] = {
468 .num_resources
= ARRAY_SIZE(timberdale_dma_resources
),
469 .resources
= timberdale_dma_resources
,
470 .platform_data
= &timb_dma_platform_data
,
471 .data_size
= sizeof(timb_dma_platform_data
),
475 .num_resources
= ARRAY_SIZE(timberdale_uart_resources
),
476 .resources
= timberdale_uart_resources
,
480 .num_resources
= ARRAY_SIZE(timberdale_xiic_resources
),
481 .resources
= timberdale_xiic_resources
,
482 .platform_data
= &timberdale_xiic_platform_data
,
483 .data_size
= sizeof(timberdale_xiic_platform_data
),
487 .num_resources
= ARRAY_SIZE(timberdale_gpio_resources
),
488 .resources
= timberdale_gpio_resources
,
489 .platform_data
= &timberdale_gpio_platform_data
,
490 .data_size
= sizeof(timberdale_gpio_platform_data
),
493 .name
= "timb-radio",
494 .num_resources
= ARRAY_SIZE(timberdale_radio_resources
),
495 .resources
= timberdale_radio_resources
,
496 .platform_data
= &timberdale_radio_platform_data
,
497 .data_size
= sizeof(timberdale_radio_platform_data
),
500 .name
= "xilinx_spi",
501 .num_resources
= ARRAY_SIZE(timberdale_spi_resources
),
502 .resources
= timberdale_spi_resources
,
503 .platform_data
= &timberdale_xspi_platform_data
,
504 .data_size
= sizeof(timberdale_xspi_platform_data
),
508 static __devinitdata
struct mfd_cell timberdale_cells_bar0_cfg3
[] = {
511 .num_resources
= ARRAY_SIZE(timberdale_dma_resources
),
512 .resources
= timberdale_dma_resources
,
513 .platform_data
= &timb_dma_platform_data
,
514 .data_size
= sizeof(timb_dma_platform_data
),
518 .num_resources
= ARRAY_SIZE(timberdale_uart_resources
),
519 .resources
= timberdale_uart_resources
,
522 .name
= "ocores-i2c",
523 .num_resources
= ARRAY_SIZE(timberdale_ocores_resources
),
524 .resources
= timberdale_ocores_resources
,
525 .platform_data
= &timberdale_ocores_platform_data
,
526 .data_size
= sizeof(timberdale_ocores_platform_data
),
530 .num_resources
= ARRAY_SIZE(timberdale_gpio_resources
),
531 .resources
= timberdale_gpio_resources
,
532 .platform_data
= &timberdale_gpio_platform_data
,
533 .data_size
= sizeof(timberdale_gpio_platform_data
),
536 .name
= "timb-radio",
537 .num_resources
= ARRAY_SIZE(timberdale_radio_resources
),
538 .resources
= timberdale_radio_resources
,
539 .platform_data
= &timberdale_radio_platform_data
,
540 .data_size
= sizeof(timberdale_radio_platform_data
),
543 .name
= "xilinx_spi",
544 .num_resources
= ARRAY_SIZE(timberdale_spi_resources
),
545 .resources
= timberdale_spi_resources
,
546 .platform_data
= &timberdale_xspi_platform_data
,
547 .data_size
= sizeof(timberdale_xspi_platform_data
),
551 .num_resources
= ARRAY_SIZE(timberdale_eth_resources
),
552 .resources
= timberdale_eth_resources
,
553 .platform_data
= &timberdale_ks8842_platform_data
,
554 .data_size
= sizeof(timberdale_ks8842_platform_data
)
558 static const __devinitconst
struct resource timberdale_sdhc_resources
[] = {
559 /* located in bar 1 and bar 2 */
561 .start
= SDHC0OFFSET
,
563 .flags
= IORESOURCE_MEM
,
566 .start
= IRQ_TIMBERDALE_SDHC
,
567 .end
= IRQ_TIMBERDALE_SDHC
,
568 .flags
= IORESOURCE_IRQ
,
572 static __devinitdata
struct mfd_cell timberdale_cells_bar1
[] = {
575 .num_resources
= ARRAY_SIZE(timberdale_sdhc_resources
),
576 .resources
= timberdale_sdhc_resources
,
580 static __devinitdata
struct mfd_cell timberdale_cells_bar2
[] = {
583 .num_resources
= ARRAY_SIZE(timberdale_sdhc_resources
),
584 .resources
= timberdale_sdhc_resources
,
588 static ssize_t
show_fw_ver(struct device
*dev
, struct device_attribute
*attr
,
591 struct pci_dev
*pdev
= to_pci_dev(dev
);
592 struct timberdale_device
*priv
= pci_get_drvdata(pdev
);
594 return sprintf(buf
, "%d.%d.%d\n", priv
->fw
.major
, priv
->fw
.minor
,
598 static DEVICE_ATTR(fw_ver
, S_IRUGO
, show_fw_ver
, NULL
);
600 /*--------------------------------------------------------------------------*/
602 static int __devinit
timb_probe(struct pci_dev
*dev
,
603 const struct pci_device_id
*id
)
605 struct timberdale_device
*priv
;
607 resource_size_t mapbase
;
608 struct msix_entry
*msix_entries
= NULL
;
611 priv
= kzalloc(sizeof(*priv
), GFP_KERNEL
);
615 pci_set_drvdata(dev
, priv
);
617 err
= pci_enable_device(dev
);
621 mapbase
= pci_resource_start(dev
, 0);
623 dev_err(&dev
->dev
, "No resource\n");
627 /* create a resource for the PCI master register */
628 priv
->ctl_mapbase
= mapbase
+ CHIPCTLOFFSET
;
629 if (!request_mem_region(priv
->ctl_mapbase
, CHIPCTLSIZE
, "timb-ctl")) {
630 dev_err(&dev
->dev
, "Failed to request ctl mem\n");
634 priv
->ctl_membase
= ioremap(priv
->ctl_mapbase
, CHIPCTLSIZE
);
635 if (!priv
->ctl_membase
) {
636 dev_err(&dev
->dev
, "ioremap failed for ctl mem\n");
640 /* read the HW config */
641 priv
->fw
.major
= ioread32(priv
->ctl_membase
+ TIMB_REV_MAJOR
);
642 priv
->fw
.minor
= ioread32(priv
->ctl_membase
+ TIMB_REV_MINOR
);
643 priv
->fw
.config
= ioread32(priv
->ctl_membase
+ TIMB_HW_CONFIG
);
645 if (priv
->fw
.major
> TIMB_SUPPORTED_MAJOR
) {
646 dev_err(&dev
->dev
, "The driver supports an older "
647 "version of the FPGA, please update the driver to "
648 "support %d.%d\n", priv
->fw
.major
, priv
->fw
.minor
);
651 if (priv
->fw
.major
< TIMB_SUPPORTED_MAJOR
||
652 priv
->fw
.minor
< TIMB_REQUIRED_MINOR
) {
653 dev_err(&dev
->dev
, "The FPGA image is too old (%d.%d), "
654 "please upgrade the FPGA to at least: %d.%d\n",
655 priv
->fw
.major
, priv
->fw
.minor
,
656 TIMB_SUPPORTED_MAJOR
, TIMB_REQUIRED_MINOR
);
660 msix_entries
= kzalloc(TIMBERDALE_NR_IRQS
* sizeof(*msix_entries
),
665 for (i
= 0; i
< TIMBERDALE_NR_IRQS
; i
++)
666 msix_entries
[i
].entry
= i
;
668 err
= pci_enable_msix(dev
, msix_entries
, TIMBERDALE_NR_IRQS
);
671 "MSI-X init failed: %d, expected entries: %d\n",
672 err
, TIMBERDALE_NR_IRQS
);
676 err
= device_create_file(&dev
->dev
, &dev_attr_fw_ver
);
678 goto err_create_file
;
680 /* Reset all FPGA PLB peripherals */
681 iowrite32(0x1, priv
->ctl_membase
+ TIMB_SW_RST
);
683 /* update IRQ offsets in I2C board info */
684 for (i
= 0; i
< ARRAY_SIZE(timberdale_i2c_board_info
); i
++)
685 timberdale_i2c_board_info
[i
].irq
=
686 msix_entries
[timberdale_i2c_board_info
[i
].irq
].vector
;
688 /* Update the SPI configuration depending on the HW (8 or 16 bit) */
689 if (priv
->fw
.config
& TIMB_HW_CONFIG_SPI_8BIT
) {
690 timberdale_xspi_platform_data
.bits_per_word
= 8;
691 timberdale_xspi_platform_data
.devices
=
692 timberdale_spi_8bit_board_info
;
693 timberdale_xspi_platform_data
.num_devices
=
694 ARRAY_SIZE(timberdale_spi_8bit_board_info
);
696 timberdale_xspi_platform_data
.bits_per_word
= 16;
697 timberdale_xspi_platform_data
.devices
=
698 timberdale_spi_16bit_board_info
;
699 timberdale_xspi_platform_data
.num_devices
=
700 ARRAY_SIZE(timberdale_spi_16bit_board_info
);
703 ip_setup
= priv
->fw
.config
& TIMB_HW_VER_MASK
;
706 err
= mfd_add_devices(&dev
->dev
, -1,
707 timberdale_cells_bar0_cfg0
,
708 ARRAY_SIZE(timberdale_cells_bar0_cfg0
),
709 &dev
->resource
[0], msix_entries
[0].vector
);
712 err
= mfd_add_devices(&dev
->dev
, -1,
713 timberdale_cells_bar0_cfg1
,
714 ARRAY_SIZE(timberdale_cells_bar0_cfg1
),
715 &dev
->resource
[0], msix_entries
[0].vector
);
718 err
= mfd_add_devices(&dev
->dev
, -1,
719 timberdale_cells_bar0_cfg2
,
720 ARRAY_SIZE(timberdale_cells_bar0_cfg2
),
721 &dev
->resource
[0], msix_entries
[0].vector
);
724 err
= mfd_add_devices(&dev
->dev
, -1,
725 timberdale_cells_bar0_cfg3
,
726 ARRAY_SIZE(timberdale_cells_bar0_cfg3
),
727 &dev
->resource
[0], msix_entries
[0].vector
);
730 dev_err(&dev
->dev
, "Uknown IP setup: %d.%d.%d\n",
731 priv
->fw
.major
, priv
->fw
.minor
, ip_setup
);
738 dev_err(&dev
->dev
, "mfd_add_devices failed: %d\n", err
);
742 err
= mfd_add_devices(&dev
->dev
, 0,
743 timberdale_cells_bar1
, ARRAY_SIZE(timberdale_cells_bar1
),
744 &dev
->resource
[1], msix_entries
[0].vector
);
746 dev_err(&dev
->dev
, "mfd_add_devices failed: %d\n", err
);
750 /* only version 0 and 3 have the iNand routed to SDHCI */
751 if (((priv
->fw
.config
& TIMB_HW_VER_MASK
) == TIMB_HW_VER0
) ||
752 ((priv
->fw
.config
& TIMB_HW_VER_MASK
) == TIMB_HW_VER3
)) {
753 err
= mfd_add_devices(&dev
->dev
, 1, timberdale_cells_bar2
,
754 ARRAY_SIZE(timberdale_cells_bar2
),
755 &dev
->resource
[2], msix_entries
[0].vector
);
757 dev_err(&dev
->dev
, "mfd_add_devices failed: %d\n", err
);
765 "Found Timberdale Card. Rev: %d.%d, HW config: 0x%02x\n",
766 priv
->fw
.major
, priv
->fw
.minor
, priv
->fw
.config
);
771 mfd_remove_devices(&dev
->dev
);
773 device_remove_file(&dev
->dev
, &dev_attr_fw_ver
);
775 pci_disable_msix(dev
);
777 iounmap(priv
->ctl_membase
);
779 release_mem_region(priv
->ctl_mapbase
, CHIPCTLSIZE
);
781 pci_set_drvdata(dev
, NULL
);
783 pci_disable_device(dev
);
787 pci_set_drvdata(dev
, NULL
);
791 static void __devexit
timb_remove(struct pci_dev
*dev
)
793 struct timberdale_device
*priv
= pci_get_drvdata(dev
);
795 mfd_remove_devices(&dev
->dev
);
797 device_remove_file(&dev
->dev
, &dev_attr_fw_ver
);
799 iounmap(priv
->ctl_membase
);
800 release_mem_region(priv
->ctl_mapbase
, CHIPCTLSIZE
);
802 pci_disable_msix(dev
);
803 pci_disable_device(dev
);
804 pci_set_drvdata(dev
, NULL
);
808 static struct pci_device_id timberdale_pci_tbl
[] = {
809 { PCI_DEVICE(PCI_VENDOR_ID_TIMB
, PCI_DEVICE_ID_TIMB
) },
812 MODULE_DEVICE_TABLE(pci
, timberdale_pci_tbl
);
814 static struct pci_driver timberdale_pci_driver
= {
816 .id_table
= timberdale_pci_tbl
,
818 .remove
= __devexit_p(timb_remove
),
821 static int __init
timberdale_init(void)
825 err
= pci_register_driver(&timberdale_pci_driver
);
828 "Failed to register PCI driver for %s device.\n",
829 timberdale_pci_driver
.name
);
833 printk(KERN_INFO
"Driver for %s has been successfully registered.\n",
834 timberdale_pci_driver
.name
);
839 static void __exit
timberdale_exit(void)
841 pci_unregister_driver(&timberdale_pci_driver
);
843 printk(KERN_INFO
"Driver for %s has been successfully unregistered.\n",
844 timberdale_pci_driver
.name
);
847 module_init(timberdale_init
);
848 module_exit(timberdale_exit
);
850 MODULE_AUTHOR("Mocean Laboratories <info@mocean-labs.com>");
851 MODULE_VERSION(DRV_VERSION
);
852 MODULE_LICENSE("GPL v2");