drivers/video/backlight/jornada720_lcd.c
Source file repositories/reference/linux-study-clean/drivers/video/backlight/jornada720_lcd.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/backlight/jornada720_lcd.c- Extension
.c- Size
- 2754 bytes
- Lines
- 128
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.hlinux/io.hlinux/kernel.hlinux/lcd.hlinux/module.hlinux/platform_device.hlinux/delay.hmach/jornada720.hmach/hardware.hvideo/s1d13xxxfb.h
Detected Declarations
function seriesfunction jornada_lcd_get_contrastfunction jornada_lcd_set_contrastfunction jornada_lcd_set_powerfunction jornada_lcd_probe
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/*
*
* LCD driver for HP Jornada 700 series (710/720/728)
* Copyright (C) 2006-2009 Kristoffer Ericson <kristoffer.ericson@gmail.com>
*/
#include <linux/device.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/lcd.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/delay.h>
#include <mach/jornada720.h>
#include <mach/hardware.h>
#include <video/s1d13xxxfb.h>
#define LCD_MAX_CONTRAST 0xff
#define LCD_DEF_CONTRAST 0x80
static int jornada_lcd_get_power(struct lcd_device *ld)
{
return PPSR & PPC_LDD2 ? LCD_POWER_ON : LCD_POWER_OFF;
}
static int jornada_lcd_get_contrast(struct lcd_device *ld)
{
int ret;
if (jornada_lcd_get_power(ld) != LCD_POWER_ON)
return 0;
jornada_ssp_start();
if (jornada_ssp_byte(GETCONTRAST) == TXDUMMY) {
ret = jornada_ssp_byte(TXDUMMY);
goto success;
}
dev_err(&ld->dev, "failed to set contrast\n");
ret = -ETIMEDOUT;
success:
jornada_ssp_end();
return ret;
}
static int jornada_lcd_set_contrast(struct lcd_device *ld, int value)
{
int ret = 0;
jornada_ssp_start();
/* start by sending our set contrast cmd to mcu */
if (jornada_ssp_byte(SETCONTRAST) == TXDUMMY) {
/* if successful push the new value */
if (jornada_ssp_byte(value) == TXDUMMY)
goto success;
}
dev_err(&ld->dev, "failed to set contrast\n");
ret = -ETIMEDOUT;
success:
jornada_ssp_end();
return ret;
}
static int jornada_lcd_set_power(struct lcd_device *ld, int power)
{
if (power != LCD_POWER_ON) {
PPSR &= ~PPC_LDD2;
PPDR |= PPC_LDD2;
} else {
PPSR |= PPC_LDD2;
}
return 0;
}
static const struct lcd_ops jornada_lcd_props = {
.get_contrast = jornada_lcd_get_contrast,
.set_contrast = jornada_lcd_set_contrast,
.get_power = jornada_lcd_get_power,
.set_power = jornada_lcd_set_power,
};
Annotation
- Immediate include surface: `linux/device.h`, `linux/io.h`, `linux/kernel.h`, `linux/lcd.h`, `linux/module.h`, `linux/platform_device.h`, `linux/delay.h`, `mach/jornada720.h`.
- Detected declarations: `function series`, `function jornada_lcd_get_contrast`, `function jornada_lcd_set_contrast`, `function jornada_lcd_set_power`, `function jornada_lcd_probe`.
- Atlas domain: Driver Families / drivers/video.
- Implementation status: source implementation candidate.
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.