This source file includes following definitions.
- vx855_probe
- vx855_remove
   1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   9 
  10 
  11 
  12 #include <linux/kernel.h>
  13 #include <linux/module.h>
  14 #include <linux/device.h>
  15 #include <linux/platform_device.h>
  16 #include <linux/pci.h>
  17 #include <linux/mfd/core.h>
  18 
  19 
  20 
  21 #define VX855_CFG_PMIO_OFFSET   0x88
  22 
  23 
  24 #define VX855_PMIO_ACPI         0x00
  25 #define VX855_PMIO_ACPI_LEN     0x0b
  26 
  27 
  28 #define VX855_PMIO_PPM          0x10
  29 #define VX855_PMIO_PPM_LEN      0x08
  30 
  31 
  32 #define VX855_PMIO_GPPM         0x20
  33 #define VX855_PMIO_R_GPI        0x48
  34 #define VX855_PMIO_R_GPO        0x4c
  35 #define VX855_PMIO_GPPM_LEN     0x33
  36 
  37 #define VSPIC_MMIO_SIZE 0x1000
  38 
  39 static struct resource vx855_gpio_resources[] = {
  40         {
  41                 .flags = IORESOURCE_IO,
  42         },
  43         {
  44                 .flags = IORESOURCE_IO,
  45         },
  46 };
  47 
  48 static const struct mfd_cell vx855_cells[] = {
  49         {
  50                 .name = "vx855_gpio",
  51                 .num_resources = ARRAY_SIZE(vx855_gpio_resources),
  52                 .resources = vx855_gpio_resources,
  53 
  54                 
  55 
  56                 .ignore_resource_conflicts = true,
  57         },
  58 };
  59 
  60 static int vx855_probe(struct pci_dev *pdev,
  61                                  const struct pci_device_id *id)
  62 {
  63         int ret;
  64         u16 gpio_io_offset;
  65 
  66         ret = pci_enable_device(pdev);
  67         if (ret)
  68                 return -ENODEV;
  69 
  70         pci_read_config_word(pdev, VX855_CFG_PMIO_OFFSET, &gpio_io_offset);
  71         if (!gpio_io_offset) {
  72                 dev_warn(&pdev->dev,
  73                         "BIOS did not assign PMIO base offset?!?\n");
  74                 ret = -ENODEV;
  75                 goto out;
  76         }
  77 
  78         
  79 
  80         gpio_io_offset &= 0xff80;
  81 
  82         
  83 
  84         vx855_gpio_resources[0].start = gpio_io_offset + VX855_PMIO_R_GPI;
  85         vx855_gpio_resources[0].end = vx855_gpio_resources[0].start + 3;
  86         vx855_gpio_resources[1].start = gpio_io_offset + VX855_PMIO_R_GPO;
  87         vx855_gpio_resources[1].end = vx855_gpio_resources[1].start + 3;
  88 
  89         ret = mfd_add_devices(&pdev->dev, -1, vx855_cells, ARRAY_SIZE(vx855_cells),
  90                         NULL, 0, NULL);
  91 
  92         
  93 
  94         return -ENODEV;
  95 out:
  96         pci_disable_device(pdev);
  97         return ret;
  98 }
  99 
 100 static void vx855_remove(struct pci_dev *pdev)
 101 {
 102         mfd_remove_devices(&pdev->dev);
 103         pci_disable_device(pdev);
 104 }
 105 
 106 static const struct pci_device_id vx855_pci_tbl[] = {
 107         { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VX855) },
 108         { 0, }
 109 };
 110 MODULE_DEVICE_TABLE(pci, vx855_pci_tbl);
 111 
 112 static struct pci_driver vx855_pci_driver = {
 113         .name           = "vx855",
 114         .id_table       = vx855_pci_tbl,
 115         .probe          = vx855_probe,
 116         .remove         = vx855_remove,
 117 };
 118 
 119 module_pci_driver(vx855_pci_driver);
 120 
 121 MODULE_LICENSE("GPL");
 122 MODULE_AUTHOR("Harald Welte <HaraldWelte@viatech.com>");
 123 MODULE_DESCRIPTION("Driver for the VIA VX855 chipset");