linux/drivers/platform/x86/pcengines-apuv2.c

// SPDX-License-Identifier: GPL-2.0+

/*
 * PC-Engines APUv2/APUv3 board platform driver
 * for GPIO buttons and LEDs
 *
 * Copyright (C) 2018 metux IT consult
 * Author: Enrico Weigelt <[email protected]>
 */

#define pr_fmt(fmt)

#include <linux/dmi.h>
#include <linux/err.h>
#include <linux/kernel.h>
#include <linux/leds.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/gpio_keys.h>
#include <linux/gpio/machine.h>
#include <linux/input.h>
#include <linux/platform_data/gpio/gpio-amd-fch.h>

/*
 * NOTE: this driver only supports APUv2/3 - not APUv1, as this one
 * has completely different register layouts.
 */

/* Register mappings */
#define APU2_GPIO_REG_LED1
#define APU2_GPIO_REG_LED2
#define APU2_GPIO_REG_LED3
#define APU2_GPIO_REG_MODESW
#define APU2_GPIO_REG_SIMSWAP
#define APU2_GPIO_REG_MPCIE2
#define APU2_GPIO_REG_MPCIE3

/* Order in which the GPIO lines are defined in the register list */
#define APU2_GPIO_LINE_LED1
#define APU2_GPIO_LINE_LED2
#define APU2_GPIO_LINE_LED3
#define APU2_GPIO_LINE_MODESW
#define APU2_GPIO_LINE_SIMSWAP
#define APU2_GPIO_LINE_MPCIE2
#define APU2_GPIO_LINE_MPCIE3

/* GPIO device */

static int apu2_gpio_regs[] =;

static const char * const apu2_gpio_names[] =;

static const struct amd_fch_gpio_pdata board_apu2 =;

/* GPIO LEDs device */

static const struct gpio_led apu2_leds[] =;

static const struct gpio_led_platform_data apu2_leds_pdata =;

static struct gpiod_lookup_table gpios_led_table =;

/* GPIO keyboard device */

static struct gpio_keys_button apu2_keys_buttons[] =;

static const struct gpio_keys_platform_data apu2_keys_pdata =;

static struct gpiod_lookup_table gpios_key_table =;

/* Board setup */

/* Note: matching works on string prefix, so "apu2" must come before "apu" */
static const struct dmi_system_id apu_gpio_dmi_table[] __initconst =;

static struct platform_device *apu_gpio_pdev;
static struct platform_device *apu_leds_pdev;
static struct platform_device *apu_keys_pdev;

static struct platform_device * __init apu_create_pdev(
	const char *name,
	const void *pdata,
	size_t sz)
{}

static int __init apu_board_init(void)
{}

static void __exit apu_board_exit(void)
{}

module_init();
module_exit(apu_board_exit);

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_DEVICE_TABLE(dmi, apu_gpio_dmi_table);
MODULE_SOFTDEP();