dvo_ch7017.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. /*
  2. * Copyright © 2006 Intel Corporation
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice (including the next
  12. * paragraph) shall be included in all copies or substantial portions of the
  13. * Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  18. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  20. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  21. * DEALINGS IN THE SOFTWARE.
  22. *
  23. * Authors:
  24. * Eric Anholt <eric@anholt.net>
  25. *
  26. */
  27. #include "dvo.h"
  28. #define CH7017_TV_DISPLAY_MODE 0x00
  29. #define CH7017_FLICKER_FILTER 0x01
  30. #define CH7017_VIDEO_BANDWIDTH 0x02
  31. #define CH7017_TEXT_ENHANCEMENT 0x03
  32. #define CH7017_START_ACTIVE_VIDEO 0x04
  33. #define CH7017_HORIZONTAL_POSITION 0x05
  34. #define CH7017_VERTICAL_POSITION 0x06
  35. #define CH7017_BLACK_LEVEL 0x07
  36. #define CH7017_CONTRAST_ENHANCEMENT 0x08
  37. #define CH7017_TV_PLL 0x09
  38. #define CH7017_TV_PLL_M 0x0a
  39. #define CH7017_TV_PLL_N 0x0b
  40. #define CH7017_SUB_CARRIER_0 0x0c
  41. #define CH7017_CIV_CONTROL 0x10
  42. #define CH7017_CIV_0 0x11
  43. #define CH7017_CHROMA_BOOST 0x14
  44. #define CH7017_CLOCK_MODE 0x1c
  45. #define CH7017_INPUT_CLOCK 0x1d
  46. #define CH7017_GPIO_CONTROL 0x1e
  47. #define CH7017_INPUT_DATA_FORMAT 0x1f
  48. #define CH7017_CONNECTION_DETECT 0x20
  49. #define CH7017_DAC_CONTROL 0x21
  50. #define CH7017_BUFFERED_CLOCK_OUTPUT 0x22
  51. #define CH7017_DEFEAT_VSYNC 0x47
  52. #define CH7017_TEST_PATTERN 0x48
  53. #define CH7017_POWER_MANAGEMENT 0x49
  54. /** Enables the TV output path. */
  55. #define CH7017_TV_EN (1 << 0)
  56. #define CH7017_DAC0_POWER_DOWN (1 << 1)
  57. #define CH7017_DAC1_POWER_DOWN (1 << 2)
  58. #define CH7017_DAC2_POWER_DOWN (1 << 3)
  59. #define CH7017_DAC3_POWER_DOWN (1 << 4)
  60. /** Powers down the TV out block, and DAC0-3 */
  61. #define CH7017_TV_POWER_DOWN_EN (1 << 5)
  62. #define CH7017_VERSION_ID 0x4a
  63. #define CH7017_DEVICE_ID 0x4b
  64. #define CH7017_DEVICE_ID_VALUE 0x1b
  65. #define CH7018_DEVICE_ID_VALUE 0x1a
  66. #define CH7019_DEVICE_ID_VALUE 0x19
  67. #define CH7017_XCLK_D2_ADJUST 0x53
  68. #define CH7017_UP_SCALER_COEFF_0 0x55
  69. #define CH7017_UP_SCALER_COEFF_1 0x56
  70. #define CH7017_UP_SCALER_COEFF_2 0x57
  71. #define CH7017_UP_SCALER_COEFF_3 0x58
  72. #define CH7017_UP_SCALER_COEFF_4 0x59
  73. #define CH7017_UP_SCALER_VERTICAL_INC_0 0x5a
  74. #define CH7017_UP_SCALER_VERTICAL_INC_1 0x5b
  75. #define CH7017_GPIO_INVERT 0x5c
  76. #define CH7017_UP_SCALER_HORIZONTAL_INC_0 0x5d
  77. #define CH7017_UP_SCALER_HORIZONTAL_INC_1 0x5e
  78. #define CH7017_HORIZONTAL_ACTIVE_PIXEL_INPUT 0x5f
  79. /**< Low bits of horizontal active pixel input */
  80. #define CH7017_ACTIVE_INPUT_LINE_OUTPUT 0x60
  81. /** High bits of horizontal active pixel input */
  82. #define CH7017_LVDS_HAP_INPUT_MASK (0x7 << 0)
  83. /** High bits of vertical active line output */
  84. #define CH7017_LVDS_VAL_HIGH_MASK (0x7 << 3)
  85. #define CH7017_VERTICAL_ACTIVE_LINE_OUTPUT 0x61
  86. /**< Low bits of vertical active line output */
  87. #define CH7017_HORIZONTAL_ACTIVE_PIXEL_OUTPUT 0x62
  88. /**< Low bits of horizontal active pixel output */
  89. #define CH7017_LVDS_POWER_DOWN 0x63
  90. /** High bits of horizontal active pixel output */
  91. #define CH7017_LVDS_HAP_HIGH_MASK (0x7 << 0)
  92. /** Enables the LVDS power down state transition */
  93. #define CH7017_LVDS_POWER_DOWN_EN (1 << 6)
  94. /** Enables the LVDS upscaler */
  95. #define CH7017_LVDS_UPSCALER_EN (1 << 7)
  96. #define CH7017_LVDS_POWER_DOWN_DEFAULT_RESERVED 0x08
  97. #define CH7017_LVDS_ENCODING 0x64
  98. #define CH7017_LVDS_DITHER_2D (1 << 2)
  99. #define CH7017_LVDS_DITHER_DIS (1 << 3)
  100. #define CH7017_LVDS_DUAL_CHANNEL_EN (1 << 4)
  101. #define CH7017_LVDS_24_BIT (1 << 5)
  102. #define CH7017_LVDS_ENCODING_2 0x65
  103. #define CH7017_LVDS_PLL_CONTROL 0x66
  104. /** Enables the LVDS panel output path */
  105. #define CH7017_LVDS_PANEN (1 << 0)
  106. /** Enables the LVDS panel backlight */
  107. #define CH7017_LVDS_BKLEN (1 << 3)
  108. #define CH7017_POWER_SEQUENCING_T1 0x67
  109. #define CH7017_POWER_SEQUENCING_T2 0x68
  110. #define CH7017_POWER_SEQUENCING_T3 0x69
  111. #define CH7017_POWER_SEQUENCING_T4 0x6a
  112. #define CH7017_POWER_SEQUENCING_T5 0x6b
  113. #define CH7017_GPIO_DRIVER_TYPE 0x6c
  114. #define CH7017_GPIO_DATA 0x6d
  115. #define CH7017_GPIO_DIRECTION_CONTROL 0x6e
  116. #define CH7017_LVDS_PLL_FEEDBACK_DIV 0x71
  117. # define CH7017_LVDS_PLL_FEED_BACK_DIVIDER_SHIFT 4
  118. # define CH7017_LVDS_PLL_FEED_FORWARD_DIVIDER_SHIFT 0
  119. # define CH7017_LVDS_PLL_FEEDBACK_DEFAULT_RESERVED 0x80
  120. #define CH7017_LVDS_PLL_VCO_CONTROL 0x72
  121. # define CH7017_LVDS_PLL_VCO_DEFAULT_RESERVED 0x80
  122. # define CH7017_LVDS_PLL_VCO_SHIFT 4
  123. # define CH7017_LVDS_PLL_POST_SCALE_DIV_SHIFT 0
  124. #define CH7017_OUTPUTS_ENABLE 0x73
  125. # define CH7017_CHARGE_PUMP_LOW 0x0
  126. # define CH7017_CHARGE_PUMP_HIGH 0x3
  127. # define CH7017_LVDS_CHANNEL_A (1 << 3)
  128. # define CH7017_LVDS_CHANNEL_B (1 << 4)
  129. # define CH7017_TV_DAC_A (1 << 5)
  130. # define CH7017_TV_DAC_B (1 << 6)
  131. # define CH7017_DDC_SELECT_DC2 (1 << 7)
  132. #define CH7017_LVDS_OUTPUT_AMPLITUDE 0x74
  133. #define CH7017_LVDS_PLL_EMI_REDUCTION 0x75
  134. #define CH7017_LVDS_POWER_DOWN_FLICKER 0x76
  135. #define CH7017_LVDS_CONTROL_2 0x78
  136. # define CH7017_LOOP_FILTER_SHIFT 5
  137. # define CH7017_PHASE_DETECTOR_SHIFT 0
  138. #define CH7017_BANG_LIMIT_CONTROL 0x7f
  139. struct ch7017_priv {
  140. uint8_t save_hapi;
  141. uint8_t save_vali;
  142. uint8_t save_valo;
  143. uint8_t save_ailo;
  144. uint8_t save_lvds_pll_vco;
  145. uint8_t save_feedback_div;
  146. uint8_t save_lvds_control_2;
  147. uint8_t save_outputs_enable;
  148. uint8_t save_lvds_power_down;
  149. uint8_t save_power_management;
  150. };
  151. static void ch7017_dump_regs(struct intel_dvo_device *dvo);
  152. static void ch7017_dpms(struct intel_dvo_device *dvo, int mode);
  153. static bool ch7017_read(struct intel_dvo_device *dvo, int addr, uint8_t *val)
  154. {
  155. struct intel_i2c_chan *i2cbus = dvo->i2c_bus;
  156. u8 out_buf[2];
  157. u8 in_buf[2];
  158. struct i2c_msg msgs[] = {
  159. {
  160. .addr = i2cbus->slave_addr,
  161. .flags = 0,
  162. .len = 1,
  163. .buf = out_buf,
  164. },
  165. {
  166. .addr = i2cbus->slave_addr,
  167. .flags = I2C_M_RD,
  168. .len = 1,
  169. .buf = in_buf,
  170. }
  171. };
  172. out_buf[0] = addr;
  173. out_buf[1] = 0;
  174. if (i2c_transfer(&i2cbus->adapter, msgs, 2) == 2) {
  175. *val= in_buf[0];
  176. return true;
  177. };
  178. return false;
  179. }
  180. static bool ch7017_write(struct intel_dvo_device *dvo, int addr, uint8_t val)
  181. {
  182. struct intel_i2c_chan *i2cbus = dvo->i2c_bus;
  183. uint8_t out_buf[2];
  184. struct i2c_msg msg = {
  185. .addr = i2cbus->slave_addr,
  186. .flags = 0,
  187. .len = 2,
  188. .buf = out_buf,
  189. };
  190. out_buf[0] = addr;
  191. out_buf[1] = val;
  192. if (i2c_transfer(&i2cbus->adapter, &msg, 1) == 1)
  193. return true;
  194. return false;
  195. }
  196. /** Probes for a CH7017 on the given bus and slave address. */
  197. static bool ch7017_init(struct intel_dvo_device *dvo,
  198. struct intel_i2c_chan *i2cbus)
  199. {
  200. struct ch7017_priv *priv;
  201. uint8_t val;
  202. priv = kzalloc(sizeof(struct ch7017_priv), GFP_KERNEL);
  203. if (priv == NULL)
  204. return false;
  205. dvo->i2c_bus = i2cbus;
  206. dvo->i2c_bus->slave_addr = dvo->slave_addr;
  207. dvo->dev_priv = priv;
  208. if (!ch7017_read(dvo, CH7017_DEVICE_ID, &val))
  209. goto fail;
  210. if (val != CH7017_DEVICE_ID_VALUE &&
  211. val != CH7018_DEVICE_ID_VALUE &&
  212. val != CH7019_DEVICE_ID_VALUE) {
  213. DRM_DEBUG("ch701x not detected, got %d: from %s Slave %d.\n",
  214. val, i2cbus->adapter.name,i2cbus->slave_addr);
  215. goto fail;
  216. }
  217. return true;
  218. fail:
  219. kfree(priv);
  220. return false;
  221. }
  222. static enum drm_connector_status ch7017_detect(struct intel_dvo_device *dvo)
  223. {
  224. return connector_status_unknown;
  225. }
  226. static enum drm_mode_status ch7017_mode_valid(struct intel_dvo_device *dvo,
  227. struct drm_display_mode *mode)
  228. {
  229. if (mode->clock > 160000)
  230. return MODE_CLOCK_HIGH;
  231. return MODE_OK;
  232. }
  233. static void ch7017_mode_set(struct intel_dvo_device *dvo,
  234. struct drm_display_mode *mode,
  235. struct drm_display_mode *adjusted_mode)
  236. {
  237. uint8_t lvds_pll_feedback_div, lvds_pll_vco_control;
  238. uint8_t outputs_enable, lvds_control_2, lvds_power_down;
  239. uint8_t horizontal_active_pixel_input;
  240. uint8_t horizontal_active_pixel_output, vertical_active_line_output;
  241. uint8_t active_input_line_output;
  242. DRM_DEBUG("Registers before mode setting\n");
  243. ch7017_dump_regs(dvo);
  244. /* LVDS PLL settings from page 75 of 7017-7017ds.pdf*/
  245. if (mode->clock < 100000) {
  246. outputs_enable = CH7017_LVDS_CHANNEL_A | CH7017_CHARGE_PUMP_LOW;
  247. lvds_pll_feedback_div = CH7017_LVDS_PLL_FEEDBACK_DEFAULT_RESERVED |
  248. (2 << CH7017_LVDS_PLL_FEED_BACK_DIVIDER_SHIFT) |
  249. (13 << CH7017_LVDS_PLL_FEED_FORWARD_DIVIDER_SHIFT);
  250. lvds_pll_vco_control = CH7017_LVDS_PLL_VCO_DEFAULT_RESERVED |
  251. (2 << CH7017_LVDS_PLL_VCO_SHIFT) |
  252. (3 << CH7017_LVDS_PLL_POST_SCALE_DIV_SHIFT);
  253. lvds_control_2 = (1 << CH7017_LOOP_FILTER_SHIFT) |
  254. (0 << CH7017_PHASE_DETECTOR_SHIFT);
  255. } else {
  256. outputs_enable = CH7017_LVDS_CHANNEL_A | CH7017_CHARGE_PUMP_HIGH;
  257. lvds_pll_feedback_div = CH7017_LVDS_PLL_FEEDBACK_DEFAULT_RESERVED |
  258. (2 << CH7017_LVDS_PLL_FEED_BACK_DIVIDER_SHIFT) |
  259. (3 << CH7017_LVDS_PLL_FEED_FORWARD_DIVIDER_SHIFT);
  260. lvds_pll_feedback_div = 35;
  261. lvds_control_2 = (3 << CH7017_LOOP_FILTER_SHIFT) |
  262. (0 << CH7017_PHASE_DETECTOR_SHIFT);
  263. if (1) { /* XXX: dual channel panel detection. Assume yes for now. */
  264. outputs_enable |= CH7017_LVDS_CHANNEL_B;
  265. lvds_pll_vco_control = CH7017_LVDS_PLL_VCO_DEFAULT_RESERVED |
  266. (2 << CH7017_LVDS_PLL_VCO_SHIFT) |
  267. (13 << CH7017_LVDS_PLL_POST_SCALE_DIV_SHIFT);
  268. } else {
  269. lvds_pll_vco_control = CH7017_LVDS_PLL_VCO_DEFAULT_RESERVED |
  270. (1 << CH7017_LVDS_PLL_VCO_SHIFT) |
  271. (13 << CH7017_LVDS_PLL_POST_SCALE_DIV_SHIFT);
  272. }
  273. }
  274. horizontal_active_pixel_input = mode->hdisplay & 0x00ff;
  275. vertical_active_line_output = mode->vdisplay & 0x00ff;
  276. horizontal_active_pixel_output = mode->hdisplay & 0x00ff;
  277. active_input_line_output = ((mode->hdisplay & 0x0700) >> 8) |
  278. (((mode->vdisplay & 0x0700) >> 8) << 3);
  279. lvds_power_down = CH7017_LVDS_POWER_DOWN_DEFAULT_RESERVED |
  280. (mode->hdisplay & 0x0700) >> 8;
  281. ch7017_dpms(dvo, DRM_MODE_DPMS_OFF);
  282. ch7017_write(dvo, CH7017_HORIZONTAL_ACTIVE_PIXEL_INPUT,
  283. horizontal_active_pixel_input);
  284. ch7017_write(dvo, CH7017_HORIZONTAL_ACTIVE_PIXEL_OUTPUT,
  285. horizontal_active_pixel_output);
  286. ch7017_write(dvo, CH7017_VERTICAL_ACTIVE_LINE_OUTPUT,
  287. vertical_active_line_output);
  288. ch7017_write(dvo, CH7017_ACTIVE_INPUT_LINE_OUTPUT,
  289. active_input_line_output);
  290. ch7017_write(dvo, CH7017_LVDS_PLL_VCO_CONTROL, lvds_pll_vco_control);
  291. ch7017_write(dvo, CH7017_LVDS_PLL_FEEDBACK_DIV, lvds_pll_feedback_div);
  292. ch7017_write(dvo, CH7017_LVDS_CONTROL_2, lvds_control_2);
  293. ch7017_write(dvo, CH7017_OUTPUTS_ENABLE, outputs_enable);
  294. /* Turn the LVDS back on with new settings. */
  295. ch7017_write(dvo, CH7017_LVDS_POWER_DOWN, lvds_power_down);
  296. DRM_DEBUG("Registers after mode setting\n");
  297. ch7017_dump_regs(dvo);
  298. }
  299. /* set the CH7017 power state */
  300. static void ch7017_dpms(struct intel_dvo_device *dvo, int mode)
  301. {
  302. uint8_t val;
  303. ch7017_read(dvo, CH7017_LVDS_POWER_DOWN, &val);
  304. /* Turn off TV/VGA, and never turn it on since we don't support it. */
  305. ch7017_write(dvo, CH7017_POWER_MANAGEMENT,
  306. CH7017_DAC0_POWER_DOWN |
  307. CH7017_DAC1_POWER_DOWN |
  308. CH7017_DAC2_POWER_DOWN |
  309. CH7017_DAC3_POWER_DOWN |
  310. CH7017_TV_POWER_DOWN_EN);
  311. if (mode == DRM_MODE_DPMS_ON) {
  312. /* Turn on the LVDS */
  313. ch7017_write(dvo, CH7017_LVDS_POWER_DOWN,
  314. val & ~CH7017_LVDS_POWER_DOWN_EN);
  315. } else {
  316. /* Turn off the LVDS */
  317. ch7017_write(dvo, CH7017_LVDS_POWER_DOWN,
  318. val | CH7017_LVDS_POWER_DOWN_EN);
  319. }
  320. /* XXX: Should actually wait for update power status somehow */
  321. udelay(20000);
  322. }
  323. static void ch7017_dump_regs(struct intel_dvo_device *dvo)
  324. {
  325. uint8_t val;
  326. #define DUMP(reg) \
  327. do { \
  328. ch7017_read(dvo, reg, &val); \
  329. DRM_DEBUG(#reg ": %02x\n", val); \
  330. } while (0)
  331. DUMP(CH7017_HORIZONTAL_ACTIVE_PIXEL_INPUT);
  332. DUMP(CH7017_HORIZONTAL_ACTIVE_PIXEL_OUTPUT);
  333. DUMP(CH7017_VERTICAL_ACTIVE_LINE_OUTPUT);
  334. DUMP(CH7017_ACTIVE_INPUT_LINE_OUTPUT);
  335. DUMP(CH7017_LVDS_PLL_VCO_CONTROL);
  336. DUMP(CH7017_LVDS_PLL_FEEDBACK_DIV);
  337. DUMP(CH7017_LVDS_CONTROL_2);
  338. DUMP(CH7017_OUTPUTS_ENABLE);
  339. DUMP(CH7017_LVDS_POWER_DOWN);
  340. }
  341. static void ch7017_save(struct intel_dvo_device *dvo)
  342. {
  343. struct ch7017_priv *priv = dvo->dev_priv;
  344. ch7017_read(dvo, CH7017_HORIZONTAL_ACTIVE_PIXEL_INPUT, &priv->save_hapi);
  345. ch7017_read(dvo, CH7017_VERTICAL_ACTIVE_LINE_OUTPUT, &priv->save_valo);
  346. ch7017_read(dvo, CH7017_ACTIVE_INPUT_LINE_OUTPUT, &priv->save_ailo);
  347. ch7017_read(dvo, CH7017_LVDS_PLL_VCO_CONTROL, &priv->save_lvds_pll_vco);
  348. ch7017_read(dvo, CH7017_LVDS_PLL_FEEDBACK_DIV, &priv->save_feedback_div);
  349. ch7017_read(dvo, CH7017_LVDS_CONTROL_2, &priv->save_lvds_control_2);
  350. ch7017_read(dvo, CH7017_OUTPUTS_ENABLE, &priv->save_outputs_enable);
  351. ch7017_read(dvo, CH7017_LVDS_POWER_DOWN, &priv->save_lvds_power_down);
  352. ch7017_read(dvo, CH7017_POWER_MANAGEMENT, &priv->save_power_management);
  353. }
  354. static void ch7017_restore(struct intel_dvo_device *dvo)
  355. {
  356. struct ch7017_priv *priv = dvo->dev_priv;
  357. /* Power down before changing mode */
  358. ch7017_dpms(dvo, DRM_MODE_DPMS_OFF);
  359. ch7017_write(dvo, CH7017_HORIZONTAL_ACTIVE_PIXEL_INPUT, priv->save_hapi);
  360. ch7017_write(dvo, CH7017_VERTICAL_ACTIVE_LINE_OUTPUT, priv->save_valo);
  361. ch7017_write(dvo, CH7017_ACTIVE_INPUT_LINE_OUTPUT, priv->save_ailo);
  362. ch7017_write(dvo, CH7017_LVDS_PLL_VCO_CONTROL, priv->save_lvds_pll_vco);
  363. ch7017_write(dvo, CH7017_LVDS_PLL_FEEDBACK_DIV, priv->save_feedback_div);
  364. ch7017_write(dvo, CH7017_LVDS_CONTROL_2, priv->save_lvds_control_2);
  365. ch7017_write(dvo, CH7017_OUTPUTS_ENABLE, priv->save_outputs_enable);
  366. ch7017_write(dvo, CH7017_LVDS_POWER_DOWN, priv->save_lvds_power_down);
  367. ch7017_write(dvo, CH7017_POWER_MANAGEMENT, priv->save_power_management);
  368. }
  369. static void ch7017_destroy(struct intel_dvo_device *dvo)
  370. {
  371. struct ch7017_priv *priv = dvo->dev_priv;
  372. if (priv) {
  373. kfree(priv);
  374. dvo->dev_priv = NULL;
  375. }
  376. }
  377. struct intel_dvo_dev_ops ch7017_ops = {
  378. .init = ch7017_init,
  379. .detect = ch7017_detect,
  380. .mode_valid = ch7017_mode_valid,
  381. .mode_set = ch7017_mode_set,
  382. .dpms = ch7017_dpms,
  383. .dump_regs = ch7017_dump_regs,
  384. .save = ch7017_save,
  385. .restore = ch7017_restore,
  386. .destroy = ch7017_destroy,
  387. };