Lines Matching refs:dvo

96 static bool ns2501_readb(struct intel_dvo_device *dvo, int addr, uint8_t * ch)  in ns2501_readb()  argument
98 struct ns2501_priv *ns = dvo->dev_priv; in ns2501_readb()
99 struct i2c_adapter *adapter = dvo->i2c_bus; in ns2501_readb()
105 .addr = dvo->slave_addr, in ns2501_readb()
111 .addr = dvo->slave_addr, in ns2501_readb()
129 adapter->name, dvo->slave_addr); in ns2501_readb()
141 static bool ns2501_writeb(struct intel_dvo_device *dvo, int addr, uint8_t ch) in ns2501_writeb() argument
143 struct ns2501_priv *ns = dvo->dev_priv; in ns2501_writeb()
144 struct i2c_adapter *adapter = dvo->i2c_bus; in ns2501_writeb()
148 .addr = dvo->slave_addr, in ns2501_writeb()
163 addr, adapter->name, dvo->slave_addr); in ns2501_writeb()
175 static bool ns2501_init(struct intel_dvo_device *dvo, in ns2501_init() argument
186 dvo->i2c_bus = adapter; in ns2501_init()
187 dvo->dev_priv = ns; in ns2501_init()
190 if (!ns2501_readb(dvo, NS2501_VID_LO, &ch)) in ns2501_init()
195 ch, adapter->name, dvo->slave_addr); in ns2501_init()
199 if (!ns2501_readb(dvo, NS2501_DID_LO, &ch)) in ns2501_init()
204 ch, adapter->name, dvo->slave_addr); in ns2501_init()
220 static enum drm_connector_status ns2501_detect(struct intel_dvo_device *dvo) in ns2501_detect() argument
232 static enum drm_mode_status ns2501_mode_valid(struct intel_dvo_device *dvo, in ns2501_mode_valid() argument
255 static void ns2501_mode_set(struct intel_dvo_device *dvo, in ns2501_mode_set() argument
261 struct ns2501_priv *ns = (struct ns2501_priv *)(dvo->dev_priv); in ns2501_mode_set()
290 ok &= ns2501_writeb(dvo, 0x11, 0xc8); // 0xc7 also works. in ns2501_mode_set()
291 ok &= ns2501_writeb(dvo, 0x1b, 0x19); in ns2501_mode_set()
292 ok &= ns2501_writeb(dvo, 0x1c, 0x62); // VBIOS left 0x64 here, but 0x62 works nicer in ns2501_mode_set()
293 ok &= ns2501_writeb(dvo, 0x1d, 0x02); in ns2501_mode_set()
295 ok &= ns2501_writeb(dvo, 0x34, 0x03); in ns2501_mode_set()
296 ok &= ns2501_writeb(dvo, 0x35, 0xff); in ns2501_mode_set()
298 ok &= ns2501_writeb(dvo, 0x80, 0x27); in ns2501_mode_set()
299 ok &= ns2501_writeb(dvo, 0x81, 0x03); in ns2501_mode_set()
300 ok &= ns2501_writeb(dvo, 0x82, 0x41); in ns2501_mode_set()
301 ok &= ns2501_writeb(dvo, 0x83, 0x05); in ns2501_mode_set()
303 ok &= ns2501_writeb(dvo, 0x8d, 0x02); in ns2501_mode_set()
304 ok &= ns2501_writeb(dvo, 0x8e, 0x04); in ns2501_mode_set()
305 ok &= ns2501_writeb(dvo, 0x8f, 0x00); in ns2501_mode_set()
307 ok &= ns2501_writeb(dvo, 0x90, 0xfe); /* vertical. VBIOS left 0xff here, but 0xfe works better */ in ns2501_mode_set()
308 ok &= ns2501_writeb(dvo, 0x91, 0x07); in ns2501_mode_set()
309 ok &= ns2501_writeb(dvo, 0x94, 0x00); in ns2501_mode_set()
310 ok &= ns2501_writeb(dvo, 0x95, 0x00); in ns2501_mode_set()
312 ok &= ns2501_writeb(dvo, 0x96, 0x00); in ns2501_mode_set()
314 ok &= ns2501_writeb(dvo, 0x99, 0x00); in ns2501_mode_set()
315 ok &= ns2501_writeb(dvo, 0x9a, 0x88); in ns2501_mode_set()
317 ok &= ns2501_writeb(dvo, 0x9c, 0x23); /* Looks like first and last line of the image. */ in ns2501_mode_set()
318 ok &= ns2501_writeb(dvo, 0x9d, 0x00); in ns2501_mode_set()
319 ok &= ns2501_writeb(dvo, 0x9e, 0x25); in ns2501_mode_set()
320 ok &= ns2501_writeb(dvo, 0x9f, 0x03); in ns2501_mode_set()
322 ok &= ns2501_writeb(dvo, 0xa4, 0x80); in ns2501_mode_set()
324 ok &= ns2501_writeb(dvo, 0xb6, 0x00); in ns2501_mode_set()
326 ok &= ns2501_writeb(dvo, 0xb9, 0xc8); /* horizontal? */ in ns2501_mode_set()
327 ok &= ns2501_writeb(dvo, 0xba, 0x00); /* horizontal? */ in ns2501_mode_set()
329 ok &= ns2501_writeb(dvo, 0xc0, 0x05); /* horizontal? */ in ns2501_mode_set()
330 ok &= ns2501_writeb(dvo, 0xc1, 0xd7); in ns2501_mode_set()
332 ok &= ns2501_writeb(dvo, 0xc2, 0x00); in ns2501_mode_set()
333 ok &= ns2501_writeb(dvo, 0xc3, 0xf8); in ns2501_mode_set()
335 ok &= ns2501_writeb(dvo, 0xc4, 0x03); in ns2501_mode_set()
336 ok &= ns2501_writeb(dvo, 0xc5, 0x1a); in ns2501_mode_set()
338 ok &= ns2501_writeb(dvo, 0xc6, 0x00); in ns2501_mode_set()
339 ok &= ns2501_writeb(dvo, 0xc7, 0x73); in ns2501_mode_set()
340 ok &= ns2501_writeb(dvo, 0xc8, 0x02); in ns2501_mode_set()
355 ok &= ns2501_writeb(dvo, 0x11, 0xa0); in ns2501_mode_set()
356 ok &= ns2501_writeb(dvo, 0x1b, 0x11); in ns2501_mode_set()
357 ok &= ns2501_writeb(dvo, 0x1c, 0x54); in ns2501_mode_set()
358 ok &= ns2501_writeb(dvo, 0x1d, 0x03); in ns2501_mode_set()
360 ok &= ns2501_writeb(dvo, 0x34, 0x03); in ns2501_mode_set()
361 ok &= ns2501_writeb(dvo, 0x35, 0xff); in ns2501_mode_set()
363 ok &= ns2501_writeb(dvo, 0x80, 0xff); in ns2501_mode_set()
364 ok &= ns2501_writeb(dvo, 0x81, 0x07); in ns2501_mode_set()
365 ok &= ns2501_writeb(dvo, 0x82, 0x3d); in ns2501_mode_set()
366 ok &= ns2501_writeb(dvo, 0x83, 0x05); in ns2501_mode_set()
368 ok &= ns2501_writeb(dvo, 0x8d, 0x02); in ns2501_mode_set()
369 ok &= ns2501_writeb(dvo, 0x8e, 0x10); in ns2501_mode_set()
370 ok &= ns2501_writeb(dvo, 0x8f, 0x00); in ns2501_mode_set()
372 ok &= ns2501_writeb(dvo, 0x90, 0xff); /* vertical */ in ns2501_mode_set()
373 ok &= ns2501_writeb(dvo, 0x91, 0x07); in ns2501_mode_set()
374 ok &= ns2501_writeb(dvo, 0x94, 0x00); in ns2501_mode_set()
375 ok &= ns2501_writeb(dvo, 0x95, 0x00); in ns2501_mode_set()
377 ok &= ns2501_writeb(dvo, 0x96, 0x05); in ns2501_mode_set()
379 ok &= ns2501_writeb(dvo, 0x99, 0x00); in ns2501_mode_set()
380 ok &= ns2501_writeb(dvo, 0x9a, 0x88); in ns2501_mode_set()
382 ok &= ns2501_writeb(dvo, 0x9c, 0x24); in ns2501_mode_set()
383 ok &= ns2501_writeb(dvo, 0x9d, 0x00); in ns2501_mode_set()
384 ok &= ns2501_writeb(dvo, 0x9e, 0x25); in ns2501_mode_set()
385 ok &= ns2501_writeb(dvo, 0x9f, 0x03); in ns2501_mode_set()
387 ok &= ns2501_writeb(dvo, 0xa4, 0x84); in ns2501_mode_set()
389 ok &= ns2501_writeb(dvo, 0xb6, 0x09); in ns2501_mode_set()
391 ok &= ns2501_writeb(dvo, 0xb9, 0xa0); /* horizontal? */ in ns2501_mode_set()
392 ok &= ns2501_writeb(dvo, 0xba, 0x00); /* horizontal? */ in ns2501_mode_set()
394 ok &= ns2501_writeb(dvo, 0xc0, 0x05); /* horizontal? */ in ns2501_mode_set()
395 ok &= ns2501_writeb(dvo, 0xc1, 0x90); in ns2501_mode_set()
397 ok &= ns2501_writeb(dvo, 0xc2, 0x00); in ns2501_mode_set()
398 ok &= ns2501_writeb(dvo, 0xc3, 0x0f); in ns2501_mode_set()
400 ok &= ns2501_writeb(dvo, 0xc4, 0x03); in ns2501_mode_set()
401 ok &= ns2501_writeb(dvo, 0xc5, 0x16); in ns2501_mode_set()
403 ok &= ns2501_writeb(dvo, 0xc6, 0x00); in ns2501_mode_set()
404 ok &= ns2501_writeb(dvo, 0xc7, 0x02); in ns2501_mode_set()
405 ok &= ns2501_writeb(dvo, 0xc8, 0x02); in ns2501_mode_set()
426 ok &= ns2501_writeb(dvo, 0x37, 0x44); in ns2501_mode_set()
435 ok &= ns2501_writeb(dvo, NS2501_REG8, ns->reg_8_shadow); in ns2501_mode_set()
440 static bool ns2501_get_hw_state(struct intel_dvo_device *dvo) in ns2501_get_hw_state() argument
444 if (!ns2501_readb(dvo, NS2501_REG8, &ch)) in ns2501_get_hw_state()
454 static void ns2501_dpms(struct intel_dvo_device *dvo, bool enable) in ns2501_dpms() argument
458 struct ns2501_priv *ns = (struct ns2501_priv *)(dvo->dev_priv); in ns2501_dpms()
477 ok &= ns2501_writeb(dvo, NS2501_REG8, ch); in ns2501_dpms()
479 ns2501_writeb(dvo, 0x34, in ns2501_dpms()
482 ns2501_writeb(dvo, 0x35, in ns2501_dpms()
488 static void ns2501_dump_regs(struct intel_dvo_device *dvo) in ns2501_dump_regs() argument
492 ns2501_readb(dvo, NS2501_FREQ_LO, &val); in ns2501_dump_regs()
494 ns2501_readb(dvo, NS2501_FREQ_HI, &val); in ns2501_dump_regs()
496 ns2501_readb(dvo, NS2501_REG8, &val); in ns2501_dump_regs()
498 ns2501_readb(dvo, NS2501_REG9, &val); in ns2501_dump_regs()
500 ns2501_readb(dvo, NS2501_REGC, &val); in ns2501_dump_regs()
504 static void ns2501_destroy(struct intel_dvo_device *dvo) in ns2501_destroy() argument
506 struct ns2501_priv *ns = dvo->dev_priv; in ns2501_destroy()
510 dvo->dev_priv = NULL; in ns2501_destroy()