Lines Matching refs:dvo

32 #include "dvo.h"
93 static void enable_dvo(struct intel_dvo_device *dvo)
95 struct ns2501_priv *ns = (struct ns2501_priv *)(dvo->dev_priv);
96 device_t adapter = dvo->i2c_bus;
126 static void restore_dvo(struct intel_dvo_device *dvo)
128 device_t adapter = dvo->i2c_bus;
138 struct ns2501_priv *ns = (struct ns2501_priv *)(dvo->dev_priv);
152 static bool ns2501_readb(struct intel_dvo_device *dvo, int addr, uint8_t * ch)
154 struct ns2501_priv *ns = dvo->dev_priv;
155 device_t adapter = dvo->i2c_bus;
161 .slave = dvo->slave_addr << 1,
167 .slave = dvo->slave_addr << 1,
185 device_get_nameunit(adapter), dvo->slave_addr);
197 static bool ns2501_writeb(struct intel_dvo_device *dvo, int addr, uint8_t ch)
199 struct ns2501_priv *ns = dvo->dev_priv;
200 device_t adapter = dvo->i2c_bus;
204 .slave = dvo->slave_addr << 1,
219 addr, device_get_nameunit(adapter), dvo->slave_addr);
231 static bool ns2501_init(struct intel_dvo_device *dvo,
242 dvo->i2c_bus = adapter;
243 dvo->dev_priv = ns;
246 if (!ns2501_readb(dvo, NS2501_VID_LO, &ch))
251 ch, device_get_nameunit(adapter), dvo->slave_addr);
255 if (!ns2501_readb(dvo, NS2501_DID_LO, &ch))
260 ch, device_get_nameunit(adapter), dvo->slave_addr);
268 DRM_DEBUG_KMS("init ns2501 dvo controller successfully!\n");
276 static enum drm_connector_status ns2501_detect(struct intel_dvo_device *dvo)
288 static enum drm_mode_status ns2501_mode_valid(struct intel_dvo_device *dvo,
311 static void ns2501_mode_set(struct intel_dvo_device *dvo,
317 struct ns2501_priv *ns = (struct ns2501_priv *)(dvo->dev_priv);
346 ok &= ns2501_writeb(dvo, 0x11, 0xc8); // 0xc7 also works.
347 ok &= ns2501_writeb(dvo, 0x1b, 0x19);
348 ok &= ns2501_writeb(dvo, 0x1c, 0x62); // VBIOS left 0x64 here, but 0x62 works nicer
349 ok &= ns2501_writeb(dvo, 0x1d, 0x02);
351 ok &= ns2501_writeb(dvo, 0x34, 0x03);
352 ok &= ns2501_writeb(dvo, 0x35, 0xff);
354 ok &= ns2501_writeb(dvo, 0x80, 0x27);
355 ok &= ns2501_writeb(dvo, 0x81, 0x03);
356 ok &= ns2501_writeb(dvo, 0x82, 0x41);
357 ok &= ns2501_writeb(dvo, 0x83, 0x05);
359 ok &= ns2501_writeb(dvo, 0x8d, 0x02);
360 ok &= ns2501_writeb(dvo, 0x8e, 0x04);
361 ok &= ns2501_writeb(dvo, 0x8f, 0x00);
363 ok &= ns2501_writeb(dvo, 0x90, 0xfe); /* vertical. VBIOS left 0xff here, but 0xfe works better */
364 ok &= ns2501_writeb(dvo, 0x91, 0x07);
365 ok &= ns2501_writeb(dvo, 0x94, 0x00);
366 ok &= ns2501_writeb(dvo, 0x95, 0x00);
368 ok &= ns2501_writeb(dvo, 0x96, 0x00);
370 ok &= ns2501_writeb(dvo, 0x99, 0x00);
371 ok &= ns2501_writeb(dvo, 0x9a, 0x88);
373 ok &= ns2501_writeb(dvo, 0x9c, 0x23); /* Looks like first and last line of the image. */
374 ok &= ns2501_writeb(dvo, 0x9d, 0x00);
375 ok &= ns2501_writeb(dvo, 0x9e, 0x25);
376 ok &= ns2501_writeb(dvo, 0x9f, 0x03);
378 ok &= ns2501_writeb(dvo, 0xa4, 0x80);
380 ok &= ns2501_writeb(dvo, 0xb6, 0x00);
382 ok &= ns2501_writeb(dvo, 0xb9, 0xc8); /* horizontal? */
383 ok &= ns2501_writeb(dvo, 0xba, 0x00); /* horizontal? */
385 ok &= ns2501_writeb(dvo, 0xc0, 0x05); /* horizontal? */
386 ok &= ns2501_writeb(dvo, 0xc1, 0xd7);
388 ok &= ns2501_writeb(dvo, 0xc2, 0x00);
389 ok &= ns2501_writeb(dvo, 0xc3, 0xf8);
391 ok &= ns2501_writeb(dvo, 0xc4, 0x03);
392 ok &= ns2501_writeb(dvo, 0xc5, 0x1a);
394 ok &= ns2501_writeb(dvo, 0xc6, 0x00);
395 ok &= ns2501_writeb(dvo, 0xc7, 0x73);
396 ok &= ns2501_writeb(dvo, 0xc8, 0x02);
411 ok &= ns2501_writeb(dvo, 0x11, 0xa0);
412 ok &= ns2501_writeb(dvo, 0x1b, 0x11);
413 ok &= ns2501_writeb(dvo, 0x1c, 0x54);
414 ok &= ns2501_writeb(dvo, 0x1d, 0x03);
416 ok &= ns2501_writeb(dvo, 0x34, 0x03);
417 ok &= ns2501_writeb(dvo, 0x35, 0xff);
419 ok &= ns2501_writeb(dvo, 0x80, 0xff);
420 ok &= ns2501_writeb(dvo, 0x81, 0x07);
421 ok &= ns2501_writeb(dvo, 0x82, 0x3d);
422 ok &= ns2501_writeb(dvo, 0x83, 0x05);
424 ok &= ns2501_writeb(dvo, 0x8d, 0x02);
425 ok &= ns2501_writeb(dvo, 0x8e, 0x10);
426 ok &= ns2501_writeb(dvo, 0x8f, 0x00);
428 ok &= ns2501_writeb(dvo, 0x90, 0xff); /* vertical */
429 ok &= ns2501_writeb(dvo, 0x91, 0x07);
430 ok &= ns2501_writeb(dvo, 0x94, 0x00);
431 ok &= ns2501_writeb(dvo, 0x95, 0x00);
433 ok &= ns2501_writeb(dvo, 0x96, 0x05);
435 ok &= ns2501_writeb(dvo, 0x99, 0x00);
436 ok &= ns2501_writeb(dvo, 0x9a, 0x88);
438 ok &= ns2501_writeb(dvo, 0x9c, 0x24);
439 ok &= ns2501_writeb(dvo, 0x9d, 0x00);
440 ok &= ns2501_writeb(dvo, 0x9e, 0x25);
441 ok &= ns2501_writeb(dvo, 0x9f, 0x03);
443 ok &= ns2501_writeb(dvo, 0xa4, 0x84);
445 ok &= ns2501_writeb(dvo, 0xb6, 0x09);
447 ok &= ns2501_writeb(dvo, 0xb9, 0xa0); /* horizontal? */
448 ok &= ns2501_writeb(dvo, 0xba, 0x00); /* horizontal? */
450 ok &= ns2501_writeb(dvo, 0xc0, 0x05); /* horizontal? */
451 ok &= ns2501_writeb(dvo, 0xc1, 0x90);
453 ok &= ns2501_writeb(dvo, 0xc2, 0x00);
454 ok &= ns2501_writeb(dvo, 0xc3, 0x0f);
456 ok &= ns2501_writeb(dvo, 0xc4, 0x03);
457 ok &= ns2501_writeb(dvo, 0xc5, 0x16);
459 ok &= ns2501_writeb(dvo, 0xc6, 0x00);
460 ok &= ns2501_writeb(dvo, 0xc7, 0x02);
461 ok &= ns2501_writeb(dvo, 0xc8, 0x02);
482 ok &= ns2501_writeb(dvo, 0x37, 0x44);
491 ok &= ns2501_writeb(dvo, NS2501_REG8, ns->reg_8_shadow);
495 restore_dvo(dvo);
496 enable_dvo(dvo);
505 restore_dvo(dvo);
509 static bool ns2501_get_hw_state(struct intel_dvo_device *dvo)
513 if (!ns2501_readb(dvo, NS2501_REG8, &ch))
523 static void ns2501_dpms(struct intel_dvo_device *dvo, bool enable)
527 struct ns2501_priv *ns = (struct ns2501_priv *)(dvo->dev_priv);
546 ok &= ns2501_writeb(dvo, NS2501_REG8, ch);
548 ns2501_writeb(dvo, 0x34,
551 ns2501_writeb(dvo, 0x35,
555 restore_dvo(dvo);
556 enable_dvo(dvo);
562 restore_dvo(dvo);
566 static void ns2501_dump_regs(struct intel_dvo_device *dvo)
570 ns2501_readb(dvo, NS2501_FREQ_LO, &val);
572 ns2501_readb(dvo, NS2501_FREQ_HI, &val);
574 ns2501_readb(dvo, NS2501_REG8, &val);
576 ns2501_readb(dvo, NS2501_REG9, &val);
578 ns2501_readb(dvo, NS2501_REGC, &val);
582 static void ns2501_destroy(struct intel_dvo_device *dvo)
584 struct ns2501_priv *ns = dvo->dev_priv;
588 dvo->dev_priv = NULL;