drivers/leds/leds-wm8350.c
Source file repositories/reference/linux-study-clean/drivers/leds/leds-wm8350.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/leds/leds-wm8350.c- Extension
.c- Size
- 5122 bytes
- Lines
- 268
- Domain
- Driver Families
- Bucket
- drivers/leds
- 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/kernel.hlinux/platform_device.hlinux/leds.hlinux/err.hlinux/mfd/wm8350/pmic.hlinux/regulator/consumer.hlinux/slab.hlinux/module.h
Detected Declarations
function wm8350_led_enablefunction wm8350_led_disablefunction wm8350_led_setfunction wm8350_led_shutdownfunction wm8350_led_probefunction wm8350_led_remove
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* LED driver for WM8350 driven LEDS.
*
* Copyright(C) 2007, 2008 Wolfson Microelectronics PLC.
*/
#include <linux/kernel.h>
#include <linux/platform_device.h>
#include <linux/leds.h>
#include <linux/err.h>
#include <linux/mfd/wm8350/pmic.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <linux/module.h>
/* Microamps */
static const int isink_cur[] = {
4,
5,
6,
7,
8,
10,
11,
14,
16,
19,
23,
27,
32,
39,
46,
54,
65,
77,
92,
109,
130,
154,
183,
218,
259,
308,
367,
436,
518,
616,
733,
872,
1037,
1233,
1466,
1744,
2073,
2466,
2933,
3487,
4147,
4932,
5865,
6975,
8294,
9864,
11730,
13949,
16589,
19728,
23460,
27899,
33178,
39455,
46920,
55798,
66355,
78910,
93840,
111596,
132710,
157820,
187681,
223191
};
#define to_wm8350_led(led_cdev) \
container_of(led_cdev, struct wm8350_led, cdev)
static int wm8350_led_enable(struct wm8350_led *led)
{
int ret = 0;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/platform_device.h`, `linux/leds.h`, `linux/err.h`, `linux/mfd/wm8350/pmic.h`, `linux/regulator/consumer.h`, `linux/slab.h`, `linux/module.h`.
- Detected declarations: `function wm8350_led_enable`, `function wm8350_led_disable`, `function wm8350_led_set`, `function wm8350_led_shutdown`, `function wm8350_led_probe`, `function wm8350_led_remove`.
- Atlas domain: Driver Families / drivers/leds.
- 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.