Lines Matching defs:dvo
37 #include "dvo.h"
98 static void enable_dvo(struct intel_dvo_device *dvo)
100 struct ns2501_priv *ns = (struct ns2501_priv *)(dvo->dev_priv);
101 struct i2c_adapter *adapter = dvo->i2c_bus;
126 static void restore_dvo(struct intel_dvo_device *dvo)
128 struct i2c_adapter *adapter = dvo->i2c_bus;
133 struct ns2501_priv *ns = (struct ns2501_priv *)(dvo->dev_priv);
147 static bool ns2501_readb(struct intel_dvo_device *dvo, int addr, uint8_t * ch)
149 struct ns2501_priv *ns = dvo->dev_priv;
150 struct i2c_adapter *adapter = dvo->i2c_bus;
156 .addr = dvo->slave_addr,
162 .addr = dvo->slave_addr,
180 adapter->name, dvo->slave_addr);
192 static bool ns2501_writeb(struct intel_dvo_device *dvo, int addr, uint8_t ch)
194 struct ns2501_priv *ns = dvo->dev_priv;
195 struct i2c_adapter *adapter = dvo->i2c_bus;
199 .addr = dvo->slave_addr,
214 addr, adapter->name, dvo->slave_addr);
226 static bool ns2501_init(struct intel_dvo_device *dvo,
237 dvo->i2c_bus = adapter;
238 dvo->dev_priv = ns;
241 if (!ns2501_readb(dvo, NS2501_VID_LO, &ch))
246 ch, adapter->name, dvo->slave_addr);
250 if (!ns2501_readb(dvo, NS2501_DID_LO, &ch))
255 ch, adapter->name, dvo->slave_addr);
263 DRM_DEBUG_KMS("init ns2501 dvo controller successfully!\n");
271 static enum drm_connector_status ns2501_detect(struct intel_dvo_device *dvo)
283 static int ns2501_mode_valid(struct intel_dvo_device *dvo,
306 static void ns2501_mode_set(struct intel_dvo_device *dvo,
312 struct ns2501_priv *ns = (struct ns2501_priv *)(dvo->dev_priv);
341 ok &= ns2501_writeb(dvo, 0x11, 0xc8); // 0xc7 also works.
342 ok &= ns2501_writeb(dvo, 0x1b, 0x19);
343 ok &= ns2501_writeb(dvo, 0x1c, 0x62); // VBIOS left 0x64 here, but 0x62 works nicer
344 ok &= ns2501_writeb(dvo, 0x1d, 0x02);
346 ok &= ns2501_writeb(dvo, 0x34, 0x03);
347 ok &= ns2501_writeb(dvo, 0x35, 0xff);
349 ok &= ns2501_writeb(dvo, 0x80, 0x27);
350 ok &= ns2501_writeb(dvo, 0x81, 0x03);
351 ok &= ns2501_writeb(dvo, 0x82, 0x41);
352 ok &= ns2501_writeb(dvo, 0x83, 0x05);
354 ok &= ns2501_writeb(dvo, 0x8d, 0x02);
355 ok &= ns2501_writeb(dvo, 0x8e, 0x04);
356 ok &= ns2501_writeb(dvo, 0x8f, 0x00);
358 ok &= ns2501_writeb(dvo, 0x90, 0xfe); /* vertical. VBIOS left 0xff here, but 0xfe works better */
359 ok &= ns2501_writeb(dvo, 0x91, 0x07);
360 ok &= ns2501_writeb(dvo, 0x94, 0x00);
361 ok &= ns2501_writeb(dvo, 0x95, 0x00);
363 ok &= ns2501_writeb(dvo, 0x96, 0x00);
365 ok &= ns2501_writeb(dvo, 0x99, 0x00);
366 ok &= ns2501_writeb(dvo, 0x9a, 0x88);
368 ok &= ns2501_writeb(dvo, 0x9c, 0x23); /* Looks like first and last line of the image. */
369 ok &= ns2501_writeb(dvo, 0x9d, 0x00);
370 ok &= ns2501_writeb(dvo, 0x9e, 0x25);
371 ok &= ns2501_writeb(dvo, 0x9f, 0x03);
373 ok &= ns2501_writeb(dvo, 0xa4, 0x80);
375 ok &= ns2501_writeb(dvo, 0xb6, 0x00);
377 ok &= ns2501_writeb(dvo, 0xb9, 0xc8); /* horizontal? */
378 ok &= ns2501_writeb(dvo, 0xba, 0x00); /* horizontal? */
380 ok &= ns2501_writeb(dvo, 0xc0, 0x05); /* horizontal? */
381 ok &= ns2501_writeb(dvo, 0xc1, 0xd7);
383 ok &= ns2501_writeb(dvo, 0xc2, 0x00);
384 ok &= ns2501_writeb(dvo, 0xc3, 0xf8);
386 ok &= ns2501_writeb(dvo, 0xc4, 0x03);
387 ok &= ns2501_writeb(dvo, 0xc5, 0x1a);
389 ok &= ns2501_writeb(dvo, 0xc6, 0x00);
390 ok &= ns2501_writeb(dvo, 0xc7, 0x73);
391 ok &= ns2501_writeb(dvo, 0xc8, 0x02);
406 ok &= ns2501_writeb(dvo, 0x11, 0xa0);
407 ok &= ns2501_writeb(dvo, 0x1b, 0x11);
408 ok &= ns2501_writeb(dvo, 0x1c, 0x54);
409 ok &= ns2501_writeb(dvo, 0x1d, 0x03);
411 ok &= ns2501_writeb(dvo, 0x34, 0x03);
412 ok &= ns2501_writeb(dvo, 0x35, 0xff);
414 ok &= ns2501_writeb(dvo, 0x80, 0xff);
415 ok &= ns2501_writeb(dvo, 0x81, 0x07);
416 ok &= ns2501_writeb(dvo, 0x82, 0x3d);
417 ok &= ns2501_writeb(dvo, 0x83, 0x05);
419 ok &= ns2501_writeb(dvo, 0x8d, 0x02);
420 ok &= ns2501_writeb(dvo, 0x8e, 0x10);
421 ok &= ns2501_writeb(dvo, 0x8f, 0x00);
423 ok &= ns2501_writeb(dvo, 0x90, 0xff); /* vertical */
424 ok &= ns2501_writeb(dvo, 0x91, 0x07);
425 ok &= ns2501_writeb(dvo, 0x94, 0x00);
426 ok &= ns2501_writeb(dvo, 0x95, 0x00);
428 ok &= ns2501_writeb(dvo, 0x96, 0x05);
430 ok &= ns2501_writeb(dvo, 0x99, 0x00);
431 ok &= ns2501_writeb(dvo, 0x9a, 0x88);
433 ok &= ns2501_writeb(dvo, 0x9c, 0x24);
434 ok &= ns2501_writeb(dvo, 0x9d, 0x00);
435 ok &= ns2501_writeb(dvo, 0x9e, 0x25);
436 ok &= ns2501_writeb(dvo, 0x9f, 0x03);
438 ok &= ns2501_writeb(dvo, 0xa4, 0x84);
440 ok &= ns2501_writeb(dvo, 0xb6, 0x09);
442 ok &= ns2501_writeb(dvo, 0xb9, 0xa0); /* horizontal? */
443 ok &= ns2501_writeb(dvo, 0xba, 0x00); /* horizontal? */
445 ok &= ns2501_writeb(dvo, 0xc0, 0x05); /* horizontal? */
446 ok &= ns2501_writeb(dvo, 0xc1, 0x90);
448 ok &= ns2501_writeb(dvo, 0xc2, 0x00);
449 ok &= ns2501_writeb(dvo, 0xc3, 0x0f);
451 ok &= ns2501_writeb(dvo, 0xc4, 0x03);
452 ok &= ns2501_writeb(dvo, 0xc5, 0x16);
454 ok &= ns2501_writeb(dvo, 0xc6, 0x00);
455 ok &= ns2501_writeb(dvo, 0xc7, 0x02);
456 ok &= ns2501_writeb(dvo, 0xc8, 0x02);
477 ok &= ns2501_writeb(dvo, 0x37, 0x44);
486 ok &= ns2501_writeb(dvo, NS2501_REG8, ns->reg_8_shadow);
490 restore_dvo(dvo);
491 enable_dvo(dvo);
500 restore_dvo(dvo);
504 static bool ns2501_get_hw_state(struct intel_dvo_device *dvo)
508 if (!ns2501_readb(dvo, NS2501_REG8, &ch))
518 static void ns2501_dpms(struct intel_dvo_device *dvo, bool enable)
522 struct ns2501_priv *ns = (struct ns2501_priv *)(dvo->dev_priv);
541 ok &= ns2501_writeb(dvo, NS2501_REG8, ch);
543 ns2501_writeb(dvo, 0x34,
546 ns2501_writeb(dvo, 0x35,
550 restore_dvo(dvo);
551 enable_dvo(dvo);
557 restore_dvo(dvo);
561 static void ns2501_dump_regs(struct intel_dvo_device *dvo)
565 ns2501_readb(dvo, NS2501_FREQ_LO, &val);
567 ns2501_readb(dvo, NS2501_FREQ_HI, &val);
569 ns2501_readb(dvo, NS2501_REG8, &val);
571 ns2501_readb(dvo, NS2501_REG9, &val);
573 ns2501_readb(dvo, NS2501_REGC, &val);
577 static void ns2501_destroy(struct intel_dvo_device *dvo)
579 struct ns2501_priv *ns = dvo->dev_priv;
583 dvo->dev_priv = NULL;