Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 1 | /* |
| 2 | * |
| 3 | * Copyright 2008 (c) Intel Corporation |
| 4 | * Jesse Barnes <jbarnes@virtuousgeek.org> |
| 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 |
| 19 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 20 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. |
| 21 | * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR |
| 22 | * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| 23 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 24 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 25 | */ |
| 26 | |
David Howells | 760285e | 2012-10-02 18:01:07 +0100 | [diff] [blame] | 27 | #include <drm/drmP.h> |
| 28 | #include <drm/i915_drm.h> |
Eric Anholt | f0217c4 | 2009-12-01 11:56:30 -0800 | [diff] [blame] | 29 | #include "intel_drv.h" |
Eugeni Dodonov | 5e5b7fa | 2012-01-07 23:40:34 -0200 | [diff] [blame] | 30 | #include "i915_reg.h" |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 31 | |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 32 | static u8 i915_read_indexed(struct drm_device *dev, u16 index_port, u16 data_port, u8 reg) |
| 33 | { |
| 34 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 35 | |
| 36 | I915_WRITE8(index_port, reg); |
| 37 | return I915_READ8(data_port); |
| 38 | } |
| 39 | |
| 40 | static u8 i915_read_ar(struct drm_device *dev, u16 st01, u8 reg, u16 palette_enable) |
| 41 | { |
| 42 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 43 | |
| 44 | I915_READ8(st01); |
| 45 | I915_WRITE8(VGA_AR_INDEX, palette_enable | reg); |
| 46 | return I915_READ8(VGA_AR_DATA_READ); |
| 47 | } |
| 48 | |
| 49 | static void i915_write_ar(struct drm_device *dev, u16 st01, u8 reg, u8 val, u16 palette_enable) |
| 50 | { |
| 51 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 52 | |
| 53 | I915_READ8(st01); |
| 54 | I915_WRITE8(VGA_AR_INDEX, palette_enable | reg); |
| 55 | I915_WRITE8(VGA_AR_DATA_WRITE, val); |
| 56 | } |
| 57 | |
| 58 | static void i915_write_indexed(struct drm_device *dev, u16 index_port, u16 data_port, u8 reg, u8 val) |
| 59 | { |
| 60 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 61 | |
| 62 | I915_WRITE8(index_port, reg); |
| 63 | I915_WRITE8(data_port, val); |
| 64 | } |
| 65 | |
| 66 | static void i915_save_vga(struct drm_device *dev) |
| 67 | { |
| 68 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 69 | int i; |
| 70 | u16 cr_index, cr_data, st01; |
| 71 | |
Daniel Vetter | 44cec74 | 2013-01-25 17:53:21 +0100 | [diff] [blame^] | 72 | /* VGA state */ |
| 73 | dev_priv->regfile.saveVGA0 = I915_READ(VGA0); |
| 74 | dev_priv->regfile.saveVGA1 = I915_READ(VGA1); |
| 75 | dev_priv->regfile.saveVGA_PD = I915_READ(VGA_PD); |
| 76 | if (HAS_PCH_SPLIT(dev)) |
| 77 | dev_priv->regfile.saveVGACNTRL = I915_READ(CPU_VGACNTRL); |
| 78 | else |
| 79 | dev_priv->regfile.saveVGACNTRL = I915_READ(VGACNTRL); |
| 80 | |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 81 | /* VGA color palette registers */ |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 82 | dev_priv->regfile.saveDACMASK = I915_READ8(VGA_DACMASK); |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 83 | |
| 84 | /* MSR bits */ |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 85 | dev_priv->regfile.saveMSR = I915_READ8(VGA_MSR_READ); |
| 86 | if (dev_priv->regfile.saveMSR & VGA_MSR_CGA_MODE) { |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 87 | cr_index = VGA_CR_INDEX_CGA; |
| 88 | cr_data = VGA_CR_DATA_CGA; |
| 89 | st01 = VGA_ST01_CGA; |
| 90 | } else { |
| 91 | cr_index = VGA_CR_INDEX_MDA; |
| 92 | cr_data = VGA_CR_DATA_MDA; |
| 93 | st01 = VGA_ST01_MDA; |
| 94 | } |
| 95 | |
| 96 | /* CRT controller regs */ |
| 97 | i915_write_indexed(dev, cr_index, cr_data, 0x11, |
| 98 | i915_read_indexed(dev, cr_index, cr_data, 0x11) & |
| 99 | (~0x80)); |
| 100 | for (i = 0; i <= 0x24; i++) |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 101 | dev_priv->regfile.saveCR[i] = |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 102 | i915_read_indexed(dev, cr_index, cr_data, i); |
| 103 | /* Make sure we don't turn off CR group 0 writes */ |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 104 | dev_priv->regfile.saveCR[0x11] &= ~0x80; |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 105 | |
| 106 | /* Attribute controller registers */ |
| 107 | I915_READ8(st01); |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 108 | dev_priv->regfile.saveAR_INDEX = I915_READ8(VGA_AR_INDEX); |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 109 | for (i = 0; i <= 0x14; i++) |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 110 | dev_priv->regfile.saveAR[i] = i915_read_ar(dev, st01, i, 0); |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 111 | I915_READ8(st01); |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 112 | I915_WRITE8(VGA_AR_INDEX, dev_priv->regfile.saveAR_INDEX); |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 113 | I915_READ8(st01); |
| 114 | |
| 115 | /* Graphics controller registers */ |
| 116 | for (i = 0; i < 9; i++) |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 117 | dev_priv->regfile.saveGR[i] = |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 118 | i915_read_indexed(dev, VGA_GR_INDEX, VGA_GR_DATA, i); |
| 119 | |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 120 | dev_priv->regfile.saveGR[0x10] = |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 121 | i915_read_indexed(dev, VGA_GR_INDEX, VGA_GR_DATA, 0x10); |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 122 | dev_priv->regfile.saveGR[0x11] = |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 123 | i915_read_indexed(dev, VGA_GR_INDEX, VGA_GR_DATA, 0x11); |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 124 | dev_priv->regfile.saveGR[0x18] = |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 125 | i915_read_indexed(dev, VGA_GR_INDEX, VGA_GR_DATA, 0x18); |
| 126 | |
| 127 | /* Sequencer registers */ |
| 128 | for (i = 0; i < 8; i++) |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 129 | dev_priv->regfile.saveSR[i] = |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 130 | i915_read_indexed(dev, VGA_SR_INDEX, VGA_SR_DATA, i); |
| 131 | } |
| 132 | |
| 133 | static void i915_restore_vga(struct drm_device *dev) |
| 134 | { |
| 135 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 136 | int i; |
| 137 | u16 cr_index, cr_data, st01; |
| 138 | |
Daniel Vetter | 44cec74 | 2013-01-25 17:53:21 +0100 | [diff] [blame^] | 139 | /* VGA state */ |
| 140 | if (HAS_PCH_SPLIT(dev)) |
| 141 | I915_WRITE(CPU_VGACNTRL, dev_priv->regfile.saveVGACNTRL); |
| 142 | else |
| 143 | I915_WRITE(VGACNTRL, dev_priv->regfile.saveVGACNTRL); |
| 144 | |
| 145 | I915_WRITE(VGA0, dev_priv->regfile.saveVGA0); |
| 146 | I915_WRITE(VGA1, dev_priv->regfile.saveVGA1); |
| 147 | I915_WRITE(VGA_PD, dev_priv->regfile.saveVGA_PD); |
| 148 | POSTING_READ(VGA_PD); |
| 149 | udelay(150); |
| 150 | |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 151 | /* MSR bits */ |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 152 | I915_WRITE8(VGA_MSR_WRITE, dev_priv->regfile.saveMSR); |
| 153 | if (dev_priv->regfile.saveMSR & VGA_MSR_CGA_MODE) { |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 154 | cr_index = VGA_CR_INDEX_CGA; |
| 155 | cr_data = VGA_CR_DATA_CGA; |
| 156 | st01 = VGA_ST01_CGA; |
| 157 | } else { |
| 158 | cr_index = VGA_CR_INDEX_MDA; |
| 159 | cr_data = VGA_CR_DATA_MDA; |
| 160 | st01 = VGA_ST01_MDA; |
| 161 | } |
| 162 | |
| 163 | /* Sequencer registers, don't write SR07 */ |
| 164 | for (i = 0; i < 7; i++) |
| 165 | i915_write_indexed(dev, VGA_SR_INDEX, VGA_SR_DATA, i, |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 166 | dev_priv->regfile.saveSR[i]); |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 167 | |
| 168 | /* CRT controller regs */ |
| 169 | /* Enable CR group 0 writes */ |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 170 | i915_write_indexed(dev, cr_index, cr_data, 0x11, dev_priv->regfile.saveCR[0x11]); |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 171 | for (i = 0; i <= 0x24; i++) |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 172 | i915_write_indexed(dev, cr_index, cr_data, i, dev_priv->regfile.saveCR[i]); |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 173 | |
| 174 | /* Graphics controller regs */ |
| 175 | for (i = 0; i < 9; i++) |
| 176 | i915_write_indexed(dev, VGA_GR_INDEX, VGA_GR_DATA, i, |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 177 | dev_priv->regfile.saveGR[i]); |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 178 | |
| 179 | i915_write_indexed(dev, VGA_GR_INDEX, VGA_GR_DATA, 0x10, |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 180 | dev_priv->regfile.saveGR[0x10]); |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 181 | i915_write_indexed(dev, VGA_GR_INDEX, VGA_GR_DATA, 0x11, |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 182 | dev_priv->regfile.saveGR[0x11]); |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 183 | i915_write_indexed(dev, VGA_GR_INDEX, VGA_GR_DATA, 0x18, |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 184 | dev_priv->regfile.saveGR[0x18]); |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 185 | |
| 186 | /* Attribute controller registers */ |
| 187 | I915_READ8(st01); /* switch back to index mode */ |
| 188 | for (i = 0; i <= 0x14; i++) |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 189 | i915_write_ar(dev, st01, i, dev_priv->regfile.saveAR[i], 0); |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 190 | I915_READ8(st01); /* switch back to index mode */ |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 191 | I915_WRITE8(VGA_AR_INDEX, dev_priv->regfile.saveAR_INDEX | 0x20); |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 192 | I915_READ8(st01); |
| 193 | |
| 194 | /* VGA color palette registers */ |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 195 | I915_WRITE8(VGA_DACMASK, dev_priv->regfile.saveDACMASK); |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 196 | } |
| 197 | |
Keith Packard | d70bed1 | 2011-06-29 00:30:34 -0700 | [diff] [blame] | 198 | static void i915_save_display(struct drm_device *dev) |
Zhao Yakui | fccdaba | 2009-07-08 14:13:14 +0800 | [diff] [blame] | 199 | { |
| 200 | struct drm_i915_private *dev_priv = dev->dev_private; |
Zhao Yakui | fccdaba | 2009-07-08 14:13:14 +0800 | [diff] [blame] | 201 | |
| 202 | /* Display arbitration control */ |
Paulo Zanoni | 8de0add | 2013-01-18 18:29:03 -0200 | [diff] [blame] | 203 | if (INTEL_INFO(dev)->gen <= 4) |
| 204 | dev_priv->regfile.saveDSPARB = I915_READ(DSPARB); |
Zhao Yakui | fccdaba | 2009-07-08 14:13:14 +0800 | [diff] [blame] | 205 | |
| 206 | /* This is only meaningful in non-KMS mode */ |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 207 | /* Don't regfile.save them in KMS mode */ |
Daniel Vetter | 2e9723a | 2013-01-25 17:53:19 +0100 | [diff] [blame] | 208 | if (!drm_core_check_feature(dev, DRIVER_MODESET)) |
Daniel Vetter | d8157a3 | 2013-01-25 17:53:20 +0100 | [diff] [blame] | 209 | i915_save_display_reg(dev); |
Ben Gamari | 1341d65 | 2009-09-14 17:48:42 -0400 | [diff] [blame] | 210 | |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 211 | /* LVDS state */ |
Chris Wilson | 90eb77b | 2010-08-14 14:41:23 +0100 | [diff] [blame] | 212 | if (HAS_PCH_SPLIT(dev)) { |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 213 | dev_priv->regfile.savePP_CONTROL = I915_READ(PCH_PP_CONTROL); |
| 214 | dev_priv->regfile.saveBLC_PWM_CTL = I915_READ(BLC_PWM_PCH_CTL1); |
| 215 | dev_priv->regfile.saveBLC_PWM_CTL2 = I915_READ(BLC_PWM_PCH_CTL2); |
| 216 | dev_priv->regfile.saveBLC_CPU_PWM_CTL = I915_READ(BLC_PWM_CPU_CTL); |
| 217 | dev_priv->regfile.saveBLC_CPU_PWM_CTL2 = I915_READ(BLC_PWM_CPU_CTL2); |
| 218 | dev_priv->regfile.saveLVDS = I915_READ(PCH_LVDS); |
Zhenyu Wang | 4204878 | 2009-10-21 15:27:01 +0800 | [diff] [blame] | 219 | } else { |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 220 | dev_priv->regfile.savePP_CONTROL = I915_READ(PP_CONTROL); |
| 221 | dev_priv->regfile.savePFIT_PGM_RATIOS = I915_READ(PFIT_PGM_RATIOS); |
| 222 | dev_priv->regfile.saveBLC_PWM_CTL = I915_READ(BLC_PWM_CTL); |
| 223 | dev_priv->regfile.saveBLC_HIST_CTL = I915_READ(BLC_HIST_CTL); |
Chris Wilson | a6c45cf | 2010-09-17 00:32:17 +0100 | [diff] [blame] | 224 | if (INTEL_INFO(dev)->gen >= 4) |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 225 | dev_priv->regfile.saveBLC_PWM_CTL2 = I915_READ(BLC_PWM_CTL2); |
Zhenyu Wang | 4204878 | 2009-10-21 15:27:01 +0800 | [diff] [blame] | 226 | if (IS_MOBILE(dev) && !IS_I830(dev)) |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 227 | dev_priv->regfile.saveLVDS = I915_READ(LVDS); |
Zhenyu Wang | 4204878 | 2009-10-21 15:27:01 +0800 | [diff] [blame] | 228 | } |
| 229 | |
Chris Wilson | 90eb77b | 2010-08-14 14:41:23 +0100 | [diff] [blame] | 230 | if (!IS_I830(dev) && !IS_845G(dev) && !HAS_PCH_SPLIT(dev)) |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 231 | dev_priv->regfile.savePFIT_CONTROL = I915_READ(PFIT_CONTROL); |
Zhenyu Wang | 4204878 | 2009-10-21 15:27:01 +0800 | [diff] [blame] | 232 | |
Chris Wilson | 90eb77b | 2010-08-14 14:41:23 +0100 | [diff] [blame] | 233 | if (HAS_PCH_SPLIT(dev)) { |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 234 | dev_priv->regfile.savePP_ON_DELAYS = I915_READ(PCH_PP_ON_DELAYS); |
| 235 | dev_priv->regfile.savePP_OFF_DELAYS = I915_READ(PCH_PP_OFF_DELAYS); |
| 236 | dev_priv->regfile.savePP_DIVISOR = I915_READ(PCH_PP_DIVISOR); |
Zhenyu Wang | 4204878 | 2009-10-21 15:27:01 +0800 | [diff] [blame] | 237 | } else { |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 238 | dev_priv->regfile.savePP_ON_DELAYS = I915_READ(PP_ON_DELAYS); |
| 239 | dev_priv->regfile.savePP_OFF_DELAYS = I915_READ(PP_OFF_DELAYS); |
| 240 | dev_priv->regfile.savePP_DIVISOR = I915_READ(PP_DIVISOR); |
Zhenyu Wang | 4204878 | 2009-10-21 15:27:01 +0800 | [diff] [blame] | 241 | } |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 242 | |
Daniel Vetter | f81183f | 2012-10-17 11:32:55 +0200 | [diff] [blame] | 243 | if (!drm_core_check_feature(dev, DRIVER_MODESET)) { |
| 244 | /* Display Port state */ |
| 245 | if (SUPPORTS_INTEGRATED_DP(dev)) { |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 246 | dev_priv->regfile.saveDP_B = I915_READ(DP_B); |
| 247 | dev_priv->regfile.saveDP_C = I915_READ(DP_C); |
| 248 | dev_priv->regfile.saveDP_D = I915_READ(DP_D); |
| 249 | dev_priv->regfile.savePIPEA_GMCH_DATA_M = I915_READ(_PIPEA_GMCH_DATA_M); |
| 250 | dev_priv->regfile.savePIPEB_GMCH_DATA_M = I915_READ(_PIPEB_GMCH_DATA_M); |
| 251 | dev_priv->regfile.savePIPEA_GMCH_DATA_N = I915_READ(_PIPEA_GMCH_DATA_N); |
| 252 | dev_priv->regfile.savePIPEB_GMCH_DATA_N = I915_READ(_PIPEB_GMCH_DATA_N); |
| 253 | dev_priv->regfile.savePIPEA_DP_LINK_M = I915_READ(_PIPEA_DP_LINK_M); |
| 254 | dev_priv->regfile.savePIPEB_DP_LINK_M = I915_READ(_PIPEB_DP_LINK_M); |
| 255 | dev_priv->regfile.savePIPEA_DP_LINK_N = I915_READ(_PIPEA_DP_LINK_N); |
| 256 | dev_priv->regfile.savePIPEB_DP_LINK_N = I915_READ(_PIPEB_DP_LINK_N); |
Daniel Vetter | f81183f | 2012-10-17 11:32:55 +0200 | [diff] [blame] | 257 | } |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 258 | /* FIXME: regfile.save TV & SDVO state */ |
Keith Packard | a4fc5ed | 2009-04-07 16:16:42 -0700 | [diff] [blame] | 259 | } |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 260 | |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 261 | /* Only regfile.save FBC state on the platform that supports FBC */ |
Zhao Yakui | a2c459e | 2010-03-19 17:05:10 +0800 | [diff] [blame] | 262 | if (I915_HAS_FBC(dev)) { |
Chris Wilson | 90eb77b | 2010-08-14 14:41:23 +0100 | [diff] [blame] | 263 | if (HAS_PCH_SPLIT(dev)) { |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 264 | dev_priv->regfile.saveDPFC_CB_BASE = I915_READ(ILK_DPFC_CB_BASE); |
Zhao Yakui | b52eb4d | 2010-06-12 14:32:27 +0800 | [diff] [blame] | 265 | } else if (IS_GM45(dev)) { |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 266 | dev_priv->regfile.saveDPFC_CB_BASE = I915_READ(DPFC_CB_BASE); |
Zhao Yakui | a2c459e | 2010-03-19 17:05:10 +0800 | [diff] [blame] | 267 | } else { |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 268 | dev_priv->regfile.saveFBC_CFB_BASE = I915_READ(FBC_CFB_BASE); |
| 269 | dev_priv->regfile.saveFBC_LL_BASE = I915_READ(FBC_LL_BASE); |
| 270 | dev_priv->regfile.saveFBC_CONTROL2 = I915_READ(FBC_CONTROL2); |
| 271 | dev_priv->regfile.saveFBC_CONTROL = I915_READ(FBC_CONTROL); |
Zhao Yakui | a2c459e | 2010-03-19 17:05:10 +0800 | [diff] [blame] | 272 | } |
Jesse Barnes | 06027f9 | 2009-10-05 13:47:26 -0700 | [diff] [blame] | 273 | } |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 274 | |
Daniel Vetter | 44cec74 | 2013-01-25 17:53:21 +0100 | [diff] [blame^] | 275 | if (!drm_core_check_feature(dev, DRIVER_MODESET)) |
| 276 | i915_save_vga(dev); |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 277 | } |
| 278 | |
Keith Packard | d70bed1 | 2011-06-29 00:30:34 -0700 | [diff] [blame] | 279 | static void i915_restore_display(struct drm_device *dev) |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 280 | { |
| 281 | struct drm_i915_private *dev_priv = dev->dev_private; |
Peng Li | 461cba2 | 2008-11-18 12:39:02 +0800 | [diff] [blame] | 282 | |
Keith Packard | 881ee98 | 2008-11-02 23:08:44 -0800 | [diff] [blame] | 283 | /* Display arbitration */ |
Paulo Zanoni | 8de0add | 2013-01-18 18:29:03 -0200 | [diff] [blame] | 284 | if (INTEL_INFO(dev)->gen <= 4) |
| 285 | I915_WRITE(DSPARB, dev_priv->regfile.saveDSPARB); |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 286 | |
Daniel Vetter | 2e9723a | 2013-01-25 17:53:19 +0100 | [diff] [blame] | 287 | if (!drm_core_check_feature(dev, DRIVER_MODESET)) |
Daniel Vetter | d8157a3 | 2013-01-25 17:53:20 +0100 | [diff] [blame] | 288 | i915_restore_display_reg(dev); |
Ben Gamari | 1341d65 | 2009-09-14 17:48:42 -0400 | [diff] [blame] | 289 | |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 290 | /* LVDS state */ |
Chris Wilson | a6c45cf | 2010-09-17 00:32:17 +0100 | [diff] [blame] | 291 | if (INTEL_INFO(dev)->gen >= 4 && !HAS_PCH_SPLIT(dev)) |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 292 | I915_WRITE(BLC_PWM_CTL2, dev_priv->regfile.saveBLC_PWM_CTL2); |
Zhenyu Wang | 4204878 | 2009-10-21 15:27:01 +0800 | [diff] [blame] | 293 | |
Chris Wilson | 90eb77b | 2010-08-14 14:41:23 +0100 | [diff] [blame] | 294 | if (HAS_PCH_SPLIT(dev)) { |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 295 | I915_WRITE(PCH_LVDS, dev_priv->regfile.saveLVDS); |
Zhenyu Wang | 4204878 | 2009-10-21 15:27:01 +0800 | [diff] [blame] | 296 | } else if (IS_MOBILE(dev) && !IS_I830(dev)) |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 297 | I915_WRITE(LVDS, dev_priv->regfile.saveLVDS); |
Zhenyu Wang | 4204878 | 2009-10-21 15:27:01 +0800 | [diff] [blame] | 298 | |
Chris Wilson | 90eb77b | 2010-08-14 14:41:23 +0100 | [diff] [blame] | 299 | if (!IS_I830(dev) && !IS_845G(dev) && !HAS_PCH_SPLIT(dev)) |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 300 | I915_WRITE(PFIT_CONTROL, dev_priv->regfile.savePFIT_CONTROL); |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 301 | |
Chris Wilson | 90eb77b | 2010-08-14 14:41:23 +0100 | [diff] [blame] | 302 | if (HAS_PCH_SPLIT(dev)) { |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 303 | I915_WRITE(BLC_PWM_PCH_CTL1, dev_priv->regfile.saveBLC_PWM_CTL); |
| 304 | I915_WRITE(BLC_PWM_PCH_CTL2, dev_priv->regfile.saveBLC_PWM_CTL2); |
Takashi Iwai | 6db65cb | 2012-06-21 15:30:41 +0200 | [diff] [blame] | 305 | /* NOTE: BLC_PWM_CPU_CTL must be written after BLC_PWM_CPU_CTL2; |
| 306 | * otherwise we get blank eDP screen after S3 on some machines |
| 307 | */ |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 308 | I915_WRITE(BLC_PWM_CPU_CTL2, dev_priv->regfile.saveBLC_CPU_PWM_CTL2); |
| 309 | I915_WRITE(BLC_PWM_CPU_CTL, dev_priv->regfile.saveBLC_CPU_PWM_CTL); |
| 310 | I915_WRITE(PCH_PP_ON_DELAYS, dev_priv->regfile.savePP_ON_DELAYS); |
| 311 | I915_WRITE(PCH_PP_OFF_DELAYS, dev_priv->regfile.savePP_OFF_DELAYS); |
| 312 | I915_WRITE(PCH_PP_DIVISOR, dev_priv->regfile.savePP_DIVISOR); |
| 313 | I915_WRITE(PCH_PP_CONTROL, dev_priv->regfile.savePP_CONTROL); |
Jesse Barnes | 88271da | 2011-01-05 12:01:24 -0800 | [diff] [blame] | 314 | I915_WRITE(RSTDBYCTL, |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 315 | dev_priv->regfile.saveMCHBAR_RENDER_STANDBY); |
Zhenyu Wang | 4204878 | 2009-10-21 15:27:01 +0800 | [diff] [blame] | 316 | } else { |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 317 | I915_WRITE(PFIT_PGM_RATIOS, dev_priv->regfile.savePFIT_PGM_RATIOS); |
| 318 | I915_WRITE(BLC_PWM_CTL, dev_priv->regfile.saveBLC_PWM_CTL); |
| 319 | I915_WRITE(BLC_HIST_CTL, dev_priv->regfile.saveBLC_HIST_CTL); |
| 320 | I915_WRITE(PP_ON_DELAYS, dev_priv->regfile.savePP_ON_DELAYS); |
| 321 | I915_WRITE(PP_OFF_DELAYS, dev_priv->regfile.savePP_OFF_DELAYS); |
| 322 | I915_WRITE(PP_DIVISOR, dev_priv->regfile.savePP_DIVISOR); |
| 323 | I915_WRITE(PP_CONTROL, dev_priv->regfile.savePP_CONTROL); |
Zhenyu Wang | 4204878 | 2009-10-21 15:27:01 +0800 | [diff] [blame] | 324 | } |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 325 | |
Daniel Vetter | f81183f | 2012-10-17 11:32:55 +0200 | [diff] [blame] | 326 | if (!drm_core_check_feature(dev, DRIVER_MODESET)) { |
| 327 | /* Display Port state */ |
| 328 | if (SUPPORTS_INTEGRATED_DP(dev)) { |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 329 | I915_WRITE(DP_B, dev_priv->regfile.saveDP_B); |
| 330 | I915_WRITE(DP_C, dev_priv->regfile.saveDP_C); |
| 331 | I915_WRITE(DP_D, dev_priv->regfile.saveDP_D); |
Daniel Vetter | f81183f | 2012-10-17 11:32:55 +0200 | [diff] [blame] | 332 | } |
| 333 | /* FIXME: restore TV & SDVO state */ |
Keith Packard | a4fc5ed | 2009-04-07 16:16:42 -0700 | [diff] [blame] | 334 | } |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 335 | |
Zhao Yakui | a2c459e | 2010-03-19 17:05:10 +0800 | [diff] [blame] | 336 | /* only restore FBC info on the platform that supports FBC*/ |
Chris Wilson | 43a9539 | 2011-07-08 12:22:36 +0100 | [diff] [blame] | 337 | intel_disable_fbc(dev); |
Zhao Yakui | a2c459e | 2010-03-19 17:05:10 +0800 | [diff] [blame] | 338 | if (I915_HAS_FBC(dev)) { |
Chris Wilson | 90eb77b | 2010-08-14 14:41:23 +0100 | [diff] [blame] | 339 | if (HAS_PCH_SPLIT(dev)) { |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 340 | I915_WRITE(ILK_DPFC_CB_BASE, dev_priv->regfile.saveDPFC_CB_BASE); |
Zhao Yakui | b52eb4d | 2010-06-12 14:32:27 +0800 | [diff] [blame] | 341 | } else if (IS_GM45(dev)) { |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 342 | I915_WRITE(DPFC_CB_BASE, dev_priv->regfile.saveDPFC_CB_BASE); |
Zhao Yakui | a2c459e | 2010-03-19 17:05:10 +0800 | [diff] [blame] | 343 | } else { |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 344 | I915_WRITE(FBC_CFB_BASE, dev_priv->regfile.saveFBC_CFB_BASE); |
| 345 | I915_WRITE(FBC_LL_BASE, dev_priv->regfile.saveFBC_LL_BASE); |
| 346 | I915_WRITE(FBC_CONTROL2, dev_priv->regfile.saveFBC_CONTROL2); |
| 347 | I915_WRITE(FBC_CONTROL, dev_priv->regfile.saveFBC_CONTROL); |
Zhao Yakui | a2c459e | 2010-03-19 17:05:10 +0800 | [diff] [blame] | 348 | } |
Jesse Barnes | 06027f9 | 2009-10-05 13:47:26 -0700 | [diff] [blame] | 349 | } |
Daniel Vetter | 44cec74 | 2013-01-25 17:53:21 +0100 | [diff] [blame^] | 350 | if (!drm_core_check_feature(dev, DRIVER_MODESET)) |
| 351 | i915_restore_vga(dev); |
Zhenyu Wang | 4204878 | 2009-10-21 15:27:01 +0800 | [diff] [blame] | 352 | else |
Daniel Vetter | 44cec74 | 2013-01-25 17:53:21 +0100 | [diff] [blame^] | 353 | i915_redisable_vga(dev); |
Ben Gamari | 1341d65 | 2009-09-14 17:48:42 -0400 | [diff] [blame] | 354 | } |
| 355 | |
| 356 | int i915_save_state(struct drm_device *dev) |
| 357 | { |
| 358 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 359 | int i; |
| 360 | |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 361 | pci_read_config_byte(dev->pdev, LBB, &dev_priv->regfile.saveLBB); |
Ben Gamari | 1341d65 | 2009-09-14 17:48:42 -0400 | [diff] [blame] | 362 | |
Keith Packard | d70bed1 | 2011-06-29 00:30:34 -0700 | [diff] [blame] | 363 | mutex_lock(&dev->struct_mutex); |
| 364 | |
Ben Gamari | 1341d65 | 2009-09-14 17:48:42 -0400 | [diff] [blame] | 365 | i915_save_display(dev); |
| 366 | |
Daniel Vetter | 905c27b | 2012-10-17 11:32:56 +0200 | [diff] [blame] | 367 | if (!drm_core_check_feature(dev, DRIVER_MODESET)) { |
| 368 | /* Interrupt state */ |
| 369 | if (HAS_PCH_SPLIT(dev)) { |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 370 | dev_priv->regfile.saveDEIER = I915_READ(DEIER); |
| 371 | dev_priv->regfile.saveDEIMR = I915_READ(DEIMR); |
| 372 | dev_priv->regfile.saveGTIER = I915_READ(GTIER); |
| 373 | dev_priv->regfile.saveGTIMR = I915_READ(GTIMR); |
| 374 | dev_priv->regfile.saveFDI_RXA_IMR = I915_READ(_FDI_RXA_IMR); |
| 375 | dev_priv->regfile.saveFDI_RXB_IMR = I915_READ(_FDI_RXB_IMR); |
| 376 | dev_priv->regfile.saveMCHBAR_RENDER_STANDBY = |
Daniel Vetter | 905c27b | 2012-10-17 11:32:56 +0200 | [diff] [blame] | 377 | I915_READ(RSTDBYCTL); |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 378 | dev_priv->regfile.savePCH_PORT_HOTPLUG = I915_READ(PCH_PORT_HOTPLUG); |
Daniel Vetter | 905c27b | 2012-10-17 11:32:56 +0200 | [diff] [blame] | 379 | } else { |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 380 | dev_priv->regfile.saveIER = I915_READ(IER); |
| 381 | dev_priv->regfile.saveIMR = I915_READ(IMR); |
Daniel Vetter | 905c27b | 2012-10-17 11:32:56 +0200 | [diff] [blame] | 382 | } |
Zhenyu Wang | 4204878 | 2009-10-21 15:27:01 +0800 | [diff] [blame] | 383 | } |
Ben Gamari | 1341d65 | 2009-09-14 17:48:42 -0400 | [diff] [blame] | 384 | |
Daniel Vetter | 8090c6b | 2012-06-24 16:42:32 +0200 | [diff] [blame] | 385 | intel_disable_gt_powersave(dev); |
Jesse Barnes | f97108d | 2010-01-29 11:27:07 -0800 | [diff] [blame] | 386 | |
Ben Gamari | 1341d65 | 2009-09-14 17:48:42 -0400 | [diff] [blame] | 387 | /* Cache mode state */ |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 388 | dev_priv->regfile.saveCACHE_MODE_0 = I915_READ(CACHE_MODE_0); |
Ben Gamari | 1341d65 | 2009-09-14 17:48:42 -0400 | [diff] [blame] | 389 | |
| 390 | /* Memory Arbitration state */ |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 391 | dev_priv->regfile.saveMI_ARB_STATE = I915_READ(MI_ARB_STATE); |
Ben Gamari | 1341d65 | 2009-09-14 17:48:42 -0400 | [diff] [blame] | 392 | |
| 393 | /* Scratch space */ |
| 394 | for (i = 0; i < 16; i++) { |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 395 | dev_priv->regfile.saveSWF0[i] = I915_READ(SWF00 + (i << 2)); |
| 396 | dev_priv->regfile.saveSWF1[i] = I915_READ(SWF10 + (i << 2)); |
Ben Gamari | 1341d65 | 2009-09-14 17:48:42 -0400 | [diff] [blame] | 397 | } |
| 398 | for (i = 0; i < 3; i++) |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 399 | dev_priv->regfile.saveSWF2[i] = I915_READ(SWF30 + (i << 2)); |
Ben Gamari | 1341d65 | 2009-09-14 17:48:42 -0400 | [diff] [blame] | 400 | |
Keith Packard | d70bed1 | 2011-06-29 00:30:34 -0700 | [diff] [blame] | 401 | mutex_unlock(&dev->struct_mutex); |
| 402 | |
Ben Gamari | 1341d65 | 2009-09-14 17:48:42 -0400 | [diff] [blame] | 403 | return 0; |
| 404 | } |
| 405 | |
| 406 | int i915_restore_state(struct drm_device *dev) |
| 407 | { |
| 408 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 409 | int i; |
| 410 | |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 411 | pci_write_config_byte(dev->pdev, LBB, dev_priv->regfile.saveLBB); |
Ben Gamari | 1341d65 | 2009-09-14 17:48:42 -0400 | [diff] [blame] | 412 | |
Keith Packard | d70bed1 | 2011-06-29 00:30:34 -0700 | [diff] [blame] | 413 | mutex_lock(&dev->struct_mutex); |
| 414 | |
Ben Gamari | 1341d65 | 2009-09-14 17:48:42 -0400 | [diff] [blame] | 415 | i915_restore_display(dev); |
| 416 | |
Daniel Vetter | 905c27b | 2012-10-17 11:32:56 +0200 | [diff] [blame] | 417 | if (!drm_core_check_feature(dev, DRIVER_MODESET)) { |
| 418 | /* Interrupt state */ |
| 419 | if (HAS_PCH_SPLIT(dev)) { |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 420 | I915_WRITE(DEIER, dev_priv->regfile.saveDEIER); |
| 421 | I915_WRITE(DEIMR, dev_priv->regfile.saveDEIMR); |
| 422 | I915_WRITE(GTIER, dev_priv->regfile.saveGTIER); |
| 423 | I915_WRITE(GTIMR, dev_priv->regfile.saveGTIMR); |
| 424 | I915_WRITE(_FDI_RXA_IMR, dev_priv->regfile.saveFDI_RXA_IMR); |
| 425 | I915_WRITE(_FDI_RXB_IMR, dev_priv->regfile.saveFDI_RXB_IMR); |
| 426 | I915_WRITE(PCH_PORT_HOTPLUG, dev_priv->regfile.savePCH_PORT_HOTPLUG); |
Daniel Vetter | 905c27b | 2012-10-17 11:32:56 +0200 | [diff] [blame] | 427 | } else { |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 428 | I915_WRITE(IER, dev_priv->regfile.saveIER); |
| 429 | I915_WRITE(IMR, dev_priv->regfile.saveIMR); |
Daniel Vetter | 905c27b | 2012-10-17 11:32:56 +0200 | [diff] [blame] | 430 | } |
Zhenyu Wang | 4204878 | 2009-10-21 15:27:01 +0800 | [diff] [blame] | 431 | } |
Keith Packard | d70bed1 | 2011-06-29 00:30:34 -0700 | [diff] [blame] | 432 | |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 433 | /* Cache mode state */ |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 434 | I915_WRITE(CACHE_MODE_0, dev_priv->regfile.saveCACHE_MODE_0 | 0xffff0000); |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 435 | |
| 436 | /* Memory arbitration state */ |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 437 | I915_WRITE(MI_ARB_STATE, dev_priv->regfile.saveMI_ARB_STATE | 0xffff0000); |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 438 | |
| 439 | for (i = 0; i < 16; i++) { |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 440 | I915_WRITE(SWF00 + (i << 2), dev_priv->regfile.saveSWF0[i]); |
| 441 | I915_WRITE(SWF10 + (i << 2), dev_priv->regfile.saveSWF1[i]); |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 442 | } |
| 443 | for (i = 0; i < 3; i++) |
Daniel Vetter | f4c956a | 2012-11-02 19:55:02 +0100 | [diff] [blame] | 444 | I915_WRITE(SWF30 + (i << 2), dev_priv->regfile.saveSWF2[i]); |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 445 | |
Keith Packard | d70bed1 | 2011-06-29 00:30:34 -0700 | [diff] [blame] | 446 | mutex_unlock(&dev->struct_mutex); |
| 447 | |
Chris Wilson | f899fc6 | 2010-07-20 15:44:45 -0700 | [diff] [blame] | 448 | intel_i2c_reset(dev); |
Eric Anholt | f0217c4 | 2009-12-01 11:56:30 -0800 | [diff] [blame] | 449 | |
Jesse Barnes | 317c35d | 2008-08-25 15:11:06 -0700 | [diff] [blame] | 450 | return 0; |
| 451 | } |