psb_drv.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517
  1. /**************************************************************************
  2. * Copyright (c) 2007-2011, Intel Corporation.
  3. * All Rights Reserved.
  4. * Copyright (c) 2008, Tungsten Graphics, Inc. Cedar Park, TX., USA.
  5. * All Rights Reserved.
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms and conditions of the GNU General Public License,
  9. * version 2, as published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope it will be useful, but WITHOUT
  12. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  14. * more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along with
  17. * this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. **************************************************************************/
  21. #include <drm/drmP.h>
  22. #include <drm/drm.h>
  23. #include "psb_drv.h"
  24. #include "framebuffer.h"
  25. #include "psb_reg.h"
  26. #include "psb_intel_reg.h"
  27. #include "intel_bios.h"
  28. #include "mid_bios.h"
  29. #include <drm/drm_pciids.h>
  30. #include "power.h"
  31. #include <linux/cpu.h>
  32. #include <linux/notifier.h>
  33. #include <linux/spinlock.h>
  34. #include <linux/pm_runtime.h>
  35. #include <acpi/video.h>
  36. #include <linux/module.h>
  37. #include <asm/set_memory.h>
  38. static struct drm_driver driver;
  39. static int psb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent);
  40. /*
  41. * The table below contains a mapping of the PCI vendor ID and the PCI Device ID
  42. * to the different groups of PowerVR 5-series chip designs
  43. *
  44. * 0x8086 = Intel Corporation
  45. *
  46. * PowerVR SGX535 - Poulsbo - Intel GMA 500, Intel Atom Z5xx
  47. * PowerVR SGX535 - Moorestown - Intel GMA 600
  48. * PowerVR SGX535 - Oaktrail - Intel GMA 600, Intel Atom Z6xx, E6xx
  49. * PowerVR SGX540 - Medfield - Intel Atom Z2460
  50. * PowerVR SGX544MP2 - Medfield -
  51. * PowerVR SGX545 - Cedartrail - Intel GMA 3600, Intel Atom D2500, N2600
  52. * PowerVR SGX545 - Cedartrail - Intel GMA 3650, Intel Atom D2550, D2700,
  53. * N2800
  54. */
  55. static const struct pci_device_id pciidlist[] = {
  56. { 0x8086, 0x8108, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &psb_chip_ops },
  57. { 0x8086, 0x8109, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &psb_chip_ops },
  58. #if defined(CONFIG_DRM_GMA600)
  59. { 0x8086, 0x4100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &oaktrail_chip_ops },
  60. { 0x8086, 0x4101, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &oaktrail_chip_ops },
  61. { 0x8086, 0x4102, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &oaktrail_chip_ops },
  62. { 0x8086, 0x4103, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &oaktrail_chip_ops },
  63. { 0x8086, 0x4104, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &oaktrail_chip_ops },
  64. { 0x8086, 0x4105, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &oaktrail_chip_ops },
  65. { 0x8086, 0x4106, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &oaktrail_chip_ops },
  66. { 0x8086, 0x4107, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &oaktrail_chip_ops },
  67. { 0x8086, 0x4108, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &oaktrail_chip_ops },
  68. #endif
  69. #if defined(CONFIG_DRM_MEDFIELD)
  70. { 0x8086, 0x0130, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &mdfld_chip_ops },
  71. { 0x8086, 0x0131, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &mdfld_chip_ops },
  72. { 0x8086, 0x0132, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &mdfld_chip_ops },
  73. { 0x8086, 0x0133, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &mdfld_chip_ops },
  74. { 0x8086, 0x0134, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &mdfld_chip_ops },
  75. { 0x8086, 0x0135, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &mdfld_chip_ops },
  76. { 0x8086, 0x0136, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &mdfld_chip_ops },
  77. { 0x8086, 0x0137, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &mdfld_chip_ops },
  78. #endif
  79. #if defined(CONFIG_DRM_GMA3600)
  80. { 0x8086, 0x0be0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  81. { 0x8086, 0x0be1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  82. { 0x8086, 0x0be2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  83. { 0x8086, 0x0be3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  84. { 0x8086, 0x0be4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  85. { 0x8086, 0x0be5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  86. { 0x8086, 0x0be6, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  87. { 0x8086, 0x0be7, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  88. { 0x8086, 0x0be8, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  89. { 0x8086, 0x0be9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  90. { 0x8086, 0x0bea, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  91. { 0x8086, 0x0beb, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  92. { 0x8086, 0x0bec, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  93. { 0x8086, 0x0bed, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  94. { 0x8086, 0x0bee, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  95. { 0x8086, 0x0bef, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (long) &cdv_chip_ops },
  96. #endif
  97. { 0, }
  98. };
  99. MODULE_DEVICE_TABLE(pci, pciidlist);
  100. /*
  101. * Standard IOCTLs.
  102. */
  103. static const struct drm_ioctl_desc psb_ioctls[] = {
  104. };
  105. static int psb_do_init(struct drm_device *dev)
  106. {
  107. struct drm_psb_private *dev_priv = dev->dev_private;
  108. struct psb_gtt *pg = &dev_priv->gtt;
  109. uint32_t stolen_gtt;
  110. if (pg->mmu_gatt_start & 0x0FFFFFFF) {
  111. dev_err(dev->dev, "Gatt must be 256M aligned. This is a bug.\n");
  112. return -EINVAL;
  113. }
  114. stolen_gtt = (pg->stolen_size >> PAGE_SHIFT) * 4;
  115. stolen_gtt = (stolen_gtt + PAGE_SIZE - 1) >> PAGE_SHIFT;
  116. stolen_gtt = (stolen_gtt < pg->gtt_pages) ? stolen_gtt : pg->gtt_pages;
  117. dev_priv->gatt_free_offset = pg->mmu_gatt_start +
  118. (stolen_gtt << PAGE_SHIFT) * 1024;
  119. spin_lock_init(&dev_priv->irqmask_lock);
  120. spin_lock_init(&dev_priv->lock_2d);
  121. PSB_WSGX32(0x00000000, PSB_CR_BIF_BANK0);
  122. PSB_WSGX32(0x00000000, PSB_CR_BIF_BANK1);
  123. PSB_RSGX32(PSB_CR_BIF_BANK1);
  124. /* Do not bypass any MMU access, let them pagefault instead */
  125. PSB_WSGX32((PSB_RSGX32(PSB_CR_BIF_CTRL) & ~_PSB_MMU_ER_MASK),
  126. PSB_CR_BIF_CTRL);
  127. PSB_RSGX32(PSB_CR_BIF_CTRL);
  128. psb_spank(dev_priv);
  129. /* mmu_gatt ?? */
  130. PSB_WSGX32(pg->gatt_start, PSB_CR_BIF_TWOD_REQ_BASE);
  131. PSB_RSGX32(PSB_CR_BIF_TWOD_REQ_BASE); /* Post */
  132. return 0;
  133. }
  134. static void psb_driver_unload(struct drm_device *dev)
  135. {
  136. struct drm_psb_private *dev_priv = dev->dev_private;
  137. /* TODO: Kill vblank etc here */
  138. if (dev_priv) {
  139. if (dev_priv->backlight_device)
  140. gma_backlight_exit(dev);
  141. psb_modeset_cleanup(dev);
  142. if (dev_priv->ops->chip_teardown)
  143. dev_priv->ops->chip_teardown(dev);
  144. psb_intel_opregion_fini(dev);
  145. if (dev_priv->pf_pd) {
  146. psb_mmu_free_pagedir(dev_priv->pf_pd);
  147. dev_priv->pf_pd = NULL;
  148. }
  149. if (dev_priv->mmu) {
  150. struct psb_gtt *pg = &dev_priv->gtt;
  151. down_read(&pg->sem);
  152. psb_mmu_remove_pfn_sequence(
  153. psb_mmu_get_default_pd
  154. (dev_priv->mmu),
  155. pg->mmu_gatt_start,
  156. dev_priv->vram_stolen_size >> PAGE_SHIFT);
  157. up_read(&pg->sem);
  158. psb_mmu_driver_takedown(dev_priv->mmu);
  159. dev_priv->mmu = NULL;
  160. }
  161. psb_gtt_takedown(dev);
  162. if (dev_priv->scratch_page) {
  163. set_pages_wb(dev_priv->scratch_page, 1);
  164. __free_page(dev_priv->scratch_page);
  165. dev_priv->scratch_page = NULL;
  166. }
  167. if (dev_priv->vdc_reg) {
  168. iounmap(dev_priv->vdc_reg);
  169. dev_priv->vdc_reg = NULL;
  170. }
  171. if (dev_priv->sgx_reg) {
  172. iounmap(dev_priv->sgx_reg);
  173. dev_priv->sgx_reg = NULL;
  174. }
  175. if (dev_priv->aux_reg) {
  176. iounmap(dev_priv->aux_reg);
  177. dev_priv->aux_reg = NULL;
  178. }
  179. pci_dev_put(dev_priv->aux_pdev);
  180. pci_dev_put(dev_priv->lpc_pdev);
  181. /* Destroy VBT data */
  182. psb_intel_destroy_bios(dev);
  183. kfree(dev_priv);
  184. dev->dev_private = NULL;
  185. }
  186. gma_power_uninit(dev);
  187. }
  188. static int psb_driver_load(struct drm_device *dev, unsigned long flags)
  189. {
  190. struct drm_psb_private *dev_priv;
  191. unsigned long resource_start, resource_len;
  192. unsigned long irqflags;
  193. int ret = -ENOMEM;
  194. struct drm_connector *connector;
  195. struct gma_encoder *gma_encoder;
  196. struct psb_gtt *pg;
  197. /* allocating and initializing driver private data */
  198. dev_priv = kzalloc(sizeof(*dev_priv), GFP_KERNEL);
  199. if (dev_priv == NULL)
  200. return -ENOMEM;
  201. dev_priv->ops = (struct psb_ops *)flags;
  202. dev_priv->dev = dev;
  203. dev->dev_private = (void *) dev_priv;
  204. pg = &dev_priv->gtt;
  205. pci_set_master(dev->pdev);
  206. dev_priv->num_pipe = dev_priv->ops->pipes;
  207. resource_start = pci_resource_start(dev->pdev, PSB_MMIO_RESOURCE);
  208. dev_priv->vdc_reg =
  209. ioremap(resource_start + PSB_VDC_OFFSET, PSB_VDC_SIZE);
  210. if (!dev_priv->vdc_reg)
  211. goto out_err;
  212. dev_priv->sgx_reg = ioremap(resource_start + dev_priv->ops->sgx_offset,
  213. PSB_SGX_SIZE);
  214. if (!dev_priv->sgx_reg)
  215. goto out_err;
  216. if (IS_MRST(dev)) {
  217. dev_priv->aux_pdev = pci_get_bus_and_slot(0, PCI_DEVFN(3, 0));
  218. if (dev_priv->aux_pdev) {
  219. resource_start = pci_resource_start(dev_priv->aux_pdev,
  220. PSB_AUX_RESOURCE);
  221. resource_len = pci_resource_len(dev_priv->aux_pdev,
  222. PSB_AUX_RESOURCE);
  223. dev_priv->aux_reg = ioremap_nocache(resource_start,
  224. resource_len);
  225. if (!dev_priv->aux_reg)
  226. goto out_err;
  227. DRM_DEBUG_KMS("Found aux vdc");
  228. } else {
  229. /* Couldn't find the aux vdc so map to primary vdc */
  230. dev_priv->aux_reg = dev_priv->vdc_reg;
  231. DRM_DEBUG_KMS("Couldn't find aux pci device");
  232. }
  233. dev_priv->gmbus_reg = dev_priv->aux_reg;
  234. dev_priv->lpc_pdev = pci_get_bus_and_slot(0, PCI_DEVFN(31, 0));
  235. if (dev_priv->lpc_pdev) {
  236. pci_read_config_word(dev_priv->lpc_pdev, PSB_LPC_GBA,
  237. &dev_priv->lpc_gpio_base);
  238. pci_write_config_dword(dev_priv->lpc_pdev, PSB_LPC_GBA,
  239. (u32)dev_priv->lpc_gpio_base | (1L<<31));
  240. pci_read_config_word(dev_priv->lpc_pdev, PSB_LPC_GBA,
  241. &dev_priv->lpc_gpio_base);
  242. dev_priv->lpc_gpio_base &= 0xffc0;
  243. if (dev_priv->lpc_gpio_base)
  244. DRM_DEBUG_KMS("Found LPC GPIO at 0x%04x\n",
  245. dev_priv->lpc_gpio_base);
  246. else {
  247. pci_dev_put(dev_priv->lpc_pdev);
  248. dev_priv->lpc_pdev = NULL;
  249. }
  250. }
  251. } else {
  252. dev_priv->gmbus_reg = dev_priv->vdc_reg;
  253. }
  254. psb_intel_opregion_setup(dev);
  255. ret = dev_priv->ops->chip_setup(dev);
  256. if (ret)
  257. goto out_err;
  258. /* Init OSPM support */
  259. gma_power_init(dev);
  260. ret = -ENOMEM;
  261. dev_priv->scratch_page = alloc_page(GFP_DMA32 | __GFP_ZERO);
  262. if (!dev_priv->scratch_page)
  263. goto out_err;
  264. set_pages_uc(dev_priv->scratch_page, 1);
  265. ret = psb_gtt_init(dev, 0);
  266. if (ret)
  267. goto out_err;
  268. dev_priv->mmu = psb_mmu_driver_init(dev, 1, 0, 0);
  269. if (!dev_priv->mmu)
  270. goto out_err;
  271. dev_priv->pf_pd = psb_mmu_alloc_pd(dev_priv->mmu, 1, 0);
  272. if (!dev_priv->pf_pd)
  273. goto out_err;
  274. ret = psb_do_init(dev);
  275. if (ret)
  276. return ret;
  277. /* Add stolen memory to SGX MMU */
  278. down_read(&pg->sem);
  279. ret = psb_mmu_insert_pfn_sequence(psb_mmu_get_default_pd(dev_priv->mmu),
  280. dev_priv->stolen_base >> PAGE_SHIFT,
  281. pg->gatt_start,
  282. pg->stolen_size >> PAGE_SHIFT, 0);
  283. up_read(&pg->sem);
  284. psb_mmu_set_pd_context(psb_mmu_get_default_pd(dev_priv->mmu), 0);
  285. psb_mmu_set_pd_context(dev_priv->pf_pd, 1);
  286. PSB_WSGX32(0x20000000, PSB_CR_PDS_EXEC_BASE);
  287. PSB_WSGX32(0x30000000, PSB_CR_BIF_3D_REQ_BASE);
  288. acpi_video_register();
  289. /* Setup vertical blanking handling */
  290. ret = drm_vblank_init(dev, dev_priv->num_pipe);
  291. if (ret)
  292. goto out_err;
  293. /*
  294. * Install interrupt handlers prior to powering off SGX or else we will
  295. * crash.
  296. */
  297. dev_priv->vdc_irq_mask = 0;
  298. dev_priv->pipestat[0] = 0;
  299. dev_priv->pipestat[1] = 0;
  300. dev_priv->pipestat[2] = 0;
  301. spin_lock_irqsave(&dev_priv->irqmask_lock, irqflags);
  302. PSB_WVDC32(0xFFFFFFFF, PSB_HWSTAM);
  303. PSB_WVDC32(0x00000000, PSB_INT_ENABLE_R);
  304. PSB_WVDC32(0xFFFFFFFF, PSB_INT_MASK_R);
  305. spin_unlock_irqrestore(&dev_priv->irqmask_lock, irqflags);
  306. drm_irq_install(dev, dev->pdev->irq);
  307. dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */
  308. dev->driver->get_vblank_counter = psb_get_vblank_counter;
  309. psb_modeset_init(dev);
  310. psb_fbdev_init(dev);
  311. drm_kms_helper_poll_init(dev);
  312. /* Only add backlight support if we have LVDS output */
  313. list_for_each_entry(connector, &dev->mode_config.connector_list,
  314. head) {
  315. gma_encoder = gma_attached_encoder(connector);
  316. switch (gma_encoder->type) {
  317. case INTEL_OUTPUT_LVDS:
  318. case INTEL_OUTPUT_MIPI:
  319. ret = gma_backlight_init(dev);
  320. break;
  321. }
  322. }
  323. if (ret)
  324. return ret;
  325. psb_intel_opregion_enable_asle(dev);
  326. #if 0
  327. /* Enable runtime pm at last */
  328. pm_runtime_enable(&dev->pdev->dev);
  329. pm_runtime_set_active(&dev->pdev->dev);
  330. #endif
  331. /* Intel drm driver load is done, continue doing pvr load */
  332. return 0;
  333. out_err:
  334. psb_driver_unload(dev);
  335. return ret;
  336. }
  337. static inline void get_brightness(struct backlight_device *bd)
  338. {
  339. #ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
  340. if (bd) {
  341. bd->props.brightness = bd->ops->get_brightness(bd);
  342. backlight_update_status(bd);
  343. }
  344. #endif
  345. }
  346. static long psb_unlocked_ioctl(struct file *filp, unsigned int cmd,
  347. unsigned long arg)
  348. {
  349. struct drm_file *file_priv = filp->private_data;
  350. struct drm_device *dev = file_priv->minor->dev;
  351. struct drm_psb_private *dev_priv = dev->dev_private;
  352. static unsigned int runtime_allowed;
  353. if (runtime_allowed == 1 && dev_priv->is_lvds_on) {
  354. runtime_allowed++;
  355. pm_runtime_allow(&dev->pdev->dev);
  356. dev_priv->rpm_enabled = 1;
  357. }
  358. return drm_ioctl(filp, cmd, arg);
  359. /* FIXME: do we need to wrap the other side of this */
  360. }
  361. static int psb_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
  362. {
  363. return drm_get_pci_dev(pdev, ent, &driver);
  364. }
  365. static void psb_pci_remove(struct pci_dev *pdev)
  366. {
  367. struct drm_device *dev = pci_get_drvdata(pdev);
  368. drm_put_dev(dev);
  369. }
  370. static const struct dev_pm_ops psb_pm_ops = {
  371. .resume = gma_power_resume,
  372. .suspend = gma_power_suspend,
  373. .thaw = gma_power_thaw,
  374. .freeze = gma_power_freeze,
  375. .restore = gma_power_restore,
  376. .runtime_suspend = psb_runtime_suspend,
  377. .runtime_resume = psb_runtime_resume,
  378. .runtime_idle = psb_runtime_idle,
  379. };
  380. static const struct vm_operations_struct psb_gem_vm_ops = {
  381. .fault = psb_gem_fault,
  382. .open = drm_gem_vm_open,
  383. .close = drm_gem_vm_close,
  384. };
  385. static const struct file_operations psb_gem_fops = {
  386. .owner = THIS_MODULE,
  387. .open = drm_open,
  388. .release = drm_release,
  389. .unlocked_ioctl = psb_unlocked_ioctl,
  390. .compat_ioctl = drm_compat_ioctl,
  391. .mmap = drm_gem_mmap,
  392. .poll = drm_poll,
  393. .read = drm_read,
  394. };
  395. static struct drm_driver driver = {
  396. .driver_features = DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | \
  397. DRIVER_MODESET | DRIVER_GEM,
  398. .load = psb_driver_load,
  399. .unload = psb_driver_unload,
  400. .lastclose = drm_fb_helper_lastclose,
  401. .num_ioctls = ARRAY_SIZE(psb_ioctls),
  402. .irq_preinstall = psb_irq_preinstall,
  403. .irq_postinstall = psb_irq_postinstall,
  404. .irq_uninstall = psb_irq_uninstall,
  405. .irq_handler = psb_irq_handler,
  406. .enable_vblank = psb_enable_vblank,
  407. .disable_vblank = psb_disable_vblank,
  408. .get_vblank_counter = psb_get_vblank_counter,
  409. .gem_free_object = psb_gem_free_object,
  410. .gem_vm_ops = &psb_gem_vm_ops,
  411. .dumb_create = psb_gem_dumb_create,
  412. .ioctls = psb_ioctls,
  413. .fops = &psb_gem_fops,
  414. .name = DRIVER_NAME,
  415. .desc = DRIVER_DESC,
  416. .date = DRIVER_DATE,
  417. .major = DRIVER_MAJOR,
  418. .minor = DRIVER_MINOR,
  419. .patchlevel = DRIVER_PATCHLEVEL
  420. };
  421. static struct pci_driver psb_pci_driver = {
  422. .name = DRIVER_NAME,
  423. .id_table = pciidlist,
  424. .probe = psb_pci_probe,
  425. .remove = psb_pci_remove,
  426. .driver.pm = &psb_pm_ops,
  427. };
  428. static int __init psb_init(void)
  429. {
  430. return pci_register_driver(&psb_pci_driver);
  431. }
  432. static void __exit psb_exit(void)
  433. {
  434. pci_unregister_driver(&psb_pci_driver);
  435. }
  436. late_initcall(psb_init);
  437. module_exit(psb_exit);
  438. MODULE_AUTHOR(DRIVER_AUTHOR);
  439. MODULE_DESCRIPTION(DRIVER_DESC);
  440. MODULE_LICENSE("GPL");