arch/mips/bcm47xx/buttons.c

Source file repositories/reference/linux-study-clean/arch/mips/bcm47xx/buttons.c

File Facts

System
Linux kernel
Corpus path
arch/mips/bcm47xx/buttons.c
Extension
.c
Size
22161 bytes
Lines
782
Domain
Architecture Layer
Bucket
arch/mips
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.

Dependency Surface

Detected Declarations

Annotated Snippet

// SPDX-License-Identifier: GPL-2.0
#include "bcm47xx_private.h"

#include <linux/input.h>
#include <linux/gpio_keys.h>
#include <linux/interrupt.h>
#include <bcm47xx_board.h>
#include <bcm47xx.h>

/**************************************************
 * Database
 **************************************************/

#define BCM47XX_GPIO_KEY(_gpio, _code)					\
	{								\
		.code		= _code,				\
		.gpio		= _gpio,				\
		.active_low	= 1,					\
	}

#define BCM47XX_GPIO_KEY_H(_gpio, _code)				\
	{								\
		.code		= _code,				\
		.gpio		= _gpio,				\
	}

/* Asus */

static const struct gpio_keys_button
bcm47xx_buttons_asus_rtn10u[] __initconst = {
	BCM47XX_GPIO_KEY(20, KEY_WPS_BUTTON),
	BCM47XX_GPIO_KEY(21, KEY_RESTART),
};

static const struct gpio_keys_button
bcm47xx_buttons_asus_rtn12[] __initconst = {
	BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
	BCM47XX_GPIO_KEY(1, KEY_RESTART),
	BCM47XX_GPIO_KEY(4, BTN_0), /* Router mode */
	BCM47XX_GPIO_KEY(5, BTN_1), /* Repeater mode */
	BCM47XX_GPIO_KEY(6, BTN_2), /* AP mode */
};

static const struct gpio_keys_button
bcm47xx_buttons_asus_rtn16[] __initconst = {
	BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON),
	BCM47XX_GPIO_KEY(8, KEY_RESTART),
};

static const struct gpio_keys_button
bcm47xx_buttons_asus_rtn66u[] __initconst = {
	BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
	BCM47XX_GPIO_KEY(9, KEY_RESTART),
};

static const struct gpio_keys_button
bcm47xx_buttons_asus_wl300g[] __initconst = {
	BCM47XX_GPIO_KEY(6, KEY_RESTART),
};

static const struct gpio_keys_button
bcm47xx_buttons_asus_wl320ge[] __initconst = {
	BCM47XX_GPIO_KEY(6, KEY_RESTART),
};

static const struct gpio_keys_button
bcm47xx_buttons_asus_wl330ge[] __initconst = {
	BCM47XX_GPIO_KEY(2, KEY_RESTART),
};

static const struct gpio_keys_button
bcm47xx_buttons_asus_wl500g[] __initconst = {
	BCM47XX_GPIO_KEY(6, KEY_RESTART),
};

static const struct gpio_keys_button
bcm47xx_buttons_asus_wl500gd[] __initconst = {
	BCM47XX_GPIO_KEY(6, KEY_RESTART),
};

static const struct gpio_keys_button
bcm47xx_buttons_asus_wl500gpv1[] __initconst = {
	BCM47XX_GPIO_KEY(0, KEY_RESTART),
	BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
};

static const struct gpio_keys_button
bcm47xx_buttons_asus_wl500gpv2[] __initconst = {
	BCM47XX_GPIO_KEY(2, KEY_RESTART),
	BCM47XX_GPIO_KEY(3, KEY_WPS_BUTTON),

Annotation

Implementation Notes