drivers/video/backlight/ipaq_micro_bl.c
Source file repositories/reference/linux-study-clean/drivers/video/backlight/ipaq_micro_bl.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/backlight/ipaq_micro_bl.c- Extension
.c- Size
- 1882 bytes
- Lines
- 76
- 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/backlight.hlinux/err.hlinux/init.hlinux/mfd/ipaq-micro.hlinux/module.hlinux/platform_device.h
Detected Declarations
function micro_bl_update_statusfunction micro_backlight_probe
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
*
* iPAQ microcontroller backlight support
* Author : Linus Walleij <linus.walleij@linaro.org>
*/
#include <linux/backlight.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/mfd/ipaq-micro.h>
#include <linux/module.h>
#include <linux/platform_device.h>
static int micro_bl_update_status(struct backlight_device *bd)
{
struct ipaq_micro *micro = dev_get_drvdata(&bd->dev);
int intensity = backlight_get_brightness(bd);
struct ipaq_micro_msg msg = {
.id = MSG_BACKLIGHT,
.tx_len = 3,
};
/*
* Message format:
* Byte 0: backlight instance (usually 1)
* Byte 1: on/off
* Byte 2: intensity, 0-255
*/
msg.tx_data[0] = 0x01;
msg.tx_data[1] = intensity > 0 ? 1 : 0;
msg.tx_data[2] = intensity;
return ipaq_micro_tx_msg_sync(micro, &msg);
}
static const struct backlight_ops micro_bl_ops = {
.options = BL_CORE_SUSPENDRESUME,
.update_status = micro_bl_update_status,
};
static const struct backlight_properties micro_bl_props = {
.type = BACKLIGHT_RAW,
.max_brightness = 255,
.power = BACKLIGHT_POWER_ON,
.brightness = 64,
};
static int micro_backlight_probe(struct platform_device *pdev)
{
struct backlight_device *bd;
struct ipaq_micro *micro = dev_get_drvdata(pdev->dev.parent);
bd = devm_backlight_device_register(&pdev->dev, "ipaq-micro-backlight",
&pdev->dev, micro, µ_bl_ops,
µ_bl_props);
if (IS_ERR(bd))
return PTR_ERR(bd);
platform_set_drvdata(pdev, bd);
backlight_update_status(bd);
return 0;
}
static struct platform_driver micro_backlight_device_driver = {
.driver = {
.name = "ipaq-micro-backlight",
},
.probe = micro_backlight_probe,
};
module_platform_driver(micro_backlight_device_driver);
MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("driver for iPAQ Atmel micro backlight");
MODULE_ALIAS("platform:ipaq-micro-backlight");
Annotation
- Immediate include surface: `linux/backlight.h`, `linux/err.h`, `linux/init.h`, `linux/mfd/ipaq-micro.h`, `linux/module.h`, `linux/platform_device.h`.
- Detected declarations: `function micro_bl_update_status`, `function micro_backlight_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.