arch/powerpc/platforms/powermac/backlight.c
Source file repositories/reference/linux-study-clean/arch/powerpc/platforms/powermac/backlight.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/platforms/powermac/backlight.c- Extension
.c- Size
- 4966 bytes
- Lines
- 188
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/backlight.hlinux/adb.hlinux/of.hlinux/pmu.hlinux/atomic.hlinux/export.hasm/backlight.h
Detected Declarations
function pmac_has_backlight_typefunction pmac_backlight_key_workerfunction pmac_backlight_keyfunction __pmac_backlight_set_legacy_brightnessfunction pmac_backlight_set_legacy_workerfunction pmac_backlight_set_legacy_brightness_pmufunction pmac_backlight_set_legacy_brightnessfunction pmac_backlight_get_legacy_brightnessfunction pmac_backlight_disablefunction pmac_backlight_enableexport pmac_backlightexport pmac_backlight_mutexexport pmac_has_backlight_type
Annotated Snippet
void pmac_backlight_set_legacy_brightness_pmu(int brightness) {
if (atomic_read(&kernel_backlight_disabled))
return;
pmac_backlight_set_legacy_queued = brightness;
schedule_work(&pmac_backlight_set_legacy_work);
}
int pmac_backlight_set_legacy_brightness(int brightness)
{
return __pmac_backlight_set_legacy_brightness(brightness);
}
int pmac_backlight_get_legacy_brightness(void)
{
int result = -ENXIO;
mutex_lock(&pmac_backlight_mutex);
if (pmac_backlight) {
struct backlight_properties *props;
props = &pmac_backlight->props;
result = props->brightness *
(OLD_BACKLIGHT_MAX + 1) /
(props->max_brightness + 1);
}
mutex_unlock(&pmac_backlight_mutex);
return result;
}
void pmac_backlight_disable(void)
{
atomic_inc(&kernel_backlight_disabled);
}
void pmac_backlight_enable(void)
{
atomic_dec(&kernel_backlight_disabled);
}
EXPORT_SYMBOL_GPL(pmac_backlight);
EXPORT_SYMBOL_GPL(pmac_backlight_mutex);
EXPORT_SYMBOL_GPL(pmac_has_backlight_type);
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/backlight.h`, `linux/adb.h`, `linux/of.h`, `linux/pmu.h`, `linux/atomic.h`, `linux/export.h`, `asm/backlight.h`.
- Detected declarations: `function pmac_has_backlight_type`, `function pmac_backlight_key_worker`, `function pmac_backlight_key`, `function __pmac_backlight_set_legacy_brightness`, `function pmac_backlight_set_legacy_worker`, `function pmac_backlight_set_legacy_brightness_pmu`, `function pmac_backlight_set_legacy_brightness`, `function pmac_backlight_get_legacy_brightness`, `function pmac_backlight_disable`, `function pmac_backlight_enable`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: integration 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.