drivers/auxdisplay/hd44780_common.c

Source file repositories/reference/linux-study-clean/drivers/auxdisplay/hd44780_common.c

File Facts

System
Linux kernel
Corpus path
drivers/auxdisplay/hd44780_common.c
Extension
.c
Size
9847 bytes
Lines
380
Domain
Driver Families
Bucket
drivers/auxdisplay
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 (shift == 0) {
			cgbytes[cgoffset++] = value;
			value = 0;
		}
	}

	hdc->write_cmd(hdc, LCD_CMD_SET_CGRAM_ADDR | (cgaddr * 8));
	for (addr = 0; addr < cgoffset; addr++)
		hdc->write_data(hdc, cgbytes[addr]);

	/* ensures that we stop writing to CGRAM */
	lcd->ops->gotoxy(lcd, lcd->addr.x, lcd->addr.y);
	return 1;
}
EXPORT_SYMBOL_GPL(hd44780_common_redefine_char);

struct charlcd *hd44780_common_alloc(void)
{
	struct hd44780_common *hdc;
	struct charlcd *lcd;

	lcd = charlcd_alloc(sizeof(*hdc));
	if (!lcd)
		return NULL;

	hdc = lcd->drvdata;
	hdc->ifwidth = 8;
	hdc->bwidth = DEFAULT_LCD_BWIDTH;
	hdc->hwidth = DEFAULT_LCD_HWIDTH;
	return lcd;
}
EXPORT_SYMBOL_GPL(hd44780_common_alloc);

void hd44780_common_free(struct charlcd *lcd)
{
	charlcd_free(lcd);
}
EXPORT_SYMBOL_GPL(hd44780_common_free);

MODULE_DESCRIPTION("Common functions for HD44780 (and compatibles) LCD displays");
MODULE_LICENSE("GPL");

Annotation

Implementation Notes