linux/drivers/platform/x86/x86-android-tablets/core.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * DMI based code to deal with broken DSDTs on X86 tablets which ship with
 * Android as (part of) the factory image. The factory kernels shipped on these
 * devices typically have a bunch of things hardcoded, rather than specified
 * in their DSDT.
 *
 * Copyright (C) 2021-2023 Hans de Goede <[email protected]>
 */

#define pr_fmt(fmt)

#include <linux/acpi.h>
#include <linux/dmi.h>
#include <linux/gpio/consumer.h>
#include <linux/gpio/machine.h>
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/serdev.h>
#include <linux/string.h>

#include "x86-android-tablets.h"
#include "../serdev_helpers.h"

static struct platform_device *x86_android_tablet_device;

/*
 * This helper allows getting a GPIO descriptor *before* the actual device
 * consuming it has been instantiated. This function MUST only be used to
 * handle this special case such as, e.g.:
 *
 * 1. Getting an IRQ from a GPIO for i2c_board_info.irq which is passed to
 * i2c_client_new() to instantiate i2c_client-s; or
 * 2. Calling desc_to_gpio() to get an old style GPIO number for gpio-keys
 * platform_data which still uses old style GPIO numbers.
 *
 * Since the consuming device has not been instantiated yet a dynamic lookup
 * is generated using the special x86_android_tablet device for dev_id.
 *
 * For normal GPIO lookups a standard static struct gpiod_lookup_table MUST be used.
 */
int x86_android_tablet_get_gpiod(const char *chip, int pin, const char *con_id,
				 bool active_low, enum gpiod_flags dflags,
				 struct gpio_desc **desc)
{}

int x86_acpi_irq_helper_get(const struct x86_acpi_irq_data *data)
{}

static int i2c_client_count;
static int spi_dev_count;
static int pdev_count;
static int serdev_count;
static struct i2c_client **i2c_clients;
static struct spi_device **spi_devs;
static struct platform_device **pdevs;
static struct serdev_device **serdevs;
static struct gpio_keys_button *buttons;
static struct gpiod_lookup_table * const *gpiod_lookup_tables;
static const struct software_node *bat_swnode;
static void (*exit_handler)(void);

static __init int x86_instantiate_i2c_client(const struct x86_dev_info *dev_info,
					     int idx)
{}

static __init int x86_instantiate_spi_dev(const struct x86_dev_info *dev_info, int idx)
{}

static __init int x86_instantiate_serdev(const struct x86_serdev_info *info, int idx)
{}

static void x86_android_tablet_remove(struct platform_device *pdev)
{}

static __init int x86_android_tablet_probe(struct platform_device *pdev)
{}

static struct platform_driver x86_android_tablet_driver =;

static int __init x86_android_tablet_init(void)
{}
module_init();

static void __exit x86_android_tablet_exit(void)
{}
module_exit(x86_android_tablet_exit);

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