diff options
| author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-08-09 09:09:29 -0400 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-08-09 09:09:29 -0400 |
| commit | 054d5c9238f3c577ad51195c3ee7803613f322cc (patch) | |
| tree | ff7d9f5c0e0ddf14230ba28f28ef69a2c0a0debf /include | |
| parent | 11e4afb49b7fa1fc8e1ffd850c1806dd86a08204 (diff) | |
| parent | 2192482ee5ce5d5d4a6cec0c351b2d3a744606eb (diff) | |
Merge branch 'devel-stable' into devel
Diffstat (limited to 'include')
46 files changed, 1239 insertions, 151 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h index 4f3d75e1ad39..c7376bf80b06 100644 --- a/include/asm-generic/gpio.h +++ b/include/asm-generic/gpio.h | |||
| @@ -31,6 +31,7 @@ static inline int gpio_is_valid(int number) | |||
| 31 | struct device; | 31 | struct device; |
| 32 | struct seq_file; | 32 | struct seq_file; |
| 33 | struct module; | 33 | struct module; |
| 34 | struct device_node; | ||
| 34 | 35 | ||
| 35 | /** | 36 | /** |
| 36 | * struct gpio_chip - abstract a GPIO controller | 37 | * struct gpio_chip - abstract a GPIO controller |
| @@ -106,6 +107,17 @@ struct gpio_chip { | |||
| 106 | const char *const *names; | 107 | const char *const *names; |
| 107 | unsigned can_sleep:1; | 108 | unsigned can_sleep:1; |
| 108 | unsigned exported:1; | 109 | unsigned exported:1; |
| 110 | |||
| 111 | #if defined(CONFIG_OF_GPIO) | ||
| 112 | /* | ||
| 113 | * If CONFIG_OF is enabled, then all GPIO controllers described in the | ||
| 114 | * device tree automatically may have an OF translation | ||
| 115 | */ | ||
| 116 | struct device_node *of_node; | ||
| 117 | int of_gpio_n_cells; | ||
| 118 | int (*of_xlate)(struct gpio_chip *gc, struct device_node *np, | ||
| 119 | const void *gpio_spec, u32 *flags); | ||
| 120 | #endif | ||
| 109 | }; | 121 | }; |
| 110 | 122 | ||
| 111 | extern const char *gpiochip_is_requested(struct gpio_chip *chip, | 123 | extern const char *gpiochip_is_requested(struct gpio_chip *chip, |
| @@ -115,6 +127,9 @@ extern int __must_check gpiochip_reserve(int start, int ngpio); | |||
| 115 | /* add/remove chips */ | 127 | /* add/remove chips */ |
| 116 | extern int gpiochip_add(struct gpio_chip *chip); | 128 | extern int gpiochip_add(struct gpio_chip *chip); |
| 117 | extern int __must_check gpiochip_remove(struct gpio_chip *chip); | 129 | extern int __must_check gpiochip_remove(struct gpio_chip *chip); |
| 130 | extern struct gpio_chip *gpiochip_find(void *data, | ||
| 131 | int (*match)(struct gpio_chip *chip, | ||
| 132 | void *data)); | ||
| 118 | 133 | ||
| 119 | 134 | ||
| 120 | /* Always use the library code for GPIO management calls, | 135 | /* Always use the library code for GPIO management calls, |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 030a954ed292..4e7ae6002056 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
| @@ -653,6 +653,7 @@ | |||
| 653 | EXIT_DATA \ | 653 | EXIT_DATA \ |
| 654 | EXIT_CALL \ | 654 | EXIT_CALL \ |
| 655 | *(.discard) \ | 655 | *(.discard) \ |
| 656 | *(.discard.*) \ | ||
| 656 | } | 657 | } |
| 657 | 658 | ||
| 658 | /** | 659 | /** |
diff --git a/include/drm/drm.h b/include/drm/drm.h index e3f46e0cb7dc..e5f70617dec5 100644 --- a/include/drm/drm.h +++ b/include/drm/drm.h | |||
| @@ -663,6 +663,8 @@ struct drm_gem_open { | |||
| 663 | #define DRM_IOCTL_UNLOCK DRM_IOW( 0x2b, struct drm_lock) | 663 | #define DRM_IOCTL_UNLOCK DRM_IOW( 0x2b, struct drm_lock) |
| 664 | #define DRM_IOCTL_FINISH DRM_IOW( 0x2c, struct drm_lock) | 664 | #define DRM_IOCTL_FINISH DRM_IOW( 0x2c, struct drm_lock) |
| 665 | 665 | ||
| 666 | #define DRM_IOCTL_GEM_PRIME_OPEN DRM_IOWR(0x2e, struct drm_gem_open) | ||
| 667 | |||
| 666 | #define DRM_IOCTL_AGP_ACQUIRE DRM_IO( 0x30) | 668 | #define DRM_IOCTL_AGP_ACQUIRE DRM_IO( 0x30) |
| 667 | #define DRM_IOCTL_AGP_RELEASE DRM_IO( 0x31) | 669 | #define DRM_IOCTL_AGP_RELEASE DRM_IO( 0x31) |
| 668 | #define DRM_IOCTL_AGP_ENABLE DRM_IOW( 0x32, struct drm_agp_mode) | 670 | #define DRM_IOCTL_AGP_ENABLE DRM_IOW( 0x32, struct drm_agp_mode) |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index c1b987158dfa..e2a4da7d7fab 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | /* | 9 | /* |
| 10 | * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. | 10 | * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. |
| 11 | * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. | 11 | * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. |
| 12 | * Copyright (c) 2009-2010, Code Aurora Forum. | ||
| 12 | * All rights reserved. | 13 | * All rights reserved. |
| 13 | * | 14 | * |
| 14 | * Permission is hereby granted, free of charge, to any person obtaining a | 15 | * Permission is hereby granted, free of charge, to any person obtaining a |
| @@ -48,9 +49,9 @@ | |||
| 48 | #include <linux/proc_fs.h> | 49 | #include <linux/proc_fs.h> |
| 49 | #include <linux/init.h> | 50 | #include <linux/init.h> |
| 50 | #include <linux/file.h> | 51 | #include <linux/file.h> |
| 52 | #include <linux/platform_device.h> | ||
| 51 | #include <linux/pci.h> | 53 | #include <linux/pci.h> |
| 52 | #include <linux/jiffies.h> | 54 | #include <linux/jiffies.h> |
| 53 | #include <linux/smp_lock.h> /* For (un)lock_kernel */ | ||
| 54 | #include <linux/dma-mapping.h> | 55 | #include <linux/dma-mapping.h> |
| 55 | #include <linux/mm.h> | 56 | #include <linux/mm.h> |
| 56 | #include <linux/cdev.h> | 57 | #include <linux/cdev.h> |
| @@ -144,6 +145,7 @@ extern void drm_ut_debug_printk(unsigned int request_level, | |||
| 144 | #define DRIVER_IRQ_VBL2 0x800 | 145 | #define DRIVER_IRQ_VBL2 0x800 |
| 145 | #define DRIVER_GEM 0x1000 | 146 | #define DRIVER_GEM 0x1000 |
| 146 | #define DRIVER_MODESET 0x2000 | 147 | #define DRIVER_MODESET 0x2000 |
| 148 | #define DRIVER_USE_PLATFORM_DEVICE 0x4000 | ||
| 147 | 149 | ||
| 148 | /***********************************************************************/ | 150 | /***********************************************************************/ |
| 149 | /** \name Begin the DRM... */ | 151 | /** \name Begin the DRM... */ |
| @@ -403,6 +405,8 @@ struct drm_pending_event { | |||
| 403 | struct drm_event *event; | 405 | struct drm_event *event; |
| 404 | struct list_head link; | 406 | struct list_head link; |
| 405 | struct drm_file *file_priv; | 407 | struct drm_file *file_priv; |
| 408 | pid_t pid; /* pid of requester, no guarantee it's valid by the time | ||
| 409 | we deliver the event, for tracing only */ | ||
| 406 | void (*destroy)(struct drm_pending_event *event); | 410 | void (*destroy)(struct drm_pending_event *event); |
| 407 | }; | 411 | }; |
| 408 | 412 | ||
| @@ -823,6 +827,7 @@ struct drm_driver { | |||
| 823 | int num_ioctls; | 827 | int num_ioctls; |
| 824 | struct file_operations fops; | 828 | struct file_operations fops; |
| 825 | struct pci_driver pci_driver; | 829 | struct pci_driver pci_driver; |
| 830 | struct platform_device *platform_device; | ||
| 826 | /* List of devices hanging off this driver */ | 831 | /* List of devices hanging off this driver */ |
| 827 | struct list_head device_list; | 832 | struct list_head device_list; |
| 828 | }; | 833 | }; |
| @@ -1015,12 +1020,16 @@ struct drm_device { | |||
| 1015 | 1020 | ||
| 1016 | struct drm_agp_head *agp; /**< AGP data */ | 1021 | struct drm_agp_head *agp; /**< AGP data */ |
| 1017 | 1022 | ||
| 1023 | struct device *dev; /**< Device structure */ | ||
| 1018 | struct pci_dev *pdev; /**< PCI device structure */ | 1024 | struct pci_dev *pdev; /**< PCI device structure */ |
| 1019 | int pci_vendor; /**< PCI vendor id */ | 1025 | int pci_vendor; /**< PCI vendor id */ |
| 1020 | int pci_device; /**< PCI device id */ | 1026 | int pci_device; /**< PCI device id */ |
| 1021 | #ifdef __alpha__ | 1027 | #ifdef __alpha__ |
| 1022 | struct pci_controller *hose; | 1028 | struct pci_controller *hose; |
| 1023 | #endif | 1029 | #endif |
| 1030 | |||
| 1031 | struct platform_device *platformdev; /**< Platform device struture */ | ||
| 1032 | |||
| 1024 | struct drm_sg_mem *sg; /**< Scatter gather memory */ | 1033 | struct drm_sg_mem *sg; /**< Scatter gather memory */ |
| 1025 | int num_crtcs; /**< Number of CRTCs on this device */ | 1034 | int num_crtcs; /**< Number of CRTCs on this device */ |
| 1026 | void *dev_private; /**< device private data */ | 1035 | void *dev_private; /**< device private data */ |
| @@ -1060,17 +1069,21 @@ struct drm_device { | |||
| 1060 | 1069 | ||
| 1061 | }; | 1070 | }; |
| 1062 | 1071 | ||
| 1063 | static inline int drm_dev_to_irq(struct drm_device *dev) | ||
| 1064 | { | ||
| 1065 | return dev->pdev->irq; | ||
| 1066 | } | ||
| 1067 | |||
| 1068 | static __inline__ int drm_core_check_feature(struct drm_device *dev, | 1072 | static __inline__ int drm_core_check_feature(struct drm_device *dev, |
| 1069 | int feature) | 1073 | int feature) |
| 1070 | { | 1074 | { |
| 1071 | return ((dev->driver->driver_features & feature) ? 1 : 0); | 1075 | return ((dev->driver->driver_features & feature) ? 1 : 0); |
| 1072 | } | 1076 | } |
| 1073 | 1077 | ||
| 1078 | |||
| 1079 | static inline int drm_dev_to_irq(struct drm_device *dev) | ||
| 1080 | { | ||
| 1081 | if (drm_core_check_feature(dev, DRIVER_USE_PLATFORM_DEVICE)) | ||
| 1082 | return platform_get_irq(dev->platformdev, 0); | ||
| 1083 | else | ||
| 1084 | return dev->pdev->irq; | ||
| 1085 | } | ||
| 1086 | |||
| 1074 | #ifdef __alpha__ | 1087 | #ifdef __alpha__ |
| 1075 | #define drm_get_pci_domain(dev) dev->hose->index | 1088 | #define drm_get_pci_domain(dev) dev->hose->index |
| 1076 | #else | 1089 | #else |
| @@ -1138,6 +1151,7 @@ extern long drm_compat_ioctl(struct file *filp, | |||
| 1138 | extern int drm_lastclose(struct drm_device *dev); | 1151 | extern int drm_lastclose(struct drm_device *dev); |
| 1139 | 1152 | ||
| 1140 | /* Device support (drm_fops.h) */ | 1153 | /* Device support (drm_fops.h) */ |
| 1154 | extern struct mutex drm_global_mutex; | ||
| 1141 | extern int drm_open(struct inode *inode, struct file *filp); | 1155 | extern int drm_open(struct inode *inode, struct file *filp); |
| 1142 | extern int drm_stub_open(struct inode *inode, struct file *filp); | 1156 | extern int drm_stub_open(struct inode *inode, struct file *filp); |
| 1143 | extern int drm_fasync(int fd, struct file *filp, int on); | 1157 | extern int drm_fasync(int fd, struct file *filp, int on); |
| @@ -1273,10 +1287,6 @@ extern int drm_freebufs(struct drm_device *dev, void *data, | |||
| 1273 | extern int drm_mapbufs(struct drm_device *dev, void *data, | 1287 | extern int drm_mapbufs(struct drm_device *dev, void *data, |
| 1274 | struct drm_file *file_priv); | 1288 | struct drm_file *file_priv); |
| 1275 | extern int drm_order(unsigned long size); | 1289 | extern int drm_order(unsigned long size); |
| 1276 | extern resource_size_t drm_get_resource_start(struct drm_device *dev, | ||
| 1277 | unsigned int resource); | ||
| 1278 | extern resource_size_t drm_get_resource_len(struct drm_device *dev, | ||
| 1279 | unsigned int resource); | ||
| 1280 | 1290 | ||
| 1281 | /* DMA support (drm_dma.h) */ | 1291 | /* DMA support (drm_dma.h) */ |
| 1282 | extern int drm_dma_setup(struct drm_device *dev); | 1292 | extern int drm_dma_setup(struct drm_device *dev); |
| @@ -1351,8 +1361,11 @@ extern int drm_dropmaster_ioctl(struct drm_device *dev, void *data, | |||
| 1351 | struct drm_master *drm_master_create(struct drm_minor *minor); | 1361 | struct drm_master *drm_master_create(struct drm_minor *minor); |
| 1352 | extern struct drm_master *drm_master_get(struct drm_master *master); | 1362 | extern struct drm_master *drm_master_get(struct drm_master *master); |
| 1353 | extern void drm_master_put(struct drm_master **master); | 1363 | extern void drm_master_put(struct drm_master **master); |
| 1354 | extern int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent, | 1364 | extern int drm_get_pci_dev(struct pci_dev *pdev, |
| 1355 | struct drm_driver *driver); | 1365 | const struct pci_device_id *ent, |
| 1366 | struct drm_driver *driver); | ||
| 1367 | extern int drm_get_platform_dev(struct platform_device *pdev, | ||
| 1368 | struct drm_driver *driver); | ||
| 1356 | extern void drm_put_dev(struct drm_device *dev); | 1369 | extern void drm_put_dev(struct drm_device *dev); |
| 1357 | extern int drm_put_minor(struct drm_minor **minor); | 1370 | extern int drm_put_minor(struct drm_minor **minor); |
| 1358 | extern unsigned int drm_debug; | 1371 | extern unsigned int drm_debug; |
| @@ -1440,6 +1453,8 @@ void drm_gem_vm_open(struct vm_area_struct *vma); | |||
| 1440 | void drm_gem_vm_close(struct vm_area_struct *vma); | 1453 | void drm_gem_vm_close(struct vm_area_struct *vma); |
| 1441 | int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma); | 1454 | int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma); |
| 1442 | 1455 | ||
| 1456 | #include "drm_global.h" | ||
| 1457 | |||
| 1443 | static inline void | 1458 | static inline void |
| 1444 | drm_gem_object_reference(struct drm_gem_object *obj) | 1459 | drm_gem_object_reference(struct drm_gem_object *obj) |
| 1445 | { | 1460 | { |
| @@ -1529,6 +1544,9 @@ static __inline__ struct drm_local_map *drm_core_findmap(struct drm_device *dev, | |||
| 1529 | 1544 | ||
| 1530 | static __inline__ int drm_device_is_agp(struct drm_device *dev) | 1545 | static __inline__ int drm_device_is_agp(struct drm_device *dev) |
| 1531 | { | 1546 | { |
| 1547 | if (drm_core_check_feature(dev, DRIVER_USE_PLATFORM_DEVICE)) | ||
| 1548 | return 0; | ||
| 1549 | |||
| 1532 | if (dev->driver->device_is_agp != NULL) { | 1550 | if (dev->driver->device_is_agp != NULL) { |
| 1533 | int err = (*dev->driver->device_is_agp) (dev); | 1551 | int err = (*dev->driver->device_is_agp) (dev); |
| 1534 | 1552 | ||
| @@ -1542,7 +1560,10 @@ static __inline__ int drm_device_is_agp(struct drm_device *dev) | |||
| 1542 | 1560 | ||
| 1543 | static __inline__ int drm_device_is_pcie(struct drm_device *dev) | 1561 | static __inline__ int drm_device_is_pcie(struct drm_device *dev) |
| 1544 | { | 1562 | { |
| 1545 | return pci_find_capability(dev->pdev, PCI_CAP_ID_EXP); | 1563 | if (drm_core_check_feature(dev, DRIVER_USE_PLATFORM_DEVICE)) |
| 1564 | return 0; | ||
| 1565 | else | ||
| 1566 | return pci_find_capability(dev->pdev, PCI_CAP_ID_EXP); | ||
| 1546 | } | 1567 | } |
| 1547 | 1568 | ||
| 1548 | static __inline__ void drm_core_dropmap(struct drm_local_map *map) | 1569 | static __inline__ void drm_core_dropmap(struct drm_local_map *map) |
| @@ -1550,6 +1571,21 @@ static __inline__ void drm_core_dropmap(struct drm_local_map *map) | |||
| 1550 | } | 1571 | } |
| 1551 | 1572 | ||
| 1552 | #include "drm_mem_util.h" | 1573 | #include "drm_mem_util.h" |
| 1574 | |||
| 1575 | static inline void *drm_get_device(struct drm_device *dev) | ||
| 1576 | { | ||
| 1577 | if (drm_core_check_feature(dev, DRIVER_USE_PLATFORM_DEVICE)) | ||
| 1578 | return dev->platformdev; | ||
| 1579 | else | ||
| 1580 | return dev->pdev; | ||
| 1581 | } | ||
| 1582 | |||
| 1583 | extern int drm_platform_init(struct drm_driver *driver); | ||
| 1584 | extern int drm_pci_init(struct drm_driver *driver); | ||
| 1585 | extern int drm_fill_in_dev(struct drm_device *dev, | ||
| 1586 | const struct pci_device_id *ent, | ||
| 1587 | struct drm_driver *driver); | ||
| 1588 | int drm_get_minor(struct drm_device *dev, struct drm_minor **minor, int type); | ||
| 1553 | /*@}*/ | 1589 | /*@}*/ |
| 1554 | 1590 | ||
| 1555 | #endif /* __KERNEL__ */ | 1591 | #endif /* __KERNEL__ */ |
diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h index 1121f7799c6f..59b7073b13fe 100644 --- a/include/drm/drm_crtc_helper.h +++ b/include/drm/drm_crtc_helper.h | |||
| @@ -60,9 +60,14 @@ struct drm_crtc_helper_funcs { | |||
| 60 | /* Move the crtc on the current fb to the given position *optional* */ | 60 | /* Move the crtc on the current fb to the given position *optional* */ |
| 61 | int (*mode_set_base)(struct drm_crtc *crtc, int x, int y, | 61 | int (*mode_set_base)(struct drm_crtc *crtc, int x, int y, |
| 62 | struct drm_framebuffer *old_fb); | 62 | struct drm_framebuffer *old_fb); |
| 63 | int (*mode_set_base_atomic)(struct drm_crtc *crtc, | ||
| 64 | struct drm_framebuffer *fb, int x, int y); | ||
| 63 | 65 | ||
| 64 | /* reload the current crtc LUT */ | 66 | /* reload the current crtc LUT */ |
| 65 | void (*load_lut)(struct drm_crtc *crtc); | 67 | void (*load_lut)(struct drm_crtc *crtc); |
| 68 | |||
| 69 | /* disable crtc when not in use - more explicit than dpms off */ | ||
| 70 | void (*disable)(struct drm_crtc *crtc); | ||
| 66 | }; | 71 | }; |
| 67 | 72 | ||
| 68 | struct drm_encoder_helper_funcs { | 73 | struct drm_encoder_helper_funcs { |
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h index f0a6afc47e76..f22e7fe4b6db 100644 --- a/include/drm/drm_fb_helper.h +++ b/include/drm/drm_fb_helper.h | |||
| @@ -32,6 +32,8 @@ | |||
| 32 | 32 | ||
| 33 | struct drm_fb_helper; | 33 | struct drm_fb_helper; |
| 34 | 34 | ||
| 35 | #include <linux/kgdb.h> | ||
| 36 | |||
| 35 | struct drm_fb_helper_crtc { | 37 | struct drm_fb_helper_crtc { |
| 36 | uint32_t crtc_id; | 38 | uint32_t crtc_id; |
| 37 | struct drm_mode_set mode_set; | 39 | struct drm_mode_set mode_set; |
| @@ -78,6 +80,7 @@ struct drm_fb_helper_connector { | |||
| 78 | 80 | ||
| 79 | struct drm_fb_helper { | 81 | struct drm_fb_helper { |
| 80 | struct drm_framebuffer *fb; | 82 | struct drm_framebuffer *fb; |
| 83 | struct drm_framebuffer *saved_fb; | ||
| 81 | struct drm_device *dev; | 84 | struct drm_device *dev; |
| 82 | struct drm_display_mode *mode; | 85 | struct drm_display_mode *mode; |
| 83 | int crtc_count; | 86 | int crtc_count; |
| @@ -126,5 +129,7 @@ int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info); | |||
| 126 | bool drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper); | 129 | bool drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper); |
| 127 | bool drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel); | 130 | bool drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel); |
| 128 | int drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper); | 131 | int drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper); |
| 132 | int drm_fb_helper_debug_enter(struct fb_info *info); | ||
| 133 | int drm_fb_helper_debug_leave(struct fb_info *info); | ||
| 129 | 134 | ||
| 130 | #endif | 135 | #endif |
diff --git a/include/drm/drm_global.h b/include/drm/drm_global.h new file mode 100644 index 000000000000..a06805eaf649 --- /dev/null +++ b/include/drm/drm_global.h | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | /************************************************************************** | ||
| 2 | * | ||
| 3 | * Copyright 2008-2009 VMware, Inc., Palo Alto, CA., USA | ||
| 4 | * All Rights Reserved. | ||
| 5 | * | ||
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
| 7 | * copy of this software and associated documentation files (the | ||
| 8 | * "Software"), to deal in the Software without restriction, including | ||
| 9 | * without limitation the rights to use, copy, modify, merge, publish, | ||
| 10 | * distribute, sub license, and/or sell copies of the Software, and to | ||
| 11 | * permit persons to whom the Software is furnished to do so, subject to | ||
| 12 | * the following conditions: | ||
| 13 | * | ||
| 14 | * The above copyright notice and this permission notice (including the | ||
| 15 | * next paragraph) shall be included in all copies or substantial portions | ||
| 16 | * of the Software. | ||
| 17 | * | ||
| 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 20 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL | ||
| 21 | * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, | ||
| 22 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | ||
| 23 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE | ||
| 24 | * USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 25 | * | ||
| 26 | **************************************************************************/ | ||
| 27 | /* | ||
| 28 | * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com> | ||
| 29 | */ | ||
| 30 | |||
| 31 | #ifndef _DRM_GLOBAL_H_ | ||
| 32 | #define _DRM_GLOBAL_H_ | ||
| 33 | enum drm_global_types { | ||
| 34 | DRM_GLOBAL_TTM_MEM = 0, | ||
| 35 | DRM_GLOBAL_TTM_BO, | ||
| 36 | DRM_GLOBAL_TTM_OBJECT, | ||
| 37 | DRM_GLOBAL_NUM | ||
| 38 | }; | ||
| 39 | |||
| 40 | struct drm_global_reference { | ||
| 41 | enum drm_global_types global_type; | ||
| 42 | size_t size; | ||
| 43 | void *object; | ||
| 44 | int (*init) (struct drm_global_reference *); | ||
| 45 | void (*release) (struct drm_global_reference *); | ||
| 46 | }; | ||
| 47 | |||
| 48 | extern void drm_global_init(void); | ||
| 49 | extern void drm_global_release(void); | ||
| 50 | extern int drm_global_item_ref(struct drm_global_reference *ref); | ||
| 51 | extern void drm_global_item_unref(struct drm_global_reference *ref); | ||
| 52 | |||
| 53 | #endif | ||
diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h index 4c10be39a43b..bf01531193d5 100644 --- a/include/drm/drm_mm.h +++ b/include/drm/drm_mm.h | |||
| @@ -42,21 +42,31 @@ | |||
| 42 | #endif | 42 | #endif |
| 43 | 43 | ||
| 44 | struct drm_mm_node { | 44 | struct drm_mm_node { |
| 45 | struct list_head fl_entry; | 45 | struct list_head free_stack; |
| 46 | struct list_head ml_entry; | 46 | struct list_head node_list; |
| 47 | int free; | 47 | unsigned free : 1; |
| 48 | unsigned scanned_block : 1; | ||
| 49 | unsigned scanned_prev_free : 1; | ||
| 50 | unsigned scanned_next_free : 1; | ||
| 48 | unsigned long start; | 51 | unsigned long start; |
| 49 | unsigned long size; | 52 | unsigned long size; |
| 50 | struct drm_mm *mm; | 53 | struct drm_mm *mm; |
| 51 | void *private; | ||
| 52 | }; | 54 | }; |
| 53 | 55 | ||
| 54 | struct drm_mm { | 56 | struct drm_mm { |
| 55 | struct list_head fl_entry; | 57 | /* List of free memory blocks, most recently freed ordered. */ |
| 56 | struct list_head ml_entry; | 58 | struct list_head free_stack; |
| 59 | /* List of all memory nodes, ordered according to the (increasing) start | ||
| 60 | * address of the memory node. */ | ||
| 61 | struct list_head node_list; | ||
| 57 | struct list_head unused_nodes; | 62 | struct list_head unused_nodes; |
| 58 | int num_unused; | 63 | int num_unused; |
| 59 | spinlock_t unused_lock; | 64 | spinlock_t unused_lock; |
| 65 | unsigned scan_alignment; | ||
| 66 | unsigned long scan_size; | ||
| 67 | unsigned long scan_hit_start; | ||
| 68 | unsigned scan_hit_size; | ||
| 69 | unsigned scanned_blocks; | ||
| 60 | }; | 70 | }; |
| 61 | 71 | ||
| 62 | /* | 72 | /* |
| @@ -133,6 +143,11 @@ static inline struct drm_mm *drm_get_mm(struct drm_mm_node *block) | |||
| 133 | return block->mm; | 143 | return block->mm; |
| 134 | } | 144 | } |
| 135 | 145 | ||
| 146 | void drm_mm_init_scan(struct drm_mm *mm, unsigned long size, | ||
| 147 | unsigned alignment); | ||
| 148 | int drm_mm_scan_add_block(struct drm_mm_node *node); | ||
| 149 | int drm_mm_scan_remove_block(struct drm_mm_node *node); | ||
| 150 | |||
| 136 | extern void drm_mm_debug_table(struct drm_mm *mm, const char *prefix); | 151 | extern void drm_mm_debug_table(struct drm_mm *mm, const char *prefix); |
| 137 | #ifdef CONFIG_DEBUG_FS | 152 | #ifdef CONFIG_DEBUG_FS |
| 138 | int drm_mm_dump_table(struct seq_file *m, struct drm_mm *mm); | 153 | int drm_mm_dump_table(struct seq_file *m, struct drm_mm *mm); |
diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h index c5ba1636613c..0fc7397c8f1f 100644 --- a/include/drm/drm_mode.h +++ b/include/drm/drm_mode.h | |||
| @@ -74,6 +74,7 @@ | |||
| 74 | /* Dithering mode options */ | 74 | /* Dithering mode options */ |
| 75 | #define DRM_MODE_DITHERING_OFF 0 | 75 | #define DRM_MODE_DITHERING_OFF 0 |
| 76 | #define DRM_MODE_DITHERING_ON 1 | 76 | #define DRM_MODE_DITHERING_ON 1 |
| 77 | #define DRM_MODE_DITHERING_AUTO 2 | ||
| 77 | 78 | ||
| 78 | /* Dirty info options */ | 79 | /* Dirty info options */ |
| 79 | #define DRM_MODE_DIRTY_OFF 0 | 80 | #define DRM_MODE_DIRTY_OFF 0 |
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h index 2d428b088cc8..3a9940ef728b 100644 --- a/include/drm/drm_pciids.h +++ b/include/drm/drm_pciids.h | |||
| @@ -146,6 +146,8 @@ | |||
| 146 | {0x1002, 0x6888, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_NEW_MEMMAP}, \ | 146 | {0x1002, 0x6888, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_NEW_MEMMAP}, \ |
| 147 | {0x1002, 0x6889, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_NEW_MEMMAP}, \ | 147 | {0x1002, 0x6889, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_NEW_MEMMAP}, \ |
| 148 | {0x1002, 0x688A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_NEW_MEMMAP}, \ | 148 | {0x1002, 0x688A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_NEW_MEMMAP}, \ |
| 149 | {0x1002, 0x688C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_NEW_MEMMAP}, \ | ||
| 150 | {0x1002, 0x688D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_NEW_MEMMAP}, \ | ||
| 149 | {0x1002, 0x6898, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_NEW_MEMMAP}, \ | 151 | {0x1002, 0x6898, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_NEW_MEMMAP}, \ |
| 150 | {0x1002, 0x6899, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_NEW_MEMMAP}, \ | 152 | {0x1002, 0x6899, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_NEW_MEMMAP}, \ |
| 151 | {0x1002, 0x689c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HEMLOCK|RADEON_NEW_MEMMAP}, \ | 153 | {0x1002, 0x689c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HEMLOCK|RADEON_NEW_MEMMAP}, \ |
| @@ -161,6 +163,7 @@ | |||
| 161 | {0x1002, 0x68be, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_JUNIPER|RADEON_NEW_MEMMAP}, \ | 163 | {0x1002, 0x68be, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_JUNIPER|RADEON_NEW_MEMMAP}, \ |
| 162 | {0x1002, 0x68c0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_REDWOOD|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 164 | {0x1002, 0x68c0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_REDWOOD|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
| 163 | {0x1002, 0x68c1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_REDWOOD|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 165 | {0x1002, 0x68c1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_REDWOOD|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
| 166 | {0x1002, 0x68c7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_REDWOOD|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 164 | {0x1002, 0x68c8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_REDWOOD|RADEON_NEW_MEMMAP}, \ | 167 | {0x1002, 0x68c8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_REDWOOD|RADEON_NEW_MEMMAP}, \ |
| 165 | {0x1002, 0x68c9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_REDWOOD|RADEON_NEW_MEMMAP}, \ | 168 | {0x1002, 0x68c9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_REDWOOD|RADEON_NEW_MEMMAP}, \ |
| 166 | {0x1002, 0x68d8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_REDWOOD|RADEON_NEW_MEMMAP}, \ | 169 | {0x1002, 0x68d8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_REDWOOD|RADEON_NEW_MEMMAP}, \ |
| @@ -174,6 +177,7 @@ | |||
| 174 | {0x1002, 0x68e8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CEDAR|RADEON_NEW_MEMMAP}, \ | 177 | {0x1002, 0x68e8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CEDAR|RADEON_NEW_MEMMAP}, \ |
| 175 | {0x1002, 0x68e9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CEDAR|RADEON_NEW_MEMMAP}, \ | 178 | {0x1002, 0x68e9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CEDAR|RADEON_NEW_MEMMAP}, \ |
| 176 | {0x1002, 0x68f1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CEDAR|RADEON_NEW_MEMMAP}, \ | 179 | {0x1002, 0x68f1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CEDAR|RADEON_NEW_MEMMAP}, \ |
| 180 | {0x1002, 0x68f2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CEDAR|RADEON_NEW_MEMMAP}, \ | ||
| 177 | {0x1002, 0x68f8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CEDAR|RADEON_NEW_MEMMAP}, \ | 181 | {0x1002, 0x68f8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CEDAR|RADEON_NEW_MEMMAP}, \ |
| 178 | {0x1002, 0x68f9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CEDAR|RADEON_NEW_MEMMAP}, \ | 182 | {0x1002, 0x68f9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CEDAR|RADEON_NEW_MEMMAP}, \ |
| 179 | {0x1002, 0x68fe, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CEDAR|RADEON_NEW_MEMMAP}, \ | 183 | {0x1002, 0x68fe, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CEDAR|RADEON_NEW_MEMMAP}, \ |
| @@ -314,6 +318,7 @@ | |||
| 314 | {0x1002, 0x9456, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ | 318 | {0x1002, 0x9456, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ |
| 315 | {0x1002, 0x945A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 319 | {0x1002, 0x945A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
| 316 | {0x1002, 0x945B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 320 | {0x1002, 0x945B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
| 321 | {0x1002, 0x945E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 317 | {0x1002, 0x9460, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ | 322 | {0x1002, 0x9460, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ |
| 318 | {0x1002, 0x9462, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ | 323 | {0x1002, 0x9462, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ |
| 319 | {0x1002, 0x946A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 324 | {0x1002, 0x946A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
| @@ -324,6 +329,7 @@ | |||
| 324 | {0x1002, 0x9487, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ | 329 | {0x1002, 0x9487, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ |
| 325 | {0x1002, 0x9488, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 330 | {0x1002, 0x9488, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
| 326 | {0x1002, 0x9489, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 331 | {0x1002, 0x9489, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
| 332 | {0x1002, 0x948A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 327 | {0x1002, 0x948F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ | 333 | {0x1002, 0x948F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ |
| 328 | {0x1002, 0x9490, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ | 334 | {0x1002, 0x9490, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ |
| 329 | {0x1002, 0x9491, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 335 | {0x1002, 0x9491, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
| @@ -366,6 +372,7 @@ | |||
| 366 | {0x1002, 0x9553, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 372 | {0x1002, 0x9553, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
| 367 | {0x1002, 0x9555, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 373 | {0x1002, 0x9555, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
| 368 | {0x1002, 0x9557, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 374 | {0x1002, 0x9557, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
| 375 | {0x1002, 0x955f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 369 | {0x1002, 0x9580, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_NEW_MEMMAP}, \ | 376 | {0x1002, 0x9580, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_NEW_MEMMAP}, \ |
| 370 | {0x1002, 0x9581, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 377 | {0x1002, 0x9581, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
| 371 | {0x1002, 0x9583, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 378 | {0x1002, 0x9583, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
diff --git a/include/drm/i2c/sil164.h b/include/drm/i2c/sil164.h new file mode 100644 index 000000000000..205e27384c83 --- /dev/null +++ b/include/drm/i2c/sil164.h | |||
| @@ -0,0 +1,63 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2010 Francisco Jerez. | ||
| 3 | * All Rights Reserved. | ||
| 4 | * | ||
| 5 | * Permission is hereby granted, free of charge, to any person obtaining | ||
| 6 | * a copy of this software and associated documentation files (the | ||
| 7 | * "Software"), to deal in the Software without restriction, including | ||
| 8 | * without limitation the rights to use, copy, modify, merge, publish, | ||
| 9 | * distribute, sublicense, and/or sell copies of the Software, and to | ||
| 10 | * permit persons to whom the Software is furnished to do so, subject to | ||
| 11 | * the following conditions: | ||
| 12 | * | ||
| 13 | * The above copyright notice and this permission notice (including the | ||
| 14 | * next paragraph) shall be included in all copies or substantial | ||
| 15 | * portions of the Software. | ||
| 16 | * | ||
| 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
| 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
| 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
| 20 | * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE | ||
| 21 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
| 22 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
| 23 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 24 | * | ||
| 25 | */ | ||
| 26 | |||
| 27 | #ifndef __DRM_I2C_SIL164_H__ | ||
| 28 | #define __DRM_I2C_SIL164_H__ | ||
| 29 | |||
| 30 | /** | ||
| 31 | * struct sil164_encoder_params | ||
| 32 | * | ||
| 33 | * Describes how the sil164 is connected to the GPU. It should be used | ||
| 34 | * as the @params parameter of its @set_config method. | ||
| 35 | * | ||
| 36 | * See "http://www.siliconimage.com/docs/SiI-DS-0021-E-164.pdf". | ||
| 37 | */ | ||
| 38 | struct sil164_encoder_params { | ||
| 39 | enum { | ||
| 40 | SIL164_INPUT_EDGE_FALLING = 0, | ||
| 41 | SIL164_INPUT_EDGE_RISING | ||
| 42 | } input_edge; | ||
| 43 | |||
| 44 | enum { | ||
| 45 | SIL164_INPUT_WIDTH_12BIT = 0, | ||
| 46 | SIL164_INPUT_WIDTH_24BIT | ||
| 47 | } input_width; | ||
| 48 | |||
| 49 | enum { | ||
| 50 | SIL164_INPUT_SINGLE_EDGE = 0, | ||
| 51 | SIL164_INPUT_DUAL_EDGE | ||
| 52 | } input_dual; | ||
| 53 | |||
| 54 | enum { | ||
| 55 | SIL164_PLL_FILTER_ON = 0, | ||
| 56 | SIL164_PLL_FILTER_OFF, | ||
| 57 | } pll_filter; | ||
| 58 | |||
| 59 | int input_skew; /** < Allowed range [-4, 3], use 0 for no de-skew. */ | ||
| 60 | int duallink_skew; /** < Allowed range [-4, 3]. */ | ||
| 61 | }; | ||
| 62 | |||
| 63 | #endif | ||
diff --git a/include/drm/radeon_drm.h b/include/drm/radeon_drm.h index 5347063e9d5a..0acaf8f91437 100644 --- a/include/drm/radeon_drm.h +++ b/include/drm/radeon_drm.h | |||
| @@ -904,6 +904,8 @@ struct drm_radeon_cs { | |||
| 904 | #define RADEON_INFO_ACCEL_WORKING 0x03 | 904 | #define RADEON_INFO_ACCEL_WORKING 0x03 |
| 905 | #define RADEON_INFO_CRTC_FROM_ID 0x04 | 905 | #define RADEON_INFO_CRTC_FROM_ID 0x04 |
| 906 | #define RADEON_INFO_ACCEL_WORKING2 0x05 | 906 | #define RADEON_INFO_ACCEL_WORKING2 0x05 |
| 907 | #define RADEON_INFO_TILING_CONFIG 0x06 | ||
| 908 | #define RADEON_INFO_WANT_HYPERZ 0x07 | ||
| 907 | 909 | ||
| 908 | struct drm_radeon_info { | 910 | struct drm_radeon_info { |
| 909 | uint32_t request; | 911 | uint32_t request; |
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index 0ea602da43e7..b87504235f18 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | #include "ttm/ttm_memory.h" | 34 | #include "ttm/ttm_memory.h" |
| 35 | #include "ttm/ttm_module.h" | 35 | #include "ttm/ttm_module.h" |
| 36 | #include "drm_mm.h" | 36 | #include "drm_mm.h" |
| 37 | #include "drm_global.h" | ||
| 37 | #include "linux/workqueue.h" | 38 | #include "linux/workqueue.h" |
| 38 | #include "linux/fs.h" | 39 | #include "linux/fs.h" |
| 39 | #include "linux/spinlock.h" | 40 | #include "linux/spinlock.h" |
| @@ -362,7 +363,7 @@ struct ttm_bo_driver { | |||
| 362 | */ | 363 | */ |
| 363 | 364 | ||
| 364 | struct ttm_bo_global_ref { | 365 | struct ttm_bo_global_ref { |
| 365 | struct ttm_global_reference ref; | 366 | struct drm_global_reference ref; |
| 366 | struct ttm_mem_global *mem_glob; | 367 | struct ttm_mem_global *mem_glob; |
| 367 | }; | 368 | }; |
| 368 | 369 | ||
| @@ -687,8 +688,8 @@ extern int ttm_mem_io_reserve(struct ttm_bo_device *bdev, | |||
| 687 | extern void ttm_mem_io_free(struct ttm_bo_device *bdev, | 688 | extern void ttm_mem_io_free(struct ttm_bo_device *bdev, |
| 688 | struct ttm_mem_reg *mem); | 689 | struct ttm_mem_reg *mem); |
| 689 | 690 | ||
| 690 | extern void ttm_bo_global_release(struct ttm_global_reference *ref); | 691 | extern void ttm_bo_global_release(struct drm_global_reference *ref); |
| 691 | extern int ttm_bo_global_init(struct ttm_global_reference *ref); | 692 | extern int ttm_bo_global_init(struct drm_global_reference *ref); |
| 692 | 693 | ||
| 693 | extern int ttm_bo_device_release(struct ttm_bo_device *bdev); | 694 | extern int ttm_bo_device_release(struct ttm_bo_device *bdev); |
| 694 | 695 | ||
diff --git a/include/drm/ttm/ttm_module.h b/include/drm/ttm/ttm_module.h index cf416aee19af..45fa318c1585 100644 --- a/include/drm/ttm/ttm_module.h +++ b/include/drm/ttm/ttm_module.h | |||
| @@ -35,26 +35,6 @@ | |||
| 35 | struct kobject; | 35 | struct kobject; |
| 36 | 36 | ||
| 37 | #define TTM_PFX "[TTM] " | 37 | #define TTM_PFX "[TTM] " |
| 38 | |||
| 39 | enum ttm_global_types { | ||
| 40 | TTM_GLOBAL_TTM_MEM = 0, | ||
| 41 | TTM_GLOBAL_TTM_BO, | ||
| 42 | TTM_GLOBAL_TTM_OBJECT, | ||
| 43 | TTM_GLOBAL_NUM | ||
| 44 | }; | ||
| 45 | |||
| 46 | struct ttm_global_reference { | ||
| 47 | enum ttm_global_types global_type; | ||
| 48 | size_t size; | ||
| 49 | void *object; | ||
| 50 | int (*init) (struct ttm_global_reference *); | ||
| 51 | void (*release) (struct ttm_global_reference *); | ||
| 52 | }; | ||
| 53 | |||
| 54 | extern void ttm_global_init(void); | ||
| 55 | extern void ttm_global_release(void); | ||
| 56 | extern int ttm_global_item_ref(struct ttm_global_reference *ref); | ||
| 57 | extern void ttm_global_item_unref(struct ttm_global_reference *ref); | ||
| 58 | extern struct kobject *ttm_get_kobj(void); | 38 | extern struct kobject *ttm_get_kobj(void); |
| 59 | 39 | ||
| 60 | #endif /* _TTM_MODULE_H_ */ | 40 | #endif /* _TTM_MODULE_H_ */ |
diff --git a/include/linux/console.h b/include/linux/console.h index dcca5339ceb3..f76fc297322d 100644 --- a/include/linux/console.h +++ b/include/linux/console.h | |||
| @@ -55,6 +55,16 @@ struct consw { | |||
| 55 | void (*con_invert_region)(struct vc_data *, u16 *, int); | 55 | void (*con_invert_region)(struct vc_data *, u16 *, int); |
| 56 | u16 *(*con_screen_pos)(struct vc_data *, int); | 56 | u16 *(*con_screen_pos)(struct vc_data *, int); |
| 57 | unsigned long (*con_getxy)(struct vc_data *, unsigned long, int *, int *); | 57 | unsigned long (*con_getxy)(struct vc_data *, unsigned long, int *, int *); |
| 58 | /* | ||
| 59 | * Prepare the console for the debugger. This includes, but is not | ||
| 60 | * limited to, unblanking the console, loading an appropriate | ||
| 61 | * palette, and allowing debugger generated output. | ||
| 62 | */ | ||
| 63 | int (*con_debug_enter)(struct vc_data *); | ||
| 64 | /* | ||
| 65 | * Restore the console to its pre-debug state as closely as possible. | ||
| 66 | */ | ||
| 67 | int (*con_debug_leave)(struct vc_data *); | ||
| 58 | }; | 68 | }; |
| 59 | 69 | ||
| 60 | extern const struct consw *conswitchp; | 70 | extern const struct consw *conswitchp; |
| @@ -69,6 +79,9 @@ int register_con_driver(const struct consw *csw, int first, int last); | |||
| 69 | int unregister_con_driver(const struct consw *csw); | 79 | int unregister_con_driver(const struct consw *csw); |
| 70 | int take_over_console(const struct consw *sw, int first, int last, int deflt); | 80 | int take_over_console(const struct consw *sw, int first, int last, int deflt); |
| 71 | void give_up_console(const struct consw *sw); | 81 | void give_up_console(const struct consw *sw); |
| 82 | int con_debug_enter(struct vc_data *vc); | ||
| 83 | int con_debug_leave(void); | ||
| 84 | |||
| 72 | /* scroll */ | 85 | /* scroll */ |
| 73 | #define SM_UP (1) | 86 | #define SM_UP (1) |
| 74 | #define SM_DOWN (2) | 87 | #define SM_DOWN (2) |
diff --git a/include/linux/fb.h b/include/linux/fb.h index e7445df44d6c..0c5659c41b01 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
| @@ -3,6 +3,9 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <linux/i2c.h> | 5 | #include <linux/i2c.h> |
| 6 | #ifdef __KERNEL__ | ||
| 7 | #include <linux/kgdb.h> | ||
| 8 | #endif /* __KERNEL__ */ | ||
| 6 | 9 | ||
| 7 | /* Definitions of frame buffers */ | 10 | /* Definitions of frame buffers */ |
| 8 | 11 | ||
| @@ -607,6 +610,12 @@ struct fb_deferred_io { | |||
| 607 | * LOCKING NOTE: those functions must _ALL_ be called with the console | 610 | * LOCKING NOTE: those functions must _ALL_ be called with the console |
| 608 | * semaphore held, this is the only suitable locking mechanism we have | 611 | * semaphore held, this is the only suitable locking mechanism we have |
| 609 | * in 2.6. Some may be called at interrupt time at this point though. | 612 | * in 2.6. Some may be called at interrupt time at this point though. |
| 613 | * | ||
| 614 | * The exception to this is the debug related hooks. Putting the fb | ||
| 615 | * into a debug state (e.g. flipping to the kernel console) and restoring | ||
| 616 | * it must be done in a lock-free manner, so low level drivers should | ||
| 617 | * keep track of the initial console (if applicable) and may need to | ||
| 618 | * perform direct, unlocked hardware writes in these hooks. | ||
| 610 | */ | 619 | */ |
| 611 | 620 | ||
| 612 | struct fb_ops { | 621 | struct fb_ops { |
| @@ -676,6 +685,10 @@ struct fb_ops { | |||
| 676 | 685 | ||
| 677 | /* teardown any resources to do with this framebuffer */ | 686 | /* teardown any resources to do with this framebuffer */ |
| 678 | void (*fb_destroy)(struct fb_info *info); | 687 | void (*fb_destroy)(struct fb_info *info); |
| 688 | |||
| 689 | /* called at KDB enter and leave time to prepare the console */ | ||
| 690 | int (*fb_debug_enter)(struct fb_info *info); | ||
| 691 | int (*fb_debug_leave)(struct fb_info *info); | ||
| 679 | }; | 692 | }; |
| 680 | 693 | ||
| 681 | #ifdef CONFIG_FB_TILEBLITTING | 694 | #ifdef CONFIG_FB_TILEBLITTING |
diff --git a/include/linux/fsl-diu-fb.h b/include/linux/fsl-diu-fb.h new file mode 100644 index 000000000000..fc295d7ea463 --- /dev/null +++ b/include/linux/fsl-diu-fb.h | |||
| @@ -0,0 +1,223 @@ | |||
| 1 | /* | ||
| 2 | * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved. | ||
| 3 | * | ||
| 4 | * Freescale DIU Frame Buffer device driver | ||
| 5 | * | ||
| 6 | * Authors: Hongjun Chen <hong-jun.chen@freescale.com> | ||
| 7 | * Paul Widmer <paul.widmer@freescale.com> | ||
| 8 | * Srikanth Srinivasan <srikanth.srinivasan@freescale.com> | ||
| 9 | * York Sun <yorksun@freescale.com> | ||
| 10 | * | ||
| 11 | * Based on imxfb.c Copyright (C) 2004 S.Hauer, Pengutronix | ||
| 12 | * | ||
| 13 | * This program is free software; you can redistribute it and/or modify it | ||
| 14 | * under the terms of the GNU General Public License as published by the | ||
| 15 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 16 | * option) any later version. | ||
| 17 | * | ||
| 18 | */ | ||
| 19 | |||
| 20 | #ifndef __FSL_DIU_FB_H__ | ||
| 21 | #define __FSL_DIU_FB_H__ | ||
| 22 | |||
| 23 | /* Arbitrary threshold to determine the allocation method | ||
| 24 | * See mpc8610fb_set_par(), map_video_memory(), and unmap_video_memory() | ||
| 25 | */ | ||
| 26 | #define MEM_ALLOC_THRESHOLD (1024*768*4+32) | ||
| 27 | /* Minimum value that the pixel clock can be set to in pico seconds | ||
| 28 | * This is determined by platform clock/3 where the minimum platform | ||
| 29 | * clock is 533MHz. This gives 5629 pico seconds. | ||
| 30 | */ | ||
| 31 | #define MIN_PIX_CLK 5629 | ||
| 32 | #define MAX_PIX_CLK 96096 | ||
| 33 | |||
| 34 | #include <linux/types.h> | ||
| 35 | |||
| 36 | struct mfb_alpha { | ||
| 37 | int enable; | ||
| 38 | int alpha; | ||
| 39 | }; | ||
| 40 | |||
| 41 | struct mfb_chroma_key { | ||
| 42 | int enable; | ||
| 43 | __u8 red_max; | ||
| 44 | __u8 green_max; | ||
| 45 | __u8 blue_max; | ||
| 46 | __u8 red_min; | ||
| 47 | __u8 green_min; | ||
| 48 | __u8 blue_min; | ||
| 49 | }; | ||
| 50 | |||
| 51 | struct aoi_display_offset { | ||
| 52 | int x_aoi_d; | ||
| 53 | int y_aoi_d; | ||
| 54 | }; | ||
| 55 | |||
| 56 | #define MFB_SET_CHROMA_KEY _IOW('M', 1, struct mfb_chroma_key) | ||
| 57 | #define MFB_WAIT_FOR_VSYNC _IOW('F', 0x20, u_int32_t) | ||
| 58 | #define MFB_SET_BRIGHTNESS _IOW('M', 3, __u8) | ||
| 59 | |||
| 60 | #define MFB_SET_ALPHA 0x80014d00 | ||
| 61 | #define MFB_GET_ALPHA 0x40014d00 | ||
| 62 | #define MFB_SET_AOID 0x80084d04 | ||
| 63 | #define MFB_GET_AOID 0x40084d04 | ||
| 64 | #define MFB_SET_PIXFMT 0x80014d08 | ||
| 65 | #define MFB_GET_PIXFMT 0x40014d08 | ||
| 66 | |||
| 67 | #define FBIOGET_GWINFO 0x46E0 | ||
| 68 | #define FBIOPUT_GWINFO 0x46E1 | ||
| 69 | |||
| 70 | #ifdef __KERNEL__ | ||
| 71 | #include <linux/spinlock.h> | ||
| 72 | |||
| 73 | /* | ||
| 74 | * These are the fields of area descriptor(in DDR memory) for every plane | ||
| 75 | */ | ||
| 76 | struct diu_ad { | ||
| 77 | /* Word 0(32-bit) in DDR memory */ | ||
| 78 | /* __u16 comp; */ | ||
| 79 | /* __u16 pixel_s:2; */ | ||
| 80 | /* __u16 pallete:1; */ | ||
| 81 | /* __u16 red_c:2; */ | ||
| 82 | /* __u16 green_c:2; */ | ||
| 83 | /* __u16 blue_c:2; */ | ||
| 84 | /* __u16 alpha_c:3; */ | ||
| 85 | /* __u16 byte_f:1; */ | ||
| 86 | /* __u16 res0:3; */ | ||
| 87 | |||
| 88 | __be32 pix_fmt; /* hard coding pixel format */ | ||
| 89 | |||
| 90 | /* Word 1(32-bit) in DDR memory */ | ||
| 91 | __le32 addr; | ||
| 92 | |||
| 93 | /* Word 2(32-bit) in DDR memory */ | ||
| 94 | /* __u32 delta_xs:11; */ | ||
| 95 | /* __u32 res1:1; */ | ||
| 96 | /* __u32 delta_ys:11; */ | ||
| 97 | /* __u32 res2:1; */ | ||
| 98 | /* __u32 g_alpha:8; */ | ||
| 99 | __le32 src_size_g_alpha; | ||
| 100 | |||
| 101 | /* Word 3(32-bit) in DDR memory */ | ||
| 102 | /* __u32 delta_xi:11; */ | ||
| 103 | /* __u32 res3:5; */ | ||
| 104 | /* __u32 delta_yi:11; */ | ||
| 105 | /* __u32 res4:3; */ | ||
| 106 | /* __u32 flip:2; */ | ||
| 107 | __le32 aoi_size; | ||
| 108 | |||
| 109 | /* Word 4(32-bit) in DDR memory */ | ||
| 110 | /*__u32 offset_xi:11; | ||
| 111 | __u32 res5:5; | ||
| 112 | __u32 offset_yi:11; | ||
| 113 | __u32 res6:5; | ||
| 114 | */ | ||
| 115 | __le32 offset_xyi; | ||
| 116 | |||
| 117 | /* Word 5(32-bit) in DDR memory */ | ||
| 118 | /*__u32 offset_xd:11; | ||
| 119 | __u32 res7:5; | ||
| 120 | __u32 offset_yd:11; | ||
| 121 | __u32 res8:5; */ | ||
| 122 | __le32 offset_xyd; | ||
| 123 | |||
| 124 | |||
| 125 | /* Word 6(32-bit) in DDR memory */ | ||
| 126 | __u8 ckmax_r; | ||
| 127 | __u8 ckmax_g; | ||
| 128 | __u8 ckmax_b; | ||
| 129 | __u8 res9; | ||
| 130 | |||
| 131 | /* Word 7(32-bit) in DDR memory */ | ||
| 132 | __u8 ckmin_r; | ||
| 133 | __u8 ckmin_g; | ||
| 134 | __u8 ckmin_b; | ||
| 135 | __u8 res10; | ||
| 136 | /* __u32 res10:8; */ | ||
| 137 | |||
| 138 | /* Word 8(32-bit) in DDR memory */ | ||
| 139 | __le32 next_ad; | ||
| 140 | |||
| 141 | /* Word 9(32-bit) in DDR memory, just for 64-bit aligned */ | ||
| 142 | __u32 paddr; | ||
| 143 | } __attribute__ ((packed)); | ||
| 144 | |||
| 145 | /* DIU register map */ | ||
| 146 | struct diu { | ||
| 147 | __be32 desc[3]; | ||
| 148 | __be32 gamma; | ||
| 149 | __be32 pallete; | ||
| 150 | __be32 cursor; | ||
| 151 | __be32 curs_pos; | ||
| 152 | __be32 diu_mode; | ||
| 153 | __be32 bgnd; | ||
| 154 | __be32 bgnd_wb; | ||
| 155 | __be32 disp_size; | ||
| 156 | __be32 wb_size; | ||
| 157 | __be32 wb_mem_addr; | ||
| 158 | __be32 hsyn_para; | ||
| 159 | __be32 vsyn_para; | ||
| 160 | __be32 syn_pol; | ||
| 161 | __be32 thresholds; | ||
| 162 | __be32 int_status; | ||
| 163 | __be32 int_mask; | ||
| 164 | __be32 colorbar[8]; | ||
| 165 | __be32 filling; | ||
| 166 | __be32 plut; | ||
| 167 | } __attribute__ ((packed)); | ||
| 168 | |||
| 169 | struct diu_hw { | ||
| 170 | struct diu *diu_reg; | ||
| 171 | spinlock_t reg_lock; | ||
| 172 | |||
| 173 | __u32 mode; /* DIU operation mode */ | ||
| 174 | }; | ||
| 175 | |||
| 176 | struct diu_addr { | ||
| 177 | __u8 __iomem *vaddr; /* Virtual address */ | ||
| 178 | dma_addr_t paddr; /* Physical address */ | ||
| 179 | __u32 offset; | ||
| 180 | }; | ||
| 181 | |||
| 182 | struct diu_pool { | ||
| 183 | struct diu_addr ad; | ||
| 184 | struct diu_addr gamma; | ||
| 185 | struct diu_addr pallete; | ||
| 186 | struct diu_addr cursor; | ||
| 187 | }; | ||
| 188 | |||
| 189 | #define FSL_DIU_BASE_OFFSET 0x2C000 /* Offset of DIU */ | ||
| 190 | #define INT_LCDC 64 /* DIU interrupt number */ | ||
| 191 | |||
| 192 | #define FSL_AOI_NUM 6 /* 5 AOIs and one dummy AOI */ | ||
| 193 | /* 1 for plane 0, 2 for plane 1&2 each */ | ||
| 194 | |||
| 195 | /* Minimum X and Y resolutions */ | ||
| 196 | #define MIN_XRES 64 | ||
| 197 | #define MIN_YRES 64 | ||
| 198 | |||
| 199 | /* HW cursor parameters */ | ||
| 200 | #define MAX_CURS 32 | ||
| 201 | |||
| 202 | /* Modes of operation of DIU */ | ||
| 203 | #define MFB_MODE0 0 /* DIU off */ | ||
| 204 | #define MFB_MODE1 1 /* All three planes output to display */ | ||
| 205 | #define MFB_MODE2 2 /* Plane 1 to display, planes 2+3 written back*/ | ||
| 206 | #define MFB_MODE3 3 /* All three planes written back to memory */ | ||
| 207 | #define MFB_MODE4 4 /* Color bar generation */ | ||
| 208 | |||
| 209 | /* INT_STATUS/INT_MASK field descriptions */ | ||
| 210 | #define INT_VSYNC 0x01 /* Vsync interrupt */ | ||
| 211 | #define INT_VSYNC_WB 0x02 /* Vsync interrupt for write back operation */ | ||
| 212 | #define INT_UNDRUN 0x04 /* Under run exception interrupt */ | ||
| 213 | #define INT_PARERR 0x08 /* Display parameters error interrupt */ | ||
| 214 | #define INT_LS_BF_VS 0x10 /* Lines before vsync. interrupt */ | ||
| 215 | |||
| 216 | /* Panels'operation modes */ | ||
| 217 | #define MFB_TYPE_OUTPUT 0 /* Panel output to display */ | ||
| 218 | #define MFB_TYPE_OFF 1 /* Panel off */ | ||
| 219 | #define MFB_TYPE_WB 2 /* Panel written back to memory */ | ||
| 220 | #define MFB_TYPE_TEST 3 /* Panel generate color bar */ | ||
| 221 | |||
| 222 | #endif /* __KERNEL__ */ | ||
| 223 | #endif /* __FSL_DIU_FB_H__ */ | ||
diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h index 25085ddd955f..e0ea40f6c515 100644 --- a/include/linux/io-mapping.h +++ b/include/linux/io-mapping.h | |||
| @@ -79,7 +79,9 @@ io_mapping_free(struct io_mapping *mapping) | |||
| 79 | 79 | ||
| 80 | /* Atomic map/unmap */ | 80 | /* Atomic map/unmap */ |
| 81 | static inline void * | 81 | static inline void * |
| 82 | io_mapping_map_atomic_wc(struct io_mapping *mapping, unsigned long offset) | 82 | io_mapping_map_atomic_wc(struct io_mapping *mapping, |
| 83 | unsigned long offset, | ||
| 84 | int slot) | ||
| 83 | { | 85 | { |
| 84 | resource_size_t phys_addr; | 86 | resource_size_t phys_addr; |
| 85 | unsigned long pfn; | 87 | unsigned long pfn; |
| @@ -87,13 +89,13 @@ io_mapping_map_atomic_wc(struct io_mapping *mapping, unsigned long offset) | |||
| 87 | BUG_ON(offset >= mapping->size); | 89 | BUG_ON(offset >= mapping->size); |
| 88 | phys_addr = mapping->base + offset; | 90 | phys_addr = mapping->base + offset; |
| 89 | pfn = (unsigned long) (phys_addr >> PAGE_SHIFT); | 91 | pfn = (unsigned long) (phys_addr >> PAGE_SHIFT); |
| 90 | return iomap_atomic_prot_pfn(pfn, KM_USER0, mapping->prot); | 92 | return iomap_atomic_prot_pfn(pfn, slot, mapping->prot); |
| 91 | } | 93 | } |
| 92 | 94 | ||
| 93 | static inline void | 95 | static inline void |
| 94 | io_mapping_unmap_atomic(void *vaddr) | 96 | io_mapping_unmap_atomic(void *vaddr, int slot) |
| 95 | { | 97 | { |
| 96 | iounmap_atomic(vaddr, KM_USER0); | 98 | iounmap_atomic(vaddr, slot); |
| 97 | } | 99 | } |
| 98 | 100 | ||
| 99 | static inline void * | 101 | static inline void * |
| @@ -133,13 +135,15 @@ io_mapping_free(struct io_mapping *mapping) | |||
| 133 | 135 | ||
| 134 | /* Atomic map/unmap */ | 136 | /* Atomic map/unmap */ |
| 135 | static inline void * | 137 | static inline void * |
| 136 | io_mapping_map_atomic_wc(struct io_mapping *mapping, unsigned long offset) | 138 | io_mapping_map_atomic_wc(struct io_mapping *mapping, |
| 139 | unsigned long offset, | ||
| 140 | int slot) | ||
| 137 | { | 141 | { |
| 138 | return ((char *) mapping) + offset; | 142 | return ((char *) mapping) + offset; |
| 139 | } | 143 | } |
| 140 | 144 | ||
| 141 | static inline void | 145 | static inline void |
| 142 | io_mapping_unmap_atomic(void *vaddr) | 146 | io_mapping_unmap_atomic(void *vaddr, int slot) |
| 143 | { | 147 | { |
| 144 | } | 148 | } |
| 145 | 149 | ||
diff --git a/include/linux/kdb.h b/include/linux/kdb.h index ccb2b3ec0fe8..ea6e5244ed3f 100644 --- a/include/linux/kdb.h +++ b/include/linux/kdb.h | |||
| @@ -114,4 +114,8 @@ enum { | |||
| 114 | KDB_INIT_EARLY, | 114 | KDB_INIT_EARLY, |
| 115 | KDB_INIT_FULL, | 115 | KDB_INIT_FULL, |
| 116 | }; | 116 | }; |
| 117 | |||
| 118 | extern int kdbgetintenv(const char *, int *); | ||
| 119 | extern int kdb_set(int, const char **); | ||
| 120 | |||
| 117 | #endif /* !_KDB_H */ | 121 | #endif /* !_KDB_H */ |
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h index 9340f34d1bb5..cc96f0f23e04 100644 --- a/include/linux/kgdb.h +++ b/include/linux/kgdb.h | |||
| @@ -90,6 +90,19 @@ struct kgdb_bkpt { | |||
| 90 | enum kgdb_bpstate state; | 90 | enum kgdb_bpstate state; |
| 91 | }; | 91 | }; |
| 92 | 92 | ||
| 93 | struct dbg_reg_def_t { | ||
| 94 | char *name; | ||
| 95 | int size; | ||
| 96 | int offset; | ||
| 97 | }; | ||
| 98 | |||
| 99 | #ifndef DBG_MAX_REG_NUM | ||
| 100 | #define DBG_MAX_REG_NUM 0 | ||
| 101 | #else | ||
| 102 | extern struct dbg_reg_def_t dbg_reg_def[]; | ||
| 103 | extern char *dbg_get_reg(int regno, void *mem, struct pt_regs *regs); | ||
| 104 | extern int dbg_set_reg(int regno, void *mem, struct pt_regs *regs); | ||
| 105 | #endif | ||
| 93 | #ifndef KGDB_MAX_BREAKPOINTS | 106 | #ifndef KGDB_MAX_BREAKPOINTS |
| 94 | # define KGDB_MAX_BREAKPOINTS 1000 | 107 | # define KGDB_MAX_BREAKPOINTS 1000 |
| 95 | #endif | 108 | #endif |
| @@ -281,7 +294,7 @@ extern void kgdb_unregister_io_module(struct kgdb_io *local_kgdb_io_ops); | |||
| 281 | extern struct kgdb_io *dbg_io_ops; | 294 | extern struct kgdb_io *dbg_io_ops; |
| 282 | 295 | ||
| 283 | extern int kgdb_hex2long(char **ptr, unsigned long *long_val); | 296 | extern int kgdb_hex2long(char **ptr, unsigned long *long_val); |
| 284 | extern int kgdb_mem2hex(char *mem, char *buf, int count); | 297 | extern char *kgdb_mem2hex(char *mem, char *buf, int count); |
| 285 | extern int kgdb_hex2mem(char *buf, char *mem, int count); | 298 | extern int kgdb_hex2mem(char *buf, char *mem, int count); |
| 286 | 299 | ||
| 287 | extern int kgdb_isremovedbreak(unsigned long addr); | 300 | extern int kgdb_isremovedbreak(unsigned long addr); |
diff --git a/include/linux/of.h b/include/linux/of.h index a367e19bb3af..cad7cf0ab278 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
| @@ -70,6 +70,11 @@ extern struct device_node *allnodes; | |||
| 70 | extern struct device_node *of_chosen; | 70 | extern struct device_node *of_chosen; |
| 71 | extern rwlock_t devtree_lock; | 71 | extern rwlock_t devtree_lock; |
| 72 | 72 | ||
| 73 | static inline bool of_node_is_root(const struct device_node *node) | ||
| 74 | { | ||
| 75 | return node && (node->parent == NULL); | ||
| 76 | } | ||
| 77 | |||
| 73 | static inline int of_node_check_flag(struct device_node *n, unsigned long flag) | 78 | static inline int of_node_check_flag(struct device_node *n, unsigned long flag) |
| 74 | { | 79 | { |
| 75 | return test_bit(flag, &n->_flags); | 80 | return test_bit(flag, &n->_flags); |
| @@ -141,6 +146,11 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size) | |||
| 141 | 146 | ||
| 142 | #define OF_BAD_ADDR ((u64)-1) | 147 | #define OF_BAD_ADDR ((u64)-1) |
| 143 | 148 | ||
| 149 | #ifndef of_node_to_nid | ||
| 150 | static inline int of_node_to_nid(struct device_node *np) { return -1; } | ||
| 151 | #define of_node_to_nid of_node_to_nid | ||
| 152 | #endif | ||
| 153 | |||
| 144 | extern struct device_node *of_find_node_by_name(struct device_node *from, | 154 | extern struct device_node *of_find_node_by_name(struct device_node *from, |
| 145 | const char *name); | 155 | const char *name); |
| 146 | #define for_each_node_by_name(dn, name) \ | 156 | #define for_each_node_by_name(dn, name) \ |
diff --git a/include/linux/of_address.h b/include/linux/of_address.h new file mode 100644 index 000000000000..8aea06f0564c --- /dev/null +++ b/include/linux/of_address.h | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | #ifndef __OF_ADDRESS_H | ||
| 2 | #define __OF_ADDRESS_H | ||
| 3 | #include <linux/ioport.h> | ||
| 4 | #include <linux/of.h> | ||
| 5 | |||
| 6 | extern u64 of_translate_address(struct device_node *np, const u32 *addr); | ||
| 7 | extern int of_address_to_resource(struct device_node *dev, int index, | ||
| 8 | struct resource *r); | ||
| 9 | extern void __iomem *of_iomap(struct device_node *device, int index); | ||
| 10 | |||
| 11 | /* Extract an address from a device, returns the region size and | ||
| 12 | * the address space flags too. The PCI version uses a BAR number | ||
| 13 | * instead of an absolute index | ||
| 14 | */ | ||
| 15 | extern const u32 *of_get_address(struct device_node *dev, int index, | ||
| 16 | u64 *size, unsigned int *flags); | ||
| 17 | |||
| 18 | #ifndef pci_address_to_pio | ||
| 19 | static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; } | ||
| 20 | #define pci_address_to_pio pci_address_to_pio | ||
| 21 | #endif | ||
| 22 | |||
| 23 | #ifdef CONFIG_PCI | ||
| 24 | extern const u32 *of_get_pci_address(struct device_node *dev, int bar_no, | ||
| 25 | u64 *size, unsigned int *flags); | ||
| 26 | extern int of_pci_address_to_resource(struct device_node *dev, int bar, | ||
| 27 | struct resource *r); | ||
| 28 | #else /* CONFIG_PCI */ | ||
| 29 | static inline int of_pci_address_to_resource(struct device_node *dev, int bar, | ||
| 30 | struct resource *r) | ||
| 31 | { | ||
| 32 | return -ENOSYS; | ||
| 33 | } | ||
| 34 | |||
| 35 | static inline const u32 *of_get_pci_address(struct device_node *dev, | ||
| 36 | int bar_no, u64 *size, unsigned int *flags) | ||
| 37 | { | ||
| 38 | return NULL; | ||
| 39 | } | ||
| 40 | #endif /* CONFIG_PCI */ | ||
| 41 | |||
| 42 | |||
| 43 | #endif /* __OF_ADDRESS_H */ | ||
| 44 | |||
diff --git a/include/linux/of_device.h b/include/linux/of_device.h index 11651facc5f1..35aa44ad9f2c 100644 --- a/include/linux/of_device.h +++ b/include/linux/of_device.h | |||
| @@ -1,32 +1,77 @@ | |||
| 1 | #ifndef _LINUX_OF_DEVICE_H | 1 | #ifndef _LINUX_OF_DEVICE_H |
| 2 | #define _LINUX_OF_DEVICE_H | 2 | #define _LINUX_OF_DEVICE_H |
| 3 | 3 | ||
| 4 | /* | ||
| 5 | * The of_device *was* a kind of "base class" that was a superset of | ||
| 6 | * struct device for use by devices attached to an OF node and probed | ||
| 7 | * using OF properties. However, the important bit of OF-style | ||
| 8 | * probing, namely the device node pointer, has been moved into the | ||
| 9 | * common struct device when CONFIG_OF is set to make OF-style probing | ||
| 10 | * available to all bus types. So now, just make of_device and | ||
| 11 | * platform_device equivalent so that current of_platform bus users | ||
| 12 | * can be transparently migrated over to using the platform bus. | ||
| 13 | * | ||
| 14 | * This line will go away once all references to of_device are removed | ||
| 15 | * from the kernel. | ||
| 16 | */ | ||
| 17 | #define of_device platform_device | ||
| 18 | #include <linux/platform_device.h> | ||
| 19 | #include <linux/of_platform.h> /* temporary until merge */ | ||
| 20 | |||
| 4 | #ifdef CONFIG_OF_DEVICE | 21 | #ifdef CONFIG_OF_DEVICE |
| 5 | #include <linux/device.h> | 22 | #include <linux/device.h> |
| 6 | #include <linux/of.h> | 23 | #include <linux/of.h> |
| 7 | #include <linux/mod_devicetable.h> | 24 | #include <linux/mod_devicetable.h> |
| 8 | 25 | ||
| 9 | #include <asm/of_device.h> | ||
| 10 | |||
| 11 | #define to_of_device(d) container_of(d, struct of_device, dev) | 26 | #define to_of_device(d) container_of(d, struct of_device, dev) |
| 12 | 27 | ||
| 13 | extern const struct of_device_id *of_match_device( | 28 | extern const struct of_device_id *of_match_device( |
| 14 | const struct of_device_id *matches, const struct device *dev); | 29 | const struct of_device_id *matches, const struct device *dev); |
| 30 | extern void of_device_make_bus_id(struct device *dev); | ||
| 31 | |||
| 32 | /** | ||
| 33 | * of_driver_match_device - Tell if a driver's of_match_table matches a device. | ||
| 34 | * @drv: the device_driver structure to test | ||
| 35 | * @dev: the device structure to match against | ||
| 36 | */ | ||
| 37 | static inline int of_driver_match_device(const struct device *dev, | ||
| 38 | const struct device_driver *drv) | ||
| 39 | { | ||
| 40 | return of_match_device(drv->of_match_table, dev) != NULL; | ||
| 41 | } | ||
| 15 | 42 | ||
| 16 | extern struct of_device *of_dev_get(struct of_device *dev); | 43 | extern struct platform_device *of_dev_get(struct platform_device *dev); |
| 17 | extern void of_dev_put(struct of_device *dev); | 44 | extern void of_dev_put(struct platform_device *dev); |
| 18 | 45 | ||
| 19 | extern int of_device_register(struct of_device *ofdev); | 46 | extern int of_device_register(struct platform_device *ofdev); |
| 20 | extern void of_device_unregister(struct of_device *ofdev); | 47 | extern void of_device_unregister(struct platform_device *ofdev); |
| 21 | extern void of_release_dev(struct device *dev); | 48 | extern void of_release_dev(struct device *dev); |
| 22 | 49 | ||
| 23 | static inline void of_device_free(struct of_device *dev) | 50 | static inline void of_device_free(struct platform_device *dev) |
| 24 | { | 51 | { |
| 25 | of_release_dev(&dev->dev); | 52 | of_release_dev(&dev->dev); |
| 26 | } | 53 | } |
| 27 | 54 | ||
| 28 | extern ssize_t of_device_get_modalias(struct of_device *ofdev, | 55 | extern ssize_t of_device_get_modalias(struct device *dev, |
| 29 | char *str, ssize_t len); | 56 | char *str, ssize_t len); |
| 57 | |||
| 58 | extern int of_device_uevent(struct device *dev, struct kobj_uevent_env *env); | ||
| 59 | |||
| 60 | |||
| 61 | #else /* CONFIG_OF_DEVICE */ | ||
| 62 | |||
| 63 | static inline int of_driver_match_device(struct device *dev, | ||
| 64 | struct device_driver *drv) | ||
| 65 | { | ||
| 66 | return 0; | ||
| 67 | } | ||
| 68 | |||
| 69 | static inline int of_device_uevent(struct device *dev, | ||
| 70 | struct kobj_uevent_env *env) | ||
| 71 | { | ||
| 72 | return -ENODEV; | ||
| 73 | } | ||
| 74 | |||
| 30 | #endif /* CONFIG_OF_DEVICE */ | 75 | #endif /* CONFIG_OF_DEVICE */ |
| 31 | 76 | ||
| 32 | #endif /* _LINUX_OF_DEVICE_H */ | 77 | #endif /* _LINUX_OF_DEVICE_H */ |
diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h index fc2472c3c254..6598c04dab01 100644 --- a/include/linux/of_gpio.h +++ b/include/linux/of_gpio.h | |||
| @@ -33,34 +33,17 @@ enum of_gpio_flags { | |||
| 33 | #ifdef CONFIG_OF_GPIO | 33 | #ifdef CONFIG_OF_GPIO |
| 34 | 34 | ||
| 35 | /* | 35 | /* |
| 36 | * Generic OF GPIO chip | ||
| 37 | */ | ||
| 38 | struct of_gpio_chip { | ||
| 39 | struct gpio_chip gc; | ||
| 40 | int gpio_cells; | ||
| 41 | int (*xlate)(struct of_gpio_chip *of_gc, struct device_node *np, | ||
| 42 | const void *gpio_spec, enum of_gpio_flags *flags); | ||
| 43 | }; | ||
| 44 | |||
| 45 | static inline struct of_gpio_chip *to_of_gpio_chip(struct gpio_chip *gc) | ||
| 46 | { | ||
| 47 | return container_of(gc, struct of_gpio_chip, gc); | ||
| 48 | } | ||
| 49 | |||
| 50 | /* | ||
| 51 | * OF GPIO chip for memory mapped banks | 36 | * OF GPIO chip for memory mapped banks |
| 52 | */ | 37 | */ |
| 53 | struct of_mm_gpio_chip { | 38 | struct of_mm_gpio_chip { |
| 54 | struct of_gpio_chip of_gc; | 39 | struct gpio_chip gc; |
| 55 | void (*save_regs)(struct of_mm_gpio_chip *mm_gc); | 40 | void (*save_regs)(struct of_mm_gpio_chip *mm_gc); |
| 56 | void __iomem *regs; | 41 | void __iomem *regs; |
| 57 | }; | 42 | }; |
| 58 | 43 | ||
| 59 | static inline struct of_mm_gpio_chip *to_of_mm_gpio_chip(struct gpio_chip *gc) | 44 | static inline struct of_mm_gpio_chip *to_of_mm_gpio_chip(struct gpio_chip *gc) |
| 60 | { | 45 | { |
| 61 | struct of_gpio_chip *of_gc = to_of_gpio_chip(gc); | 46 | return container_of(gc, struct of_mm_gpio_chip, gc); |
| 62 | |||
| 63 | return container_of(of_gc, struct of_mm_gpio_chip, of_gc); | ||
| 64 | } | 47 | } |
| 65 | 48 | ||
| 66 | extern int of_get_gpio_flags(struct device_node *np, int index, | 49 | extern int of_get_gpio_flags(struct device_node *np, int index, |
| @@ -69,11 +52,12 @@ extern unsigned int of_gpio_count(struct device_node *np); | |||
| 69 | 52 | ||
| 70 | extern int of_mm_gpiochip_add(struct device_node *np, | 53 | extern int of_mm_gpiochip_add(struct device_node *np, |
| 71 | struct of_mm_gpio_chip *mm_gc); | 54 | struct of_mm_gpio_chip *mm_gc); |
| 72 | extern int of_gpio_simple_xlate(struct of_gpio_chip *of_gc, | 55 | |
| 73 | struct device_node *np, | 56 | extern void of_gpiochip_add(struct gpio_chip *gc); |
| 74 | const void *gpio_spec, | 57 | extern void of_gpiochip_remove(struct gpio_chip *gc); |
| 75 | enum of_gpio_flags *flags); | 58 | extern struct gpio_chip *of_node_to_gpiochip(struct device_node *np); |
| 76 | #else | 59 | |
| 60 | #else /* CONFIG_OF_GPIO */ | ||
| 77 | 61 | ||
| 78 | /* Drivers may not strictly depend on the GPIO support, so let them link. */ | 62 | /* Drivers may not strictly depend on the GPIO support, so let them link. */ |
| 79 | static inline int of_get_gpio_flags(struct device_node *np, int index, | 63 | static inline int of_get_gpio_flags(struct device_node *np, int index, |
| @@ -87,6 +71,9 @@ static inline unsigned int of_gpio_count(struct device_node *np) | |||
| 87 | return 0; | 71 | return 0; |
| 88 | } | 72 | } |
| 89 | 73 | ||
| 74 | static inline void of_gpiochip_add(struct gpio_chip *gc) { } | ||
| 75 | static inline void of_gpiochip_remove(struct gpio_chip *gc) { } | ||
| 76 | |||
| 90 | #endif /* CONFIG_OF_GPIO */ | 77 | #endif /* CONFIG_OF_GPIO */ |
| 91 | 78 | ||
| 92 | /** | 79 | /** |
diff --git a/include/linux/of_i2c.h b/include/linux/of_i2c.h index 34974b5a76f7..0efe8d465f55 100644 --- a/include/linux/of_i2c.h +++ b/include/linux/of_i2c.h | |||
| @@ -12,12 +12,19 @@ | |||
| 12 | #ifndef __LINUX_OF_I2C_H | 12 | #ifndef __LINUX_OF_I2C_H |
| 13 | #define __LINUX_OF_I2C_H | 13 | #define __LINUX_OF_I2C_H |
| 14 | 14 | ||
| 15 | #if defined(CONFIG_OF_I2C) || defined(CONFIG_OF_I2C_MODULE) | ||
| 15 | #include <linux/i2c.h> | 16 | #include <linux/i2c.h> |
| 16 | 17 | ||
| 17 | void of_register_i2c_devices(struct i2c_adapter *adap, | 18 | extern void of_i2c_register_devices(struct i2c_adapter *adap); |
| 18 | struct device_node *adap_node); | ||
| 19 | 19 | ||
| 20 | /* must call put_device() when done with returned i2c_client device */ | 20 | /* must call put_device() when done with returned i2c_client device */ |
| 21 | struct i2c_client *of_find_i2c_device_by_node(struct device_node *node); | 21 | extern struct i2c_client *of_find_i2c_device_by_node(struct device_node *node); |
| 22 | |||
| 23 | #else | ||
| 24 | static inline void of_i2c_register_devices(struct i2c_adapter *adap) | ||
| 25 | { | ||
| 26 | return; | ||
| 27 | } | ||
| 28 | #endif /* CONFIG_OF_I2C */ | ||
| 22 | 29 | ||
| 23 | #endif /* __LINUX_OF_I2C_H */ | 30 | #endif /* __LINUX_OF_I2C_H */ |
diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h new file mode 100644 index 000000000000..5929781c104d --- /dev/null +++ b/include/linux/of_irq.h | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | #ifndef __OF_IRQ_H | ||
| 2 | #define __OF_IRQ_H | ||
| 3 | |||
| 4 | #if defined(CONFIG_OF) | ||
| 5 | struct of_irq; | ||
| 6 | #include <linux/types.h> | ||
| 7 | #include <linux/errno.h> | ||
| 8 | #include <linux/ioport.h> | ||
| 9 | #include <linux/of.h> | ||
| 10 | |||
| 11 | /* | ||
| 12 | * irq_of_parse_and_map() is used ba all OF enabled platforms; but SPARC | ||
| 13 | * implements it differently. However, the prototype is the same for all, | ||
| 14 | * so declare it here regardless of the CONFIG_OF_IRQ setting. | ||
| 15 | */ | ||
| 16 | extern unsigned int irq_of_parse_and_map(struct device_node *node, int index); | ||
| 17 | |||
| 18 | #if defined(CONFIG_OF_IRQ) | ||
| 19 | /** | ||
| 20 | * of_irq - container for device_node/irq_specifier pair for an irq controller | ||
| 21 | * @controller: pointer to interrupt controller device tree node | ||
| 22 | * @size: size of interrupt specifier | ||
| 23 | * @specifier: array of cells @size long specifing the specific interrupt | ||
| 24 | * | ||
| 25 | * This structure is returned when an interrupt is mapped. The controller | ||
| 26 | * field needs to be put() after use | ||
| 27 | */ | ||
| 28 | #define OF_MAX_IRQ_SPEC 4 /* We handle specifiers of at most 4 cells */ | ||
| 29 | struct of_irq { | ||
| 30 | struct device_node *controller; /* Interrupt controller node */ | ||
| 31 | u32 size; /* Specifier size */ | ||
| 32 | u32 specifier[OF_MAX_IRQ_SPEC]; /* Specifier copy */ | ||
| 33 | }; | ||
| 34 | |||
| 35 | /* | ||
| 36 | * Workarounds only applied to 32bit powermac machines | ||
| 37 | */ | ||
| 38 | #define OF_IMAP_OLDWORLD_MAC 0x00000001 | ||
| 39 | #define OF_IMAP_NO_PHANDLE 0x00000002 | ||
| 40 | |||
| 41 | #if defined(CONFIG_PPC32) && defined(CONFIG_PPC_PMAC) | ||
| 42 | extern unsigned int of_irq_workarounds; | ||
| 43 | extern struct device_node *of_irq_dflt_pic; | ||
| 44 | extern int of_irq_map_oldworld(struct device_node *device, int index, | ||
| 45 | struct of_irq *out_irq); | ||
| 46 | #else /* CONFIG_PPC32 && CONFIG_PPC_PMAC */ | ||
| 47 | #define of_irq_workarounds (0) | ||
| 48 | #define of_irq_dflt_pic (NULL) | ||
| 49 | static inline int of_irq_map_oldworld(struct device_node *device, int index, | ||
| 50 | struct of_irq *out_irq) | ||
| 51 | { | ||
| 52 | return -EINVAL; | ||
| 53 | } | ||
| 54 | #endif /* CONFIG_PPC32 && CONFIG_PPC_PMAC */ | ||
| 55 | |||
| 56 | |||
| 57 | extern int of_irq_map_raw(struct device_node *parent, const u32 *intspec, | ||
| 58 | u32 ointsize, const u32 *addr, | ||
| 59 | struct of_irq *out_irq); | ||
| 60 | extern int of_irq_map_one(struct device_node *device, int index, | ||
| 61 | struct of_irq *out_irq); | ||
| 62 | extern unsigned int irq_create_of_mapping(struct device_node *controller, | ||
| 63 | const u32 *intspec, | ||
| 64 | unsigned int intsize); | ||
| 65 | extern int of_irq_to_resource(struct device_node *dev, int index, | ||
| 66 | struct resource *r); | ||
| 67 | |||
| 68 | #endif /* CONFIG_OF_IRQ */ | ||
| 69 | #endif /* CONFIG_OF */ | ||
| 70 | #endif /* __OF_IRQ_H */ | ||
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h index 1643d3761eb4..4e6d989c06df 100644 --- a/include/linux/of_platform.h +++ b/include/linux/of_platform.h | |||
| @@ -17,29 +17,24 @@ | |||
| 17 | #include <linux/mod_devicetable.h> | 17 | #include <linux/mod_devicetable.h> |
| 18 | #include <linux/pm.h> | 18 | #include <linux/pm.h> |
| 19 | #include <linux/of_device.h> | 19 | #include <linux/of_device.h> |
| 20 | 20 | #include <linux/platform_device.h> | |
| 21 | /* | ||
| 22 | * The of_platform_bus_type is a bus type used by drivers that do not | ||
| 23 | * attach to a macio or similar bus but still use OF probing | ||
| 24 | * mechanism | ||
| 25 | */ | ||
| 26 | extern struct bus_type of_platform_bus_type; | ||
| 27 | 21 | ||
| 28 | /* | 22 | /* |
| 29 | * An of_platform_driver driver is attached to a basic of_device on | 23 | * An of_platform_driver driver is attached to a basic of_device on |
| 30 | * the "platform bus" (of_platform_bus_type). | 24 | * the "platform bus" (platform_bus_type). |
| 31 | */ | 25 | */ |
| 32 | struct of_platform_driver | 26 | struct of_platform_driver |
| 33 | { | 27 | { |
| 34 | int (*probe)(struct of_device* dev, | 28 | int (*probe)(struct platform_device* dev, |
| 35 | const struct of_device_id *match); | 29 | const struct of_device_id *match); |
| 36 | int (*remove)(struct of_device* dev); | 30 | int (*remove)(struct platform_device* dev); |
| 37 | 31 | ||
| 38 | int (*suspend)(struct of_device* dev, pm_message_t state); | 32 | int (*suspend)(struct platform_device* dev, pm_message_t state); |
| 39 | int (*resume)(struct of_device* dev); | 33 | int (*resume)(struct platform_device* dev); |
| 40 | int (*shutdown)(struct of_device* dev); | 34 | int (*shutdown)(struct platform_device* dev); |
| 41 | 35 | ||
| 42 | struct device_driver driver; | 36 | struct device_driver driver; |
| 37 | struct platform_driver platform_driver; | ||
| 43 | }; | 38 | }; |
| 44 | #define to_of_platform_driver(drv) \ | 39 | #define to_of_platform_driver(drv) \ |
| 45 | container_of(drv,struct of_platform_driver, driver) | 40 | container_of(drv,struct of_platform_driver, driver) |
| @@ -49,20 +44,30 @@ extern int of_register_driver(struct of_platform_driver *drv, | |||
| 49 | extern void of_unregister_driver(struct of_platform_driver *drv); | 44 | extern void of_unregister_driver(struct of_platform_driver *drv); |
| 50 | 45 | ||
| 51 | /* Platform drivers register/unregister */ | 46 | /* Platform drivers register/unregister */ |
| 52 | static inline int of_register_platform_driver(struct of_platform_driver *drv) | 47 | extern int of_register_platform_driver(struct of_platform_driver *drv); |
| 53 | { | 48 | extern void of_unregister_platform_driver(struct of_platform_driver *drv); |
| 54 | return of_register_driver(drv, &of_platform_bus_type); | ||
| 55 | } | ||
| 56 | static inline void of_unregister_platform_driver(struct of_platform_driver *drv) | ||
| 57 | { | ||
| 58 | of_unregister_driver(drv); | ||
| 59 | } | ||
| 60 | 49 | ||
| 61 | #include <asm/of_platform.h> | 50 | extern struct platform_device *of_device_alloc(struct device_node *np, |
| 62 | 51 | const char *bus_id, | |
| 63 | extern struct of_device *of_find_device_by_node(struct device_node *np); | 52 | struct device *parent); |
| 53 | extern struct platform_device *of_find_device_by_node(struct device_node *np); | ||
| 64 | 54 | ||
| 65 | extern int of_bus_type_init(struct bus_type *bus, const char *name); | 55 | extern int of_bus_type_init(struct bus_type *bus, const char *name); |
| 56 | |||
| 57 | #if !defined(CONFIG_SPARC) /* SPARC has its own device registration method */ | ||
| 58 | /* Platform devices and busses creation */ | ||
| 59 | extern struct platform_device *of_platform_device_create(struct device_node *np, | ||
| 60 | const char *bus_id, | ||
| 61 | struct device *parent); | ||
| 62 | |||
| 63 | /* pseudo "matches" value to not do deep probe */ | ||
| 64 | #define OF_NO_DEEP_PROBE ((struct of_device_id *)-1) | ||
| 65 | |||
| 66 | extern int of_platform_bus_probe(struct device_node *root, | ||
| 67 | const struct of_device_id *matches, | ||
| 68 | struct device *parent); | ||
| 69 | #endif /* !CONFIG_SPARC */ | ||
| 70 | |||
| 66 | #endif /* CONFIG_OF_DEVICE */ | 71 | #endif /* CONFIG_OF_DEVICE */ |
| 67 | 72 | ||
| 68 | #endif /* _LINUX_OF_PLATFORM_H */ | 73 | #endif /* _LINUX_OF_PLATFORM_H */ |
diff --git a/include/linux/of_spi.h b/include/linux/of_spi.h index 5f71ee8c0868..9e3e70f78ae6 100644 --- a/include/linux/of_spi.h +++ b/include/linux/of_spi.h | |||
| @@ -9,10 +9,15 @@ | |||
| 9 | #ifndef __LINUX_OF_SPI_H | 9 | #ifndef __LINUX_OF_SPI_H |
| 10 | #define __LINUX_OF_SPI_H | 10 | #define __LINUX_OF_SPI_H |
| 11 | 11 | ||
| 12 | #include <linux/of.h> | ||
| 13 | #include <linux/spi/spi.h> | 12 | #include <linux/spi/spi.h> |
| 14 | 13 | ||
| 15 | extern void of_register_spi_devices(struct spi_master *master, | 14 | #if defined(CONFIG_OF_SPI) || defined(CONFIG_OF_SPI_MODULE) |
| 16 | struct device_node *np); | 15 | extern void of_register_spi_devices(struct spi_master *master); |
| 16 | #else | ||
| 17 | static inline void of_register_spi_devices(struct spi_master *master) | ||
| 18 | { | ||
| 19 | return; | ||
| 20 | } | ||
| 21 | #endif /* CONFIG_OF_SPI */ | ||
| 17 | 22 | ||
| 18 | #endif /* __LINUX_OF_SPI */ | 23 | #endif /* __LINUX_OF_SPI */ |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index e69612cace61..40c804d484ca 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -2264,6 +2264,7 @@ | |||
| 2264 | #define PCI_DEVICE_ID_TDI_EHCI 0x0101 | 2264 | #define PCI_DEVICE_ID_TDI_EHCI 0x0101 |
| 2265 | 2265 | ||
| 2266 | #define PCI_VENDOR_ID_FREESCALE 0x1957 | 2266 | #define PCI_VENDOR_ID_FREESCALE 0x1957 |
| 2267 | #define PCI_DEVICE_ID_MPC8308 0xc006 | ||
| 2267 | #define PCI_DEVICE_ID_MPC8315E 0x00b4 | 2268 | #define PCI_DEVICE_ID_MPC8315E 0x00b4 |
| 2268 | #define PCI_DEVICE_ID_MPC8315 0x00b5 | 2269 | #define PCI_DEVICE_ID_MPC8315 0x00b5 |
| 2269 | #define PCI_DEVICE_ID_MPC8314E 0x00b6 | 2270 | #define PCI_DEVICE_ID_MPC8314E 0x00b6 |
| @@ -2772,3 +2773,6 @@ | |||
| 2772 | #define PCI_DEVICE_ID_RME_DIGI32 0x9896 | 2773 | #define PCI_DEVICE_ID_RME_DIGI32 0x9896 |
| 2773 | #define PCI_DEVICE_ID_RME_DIGI32_PRO 0x9897 | 2774 | #define PCI_DEVICE_ID_RME_DIGI32_PRO 0x9897 |
| 2774 | #define PCI_DEVICE_ID_RME_DIGI32_8 0x9898 | 2775 | #define PCI_DEVICE_ID_RME_DIGI32_8 0x9898 |
| 2776 | |||
| 2777 | #define PCI_VENDOR_ID_XEN 0x5853 | ||
| 2778 | #define PCI_DEVICE_ID_XEN_PLATFORM 0x0001 | ||
diff --git a/include/linux/power/jz4740-battery.h b/include/linux/power/jz4740-battery.h new file mode 100644 index 000000000000..19c9610c720a --- /dev/null +++ b/include/linux/power/jz4740-battery.h | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2009, Jiejing Zhang <kzjeef@gmail.com> | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify it | ||
| 5 | * under the terms of the GNU General Public License as published by the | ||
| 6 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 7 | * option) any later version. | ||
| 8 | * | ||
| 9 | * You should have received a copy of the GNU General Public License along | ||
| 10 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 11 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 12 | * | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __JZ4740_BATTERY_H | ||
| 16 | #define __JZ4740_BATTERY_H | ||
| 17 | |||
| 18 | struct jz_battery_platform_data { | ||
| 19 | struct power_supply_info info; | ||
| 20 | int gpio_charge; /* GPIO port of Charger state */ | ||
| 21 | int gpio_charge_active_low; | ||
| 22 | }; | ||
| 23 | |||
| 24 | #endif | ||
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index f10db6e5f3b5..522832023a69 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
| @@ -186,6 +186,9 @@ | |||
| 186 | #define PORT_ALTERA_JTAGUART 91 | 186 | #define PORT_ALTERA_JTAGUART 91 |
| 187 | #define PORT_ALTERA_UART 92 | 187 | #define PORT_ALTERA_UART 92 |
| 188 | 188 | ||
| 189 | /* SH-SCI */ | ||
| 190 | #define PORT_SCIFB 93 | ||
| 191 | |||
| 189 | #ifdef __KERNEL__ | 192 | #ifdef __KERNEL__ |
| 190 | 193 | ||
| 191 | #include <linux/compiler.h> | 194 | #include <linux/compiler.h> |
diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h index 1636d1e2a5f1..875ce50719a9 100644 --- a/include/linux/sh_clk.h +++ b/include/linux/sh_clk.h | |||
| @@ -25,6 +25,10 @@ struct clk { | |||
| 25 | int id; | 25 | int id; |
| 26 | 26 | ||
| 27 | struct clk *parent; | 27 | struct clk *parent; |
| 28 | struct clk **parent_table; /* list of parents to */ | ||
| 29 | unsigned short parent_num; /* choose between */ | ||
| 30 | unsigned char src_shift; /* source clock field in the */ | ||
| 31 | unsigned char src_width; /* configuration register */ | ||
| 28 | struct clk_ops *ops; | 32 | struct clk_ops *ops; |
| 29 | 33 | ||
| 30 | struct list_head children; | 34 | struct list_head children; |
| @@ -138,13 +142,22 @@ int sh_clk_div4_enable_register(struct clk *clks, int nr, | |||
| 138 | int sh_clk_div4_reparent_register(struct clk *clks, int nr, | 142 | int sh_clk_div4_reparent_register(struct clk *clks, int nr, |
| 139 | struct clk_div4_table *table); | 143 | struct clk_div4_table *table); |
| 140 | 144 | ||
| 141 | #define SH_CLK_DIV6(_parent, _reg, _flags) \ | 145 | #define SH_CLK_DIV6_EXT(_parent, _reg, _flags, _parents, \ |
| 142 | { \ | 146 | _num_parents, _src_shift, _src_width) \ |
| 143 | .parent = _parent, \ | 147 | { \ |
| 144 | .enable_reg = (void __iomem *)_reg, \ | 148 | .parent = _parent, \ |
| 145 | .flags = _flags, \ | 149 | .enable_reg = (void __iomem *)_reg, \ |
| 150 | .flags = _flags, \ | ||
| 151 | .parent_table = _parents, \ | ||
| 152 | .parent_num = _num_parents, \ | ||
| 153 | .src_shift = _src_shift, \ | ||
| 154 | .src_width = _src_width, \ | ||
| 146 | } | 155 | } |
| 147 | 156 | ||
| 157 | #define SH_CLK_DIV6(_parent, _reg, _flags) \ | ||
| 158 | SH_CLK_DIV6_EXT(_parent, _reg, _flags, NULL, 0, 0, 0) | ||
| 159 | |||
| 148 | int sh_clk_div6_register(struct clk *clks, int nr); | 160 | int sh_clk_div6_register(struct clk *clks, int nr); |
| 161 | int sh_clk_div6_reparent_register(struct clk *clks, int nr); | ||
| 149 | 162 | ||
| 150 | #endif /* __SH_CLOCK_H */ | 163 | #endif /* __SH_CLOCK_H */ |
diff --git a/include/linux/wm97xx_batt.h b/include/linux/wm97xx_batt.h deleted file mode 100644 index a1d6419c2ff8..000000000000 --- a/include/linux/wm97xx_batt.h +++ /dev/null | |||
| @@ -1,16 +0,0 @@ | |||
| 1 | #ifndef _LINUX_WM97XX_BAT_H | ||
| 2 | #define _LINUX_WM97XX_BAT_H | ||
| 3 | |||
| 4 | #include <linux/wm97xx.h> | ||
| 5 | |||
| 6 | #warning This file will be removed soon, use wm97xx.h instead! | ||
| 7 | |||
| 8 | #define wm97xx_batt_info wm97xx_batt_pdata | ||
| 9 | |||
| 10 | #ifdef CONFIG_BATTERY_WM97XX | ||
| 11 | void wm97xx_bat_set_pdata(struct wm97xx_batt_info *data); | ||
| 12 | #else | ||
| 13 | static inline void wm97xx_bat_set_pdata(struct wm97xx_batt_info *data) {} | ||
| 14 | #endif | ||
| 15 | |||
| 16 | #endif | ||
diff --git a/include/video/mipi_display.h b/include/video/mipi_display.h new file mode 100644 index 000000000000..ddcc8ca7316b --- /dev/null +++ b/include/video/mipi_display.h | |||
| @@ -0,0 +1,130 @@ | |||
| 1 | /* | ||
| 2 | * Defines for Mobile Industry Processor Interface (MIPI(R)) | ||
| 3 | * Display Working Group standards: DSI, DCS, DBI, DPI | ||
| 4 | * | ||
| 5 | * Copyright (C) 2010 Guennadi Liakhovetski <g.liakhovetski@gmx.de> | ||
| 6 | * Copyright (C) 2006 Nokia Corporation | ||
| 7 | * Author: Imre Deak <imre.deak@nokia.com> | ||
| 8 | * | ||
| 9 | * This program is free software; you can redistribute it and/or modify | ||
| 10 | * it under the terms of the GNU General Public License version 2 as | ||
| 11 | * published by the Free Software Foundation. | ||
| 12 | */ | ||
| 13 | #ifndef MIPI_DISPLAY_H | ||
| 14 | #define MIPI_DISPLAY_H | ||
| 15 | |||
| 16 | /* MIPI DSI Processor-to-Peripheral transaction types */ | ||
| 17 | enum { | ||
| 18 | MIPI_DSI_V_SYNC_START = 0x01, | ||
| 19 | MIPI_DSI_V_SYNC_END = 0x11, | ||
| 20 | MIPI_DSI_H_SYNC_START = 0x21, | ||
| 21 | MIPI_DSI_H_SYNC_END = 0x31, | ||
| 22 | |||
| 23 | MIPI_DSI_COLOR_MODE_OFF = 0x02, | ||
| 24 | MIPI_DSI_COLOR_MODE_ON = 0x12, | ||
| 25 | MIPI_DSI_SHUTDOWN_PERIPHERAL = 0x22, | ||
| 26 | MIPI_DSI_TURN_ON_PERIPHERAL = 0x32, | ||
| 27 | |||
| 28 | MIPI_DSI_GENERIC_SHORT_WRITE_0_PARAM = 0x03, | ||
| 29 | MIPI_DSI_GENERIC_SHORT_WRITE_1_PARAM = 0x13, | ||
| 30 | MIPI_DSI_GENERIC_SHORT_WRITE_2_PARAM = 0x23, | ||
| 31 | |||
| 32 | MIPI_DSI_GENERIC_READ_REQUEST_0_PARAM = 0x04, | ||
| 33 | MIPI_DSI_GENERIC_READ_REQUEST_1_PARAM = 0x14, | ||
| 34 | MIPI_DSI_GENERIC_READ_REQUEST_2_PARAM = 0x24, | ||
| 35 | |||
| 36 | MIPI_DSI_DCS_SHORT_WRITE = 0x05, | ||
| 37 | MIPI_DSI_DCS_SHORT_WRITE_PARAM = 0x15, | ||
| 38 | |||
| 39 | MIPI_DSI_DCS_READ = 0x06, | ||
| 40 | |||
| 41 | MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE = 0x37, | ||
| 42 | |||
| 43 | MIPI_DSI_END_OF_TRANSMISSION = 0x08, | ||
| 44 | |||
| 45 | MIPI_DSI_NULL_PACKET = 0x09, | ||
| 46 | MIPI_DSI_BLANKING_PACKET = 0x19, | ||
| 47 | MIPI_DSI_GENERIC_LONG_WRITE = 0x29, | ||
| 48 | MIPI_DSI_DCS_LONG_WRITE = 0x39, | ||
| 49 | |||
| 50 | MIPI_DSI_LOOSELY_PACKED_PIXEL_STREAM_YCBCR20 = 0x0c, | ||
| 51 | MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR24 = 0x1c, | ||
| 52 | MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR16 = 0x2c, | ||
| 53 | |||
| 54 | MIPI_DSI_PACKED_PIXEL_STREAM_30 = 0x0d, | ||
| 55 | MIPI_DSI_PACKED_PIXEL_STREAM_36 = 0x1d, | ||
| 56 | MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR12 = 0x3d, | ||
| 57 | |||
| 58 | MIPI_DSI_PACKED_PIXEL_STREAM_16 = 0x0e, | ||
| 59 | MIPI_DSI_PACKED_PIXEL_STREAM_18 = 0x1e, | ||
| 60 | MIPI_DSI_PIXEL_STREAM_3BYTE_18 = 0x2e, | ||
| 61 | MIPI_DSI_PACKED_PIXEL_STREAM_24 = 0x3e, | ||
| 62 | }; | ||
| 63 | |||
| 64 | /* MIPI DSI Peripheral-to-Processor transaction types */ | ||
| 65 | enum { | ||
| 66 | MIPI_DSI_RX_ACKNOWLEDGE_AND_ERROR_REPORT = 0x02, | ||
| 67 | MIPI_DSI_RX_END_OF_TRANSMISSION = 0x08, | ||
| 68 | MIPI_DSI_RX_GENERIC_SHORT_READ_RESPONSE_1BYTE = 0x11, | ||
| 69 | MIPI_DSI_RX_GENERIC_SHORT_READ_RESPONSE_2BYTE = 0x12, | ||
| 70 | MIPI_DSI_RX_GENERIC_LONG_READ_RESPONSE = 0x1a, | ||
| 71 | MIPI_DSI_RX_DCS_LONG_READ_RESPONSE = 0x1c, | ||
| 72 | MIPI_DSI_RX_DCS_SHORT_READ_RESPONSE_1BYTE = 0x21, | ||
| 73 | MIPI_DSI_RX_DCS_SHORT_READ_RESPONSE_2BYTE = 0x22, | ||
| 74 | }; | ||
| 75 | |||
| 76 | /* MIPI DCS commands */ | ||
| 77 | enum { | ||
| 78 | MIPI_DCS_NOP = 0x00, | ||
| 79 | MIPI_DCS_SOFT_RESET = 0x01, | ||
| 80 | MIPI_DCS_GET_DISPLAY_ID = 0x04, | ||
| 81 | MIPI_DCS_GET_RED_CHANNEL = 0x06, | ||
| 82 | MIPI_DCS_GET_GREEN_CHANNEL = 0x07, | ||
| 83 | MIPI_DCS_GET_BLUE_CHANNEL = 0x08, | ||
| 84 | MIPI_DCS_GET_DISPLAY_STATUS = 0x09, | ||
| 85 | MIPI_DCS_GET_POWER_MODE = 0x0A, | ||
| 86 | MIPI_DCS_GET_ADDRESS_MODE = 0x0B, | ||
| 87 | MIPI_DCS_GET_PIXEL_FORMAT = 0x0C, | ||
| 88 | MIPI_DCS_GET_DISPLAY_MODE = 0x0D, | ||
| 89 | MIPI_DCS_GET_SIGNAL_MODE = 0x0E, | ||
| 90 | MIPI_DCS_GET_DIAGNOSTIC_RESULT = 0x0F, | ||
| 91 | MIPI_DCS_ENTER_SLEEP_MODE = 0x10, | ||
| 92 | MIPI_DCS_EXIT_SLEEP_MODE = 0x11, | ||
| 93 | MIPI_DCS_ENTER_PARTIAL_MODE = 0x12, | ||
| 94 | MIPI_DCS_ENTER_NORMAL_MODE = 0x13, | ||
| 95 | MIPI_DCS_EXIT_INVERT_MODE = 0x20, | ||
| 96 | MIPI_DCS_ENTER_INVERT_MODE = 0x21, | ||
| 97 | MIPI_DCS_SET_GAMMA_CURVE = 0x26, | ||
| 98 | MIPI_DCS_SET_DISPLAY_OFF = 0x28, | ||
| 99 | MIPI_DCS_SET_DISPLAY_ON = 0x29, | ||
| 100 | MIPI_DCS_SET_COLUMN_ADDRESS = 0x2A, | ||
| 101 | MIPI_DCS_SET_PAGE_ADDRESS = 0x2B, | ||
| 102 | MIPI_DCS_WRITE_MEMORY_START = 0x2C, | ||
| 103 | MIPI_DCS_WRITE_LUT = 0x2D, | ||
| 104 | MIPI_DCS_READ_MEMORY_START = 0x2E, | ||
| 105 | MIPI_DCS_SET_PARTIAL_AREA = 0x30, | ||
| 106 | MIPI_DCS_SET_SCROLL_AREA = 0x33, | ||
| 107 | MIPI_DCS_SET_TEAR_OFF = 0x34, | ||
| 108 | MIPI_DCS_SET_TEAR_ON = 0x35, | ||
| 109 | MIPI_DCS_SET_ADDRESS_MODE = 0x36, | ||
| 110 | MIPI_DCS_SET_SCROLL_START = 0x37, | ||
| 111 | MIPI_DCS_EXIT_IDLE_MODE = 0x38, | ||
| 112 | MIPI_DCS_ENTER_IDLE_MODE = 0x39, | ||
| 113 | MIPI_DCS_SET_PIXEL_FORMAT = 0x3A, | ||
| 114 | MIPI_DCS_WRITE_MEMORY_CONTINUE = 0x3C, | ||
| 115 | MIPI_DCS_READ_MEMORY_CONTINUE = 0x3E, | ||
| 116 | MIPI_DCS_SET_TEAR_SCANLINE = 0x44, | ||
| 117 | MIPI_DCS_GET_SCANLINE = 0x45, | ||
| 118 | MIPI_DCS_READ_DDB_START = 0xA1, | ||
| 119 | MIPI_DCS_READ_DDB_CONTINUE = 0xA8, | ||
| 120 | }; | ||
| 121 | |||
| 122 | /* MIPI DCS pixel formats */ | ||
| 123 | #define MIPI_DCS_PIXEL_FMT_24BIT 7 | ||
| 124 | #define MIPI_DCS_PIXEL_FMT_18BIT 6 | ||
| 125 | #define MIPI_DCS_PIXEL_FMT_16BIT 5 | ||
| 126 | #define MIPI_DCS_PIXEL_FMT_12BIT 3 | ||
| 127 | #define MIPI_DCS_PIXEL_FMT_8BIT 2 | ||
| 128 | #define MIPI_DCS_PIXEL_FMT_3BIT 1 | ||
| 129 | |||
| 130 | #endif | ||
diff --git a/include/video/sh_mipi_dsi.h b/include/video/sh_mipi_dsi.h new file mode 100644 index 000000000000..18bca08f9f59 --- /dev/null +++ b/include/video/sh_mipi_dsi.h | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | /* | ||
| 2 | * Public SH-mobile MIPI DSI header | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010 Guennadi Liakhovetski <g.liakhovetski@gmx.de> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | #ifndef VIDEO_SH_MIPI_DSI_H | ||
| 11 | #define VIDEO_SH_MIPI_DSI_H | ||
| 12 | |||
| 13 | enum sh_mipi_dsi_data_fmt { | ||
| 14 | MIPI_RGB888, | ||
| 15 | MIPI_RGB565, | ||
| 16 | MIPI_RGB666_LP, | ||
| 17 | MIPI_RGB666, | ||
| 18 | MIPI_BGR888, | ||
| 19 | MIPI_BGR565, | ||
| 20 | MIPI_BGR666_LP, | ||
| 21 | MIPI_BGR666, | ||
| 22 | MIPI_YUYV, | ||
| 23 | MIPI_UYVY, | ||
| 24 | MIPI_YUV420_L, | ||
| 25 | MIPI_YUV420, | ||
| 26 | }; | ||
| 27 | |||
| 28 | struct sh_mobile_lcdc_chan_cfg; | ||
| 29 | |||
| 30 | struct sh_mipi_dsi_info { | ||
| 31 | enum sh_mipi_dsi_data_fmt data_format; | ||
| 32 | struct sh_mobile_lcdc_chan_cfg *lcd_chan; | ||
| 33 | }; | ||
| 34 | |||
| 35 | #endif | ||
diff --git a/include/video/sh_mobile_hdmi.h b/include/video/sh_mobile_hdmi.h new file mode 100644 index 000000000000..577cf18cce89 --- /dev/null +++ b/include/video/sh_mobile_hdmi.h | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | /* | ||
| 2 | * SH-Mobile High-Definition Multimedia Interface (HDMI) | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010, Guennadi Liakhovetski <g.liakhovetski@gmx.de> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef SH_MOBILE_HDMI_H | ||
| 12 | #define SH_MOBILE_HDMI_H | ||
| 13 | |||
| 14 | struct sh_mobile_lcdc_chan_cfg; | ||
| 15 | struct device; | ||
| 16 | |||
| 17 | struct sh_mobile_hdmi_info { | ||
| 18 | struct sh_mobile_lcdc_chan_cfg *lcd_chan; | ||
| 19 | struct device *lcd_dev; | ||
| 20 | }; | ||
| 21 | |||
| 22 | #endif | ||
diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h index 288205457713..55d700e8566e 100644 --- a/include/video/sh_mobile_lcdc.h +++ b/include/video/sh_mobile_lcdc.h | |||
| @@ -3,24 +3,27 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/fb.h> | 4 | #include <linux/fb.h> |
| 5 | 5 | ||
| 6 | enum { RGB8, /* 24bpp, 8:8:8 */ | 6 | enum { |
| 7 | RGB9, /* 18bpp, 9:9 */ | 7 | RGB8, /* 24bpp, 8:8:8 */ |
| 8 | RGB12A, /* 24bpp, 12:12 */ | 8 | RGB9, /* 18bpp, 9:9 */ |
| 9 | RGB12B, /* 12bpp */ | 9 | RGB12A, /* 24bpp, 12:12 */ |
| 10 | RGB16, /* 16bpp */ | 10 | RGB12B, /* 12bpp */ |
| 11 | RGB18, /* 18bpp */ | 11 | RGB16, /* 16bpp */ |
| 12 | RGB24, /* 24bpp */ | 12 | RGB18, /* 18bpp */ |
| 13 | SYS8A, /* 24bpp, 8:8:8 */ | 13 | RGB24, /* 24bpp */ |
| 14 | SYS8B, /* 18bpp, 8:8:2 */ | 14 | YUV422, /* 16bpp */ |
| 15 | SYS8C, /* 18bpp, 2:8:8 */ | 15 | SYS8A, /* 24bpp, 8:8:8 */ |
| 16 | SYS8D, /* 16bpp, 8:8 */ | 16 | SYS8B, /* 18bpp, 8:8:2 */ |
| 17 | SYS9, /* 18bpp, 9:9 */ | 17 | SYS8C, /* 18bpp, 2:8:8 */ |
| 18 | SYS12, /* 24bpp, 12:12 */ | 18 | SYS8D, /* 16bpp, 8:8 */ |
| 19 | SYS16A, /* 16bpp */ | 19 | SYS9, /* 18bpp, 9:9 */ |
| 20 | SYS16B, /* 18bpp, 16:2 */ | 20 | SYS12, /* 24bpp, 12:12 */ |
| 21 | SYS16C, /* 18bpp, 2:16 */ | 21 | SYS16A, /* 16bpp */ |
| 22 | SYS18, /* 18bpp */ | 22 | SYS16B, /* 18bpp, 16:2 */ |
| 23 | SYS24 };/* 24bpp */ | 23 | SYS16C, /* 18bpp, 2:16 */ |
| 24 | SYS18, /* 18bpp */ | ||
| 25 | SYS24, /* 24bpp */ | ||
| 26 | }; | ||
| 24 | 27 | ||
| 25 | enum { LCDC_CHAN_DISABLED = 0, | 28 | enum { LCDC_CHAN_DISABLED = 0, |
| 26 | LCDC_CHAN_MAINLCD, | 29 | LCDC_CHAN_MAINLCD, |
| @@ -52,7 +55,7 @@ struct sh_mobile_lcdc_board_cfg { | |||
| 52 | struct sh_mobile_lcdc_sys_bus_ops *sys_ops); | 55 | struct sh_mobile_lcdc_sys_bus_ops *sys_ops); |
| 53 | void (*start_transfer)(void *board_data, void *sys_ops_handle, | 56 | void (*start_transfer)(void *board_data, void *sys_ops_handle, |
| 54 | struct sh_mobile_lcdc_sys_bus_ops *sys_ops); | 57 | struct sh_mobile_lcdc_sys_bus_ops *sys_ops); |
| 55 | void (*display_on)(void *board_data); | 58 | void (*display_on)(void *board_data, struct fb_info *info); |
| 56 | void (*display_off)(void *board_data); | 59 | void (*display_off)(void *board_data); |
| 57 | }; | 60 | }; |
| 58 | 61 | ||
diff --git a/include/xen/events.h b/include/xen/events.h index e68d59a90ca8..a15d93262e30 100644 --- a/include/xen/events.h +++ b/include/xen/events.h | |||
| @@ -56,4 +56,11 @@ void xen_poll_irq(int irq); | |||
| 56 | /* Determine the IRQ which is bound to an event channel */ | 56 | /* Determine the IRQ which is bound to an event channel */ |
| 57 | unsigned irq_from_evtchn(unsigned int evtchn); | 57 | unsigned irq_from_evtchn(unsigned int evtchn); |
| 58 | 58 | ||
| 59 | /* Xen HVM evtchn vector callback */ | ||
| 60 | extern void xen_hvm_callback_vector(void); | ||
| 61 | extern int xen_have_vector_callback; | ||
| 62 | int xen_set_callback_via(uint64_t via); | ||
| 63 | void xen_evtchn_do_upcall(struct pt_regs *regs); | ||
| 64 | void xen_hvm_evtchn_do_upcall(void); | ||
| 65 | |||
| 59 | #endif /* _XEN_EVENTS_H */ | 66 | #endif /* _XEN_EVENTS_H */ |
diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h index a40f1cd91be1..9a731706a016 100644 --- a/include/xen/grant_table.h +++ b/include/xen/grant_table.h | |||
| @@ -51,6 +51,7 @@ struct gnttab_free_callback { | |||
| 51 | u16 count; | 51 | u16 count; |
| 52 | }; | 52 | }; |
| 53 | 53 | ||
| 54 | int gnttab_init(void); | ||
| 54 | int gnttab_suspend(void); | 55 | int gnttab_suspend(void); |
| 55 | int gnttab_resume(void); | 56 | int gnttab_resume(void); |
| 56 | 57 | ||
| @@ -112,6 +113,9 @@ int arch_gnttab_map_shared(unsigned long *frames, unsigned long nr_gframes, | |||
| 112 | void arch_gnttab_unmap_shared(struct grant_entry *shared, | 113 | void arch_gnttab_unmap_shared(struct grant_entry *shared, |
| 113 | unsigned long nr_gframes); | 114 | unsigned long nr_gframes); |
| 114 | 115 | ||
| 116 | extern unsigned long xen_hvm_resume_frames; | ||
| 117 | unsigned int gnttab_max_grant_frames(void); | ||
| 118 | |||
| 115 | #define gnttab_map_vaddr(map) ((void *)(map.host_virt_addr)) | 119 | #define gnttab_map_vaddr(map) ((void *)(map.host_virt_addr)) |
| 116 | 120 | ||
| 117 | #endif /* __ASM_GNTTAB_H__ */ | 121 | #endif /* __ASM_GNTTAB_H__ */ |
diff --git a/include/xen/hvm.h b/include/xen/hvm.h new file mode 100644 index 000000000000..b193fa2f9fdd --- /dev/null +++ b/include/xen/hvm.h | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | /* Simple wrappers around HVM functions */ | ||
| 2 | #ifndef XEN_HVM_H__ | ||
| 3 | #define XEN_HVM_H__ | ||
| 4 | |||
| 5 | #include <xen/interface/hvm/params.h> | ||
| 6 | #include <asm/xen/hypercall.h> | ||
| 7 | |||
| 8 | static inline int hvm_get_parameter(int idx, uint64_t *value) | ||
| 9 | { | ||
| 10 | struct xen_hvm_param xhv; | ||
| 11 | int r; | ||
| 12 | |||
| 13 | xhv.domid = DOMID_SELF; | ||
| 14 | xhv.index = idx; | ||
| 15 | r = HYPERVISOR_hvm_op(HVMOP_get_param, &xhv); | ||
| 16 | if (r < 0) { | ||
| 17 | printk(KERN_ERR "Cannot get hvm parameter %d: %d!\n", | ||
| 18 | idx, r); | ||
| 19 | return r; | ||
| 20 | } | ||
| 21 | *value = xhv.value; | ||
| 22 | return r; | ||
| 23 | } | ||
| 24 | |||
| 25 | #define HVM_CALLBACK_VIA_TYPE_VECTOR 0x2 | ||
| 26 | #define HVM_CALLBACK_VIA_TYPE_SHIFT 56 | ||
| 27 | #define HVM_CALLBACK_VECTOR(x) (((uint64_t)HVM_CALLBACK_VIA_TYPE_VECTOR)<<\ | ||
| 28 | HVM_CALLBACK_VIA_TYPE_SHIFT | (x)) | ||
| 29 | |||
| 30 | #endif /* XEN_HVM_H__ */ | ||
diff --git a/include/xen/interface/features.h b/include/xen/interface/features.h index f51b6413b054..70d2563ab166 100644 --- a/include/xen/interface/features.h +++ b/include/xen/interface/features.h | |||
| @@ -41,6 +41,12 @@ | |||
| 41 | /* x86: Does this Xen host support the MMU_PT_UPDATE_PRESERVE_AD hypercall? */ | 41 | /* x86: Does this Xen host support the MMU_PT_UPDATE_PRESERVE_AD hypercall? */ |
| 42 | #define XENFEAT_mmu_pt_update_preserve_ad 5 | 42 | #define XENFEAT_mmu_pt_update_preserve_ad 5 |
| 43 | 43 | ||
| 44 | /* x86: Does this Xen host support the HVM callback vector type? */ | ||
| 45 | #define XENFEAT_hvm_callback_vector 8 | ||
| 46 | |||
| 47 | /* x86: pvclock algorithm is safe to use on HVM */ | ||
| 48 | #define XENFEAT_hvm_safe_pvclock 9 | ||
| 49 | |||
| 44 | #define XENFEAT_NR_SUBMAPS 1 | 50 | #define XENFEAT_NR_SUBMAPS 1 |
| 45 | 51 | ||
| 46 | #endif /* __XEN_PUBLIC_FEATURES_H__ */ | 52 | #endif /* __XEN_PUBLIC_FEATURES_H__ */ |
diff --git a/include/xen/interface/grant_table.h b/include/xen/interface/grant_table.h index 39da93c21de0..39e571796e32 100644 --- a/include/xen/interface/grant_table.h +++ b/include/xen/interface/grant_table.h | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #ifndef __XEN_PUBLIC_GRANT_TABLE_H__ | 28 | #ifndef __XEN_PUBLIC_GRANT_TABLE_H__ |
| 29 | #define __XEN_PUBLIC_GRANT_TABLE_H__ | 29 | #define __XEN_PUBLIC_GRANT_TABLE_H__ |
| 30 | 30 | ||
| 31 | #include <xen/interface/xen.h> | ||
| 31 | 32 | ||
| 32 | /*********************************** | 33 | /*********************************** |
| 33 | * GRANT TABLE REPRESENTATION | 34 | * GRANT TABLE REPRESENTATION |
diff --git a/include/xen/interface/hvm/hvm_op.h b/include/xen/interface/hvm/hvm_op.h new file mode 100644 index 000000000000..a4827f46ee97 --- /dev/null +++ b/include/xen/interface/hvm/hvm_op.h | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | /* | ||
| 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| 3 | * of this software and associated documentation files (the "Software"), to | ||
| 4 | * deal in the Software without restriction, including without limitation the | ||
| 5 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
| 6 | * sell copies of the Software, and to permit persons to whom the Software is | ||
| 7 | * furnished to do so, subject to the following conditions: | ||
| 8 | * | ||
| 9 | * The above copyright notice and this permission notice shall be included in | ||
| 10 | * all copies or substantial portions of the Software. | ||
| 11 | * | ||
| 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
| 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
| 18 | * DEALINGS IN THE SOFTWARE. | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __XEN_PUBLIC_HVM_HVM_OP_H__ | ||
| 22 | #define __XEN_PUBLIC_HVM_HVM_OP_H__ | ||
| 23 | |||
| 24 | /* Get/set subcommands: the second argument of the hypercall is a | ||
| 25 | * pointer to a xen_hvm_param struct. */ | ||
| 26 | #define HVMOP_set_param 0 | ||
| 27 | #define HVMOP_get_param 1 | ||
| 28 | struct xen_hvm_param { | ||
| 29 | domid_t domid; /* IN */ | ||
| 30 | uint32_t index; /* IN */ | ||
| 31 | uint64_t value; /* IN/OUT */ | ||
| 32 | }; | ||
| 33 | DEFINE_GUEST_HANDLE_STRUCT(xen_hvm_param); | ||
| 34 | |||
| 35 | /* Hint from PV drivers for pagetable destruction. */ | ||
| 36 | #define HVMOP_pagetable_dying 9 | ||
| 37 | struct xen_hvm_pagetable_dying { | ||
| 38 | /* Domain with a pagetable about to be destroyed. */ | ||
| 39 | domid_t domid; | ||
| 40 | /* guest physical address of the toplevel pagetable dying */ | ||
| 41 | aligned_u64 gpa; | ||
| 42 | }; | ||
| 43 | typedef struct xen_hvm_pagetable_dying xen_hvm_pagetable_dying_t; | ||
| 44 | DEFINE_GUEST_HANDLE_STRUCT(xen_hvm_pagetable_dying_t); | ||
| 45 | |||
| 46 | #endif /* __XEN_PUBLIC_HVM_HVM_OP_H__ */ | ||
diff --git a/include/xen/interface/hvm/params.h b/include/xen/interface/hvm/params.h new file mode 100644 index 000000000000..1888d8c157e6 --- /dev/null +++ b/include/xen/interface/hvm/params.h | |||
| @@ -0,0 +1,95 @@ | |||
| 1 | /* | ||
| 2 | * Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| 3 | * of this software and associated documentation files (the "Software"), to | ||
| 4 | * deal in the Software without restriction, including without limitation the | ||
| 5 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | ||
| 6 | * sell copies of the Software, and to permit persons to whom the Software is | ||
| 7 | * furnished to do so, subject to the following conditions: | ||
| 8 | * | ||
| 9 | * The above copyright notice and this permission notice shall be included in | ||
| 10 | * all copies or substantial portions of the Software. | ||
| 11 | * | ||
| 12 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 13 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 14 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| 15 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 16 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
| 17 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
| 18 | * DEALINGS IN THE SOFTWARE. | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef __XEN_PUBLIC_HVM_PARAMS_H__ | ||
| 22 | #define __XEN_PUBLIC_HVM_PARAMS_H__ | ||
| 23 | |||
| 24 | #include "hvm_op.h" | ||
| 25 | |||
| 26 | /* | ||
| 27 | * Parameter space for HVMOP_{set,get}_param. | ||
| 28 | */ | ||
| 29 | |||
| 30 | /* | ||
| 31 | * How should CPU0 event-channel notifications be delivered? | ||
| 32 | * val[63:56] == 0: val[55:0] is a delivery GSI (Global System Interrupt). | ||
| 33 | * val[63:56] == 1: val[55:0] is a delivery PCI INTx line, as follows: | ||
| 34 | * Domain = val[47:32], Bus = val[31:16], | ||
| 35 | * DevFn = val[15: 8], IntX = val[ 1: 0] | ||
| 36 | * val[63:56] == 2: val[7:0] is a vector number. | ||
| 37 | * If val == 0 then CPU0 event-channel notifications are not delivered. | ||
| 38 | */ | ||
| 39 | #define HVM_PARAM_CALLBACK_IRQ 0 | ||
| 40 | |||
| 41 | #define HVM_PARAM_STORE_PFN 1 | ||
| 42 | #define HVM_PARAM_STORE_EVTCHN 2 | ||
| 43 | |||
| 44 | #define HVM_PARAM_PAE_ENABLED 4 | ||
| 45 | |||
| 46 | #define HVM_PARAM_IOREQ_PFN 5 | ||
| 47 | |||
| 48 | #define HVM_PARAM_BUFIOREQ_PFN 6 | ||
| 49 | |||
| 50 | /* | ||
| 51 | * Set mode for virtual timers (currently x86 only): | ||
| 52 | * delay_for_missed_ticks (default): | ||
| 53 | * Do not advance a vcpu's time beyond the correct delivery time for | ||
| 54 | * interrupts that have been missed due to preemption. Deliver missed | ||
| 55 | * interrupts when the vcpu is rescheduled and advance the vcpu's virtual | ||
| 56 | * time stepwise for each one. | ||
| 57 | * no_delay_for_missed_ticks: | ||
| 58 | * As above, missed interrupts are delivered, but guest time always tracks | ||
| 59 | * wallclock (i.e., real) time while doing so. | ||
| 60 | * no_missed_ticks_pending: | ||
| 61 | * No missed interrupts are held pending. Instead, to ensure ticks are | ||
| 62 | * delivered at some non-zero rate, if we detect missed ticks then the | ||
| 63 | * internal tick alarm is not disabled if the VCPU is preempted during the | ||
| 64 | * next tick period. | ||
| 65 | * one_missed_tick_pending: | ||
| 66 | * Missed interrupts are collapsed together and delivered as one 'late tick'. | ||
| 67 | * Guest time always tracks wallclock (i.e., real) time. | ||
| 68 | */ | ||
| 69 | #define HVM_PARAM_TIMER_MODE 10 | ||
| 70 | #define HVMPTM_delay_for_missed_ticks 0 | ||
| 71 | #define HVMPTM_no_delay_for_missed_ticks 1 | ||
| 72 | #define HVMPTM_no_missed_ticks_pending 2 | ||
| 73 | #define HVMPTM_one_missed_tick_pending 3 | ||
| 74 | |||
| 75 | /* Boolean: Enable virtual HPET (high-precision event timer)? (x86-only) */ | ||
| 76 | #define HVM_PARAM_HPET_ENABLED 11 | ||
| 77 | |||
| 78 | /* Identity-map page directory used by Intel EPT when CR0.PG=0. */ | ||
| 79 | #define HVM_PARAM_IDENT_PT 12 | ||
| 80 | |||
| 81 | /* Device Model domain, defaults to 0. */ | ||
| 82 | #define HVM_PARAM_DM_DOMAIN 13 | ||
| 83 | |||
| 84 | /* ACPI S state: currently support S0 and S3 on x86. */ | ||
| 85 | #define HVM_PARAM_ACPI_S_STATE 14 | ||
| 86 | |||
| 87 | /* TSS used on Intel when CR0.PE=0. */ | ||
| 88 | #define HVM_PARAM_VM86_TSS 15 | ||
| 89 | |||
| 90 | /* Boolean: Enable aligning all periodic vpts to reduce interrupts */ | ||
| 91 | #define HVM_PARAM_VPT_ALIGN 16 | ||
| 92 | |||
| 93 | #define HVM_NR_PARAMS 17 | ||
| 94 | |||
| 95 | #endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */ | ||
diff --git a/include/xen/platform_pci.h b/include/xen/platform_pci.h new file mode 100644 index 000000000000..ce9d671c636c --- /dev/null +++ b/include/xen/platform_pci.h | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | #ifndef _XEN_PLATFORM_PCI_H | ||
| 2 | #define _XEN_PLATFORM_PCI_H | ||
| 3 | |||
| 4 | #define XEN_IOPORT_MAGIC_VAL 0x49d2 | ||
| 5 | #define XEN_IOPORT_LINUX_PRODNUM 0x0003 | ||
| 6 | #define XEN_IOPORT_LINUX_DRVVER 0x0001 | ||
| 7 | |||
| 8 | #define XEN_IOPORT_BASE 0x10 | ||
| 9 | |||
| 10 | #define XEN_IOPORT_PLATFLAGS (XEN_IOPORT_BASE + 0) /* 1 byte access (R/W) */ | ||
| 11 | #define XEN_IOPORT_MAGIC (XEN_IOPORT_BASE + 0) /* 2 byte access (R) */ | ||
| 12 | #define XEN_IOPORT_UNPLUG (XEN_IOPORT_BASE + 0) /* 2 byte access (W) */ | ||
| 13 | #define XEN_IOPORT_DRVVER (XEN_IOPORT_BASE + 0) /* 4 byte access (W) */ | ||
| 14 | |||
| 15 | #define XEN_IOPORT_SYSLOG (XEN_IOPORT_BASE + 2) /* 1 byte access (W) */ | ||
| 16 | #define XEN_IOPORT_PROTOVER (XEN_IOPORT_BASE + 2) /* 1 byte access (R) */ | ||
| 17 | #define XEN_IOPORT_PRODNUM (XEN_IOPORT_BASE + 2) /* 2 byte access (W) */ | ||
| 18 | |||
| 19 | #define XEN_UNPLUG_ALL_IDE_DISKS 1 | ||
| 20 | #define XEN_UNPLUG_ALL_NICS 2 | ||
| 21 | #define XEN_UNPLUG_AUX_IDE_DISKS 4 | ||
| 22 | #define XEN_UNPLUG_ALL 7 | ||
| 23 | #define XEN_UNPLUG_IGNORE 8 | ||
| 24 | |||
| 25 | static inline int xen_must_unplug_nics(void) { | ||
| 26 | #if (defined(CONFIG_XEN_NETDEV_FRONTEND) || \ | ||
| 27 | defined(CONFIG_XEN_NETDEV_FRONTEND_MODULE)) && \ | ||
| 28 | (defined(CONFIG_XEN_PLATFORM_PCI) || \ | ||
| 29 | defined(CONFIG_XEN_PLATFORM_PCI_MODULE)) | ||
| 30 | return 1; | ||
| 31 | #else | ||
| 32 | return 0; | ||
| 33 | #endif | ||
| 34 | } | ||
| 35 | |||
| 36 | static inline int xen_must_unplug_disks(void) { | ||
| 37 | #if (defined(CONFIG_XEN_BLKDEV_FRONTEND) || \ | ||
| 38 | defined(CONFIG_XEN_BLKDEV_FRONTEND_MODULE)) && \ | ||
| 39 | (defined(CONFIG_XEN_PLATFORM_PCI) || \ | ||
| 40 | defined(CONFIG_XEN_PLATFORM_PCI_MODULE)) | ||
| 41 | return 1; | ||
| 42 | #else | ||
| 43 | return 0; | ||
| 44 | #endif | ||
| 45 | } | ||
| 46 | |||
| 47 | extern int xen_platform_pci_unplug; | ||
| 48 | |||
| 49 | #endif /* _XEN_PLATFORM_PCI_H */ | ||
diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h index 883a21bba24b..46bc81ef74c6 100644 --- a/include/xen/xen-ops.h +++ b/include/xen/xen-ops.h | |||
| @@ -7,6 +7,7 @@ DECLARE_PER_CPU(struct vcpu_info *, xen_vcpu); | |||
| 7 | 7 | ||
| 8 | void xen_pre_suspend(void); | 8 | void xen_pre_suspend(void); |
| 9 | void xen_post_suspend(int suspend_cancelled); | 9 | void xen_post_suspend(int suspend_cancelled); |
| 10 | void xen_hvm_post_suspend(int suspend_cancelled); | ||
| 10 | 11 | ||
| 11 | void xen_mm_pin_all(void); | 12 | void xen_mm_pin_all(void); |
| 12 | void xen_mm_unpin_all(void); | 13 | void xen_mm_unpin_all(void); |
| @@ -14,4 +15,6 @@ void xen_mm_unpin_all(void); | |||
| 14 | void xen_timer_resume(void); | 15 | void xen_timer_resume(void); |
| 15 | void xen_arch_resume(void); | 16 | void xen_arch_resume(void); |
| 16 | 17 | ||
| 18 | int xen_setup_shutdown_event(void); | ||
| 19 | |||
| 17 | #endif /* INCLUDE_XEN_OPS_H */ | 20 | #endif /* INCLUDE_XEN_OPS_H */ |
