Subversion Repositories Kolibri OS

Rev

Rev 2342 | Rev 5060 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2342 Rev 3031
Line 286... Line 286...
286
 
286
 
287
	return MODE_OK;
287
	return MODE_OK;
Line 288... Line 288...
288
}
288
}
289
 
289
 
290
/** Sets the power state of the panel connected to the ivch */
290
/** Sets the power state of the panel connected to the ivch */
291
static void ivch_dpms(struct intel_dvo_device *dvo, int mode)
291
static void ivch_dpms(struct intel_dvo_device *dvo, bool enable)
292
{
292
{
Line 293... Line 293...
293
	int i;
293
	int i;
294
	uint16_t vr01, vr30, backlight;
294
	uint16_t vr01, vr30, backlight;
295
 
295
 
Line 296... Line 296...
296
	/* Set the new power state of the panel. */
296
	/* Set the new power state of the panel. */
297
	if (!ivch_read(dvo, VR01, &vr01))
297
	if (!ivch_read(dvo, VR01, &vr01))
298
		return;
298
		return;
299
 
299
 
300
	if (mode == DRM_MODE_DPMS_ON)
300
	if (enable)
Line 301... Line 301...
301
		backlight = 1;
301
		backlight = 1;
302
	else
302
	else
303
		backlight = 0;
303
		backlight = 0;
304
	ivch_write(dvo, VR80, backlight);
304
	ivch_write(dvo, VR80, backlight);
Line 305... Line 305...
305
 
305
 
Line 313... Line 313...
313
	/* Wait for the panel to make its state transition */
313
	/* Wait for the panel to make its state transition */
314
	for (i = 0; i < 100; i++) {
314
	for (i = 0; i < 100; i++) {
315
		if (!ivch_read(dvo, VR30, &vr30))
315
		if (!ivch_read(dvo, VR30, &vr30))
316
			break;
316
			break;
Line 317... Line 317...
317
 
317
 
318
		if (((vr30 & VR30_PANEL_ON) != 0) == (mode == DRM_MODE_DPMS_ON))
318
		if (((vr30 & VR30_PANEL_ON) != 0) == enable)
319
			break;
319
			break;
320
		udelay(1000);
320
		udelay(1000);
321
	}
321
	}
322
	/* wait some more; vch may fail to resync sometimes without this */
322
	/* wait some more; vch may fail to resync sometimes without this */
323
	udelay(16 * 1000);
323
	udelay(16 * 1000);
Line -... Line 324...
-
 
324
}
-
 
325
 
-
 
326
static bool ivch_get_hw_state(struct intel_dvo_device *dvo)
-
 
327
{
-
 
328
	uint16_t vr01;
-
 
329
 
-
 
330
	/* Set the new power state of the panel. */
-
 
331
	if (!ivch_read(dvo, VR01, &vr01))
-
 
332
		return false;
-
 
333
 
-
 
334
	if (vr01 & VR01_LCD_ENABLE)
-
 
335
		return true;
-
 
336
	else
-
 
337
		return false;
324
}
338
}
325
 
339
 
326
static void ivch_mode_set(struct intel_dvo_device *dvo,
340
static void ivch_mode_set(struct intel_dvo_device *dvo,
327
			  struct drm_display_mode *mode,
341
			  struct drm_display_mode *mode,
328
			  struct drm_display_mode *adjusted_mode)
342
			  struct drm_display_mode *adjusted_mode)
Line 411... Line 425...
411
}
425
}
Line 412... Line 426...
412
 
426
 
413
struct intel_dvo_dev_ops ivch_ops = {
427
struct intel_dvo_dev_ops ivch_ops = {
414
	.init = ivch_init,
428
	.init = ivch_init,
-
 
429
	.dpms = ivch_dpms,
415
	.dpms = ivch_dpms,
430
	.get_hw_state = ivch_get_hw_state,
416
	.mode_valid = ivch_mode_valid,
431
	.mode_valid = ivch_mode_valid,
417
	.mode_set = ivch_mode_set,
432
	.mode_set = ivch_mode_set,
418
	.detect = ivch_detect,
433
	.detect = ivch_detect,
419
	.dump_regs = ivch_dump_regs,
434
	.dump_regs = ivch_dump_regs,