drivers/video/fbdev/geode/suspend_gx.c

Source file repositories/reference/linux-study-clean/drivers/video/fbdev/geode/suspend_gx.c

File Facts

System
Linux kernel
Corpus path
drivers/video/fbdev/geode/suspend_gx.c
Extension
.c
Size
5998 bytes
Lines
260
Domain
Driver Families
Bucket
drivers/video
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

switch (i) {
		case GP_VECTOR_MODE:
		case GP_BLT_MODE:
		case GP_BLT_STATUS:
		case GP_HST_SRC:
			/* don't restore these registers */
			break;
		default:
			write_gp(par, i, par->gp[i]);
		}
	}
}

static void gx_restore_display_ctlr(struct gxfb_par *par)
{
	int i;

	for (i = 0; i < ARRAY_SIZE(par->dc); i++) {
		switch (i) {
		case DC_UNLOCK:
			/* unlock the DC; runs first */
			write_dc(par, DC_UNLOCK, DC_UNLOCK_UNLOCK);
			break;

		case DC_GENERAL_CFG:
			/* write without the enables */
			write_dc(par, i, par->dc[i] & ~(DC_GENERAL_CFG_VIDE |
					DC_GENERAL_CFG_ICNE |
					DC_GENERAL_CFG_CURE |
					DC_GENERAL_CFG_DFLE));
			break;

		case DC_DISPLAY_CFG:
			/* write without the enables */
			write_dc(par, i, par->dc[i] & ~(DC_DISPLAY_CFG_VDEN |
					DC_DISPLAY_CFG_GDEN |
					DC_DISPLAY_CFG_TGEN));
			break;

		case DC_RSVD_0:
		case DC_RSVD_1:
		case DC_RSVD_2:
		case DC_RSVD_3:
		case DC_RSVD_4:
		case DC_LINE_CNT:
		case DC_PAL_ADDRESS:
		case DC_PAL_DATA:
		case DC_DFIFO_DIAG:
		case DC_CFIFO_DIAG:
		case DC_RSVD_5:
			/* don't restore these registers */
			break;
		default:
			write_dc(par, i, par->dc[i]);
		}
	}

	/* restore the palette */
	write_dc(par, DC_PAL_ADDRESS, 0);
	for (i = 0; i < ARRAY_SIZE(par->pal); i++)
		write_dc(par, DC_PAL_DATA, par->pal[i]);
}

static void gx_restore_video_proc(struct gxfb_par *par)
{
	int i;

	wrmsrq(MSR_GX_MSR_PADSEL, par->msr.padsel);

	for (i = 0; i < ARRAY_SIZE(par->vp); i++) {
		switch (i) {
		case VP_VCFG:
			/* don't enable video yet */
			write_vp(par, i, par->vp[i] & ~VP_VCFG_VID_EN);
			break;

		case VP_DCFG:
			/* don't enable CRT yet */
			write_vp(par, i, par->vp[i] &
					~(VP_DCFG_DAC_BL_EN | VP_DCFG_VSYNC_EN |
					VP_DCFG_HSYNC_EN | VP_DCFG_CRT_EN));
			break;

		case VP_GAR:
		case VP_GDR:
		case VP_RSVD_0:
		case VP_RSVD_1:
		case VP_RSVD_2:
		case VP_RSVD_3:
		case VP_CRC32:

Annotation

Implementation Notes