drivers/video/fbdev/omap/lcd_mipid.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/omap/lcd_mipid.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/omap/lcd_mipid.c- Extension
.c- Size
- 13354 bytes
- Lines
- 607
- 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.
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.hlinux/delay.hlinux/gpio/consumer.hlinux/slab.hlinux/workqueue.hlinux/spi/spi.hlinux/module.hlinux/platform_data/lcd-mipid.homapfb.h
Detected Declarations
struct mipid_devicefunction mipid_transferfunction mipid_cmdfunction mipid_writefunction mipid_readfunction set_data_linesfunction send_init_stringfunction hw_guard_startfunction hw_guard_waitfunction set_sleep_modefunction set_display_statefunction mipid_set_bklight_levelfunction mipid_get_bklight_levelfunction mipid_get_bklight_maxfunction mipid_get_capsfunction read_first_pixelfunction mipid_run_testfunction ls041y3_esd_recoverfunction ls041y3_esd_check_mode1function ls041y3_esd_check_mode2function ls041y3_esd_checkfunction mipid_esd_start_checkfunction mipid_esd_stop_checkfunction mipid_esd_workfunction mipid_enablefunction mipid_disablefunction panel_enabledfunction mipid_initfunction mipid_cleanupfunction mipid_detectfunction mipid_spi_probefunction mipid_spi_remove
Annotated Snippet
struct mipid_device {
int enabled;
int revision;
unsigned int saved_bklight_level;
unsigned long hw_guard_end; /* next value of jiffies
when we can issue the
next sleep in/out command */
unsigned long hw_guard_wait; /* max guard time in jiffies */
struct gpio_desc *reset;
struct omapfb_device *fbdev;
struct spi_device *spi;
struct mutex mutex;
struct lcd_panel panel;
struct delayed_work esd_work;
void (*esd_check)(struct mipid_device *m);
};
static void mipid_transfer(struct mipid_device *md, int cmd, const u8 *wbuf,
int wlen, u8 *rbuf, int rlen)
{
struct spi_message m;
struct spi_transfer *x, xfer[4];
u16 w;
int r;
BUG_ON(md->spi == NULL);
spi_message_init(&m);
memset(xfer, 0, sizeof(xfer));
x = &xfer[0];
cmd &= 0xff;
x->tx_buf = &cmd;
x->bits_per_word = 9;
x->len = 2;
spi_message_add_tail(x, &m);
if (wlen) {
x++;
x->tx_buf = wbuf;
x->len = wlen;
x->bits_per_word = 9;
spi_message_add_tail(x, &m);
}
if (rlen) {
x++;
x->rx_buf = &w;
x->len = 1;
spi_message_add_tail(x, &m);
if (rlen > 1) {
/* Arrange for the extra clock before the first
* data bit.
*/
x->bits_per_word = 9;
x->len = 2;
x++;
x->rx_buf = &rbuf[1];
x->len = rlen - 1;
spi_message_add_tail(x, &m);
}
}
r = spi_sync(md->spi, &m);
if (r < 0)
dev_dbg(&md->spi->dev, "spi_sync %d\n", r);
if (rlen)
rbuf[0] = w & 0xff;
}
static inline void mipid_cmd(struct mipid_device *md, int cmd)
{
mipid_transfer(md, cmd, NULL, 0, NULL, 0);
}
static inline void mipid_write(struct mipid_device *md,
int reg, const u8 *buf, int len)
{
mipid_transfer(md, reg, buf, len, NULL, 0);
}
static inline void mipid_read(struct mipid_device *md,
int reg, u8 *buf, int len)
{
Annotation
- Immediate include surface: `linux/device.h`, `linux/delay.h`, `linux/gpio/consumer.h`, `linux/slab.h`, `linux/workqueue.h`, `linux/spi/spi.h`, `linux/module.h`, `linux/platform_data/lcd-mipid.h`.
- Detected declarations: `struct mipid_device`, `function mipid_transfer`, `function mipid_cmd`, `function mipid_write`, `function mipid_read`, `function set_data_lines`, `function send_init_string`, `function hw_guard_start`, `function hw_guard_wait`, `function set_sleep_mode`.
- Atlas domain: Driver Families / drivers/video.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.