linux/drivers/platform/surface/surface_hotplug.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Surface Book (2 and later) hot-plug driver.
 *
 * Surface Book devices (can) have a hot-pluggable discrete GPU (dGPU). This
 * driver is responsible for out-of-band hot-plug event signaling on these
 * devices. It is specifically required when the hot-plug device is in D3cold
 * and can thus not generate PCIe hot-plug events itself.
 *
 * Event signaling is handled via ACPI, which will generate the appropriate
 * device-check notifications to be picked up by the PCIe hot-plug driver.
 *
 * Copyright (C) 2019-2022 Maximilian Luz <[email protected]>
 */

#include <linux/acpi.h>
#include <linux/gpio.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/platform_device.h>

static const struct acpi_gpio_params shps_base_presence_int   =;
static const struct acpi_gpio_params shps_base_presence       =;
static const struct acpi_gpio_params shps_device_power_int    =;
static const struct acpi_gpio_params shps_device_power        =;
static const struct acpi_gpio_params shps_device_presence_int =;
static const struct acpi_gpio_params shps_device_presence     =;

static const struct acpi_gpio_mapping shps_acpi_gpios[] =;

/* 5515a847-ed55-4b27-8352-cd320e10360a */
static const guid_t shps_dsm_guid =;

#define SHPS_DSM_REVISION

enum shps_dsm_fn {};

enum shps_irq_type {};

static const char *const shps_gpio_names[] =;

struct shps_device {};

#define SHPS_IRQ_NOT_PRESENT

static enum shps_dsm_fn shps_dsm_fn_for_irq(enum shps_irq_type type)
{}

static void shps_dsm_notify_irq(struct platform_device *pdev, enum shps_irq_type type)
{}

static irqreturn_t shps_handle_irq(int irq, void *data)
{}

static int shps_setup_irq(struct platform_device *pdev, enum shps_irq_type type)
{}

static void surface_hotplug_remove(struct platform_device *pdev)
{}

static int surface_hotplug_probe(struct platform_device *pdev)
{}

static const struct acpi_device_id surface_hotplug_acpi_match[] =;
MODULE_DEVICE_TABLE(acpi, surface_hotplug_acpi_match);

static struct platform_driver surface_hotplug_driver =;
module_platform_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();