cdv_device.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  1. /**************************************************************************
  2. * Copyright (c) 2011, Intel Corporation.
  3. * All Rights Reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms and conditions of the GNU General Public License,
  7. * version 2, as published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along with
  15. * this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  17. *
  18. **************************************************************************/
  19. #include <linux/backlight.h>
  20. #include <drm/drmP.h>
  21. #include <drm/drm.h>
  22. #include "gma_drm.h"
  23. #include "psb_drv.h"
  24. #include "psb_reg.h"
  25. #include "psb_intel_reg.h"
  26. #include "intel_bios.h"
  27. #include "cdv_device.h"
  28. #define VGA_SR_INDEX 0x3c4
  29. #define VGA_SR_DATA 0x3c5
  30. static void cdv_disable_vga(struct drm_device *dev)
  31. {
  32. u8 sr1;
  33. u32 vga_reg;
  34. vga_reg = VGACNTRL;
  35. outb(1, VGA_SR_INDEX);
  36. sr1 = inb(VGA_SR_DATA);
  37. outb(sr1 | 1<<5, VGA_SR_DATA);
  38. udelay(300);
  39. REG_WRITE(vga_reg, VGA_DISP_DISABLE);
  40. REG_READ(vga_reg);
  41. }
  42. static int cdv_output_init(struct drm_device *dev)
  43. {
  44. struct drm_psb_private *dev_priv = dev->dev_private;
  45. drm_mode_create_scaling_mode_property(dev);
  46. cdv_disable_vga(dev);
  47. cdv_intel_crt_init(dev, &dev_priv->mode_dev);
  48. cdv_intel_lvds_init(dev, &dev_priv->mode_dev);
  49. /* These bits indicate HDMI not SDVO on CDV */
  50. if (REG_READ(SDVOB) & SDVO_DETECTED)
  51. cdv_hdmi_init(dev, &dev_priv->mode_dev, SDVOB);
  52. if (REG_READ(SDVOC) & SDVO_DETECTED)
  53. cdv_hdmi_init(dev, &dev_priv->mode_dev, SDVOC);
  54. return 0;
  55. }
  56. #ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
  57. /*
  58. * Cedartrail Backlght Interfaces
  59. */
  60. static struct backlight_device *cdv_backlight_device;
  61. static int cdv_backlight_combination_mode(struct drm_device *dev)
  62. {
  63. return REG_READ(BLC_PWM_CTL2) & PWM_LEGACY_MODE;
  64. }
  65. static u32 cdv_get_max_backlight(struct drm_device *dev)
  66. {
  67. u32 max = REG_READ(BLC_PWM_CTL);
  68. if (max == 0) {
  69. DRM_DEBUG_KMS("LVDS Panel PWM value is 0!\n");
  70. /* i915 does this, I believe which means that we should not
  71. * smash PWM control as firmware will take control of it. */
  72. return 1;
  73. }
  74. max >>= 16;
  75. if (cdv_backlight_combination_mode(dev))
  76. max *= 0xff;
  77. return max;
  78. }
  79. static int cdv_get_brightness(struct backlight_device *bd)
  80. {
  81. struct drm_device *dev = bl_get_data(bd);
  82. u32 val = REG_READ(BLC_PWM_CTL) & BACKLIGHT_DUTY_CYCLE_MASK;
  83. if (cdv_backlight_combination_mode(dev)) {
  84. u8 lbpc;
  85. val &= ~1;
  86. pci_read_config_byte(dev->pdev, 0xF4, &lbpc);
  87. val *= lbpc;
  88. }
  89. return (val * 100)/cdv_get_max_backlight(dev);
  90. }
  91. static int cdv_set_brightness(struct backlight_device *bd)
  92. {
  93. struct drm_device *dev = bl_get_data(bd);
  94. int level = bd->props.brightness;
  95. u32 blc_pwm_ctl;
  96. /* Percentage 1-100% being valid */
  97. if (level < 1)
  98. level = 1;
  99. level *= cdv_get_max_backlight(dev);
  100. level /= 100;
  101. if (cdv_backlight_combination_mode(dev)) {
  102. u32 max = cdv_get_max_backlight(dev);
  103. u8 lbpc;
  104. lbpc = level * 0xfe / max + 1;
  105. level /= lbpc;
  106. pci_write_config_byte(dev->pdev, 0xF4, lbpc);
  107. }
  108. blc_pwm_ctl = REG_READ(BLC_PWM_CTL) & ~BACKLIGHT_DUTY_CYCLE_MASK;
  109. REG_WRITE(BLC_PWM_CTL, (blc_pwm_ctl |
  110. (level << BACKLIGHT_DUTY_CYCLE_SHIFT)));
  111. return 0;
  112. }
  113. static const struct backlight_ops cdv_ops = {
  114. .get_brightness = cdv_get_brightness,
  115. .update_status = cdv_set_brightness,
  116. };
  117. static int cdv_backlight_init(struct drm_device *dev)
  118. {
  119. struct drm_psb_private *dev_priv = dev->dev_private;
  120. struct backlight_properties props;
  121. memset(&props, 0, sizeof(struct backlight_properties));
  122. props.max_brightness = 100;
  123. props.type = BACKLIGHT_PLATFORM;
  124. cdv_backlight_device = backlight_device_register("psb-bl",
  125. NULL, (void *)dev, &cdv_ops, &props);
  126. if (IS_ERR(cdv_backlight_device))
  127. return PTR_ERR(cdv_backlight_device);
  128. cdv_backlight_device->props.brightness =
  129. cdv_get_brightness(cdv_backlight_device);
  130. backlight_update_status(cdv_backlight_device);
  131. dev_priv->backlight_device = cdv_backlight_device;
  132. return 0;
  133. }
  134. #endif
  135. /*
  136. * Provide the Cedarview specific chip logic and low level methods
  137. * for power management
  138. *
  139. * FIXME: we need to implement the apm/ospm base management bits
  140. * for this and the MID devices.
  141. */
  142. static inline u32 CDV_MSG_READ32(uint port, uint offset)
  143. {
  144. int mcr = (0x10<<24) | (port << 16) | (offset << 8);
  145. uint32_t ret_val = 0;
  146. struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
  147. pci_write_config_dword(pci_root, 0xD0, mcr);
  148. pci_read_config_dword(pci_root, 0xD4, &ret_val);
  149. pci_dev_put(pci_root);
  150. return ret_val;
  151. }
  152. static inline void CDV_MSG_WRITE32(uint port, uint offset, u32 value)
  153. {
  154. int mcr = (0x11<<24) | (port << 16) | (offset << 8) | 0xF0;
  155. struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
  156. pci_write_config_dword(pci_root, 0xD4, value);
  157. pci_write_config_dword(pci_root, 0xD0, mcr);
  158. pci_dev_put(pci_root);
  159. }
  160. #define PSB_PM_SSC 0x20
  161. #define PSB_PM_SSS 0x30
  162. #define PSB_PWRGT_GFX_ON 0x02
  163. #define PSB_PWRGT_GFX_OFF 0x01
  164. #define PSB_PWRGT_GFX_D0 0x00
  165. #define PSB_PWRGT_GFX_D3 0x03
  166. static void cdv_init_pm(struct drm_device *dev)
  167. {
  168. struct drm_psb_private *dev_priv = dev->dev_private;
  169. u32 pwr_cnt;
  170. int i;
  171. dev_priv->apm_base = CDV_MSG_READ32(PSB_PUNIT_PORT,
  172. PSB_APMBA) & 0xFFFF;
  173. dev_priv->ospm_base = CDV_MSG_READ32(PSB_PUNIT_PORT,
  174. PSB_OSPMBA) & 0xFFFF;
  175. /* Power status */
  176. pwr_cnt = inl(dev_priv->apm_base + PSB_APM_CMD);
  177. /* Enable the GPU */
  178. pwr_cnt &= ~PSB_PWRGT_GFX_MASK;
  179. pwr_cnt |= PSB_PWRGT_GFX_ON;
  180. outl(pwr_cnt, dev_priv->apm_base + PSB_APM_CMD);
  181. /* Wait for the GPU power */
  182. for (i = 0; i < 5; i++) {
  183. u32 pwr_sts = inl(dev_priv->apm_base + PSB_APM_STS);
  184. if ((pwr_sts & PSB_PWRGT_GFX_MASK) == 0)
  185. return;
  186. udelay(10);
  187. }
  188. dev_err(dev->dev, "GPU: power management timed out.\n");
  189. }
  190. static void cdv_errata(struct drm_device *dev)
  191. {
  192. /* Disable bonus launch.
  193. * CPU and GPU competes for memory and display misses updates and
  194. * flickers. Worst with dual core, dual displays.
  195. *
  196. * Fixes were done to Win 7 gfx driver to disable a feature called
  197. * Bonus Launch to work around the issue, by degrading
  198. * performance.
  199. */
  200. CDV_MSG_WRITE32(3, 0x30, 0x08027108);
  201. }
  202. /**
  203. * cdv_save_display_registers - save registers lost on suspend
  204. * @dev: our DRM device
  205. *
  206. * Save the state we need in order to be able to restore the interface
  207. * upon resume from suspend
  208. */
  209. static int cdv_save_display_registers(struct drm_device *dev)
  210. {
  211. struct drm_psb_private *dev_priv = dev->dev_private;
  212. struct psb_save_area *regs = &dev_priv->regs;
  213. struct drm_connector *connector;
  214. dev_dbg(dev->dev, "Saving GPU registers.\n");
  215. pci_read_config_byte(dev->pdev, 0xF4, &regs->cdv.saveLBB);
  216. regs->cdv.saveDSPCLK_GATE_D = REG_READ(DSPCLK_GATE_D);
  217. regs->cdv.saveRAMCLK_GATE_D = REG_READ(RAMCLK_GATE_D);
  218. regs->cdv.saveDSPARB = REG_READ(DSPARB);
  219. regs->cdv.saveDSPFW[0] = REG_READ(DSPFW1);
  220. regs->cdv.saveDSPFW[1] = REG_READ(DSPFW2);
  221. regs->cdv.saveDSPFW[2] = REG_READ(DSPFW3);
  222. regs->cdv.saveDSPFW[3] = REG_READ(DSPFW4);
  223. regs->cdv.saveDSPFW[4] = REG_READ(DSPFW5);
  224. regs->cdv.saveDSPFW[5] = REG_READ(DSPFW6);
  225. regs->cdv.saveADPA = REG_READ(ADPA);
  226. regs->cdv.savePP_CONTROL = REG_READ(PP_CONTROL);
  227. regs->cdv.savePFIT_PGM_RATIOS = REG_READ(PFIT_PGM_RATIOS);
  228. regs->saveBLC_PWM_CTL = REG_READ(BLC_PWM_CTL);
  229. regs->saveBLC_PWM_CTL2 = REG_READ(BLC_PWM_CTL2);
  230. regs->cdv.saveLVDS = REG_READ(LVDS);
  231. regs->cdv.savePFIT_CONTROL = REG_READ(PFIT_CONTROL);
  232. regs->cdv.savePP_ON_DELAYS = REG_READ(PP_ON_DELAYS);
  233. regs->cdv.savePP_OFF_DELAYS = REG_READ(PP_OFF_DELAYS);
  234. regs->cdv.savePP_CYCLE = REG_READ(PP_CYCLE);
  235. regs->cdv.saveVGACNTRL = REG_READ(VGACNTRL);
  236. regs->cdv.saveIER = REG_READ(PSB_INT_ENABLE_R);
  237. regs->cdv.saveIMR = REG_READ(PSB_INT_MASK_R);
  238. list_for_each_entry(connector, &dev->mode_config.connector_list, head)
  239. connector->funcs->dpms(connector, DRM_MODE_DPMS_OFF);
  240. return 0;
  241. }
  242. /**
  243. * cdv_restore_display_registers - restore lost register state
  244. * @dev: our DRM device
  245. *
  246. * Restore register state that was lost during suspend and resume.
  247. *
  248. * FIXME: review
  249. */
  250. static int cdv_restore_display_registers(struct drm_device *dev)
  251. {
  252. struct drm_psb_private *dev_priv = dev->dev_private;
  253. struct psb_save_area *regs = &dev_priv->regs;
  254. struct drm_connector *connector;
  255. u32 temp;
  256. pci_write_config_byte(dev->pdev, 0xF4, regs->cdv.saveLBB);
  257. REG_WRITE(DSPCLK_GATE_D, regs->cdv.saveDSPCLK_GATE_D);
  258. REG_WRITE(RAMCLK_GATE_D, regs->cdv.saveRAMCLK_GATE_D);
  259. /* BIOS does below anyway */
  260. REG_WRITE(DPIO_CFG, 0);
  261. REG_WRITE(DPIO_CFG, DPIO_MODE_SELECT_0 | DPIO_CMN_RESET_N);
  262. temp = REG_READ(DPLL_A);
  263. if ((temp & DPLL_SYNCLOCK_ENABLE) == 0) {
  264. REG_WRITE(DPLL_A, temp | DPLL_SYNCLOCK_ENABLE);
  265. REG_READ(DPLL_A);
  266. }
  267. temp = REG_READ(DPLL_B);
  268. if ((temp & DPLL_SYNCLOCK_ENABLE) == 0) {
  269. REG_WRITE(DPLL_B, temp | DPLL_SYNCLOCK_ENABLE);
  270. REG_READ(DPLL_B);
  271. }
  272. udelay(500);
  273. REG_WRITE(DSPFW1, regs->cdv.saveDSPFW[0]);
  274. REG_WRITE(DSPFW2, regs->cdv.saveDSPFW[1]);
  275. REG_WRITE(DSPFW3, regs->cdv.saveDSPFW[2]);
  276. REG_WRITE(DSPFW4, regs->cdv.saveDSPFW[3]);
  277. REG_WRITE(DSPFW5, regs->cdv.saveDSPFW[4]);
  278. REG_WRITE(DSPFW6, regs->cdv.saveDSPFW[5]);
  279. REG_WRITE(DSPARB, regs->cdv.saveDSPARB);
  280. REG_WRITE(ADPA, regs->cdv.saveADPA);
  281. REG_WRITE(BLC_PWM_CTL2, regs->saveBLC_PWM_CTL2);
  282. REG_WRITE(LVDS, regs->cdv.saveLVDS);
  283. REG_WRITE(PFIT_CONTROL, regs->cdv.savePFIT_CONTROL);
  284. REG_WRITE(PFIT_PGM_RATIOS, regs->cdv.savePFIT_PGM_RATIOS);
  285. REG_WRITE(BLC_PWM_CTL, regs->saveBLC_PWM_CTL);
  286. REG_WRITE(PP_ON_DELAYS, regs->cdv.savePP_ON_DELAYS);
  287. REG_WRITE(PP_OFF_DELAYS, regs->cdv.savePP_OFF_DELAYS);
  288. REG_WRITE(PP_CYCLE, regs->cdv.savePP_CYCLE);
  289. REG_WRITE(PP_CONTROL, regs->cdv.savePP_CONTROL);
  290. REG_WRITE(VGACNTRL, regs->cdv.saveVGACNTRL);
  291. REG_WRITE(PSB_INT_ENABLE_R, regs->cdv.saveIER);
  292. REG_WRITE(PSB_INT_MASK_R, regs->cdv.saveIMR);
  293. /* Fix arbitration bug */
  294. cdv_errata(dev);
  295. drm_mode_config_reset(dev);
  296. list_for_each_entry(connector, &dev->mode_config.connector_list, head)
  297. connector->funcs->dpms(connector, DRM_MODE_DPMS_ON);
  298. /* Resume the modeset for every activated CRTC */
  299. drm_helper_resume_force_mode(dev);
  300. return 0;
  301. }
  302. static int cdv_power_down(struct drm_device *dev)
  303. {
  304. struct drm_psb_private *dev_priv = dev->dev_private;
  305. u32 pwr_cnt, pwr_mask, pwr_sts;
  306. int tries = 5;
  307. pwr_cnt = inl(dev_priv->apm_base + PSB_APM_CMD);
  308. pwr_cnt &= ~PSB_PWRGT_GFX_MASK;
  309. pwr_cnt |= PSB_PWRGT_GFX_OFF;
  310. pwr_mask = PSB_PWRGT_GFX_MASK;
  311. outl(pwr_cnt, dev_priv->apm_base + PSB_APM_CMD);
  312. while (tries--) {
  313. pwr_sts = inl(dev_priv->apm_base + PSB_APM_STS);
  314. if ((pwr_sts & pwr_mask) == PSB_PWRGT_GFX_D3)
  315. return 0;
  316. udelay(10);
  317. }
  318. return 0;
  319. }
  320. static int cdv_power_up(struct drm_device *dev)
  321. {
  322. struct drm_psb_private *dev_priv = dev->dev_private;
  323. u32 pwr_cnt, pwr_mask, pwr_sts;
  324. int tries = 5;
  325. pwr_cnt = inl(dev_priv->apm_base + PSB_APM_CMD);
  326. pwr_cnt &= ~PSB_PWRGT_GFX_MASK;
  327. pwr_cnt |= PSB_PWRGT_GFX_ON;
  328. pwr_mask = PSB_PWRGT_GFX_MASK;
  329. outl(pwr_cnt, dev_priv->apm_base + PSB_APM_CMD);
  330. while (tries--) {
  331. pwr_sts = inl(dev_priv->apm_base + PSB_APM_STS);
  332. if ((pwr_sts & pwr_mask) == PSB_PWRGT_GFX_D0)
  333. return 0;
  334. udelay(10);
  335. }
  336. return 0;
  337. }
  338. /* FIXME ? - shared with Poulsbo */
  339. static void cdv_get_core_freq(struct drm_device *dev)
  340. {
  341. uint32_t clock;
  342. struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
  343. struct drm_psb_private *dev_priv = dev->dev_private;
  344. pci_write_config_dword(pci_root, 0xD0, 0xD0050300);
  345. pci_read_config_dword(pci_root, 0xD4, &clock);
  346. pci_dev_put(pci_root);
  347. switch (clock & 0x07) {
  348. case 0:
  349. dev_priv->core_freq = 100;
  350. break;
  351. case 1:
  352. dev_priv->core_freq = 133;
  353. break;
  354. case 2:
  355. dev_priv->core_freq = 150;
  356. break;
  357. case 3:
  358. dev_priv->core_freq = 178;
  359. break;
  360. case 4:
  361. dev_priv->core_freq = 200;
  362. break;
  363. case 5:
  364. case 6:
  365. case 7:
  366. dev_priv->core_freq = 266;
  367. default:
  368. dev_priv->core_freq = 0;
  369. }
  370. }
  371. static void cdv_hotplug_work_func(struct work_struct *work)
  372. {
  373. struct drm_psb_private *dev_priv = container_of(work, struct drm_psb_private,
  374. hotplug_work);
  375. struct drm_device *dev = dev_priv->dev;
  376. /* Just fire off a uevent and let userspace tell us what to do */
  377. drm_helper_hpd_irq_event(dev);
  378. }
  379. /* The core driver has received a hotplug IRQ. We are in IRQ context
  380. so extract the needed information and kick off queued processing */
  381. static int cdv_hotplug_event(struct drm_device *dev)
  382. {
  383. struct drm_psb_private *dev_priv = dev->dev_private;
  384. schedule_work(&dev_priv->hotplug_work);
  385. REG_WRITE(PORT_HOTPLUG_STAT, REG_READ(PORT_HOTPLUG_STAT));
  386. return 1;
  387. }
  388. static void cdv_hotplug_enable(struct drm_device *dev, bool on)
  389. {
  390. if (on) {
  391. u32 hotplug = REG_READ(PORT_HOTPLUG_EN);
  392. hotplug |= HDMIB_HOTPLUG_INT_EN | HDMIC_HOTPLUG_INT_EN |
  393. HDMID_HOTPLUG_INT_EN | CRT_HOTPLUG_INT_EN;
  394. REG_WRITE(PORT_HOTPLUG_EN, hotplug);
  395. } else {
  396. REG_WRITE(PORT_HOTPLUG_EN, 0);
  397. REG_WRITE(PORT_HOTPLUG_STAT, REG_READ(PORT_HOTPLUG_STAT));
  398. }
  399. }
  400. /* Cedarview */
  401. static const struct psb_offset cdv_regmap[2] = {
  402. {
  403. .fp0 = FPA0,
  404. .fp1 = FPA1,
  405. .cntr = DSPACNTR,
  406. .conf = PIPEACONF,
  407. .src = PIPEASRC,
  408. .dpll = DPLL_A,
  409. .dpll_md = DPLL_A_MD,
  410. .htotal = HTOTAL_A,
  411. .hblank = HBLANK_A,
  412. .hsync = HSYNC_A,
  413. .vtotal = VTOTAL_A,
  414. .vblank = VBLANK_A,
  415. .vsync = VSYNC_A,
  416. .stride = DSPASTRIDE,
  417. .size = DSPASIZE,
  418. .pos = DSPAPOS,
  419. .base = DSPABASE,
  420. .surf = DSPASURF,
  421. .addr = DSPABASE,
  422. .status = PIPEASTAT,
  423. .linoff = DSPALINOFF,
  424. .tileoff = DSPATILEOFF,
  425. .palette = PALETTE_A,
  426. },
  427. {
  428. .fp0 = FPB0,
  429. .fp1 = FPB1,
  430. .cntr = DSPBCNTR,
  431. .conf = PIPEBCONF,
  432. .src = PIPEBSRC,
  433. .dpll = DPLL_B,
  434. .dpll_md = DPLL_B_MD,
  435. .htotal = HTOTAL_B,
  436. .hblank = HBLANK_B,
  437. .hsync = HSYNC_B,
  438. .vtotal = VTOTAL_B,
  439. .vblank = VBLANK_B,
  440. .vsync = VSYNC_B,
  441. .stride = DSPBSTRIDE,
  442. .size = DSPBSIZE,
  443. .pos = DSPBPOS,
  444. .base = DSPBBASE,
  445. .surf = DSPBSURF,
  446. .addr = DSPBBASE,
  447. .status = PIPEBSTAT,
  448. .linoff = DSPBLINOFF,
  449. .tileoff = DSPBTILEOFF,
  450. .palette = PALETTE_B,
  451. }
  452. };
  453. static int cdv_chip_setup(struct drm_device *dev)
  454. {
  455. struct drm_psb_private *dev_priv = dev->dev_private;
  456. INIT_WORK(&dev_priv->hotplug_work, cdv_hotplug_work_func);
  457. if (pci_enable_msi(dev->pdev))
  458. dev_warn(dev->dev, "Enabling MSI failed!\n");
  459. dev_priv->regmap = cdv_regmap;
  460. cdv_get_core_freq(dev);
  461. psb_intel_opregion_init(dev);
  462. psb_intel_init_bios(dev);
  463. cdv_hotplug_enable(dev, false);
  464. return 0;
  465. }
  466. /* CDV is much like Poulsbo but has MID like SGX offsets and PM */
  467. const struct psb_ops cdv_chip_ops = {
  468. .name = "GMA3600/3650",
  469. .accel_2d = 0,
  470. .pipes = 2,
  471. .crtcs = 2,
  472. .hdmi_mask = (1 << 0) | (1 << 1),
  473. .lvds_mask = (1 << 1),
  474. .cursor_needs_phys = 0,
  475. .sgx_offset = MRST_SGX_OFFSET,
  476. .chip_setup = cdv_chip_setup,
  477. .errata = cdv_errata,
  478. .crtc_helper = &cdv_intel_helper_funcs,
  479. .crtc_funcs = &cdv_intel_crtc_funcs,
  480. .output_init = cdv_output_init,
  481. .hotplug = cdv_hotplug_event,
  482. .hotplug_enable = cdv_hotplug_enable,
  483. #ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
  484. .backlight_init = cdv_backlight_init,
  485. #endif
  486. .init_pm = cdv_init_pm,
  487. .save_regs = cdv_save_display_registers,
  488. .restore_regs = cdv_restore_display_registers,
  489. .power_down = cdv_power_down,
  490. .power_up = cdv_power_up,
  491. };