linux/sound/soc/codecs/ts3a227e.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * TS3A227E Autonomous Audio Accessory Detection and Configuration Switch
 *
 * Copyright (C) 2014 Google, Inc.
 */

#include <linux/gpio.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/input.h>
#include <linux/module.h>
#include <linux/regmap.h>
#include <linux/acpi.h>

#include <sound/core.h>
#include <sound/jack.h>
#include <sound/soc.h>

#include "ts3a227e.h"

struct ts3a227e {};

/* Button values to be reported on the jack */
static const int ts3a227e_buttons[] =;

#define TS3A227E_NUM_BUTTONS
#define TS3A227E_JACK_MASK

/* TS3A227E registers */
#define TS3A227E_REG_DEVICE_ID
#define TS3A227E_REG_INTERRUPT
#define TS3A227E_REG_KP_INTERRUPT
#define TS3A227E_REG_INTERRUPT_DISABLE
#define TS3A227E_REG_SETTING_1
#define TS3A227E_REG_SETTING_2
#define TS3A227E_REG_SETTING_3
#define TS3A227E_REG_SWITCH_CONTROL_1
#define TS3A227E_REG_SWITCH_CONTROL_2
#define TS3A227E_REG_SWITCH_STATUS_1
#define TS3A227E_REG_SWITCH_STATUS_2
#define TS3A227E_REG_ACCESSORY_STATUS
#define TS3A227E_REG_ADC_OUTPUT
#define TS3A227E_REG_KP_THRESHOLD_1
#define TS3A227E_REG_KP_THRESHOLD_2
#define TS3A227E_REG_KP_THRESHOLD_3

/* TS3A227E_REG_INTERRUPT 0x01 */
#define INS_REM_EVENT
#define DETECTION_COMPLETE_EVENT

/* TS3A227E_REG_KP_INTERRUPT 0x02 */
#define PRESS_MASK(idx)
#define RELEASE_MASK(idx)

/* TS3A227E_REG_INTERRUPT_DISABLE 0x03 */
#define INS_REM_INT_DISABLE
#define DETECTION_COMPLETE_INT_DISABLE
#define ADC_COMPLETE_INT_DISABLE
#define INTB_DISABLE

/* TS3A227E_REG_SETTING_1 0x4 */
#define DEBOUNCE_INSERTION_SETTING_SFT
#define DEBOUNCE_INSERTION_SETTING_MASK

/* TS3A227E_REG_SETTING_2 0x05 */
#define KP_ENABLE

/* TS3A227E_REG_SETTING_3 0x06 */
#define MICBIAS_SETTING_SFT
#define MICBIAS_SETTING_MASK
#define DEBOUNCE_RELEASE_SETTING_SFT
#define DEBOUNCE_RELEASE_SETTING_MASK
#define DEBOUNCE_PRESS_SETTING_SFT
#define DEBOUNCE_PRESS_SETTING_MASK

/* TS3A227E_REG_ACCESSORY_STATUS  0x0b */
#define TYPE_3_POLE
#define TYPE_4_POLE_OMTP
#define TYPE_4_POLE_STANDARD
#define JACK_INSERTED
#define EITHER_MIC_MASK

static const struct reg_default ts3a227e_reg_defaults[] =;

static bool ts3a227e_readable_reg(struct device *dev, unsigned int reg)
{}

static bool ts3a227e_writeable_reg(struct device *dev, unsigned int reg)
{}

static bool ts3a227e_volatile_reg(struct device *dev, unsigned int reg)
{}

static void ts3a227e_jack_report(struct ts3a227e *ts3a227e)
{}

static void ts3a227e_new_jack_state(struct ts3a227e *ts3a227e, unsigned acc_reg)
{}

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

/**
 * ts3a227e_enable_jack_detect - Specify a jack for event reporting
 *
 * @component:  component to register the jack with
 * @jack: jack to use to report headset and button events on
 *
 * After this function has been called the headset insert/remove and button
 * events 0-3 will be routed to the given jack.  Jack can be null to stop
 * reporting.
 */
int ts3a227e_enable_jack_detect(struct snd_soc_component *component,
				struct snd_soc_jack *jack)
{}
EXPORT_SYMBOL_GPL();

static int ts3a227e_set_jack(struct snd_soc_component *component,
			     struct snd_soc_jack *jack, void *data)
{}

static int ts3a227e_get_jack_type(struct snd_soc_component *component)
{}

static const struct snd_soc_component_driver ts3a227e_soc_driver =;

static const struct regmap_config ts3a227e_regmap_config =;

static int ts3a227e_parse_device_property(struct ts3a227e *ts3a227e,
				struct device *dev)
{}

static int ts3a227e_i2c_probe(struct i2c_client *i2c)
{}

#ifdef CONFIG_PM_SLEEP
static int ts3a227e_suspend(struct device *dev)
{}

static int ts3a227e_resume(struct device *dev)
{}
#endif

static const struct dev_pm_ops ts3a227e_pm =;

static const struct i2c_device_id ts3a227e_i2c_ids[] =;
MODULE_DEVICE_TABLE(i2c, ts3a227e_i2c_ids);

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

#ifdef CONFIG_ACPI
static struct acpi_device_id ts3a227e_acpi_match[] =;
MODULE_DEVICE_TABLE(acpi, ts3a227e_acpi_match);
#endif

static struct i2c_driver ts3a227e_driver =;
module_i2c_driver();

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