arch/arm/mach-orion5x/board-d2net.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-orion5x/board-d2net.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-orion5x/board-d2net.c- Extension
.c- Size
- 3184 bytes
- Lines
- 117
- Domain
- Architecture Layer
- Bucket
- arch/arm
- Inferred role
- Architecture Layer: implementation source
- Status
- source 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/init.hlinux/platform_device.hlinux/pci.hlinux/irq.hlinux/leds.hlinux/gpio.hlinux/gpio/machine.hasm/mach-types.hasm/mach/arch.hasm/mach/pci.hplat/orion-gpio.hcommon.horion5x.h
Detected Declarations
function d2net_gpio_leds_initfunction d2net_init
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* arch/arm/mach-orion5x/board-d2net.c
*
* LaCie d2Network and Big Disk Network NAS setup
*
* Copyright (C) 2009 Simon Guinot <sguinot@lacie.com>
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/pci.h>
#include <linux/irq.h>
#include <linux/leds.h>
#include <linux/gpio.h>
#include <linux/gpio/machine.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/pci.h>
#include <plat/orion-gpio.h>
#include "common.h"
#include "orion5x.h"
/*****************************************************************************
* LaCie d2 Network Info
****************************************************************************/
/*****************************************************************************
* GPIO LED's
****************************************************************************/
/*
* The blue front LED is wired to the CPLD and can blink in relation with the
* SATA activity.
*
* The following array detail the different LED registers and the combination
* of their possible values:
*
* led_off | blink_ctrl | SATA active | LED state
* | | |
* 1 | x | x | off
* 0 | 0 | 0 | off
* 0 | 1 | 0 | blink (rate 300ms)
* 0 | x | 1 | on
*
* Notes: The blue and the red front LED's can't be on at the same time.
* Red LED have priority.
*/
#define D2NET_GPIO_RED_LED 6
#define D2NET_GPIO_BLUE_LED_BLINK_CTRL 16
#define D2NET_GPIO_BLUE_LED_OFF 23
static struct gpio_led d2net_leds[] = {
{
.name = "d2net:blue:sata",
.default_trigger = "default-on",
},
{
.name = "d2net:red:fail",
},
};
static struct gpio_led_platform_data d2net_led_data = {
.num_leds = ARRAY_SIZE(d2net_leds),
.leds = d2net_leds,
};
static struct platform_device d2net_gpio_leds = {
.name = "leds-gpio",
.id = -1,
.dev = {
.platform_data = &d2net_led_data,
},
};
static struct gpiod_lookup_table d2net_leds_gpio_table = {
.dev_id = "leds-gpio",
.table = {
GPIO_LOOKUP_IDX("orion_gpio0", D2NET_GPIO_BLUE_LED_OFF, NULL,
0, GPIO_ACTIVE_LOW),
GPIO_LOOKUP_IDX("orion_gpio0", D2NET_GPIO_RED_LED, NULL,
1, GPIO_ACTIVE_HIGH),
{ },
},
};
static void __init d2net_gpio_leds_init(void)
{
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/init.h`, `linux/platform_device.h`, `linux/pci.h`, `linux/irq.h`, `linux/leds.h`, `linux/gpio.h`, `linux/gpio/machine.h`.
- Detected declarations: `function d2net_gpio_leds_init`, `function d2net_init`.
- Atlas domain: Architecture Layer / arch/arm.
- 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.