drivers/video/fbdev/core/fb_ddc.c

Source file repositories/reference/linux-study-clean/drivers/video/fbdev/core/fb_ddc.c

File Facts

System
Linux kernel
Corpus path
drivers/video/fbdev/core/fb_ddc.c
Extension
.c
Size
2816 bytes
Lines
128
Domain
Driver Families
Bucket
drivers/video
Inferred role
Driver Families: exported/initcall integration point
Status
integration 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

if (algo_data->getscl) {
			for (j = 0; j < 5; j++) {
				msleep(10);
				if (algo_data->getscl(algo_data->data))
					break;
			}
			if (j == 5)
				continue;
		} else {
			udelay(algo_data->udelay);
		}

		algo_data->setsda(algo_data->data, 0);
		msleep(15);
		algo_data->setscl(algo_data->data, 0);
		msleep(15);
		algo_data->setsda(algo_data->data, 1);
		msleep(15);

		/* Do the real work */
		edid = fb_do_probe_ddc_edid(adapter);
		algo_data->setsda(algo_data->data, 0);
		algo_data->setscl(algo_data->data, 0);
		msleep(15);

		algo_data->setscl(algo_data->data, 1);
		if (algo_data->getscl) {
			for (j = 0; j < 10; j++) {
				msleep(10);
				if (algo_data->getscl(algo_data->data))
					break;
			}
		} else {
			udelay(algo_data->udelay);
		}

		algo_data->setsda(algo_data->data, 1);
		msleep(15);
		algo_data->setscl(algo_data->data, 0);
		algo_data->setsda(algo_data->data, 0);
		if (edid)
			break;
	}
	/* Release the DDC lines when done or the Apple Cinema HD display
	 * will switch off
	 */
	algo_data->setsda(algo_data->data, 1);
	algo_data->setscl(algo_data->data, 1);

	return edid;
}

EXPORT_SYMBOL_GPL(fb_ddc_read);

MODULE_AUTHOR("Dennis Munsie <dmunsie@cecropia.com>");
MODULE_DESCRIPTION("DDC/EDID reading support");
MODULE_LICENSE("GPL");

Annotation

Implementation Notes