linux/drivers/mfd/arizona-spi.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * arizona-spi.c  --  Arizona SPI bus interface
 *
 * Copyright 2012 Wolfson Microelectronics plc
 *
 * Author: Mark Brown <[email protected]>
 */

#include <linux/acpi.h>
#include <linux/err.h>
#include <linux/gpio/consumer.h>
#include <linux/gpio/machine.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <linux/spi/spi.h>
#include <linux/of.h>
#include <uapi/linux/input-event-codes.h>

#include <linux/mfd/arizona/core.h>

#include "arizona.h"

#ifdef CONFIG_ACPI
static const struct acpi_gpio_params reset_gpios =;
static const struct acpi_gpio_params ldoena_gpios =;

static const struct acpi_gpio_mapping arizona_acpi_gpios[] =;

/*
 * The ACPI resources for the device only describe external GPIO-s. They do
 * not provide mappings for the GPIO-s coming from the Arizona codec itself.
 */
static const struct gpiod_lookup arizona_soc_gpios[] =;

static void arizona_spi_acpi_remove_lookup(void *lookup)
{}

/* For ACPI tables from boards which ship with Windows as factory OS */
static int arizona_spi_acpi_windows_probe(struct arizona *arizona)
{}

/* For ACPI tables from boards which ship with Android as factory OS */
static int arizona_spi_acpi_android_probe(struct arizona *arizona)
{}

/*
 * The AOSP 3.5 mm Headset: Accessory Specification gives the following values:
 * Function A Play/Pause:           0 ohm
 * Function D Voice assistant:    135 ohm
 * Function B Volume Up           240 ohm
 * Function C Volume Down         470 ohm
 * Minimum Mic DC resistance     1000 ohm
 * Minimum Ear speaker impedance   16 ohm
 * Note the first max value below must be less then the min. speaker impedance,
 * to allow CTIA/OMTP detection to work. The other max values are the closest
 * value from extcon-arizona.c:arizona_micd_levels halfway 2 button resistances.
 */
static const struct arizona_micd_range arizona_micd_aosp_ranges[] =;

static int arizona_spi_acpi_probe(struct arizona *arizona)
{}

static const struct acpi_device_id arizona_acpi_match[] =;
MODULE_DEVICE_TABLE(acpi, arizona_acpi_match);
#else
static int arizona_spi_acpi_probe(struct arizona *arizona)
{
	return -ENODEV;
}
#endif

static int arizona_spi_probe(struct spi_device *spi)
{}

static void arizona_spi_remove(struct spi_device *spi)
{}

static const struct spi_device_id arizona_spi_ids[] =;
MODULE_DEVICE_TABLE(spi, arizona_spi_ids);

#ifdef CONFIG_OF
static const struct of_device_id arizona_spi_of_match[] =;
MODULE_DEVICE_TABLE(of, arizona_spi_of_match);
#endif

static struct spi_driver arizona_spi_driver =;

module_spi_driver();

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