Subversion Repositories Kolibri OS

Rev

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

Rev 2342 Rev 3031
Line 161... Line 161...
161
struct ch7017_priv {
161
struct ch7017_priv {
162
	uint8_t dummy;
162
	uint8_t dummy;
163
};
163
};
Line 164... Line 164...
164
 
164
 
165
static void ch7017_dump_regs(struct intel_dvo_device *dvo);
165
static void ch7017_dump_regs(struct intel_dvo_device *dvo);
Line 166... Line 166...
166
static void ch7017_dpms(struct intel_dvo_device *dvo, int mode);
166
static void ch7017_dpms(struct intel_dvo_device *dvo, bool enable);
167
 
167
 
168
static bool ch7017_read(struct intel_dvo_device *dvo, u8 addr, u8 *val)
168
static bool ch7017_read(struct intel_dvo_device *dvo, u8 addr, u8 *val)
169
{
169
{
Line 307... Line 307...
307
				   (((mode->vdisplay & 0x0700) >> 8) << 3);
307
				   (((mode->vdisplay & 0x0700) >> 8) << 3);
Line 308... Line 308...
308
 
308
 
309
	lvds_power_down = CH7017_LVDS_POWER_DOWN_DEFAULT_RESERVED |
309
	lvds_power_down = CH7017_LVDS_POWER_DOWN_DEFAULT_RESERVED |
Line 310... Line 310...
310
			  (mode->hdisplay & 0x0700) >> 8;
310
			  (mode->hdisplay & 0x0700) >> 8;
311
 
311
 
312
	ch7017_dpms(dvo, DRM_MODE_DPMS_OFF);
312
	ch7017_dpms(dvo, false);
313
	ch7017_write(dvo, CH7017_HORIZONTAL_ACTIVE_PIXEL_INPUT,
313
	ch7017_write(dvo, CH7017_HORIZONTAL_ACTIVE_PIXEL_INPUT,
314
			horizontal_active_pixel_input);
314
			horizontal_active_pixel_input);
315
	ch7017_write(dvo, CH7017_HORIZONTAL_ACTIVE_PIXEL_OUTPUT,
315
	ch7017_write(dvo, CH7017_HORIZONTAL_ACTIVE_PIXEL_OUTPUT,
Line 329... Line 329...
329
	DRM_DEBUG_KMS("Registers after mode setting\n");
329
	DRM_DEBUG_KMS("Registers after mode setting\n");
330
	ch7017_dump_regs(dvo);
330
	ch7017_dump_regs(dvo);
331
}
331
}
Line 332... Line 332...
332
 
332
 
333
/* set the CH7017 power state */
333
/* set the CH7017 power state */
334
static void ch7017_dpms(struct intel_dvo_device *dvo, int mode)
334
static void ch7017_dpms(struct intel_dvo_device *dvo, bool enable)
335
{
335
{
Line 336... Line 336...
336
	uint8_t val;
336
	uint8_t val;
Line 343... Line 343...
343
			CH7017_DAC1_POWER_DOWN |
343
			CH7017_DAC1_POWER_DOWN |
344
			CH7017_DAC2_POWER_DOWN |
344
			CH7017_DAC2_POWER_DOWN |
345
			CH7017_DAC3_POWER_DOWN |
345
			CH7017_DAC3_POWER_DOWN |
346
			CH7017_TV_POWER_DOWN_EN);
346
			CH7017_TV_POWER_DOWN_EN);
Line 347... Line 347...
347
 
347
 
348
	if (mode == DRM_MODE_DPMS_ON) {
348
	if (enable) {
349
		/* Turn on the LVDS */
349
		/* Turn on the LVDS */
350
		ch7017_write(dvo, CH7017_LVDS_POWER_DOWN,
350
		ch7017_write(dvo, CH7017_LVDS_POWER_DOWN,
351
			     val & ~CH7017_LVDS_POWER_DOWN_EN);
351
			     val & ~CH7017_LVDS_POWER_DOWN_EN);
352
	} else {
352
	} else {
Line 357... Line 357...
357
 
357
 
358
	/* XXX: Should actually wait for update power status somehow */
358
	/* XXX: Should actually wait for update power status somehow */
359
	msleep(20);
359
	msleep(20);
Line -... Line 360...
-
 
360
}
-
 
361
 
-
 
362
static bool ch7017_get_hw_state(struct intel_dvo_device *dvo)
-
 
363
{
-
 
364
	uint8_t val;
-
 
365
 
-
 
366
	ch7017_read(dvo, CH7017_LVDS_POWER_DOWN, &val);
-
 
367
 
-
 
368
	if (val & CH7017_LVDS_POWER_DOWN_EN)
-
 
369
		return false;
-
 
370
	else
-
 
371
		return true;
360
}
372
}
361
 
373
 
362
static void ch7017_dump_regs(struct intel_dvo_device *dvo)
374
static void ch7017_dump_regs(struct intel_dvo_device *dvo)
Line 363... Line 375...
363
{
375
{
Line 394... Line 406...
394
	.init = ch7017_init,
406
	.init = ch7017_init,
395
	.detect = ch7017_detect,
407
	.detect = ch7017_detect,
396
	.mode_valid = ch7017_mode_valid,
408
	.mode_valid = ch7017_mode_valid,
397
	.mode_set = ch7017_mode_set,
409
	.mode_set = ch7017_mode_set,
398
	.dpms = ch7017_dpms,
410
	.dpms = ch7017_dpms,
-
 
411
	.get_hw_state = ch7017_get_hw_state,
399
	.dump_regs = ch7017_dump_regs,
412
	.dump_regs = ch7017_dump_regs,
400
	.destroy = ch7017_destroy,
413
	.destroy = ch7017_destroy,
401
};
414
};