arch/arm/mach-orion5x/ts409-setup.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-orion5x/ts409-setup.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-orion5x/ts409-setup.c- Extension
.c- Size
- 8557 bytes
- Lines
- 330
- Domain
- Architecture Layer
- Bucket
- arch/arm
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/gpio.hlinux/gpio/machine.hlinux/kernel.hlinux/init.hlinux/platform_device.hlinux/pci.hlinux/irq.hlinux/mtd/physmap.hlinux/mv643xx_eth.hlinux/leds.hlinux/gpio_keys.hlinux/input.hlinux/i2c.hlinux/serial_reg.hasm/mach-types.hasm/mach/arch.hasm/mach/pci.hcommon.hmpp.horion5x.htsx09-common.h
Detected Declarations
function qnap_ts409_pci_map_irqfunction qnap_ts409_pci_initfunction qnap_ts409_initmodule init qnap_ts409_pci_init
Annotated Snippet
subsys_initcall(qnap_ts409_pci_init);
/*****************************************************************************
* RTC S35390A on I2C bus
****************************************************************************/
#define TS409_RTC_GPIO 10
static struct i2c_board_info __initdata qnap_ts409_i2c_rtc = {
I2C_BOARD_INFO("s35390a", 0x30),
};
/*****************************************************************************
* LEDs attached to GPIO
****************************************************************************/
static struct gpio_led ts409_led_pins[] = {
{
.name = "ts409:red:sata1",
}, {
.name = "ts409:red:sata2",
}, {
.name = "ts409:red:sata3",
}, {
.name = "ts409:red:sata4",
},
};
static struct gpiod_lookup_table ts409_leds_gpio_table = {
.dev_id = "leds-gpio",
.table = {
GPIO_LOOKUP_IDX("orion_gpio0", 4, NULL,
0, GPIO_ACTIVE_LOW),
GPIO_LOOKUP_IDX("orion_gpio0", 5, NULL,
1, GPIO_ACTIVE_LOW),
GPIO_LOOKUP_IDX("orion_gpio0", 6, NULL,
2, GPIO_ACTIVE_LOW),
GPIO_LOOKUP_IDX("orion_gpio0", 7, NULL,
3, GPIO_ACTIVE_LOW),
{ },
},
};
static struct gpio_led_platform_data ts409_led_data = {
.leds = ts409_led_pins,
.num_leds = ARRAY_SIZE(ts409_led_pins),
};
static struct platform_device ts409_leds = {
.name = "leds-gpio",
.id = -1,
.dev = {
.platform_data = &ts409_led_data,
},
};
/****************************************************************************
* GPIO Attached Keys
* Power button is attached to the PIC microcontroller
****************************************************************************/
#define QNAP_TS409_GPIO_KEY_RESET 14
#define QNAP_TS409_GPIO_KEY_MEDIA 15
static struct gpio_keys_button qnap_ts409_buttons[] = {
{
.code = KEY_RESTART,
.gpio = QNAP_TS409_GPIO_KEY_RESET,
.desc = "Reset Button",
.active_low = 1,
}, {
.code = KEY_COPY,
.gpio = QNAP_TS409_GPIO_KEY_MEDIA,
.desc = "USB Copy Button",
.active_low = 1,
},
};
static struct gpio_keys_platform_data qnap_ts409_button_data = {
.buttons = qnap_ts409_buttons,
.nbuttons = ARRAY_SIZE(qnap_ts409_buttons),
};
static struct platform_device qnap_ts409_button_device = {
.name = "gpio-keys",
.id = -1,
.num_resources = 0,
.dev = {
.platform_data = &qnap_ts409_button_data,
},
Annotation
- Immediate include surface: `linux/gpio.h`, `linux/gpio/machine.h`, `linux/kernel.h`, `linux/init.h`, `linux/platform_device.h`, `linux/pci.h`, `linux/irq.h`, `linux/mtd/physmap.h`.
- Detected declarations: `function qnap_ts409_pci_map_irq`, `function qnap_ts409_pci_init`, `function qnap_ts409_init`, `module init qnap_ts409_pci_init`.
- Atlas domain: Architecture Layer / arch/arm.
- Implementation status: integration 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.