Ignore:
Timestamp:
Jan 1, 2021, 5:31:48 AM (5 years ago)
Author:
Paul Smedley
Message:

Add source for uniaud32 based on code from linux kernel 5.4.86

Location:
GPL/branches/uniaud32-next
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • GPL/branches/uniaud32-next/include/linux/pci.h

    r604 r615  
    1818#include <linux/types.h>
    1919#include <linux/list.h>
     20#include <linux/kobject.h>
     21#include <linux/device.h>
     22#include <linux/pm.h>
     23
    2024#pragma pack(1) //!!! by vladest
    2125/*
     
    302306#define pci_choose_state(pci,state)     ((state) ? PCI_D3hot : PCI_D0)
    303307
    304 typedef struct device {
    305     struct pci_dev *pci;  /* for PCI and PCI-SG types */
    306   struct device   * parent;
    307   struct bus_type * bus;    /* type of bus device is on */
    308   char  bus_id[BUS_ID_SIZE];  /* position on parent bus */
    309   void  (*release)(struct device * dev);
    310     unsigned int flags; /* GFP_XXX for continous and ISA types */
    311 #ifdef CONFIG_SBUS
    312     struct sbus_dev *sbus;  /* for SBUS type */
    313 #endif
    314   void *private_data;
    315   void *platform_data;
    316 
    317   struct device_driver *driver;
    318   struct pm_dev *pm_dev;
    319   char  bus_id[20];
    320 } device;
     308struct dev_pm_info2 {
     309        unsigned int            async_suspend:1;
     310        bool                    is_prepared:1;  /* Owned by the PM core */
     311        u32                     power_state;
     312        u8                      * saved_state;
     313        atomic_t                pm_users;
     314        struct device           * pm_parent;
     315        struct list_head        entry;
     316};
    321317
    322318/*
     
    334330  struct proc_dir_entry *procent; /* device entry in /proc/bus/pci */
    335331
    336         struct device   dev;
    337 
     332  struct device   dev;
     333        unsigned int    class;          /* 3 bytes: (base,sub,prog-if) */
     334  u8            revision;       /* PCI revision, low byte of class word */
    338335  unsigned int  devfn;    /* encoded device & function index */
    339336  unsigned short  vendor;
     
    369366
    370367  void         *driver_data;
    371   unsigned long   dma_mask;
     368        u64             dma_mask;       /* Mask of the bits of bus address this
     369                                           device implements.  Normally this is
     370                                           0xffffffff.  You only need to change
     371                                           this if your device has broken DMA
     372                                           or supports 64-bit transfers.  */
     373  unsigned int  no_64bit_msi:1; /* device may only use 32-bit MSIs */
    372374
    373375  int (*prepare)(struct pci_dev *dev);
     
    579581        unsigned long driver_data;
    580582};
    581 #if 0
     583
     584#if 1
     585struct device_driver {
     586        const char              *name;
     587        struct bus_type         *bus;
     588
     589        struct module           *owner;
     590        const char              *mod_name;      /* used for built-in modules */
     591
     592        bool suppress_bind_attrs;       /* disables bind/unbind via sysfs */
     593
     594        const struct of_device_id       *of_match_table;
     595
     596        int (*probe) (struct device *dev);
     597        int (*remove) (struct device *dev);
     598        void (*shutdown) (struct device *dev);
     599        int (*suspend) (struct device *dev, u32 state);
     600        int (*resume) (struct device *dev);
     601        const struct attribute_group **groups;
     602
     603        const struct dev_pm_ops *pm;
     604
     605        struct driver_private *p;
     606};
     607#endif
     608
    582609struct pci_driver {
    583         struct list_head node;
    584         char *name;
    585         const struct pci_device_id *id_table;
    586         int (*probe)(struct pci_dev *dev, const struct pci_device_id *id);
    587         void (*remove)(struct pci_dev *dev);
    588         void (*suspend)(struct pci_dev *dev, u32 state);
    589         void (*resume)(struct pci_dev *dev);
    590 };
    591 #else
    592 struct pci_driver {
    593   struct list_head node;
    594   struct pci_dev *dev;
    595   char *name;
    596   const struct pci_device_id *id_table; /* NULL if wants all devices */
    597   int (*probe)(struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */
    598   void (*remove)(struct pci_dev *dev);  /* Device removed (NULL if not a hot-plug capable driver) */
    599   int (*suspend)(struct pci_dev *dev, u32 stgate);  /* Device suspended */
    600   int (*resume)(struct pci_dev *dev); /* Device woken up */
    601 };
    602 #endif
     610        struct list_head node;
     611        struct pci_dev *dev;
     612        char *name;
     613        const struct pci_device_id *id_table; /* NULL if wants all devices */
     614        int (*probe)(struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */
     615        void (*remove)(struct pci_dev *dev);  /* Device removed (NULL if not a hot-plug capable driver) */
     616        int (*suspend)(struct pci_dev *dev, u32 stgate);  /* Device suspended */
     617        int (*resume)(struct pci_dev *dev); /* Device woken up */
     618        void (*shutdown) (struct pci_dev *dev);
     619        struct device_driver    driver;
     620};
    603621
    604622/*
     
    651669 *
    652670 */
    653 const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, struct pci_dev *dev);
     671const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, struct pci_dev *dev);
    654672unsigned long pci_get_size (struct pci_dev *dev, int n_base);
    655673
     
    686704#define pci_get_device  pci_find_device
    687705#define pci_dev_put(x)
     706
     707#define to_pci_dev(n)   container_of(n, struct pci_dev, dev)
    688708
    689709#pragma pack() //!!! by vladest
     
    728748  const struct pci_device_id _table[] __devinitdata
    729749
     750/**
     751 * module_pci_driver() - Helper macro for registering a PCI driver
     752 * @__pci_driver: pci_driver struct
     753 *
     754 * Helper macro for PCI drivers which do not do anything special in module
     755 * init/exit. This eliminates a lot of boilerplate. Each module may only
     756 * use this macro once, and calling it replaces module_init() and module_exit()
     757 */
     758#define module_pci_driver(__pci_driver) \
     759        module_driver(__pci_driver, pci_register_driver, \
     760                       pci_unregister_driver)
     761
     762static inline bool pci_dev_run_wake(struct pci_dev *dev) { return 0; }
     763
     764/* If you want to know what to call your pci_dev, ask this function.
     765 * Again, it's a wrapper around the generic device.
     766 */
     767static inline const char *pci_name(struct pci_dev *pdev)
     768{
     769        return dev_name(&pdev->dev);
     770}
     771
     772/**
     773 * PCI_DEVICE_SUB - macro used to describe a specific pci device with subsystem
     774 * @vend: the 16 bit PCI Vendor ID
     775 * @dev: the 16 bit PCI Device ID
     776 * @subvend: the 16 bit PCI Subvendor ID
     777 * @subdev: the 16 bit PCI Subdevice ID
     778 *
     779 * This macro is used to create a struct pci_device_id that matches a
     780 * specific device with subsystem information.
     781 */
     782#define PCI_DEVICE_SUB(vend, dev, subvend, subdev) \
     783        .vendor = (vend), .device = (dev), \
     784        .subvendor = (subvend), .subdevice = (subdev)
     785
     786
    730787#endif /* LINUX_PCI_H */
Note: See TracChangeset for help on using the changeset viewer.