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.

Dependency Surface

Detected Declarations

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

Implementation Notes