linux/sound/soc/intel/boards/sof_es8336.c

// SPDX-License-Identifier: GPL-2.0-only
// Copyright(c) 2021 Intel Corporation.

/*
 * Intel SOF Machine Driver with es8336 Codec
 */

#include <linux/device.h>
#include <linux/dmi.h>
#include <linux/gpio/consumer.h>
#include <linux/gpio/machine.h>
#include <linux/i2c.h>
#include <linux/input.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <sound/jack.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/soc-acpi.h>
#include "hda_dsp_common.h"

/* jd-inv + terminating entry */
#define MAX_NO_PROPS

#define SOF_ES8336_SSP_CODEC(quirk)
#define SOF_ES8336_SSP_CODEC_MASK

#define SOF_ES8336_SPEAKERS_EN_GPIO1_QUIRK

/* HDMI capture*/
#define SOF_SSP_HDMI_CAPTURE_PRESENT
#define SOF_NO_OF_HDMI_CAPTURE_SSP_SHIFT
#define SOF_NO_OF_HDMI_CAPTURE_SSP_MASK
#define SOF_NO_OF_HDMI_CAPTURE_SSP(quirk)

#define SOF_HDMI_CAPTURE_1_SSP_SHIFT
#define SOF_HDMI_CAPTURE_1_SSP_MASK
#define SOF_HDMI_CAPTURE_1_SSP(quirk)

#define SOF_HDMI_CAPTURE_2_SSP_SHIFT
#define SOF_HDMI_CAPTURE_2_SSP_MASK
#define SOF_HDMI_CAPTURE_2_SSP(quirk)

#define SOF_ES8336_ENABLE_DMIC
#define SOF_ES8336_JD_INVERTED
#define SOF_ES8336_HEADPHONE_GPIO
#define SOC_ES8336_HEADSET_MIC1

static unsigned long quirk;

static int quirk_override =;
module_param_named(quirk, quirk_override, int, 0444);
MODULE_PARM_DESC();

struct sof_es8336_private {};

struct sof_hdmi_pcm {};

static const struct acpi_gpio_params enable_gpio0 =;
static const struct acpi_gpio_params enable_gpio1 =;

static const struct acpi_gpio_mapping acpi_speakers_enable_gpio0[] =;

static const struct acpi_gpio_mapping acpi_speakers_enable_gpio1[] =;

static const struct acpi_gpio_mapping acpi_enable_both_gpios[] =;

static const struct acpi_gpio_mapping acpi_enable_both_gpios_rev_order[] =;

static void log_quirks(struct device *dev)
{}

static void pcm_pop_work_events(struct work_struct *work)
{}

static int sof_8336_trigger(struct snd_pcm_substream *substream, int cmd)
{}

static int sof_es8316_speaker_power_event(struct snd_soc_dapm_widget *w,
					  struct snd_kcontrol *kcontrol, int event)
{}

static const struct snd_soc_dapm_widget sof_es8316_widgets[] =;

static const struct snd_soc_dapm_widget dmic_widgets[] =;

static const struct snd_soc_dapm_route sof_es8316_audio_map[] =;

static const struct snd_soc_dapm_route sof_es8316_headset_mic2_map[] =;

static const struct snd_soc_dapm_route sof_es8316_headset_mic1_map[] =;

static const struct snd_soc_dapm_route dmic_map[] =;

static const struct snd_kcontrol_new sof_es8316_controls[] =;

static struct snd_soc_jack_pin sof_es8316_jack_pins[] =;

static int dmic_init(struct snd_soc_pcm_runtime *runtime)
{}

static int sof_hdmi_init(struct snd_soc_pcm_runtime *runtime)
{}

static int sof_es8316_init(struct snd_soc_pcm_runtime *runtime)
{}

static void sof_es8316_exit(struct snd_soc_pcm_runtime *rtd)
{}

static int sof_es8336_quirk_cb(const struct dmi_system_id *id)
{}

/*
 * this table should only be used to add GPIO or jack-detection quirks
 * that cannot be detected from ACPI tables. The SSP and DMIC
 * information are providing by the platform driver and are aligned
 * with the topology used.
 *
 * If the GPIO support is missing, the quirk parameter can be used to
 * enable speakers. In that case it's recommended to keep the SSP and DMIC
 * information consistent, overriding the SSP and DMIC can only be done
 * if the topology file is modified as well.
 */
static const struct dmi_system_id sof_es8336_quirk_table[] =;

static int sof_es8336_hw_params(struct snd_pcm_substream *substream,
				struct snd_pcm_hw_params *params)
{}

/* machine stream operations */
static const struct snd_soc_ops sof_es8336_ops =;

static struct snd_soc_dai_link_component platform_component[] =;

SND_SOC_DAILINK_DEF(es8336_codec,
	DAILINK_COMP_ARRAY(COMP_CODEC("i2c-ESSX8336:00", "ES8316 HiFi")));

static struct snd_soc_dai_link_component dmic_component[] =;

static int sof_es8336_late_probe(struct snd_soc_card *card)
{}

/* SoC card */
static struct snd_soc_card sof_es8336_card =;

static struct snd_soc_dai_link *sof_card_dai_links_create(struct device *dev,
							  int ssp_codec,
							  int dmic_be_num,
							  int hdmi_num)
{}

static char soc_components[30];

 /* i2c-<HID>:00 with HID being 8 chars */
static char codec_name[SND_ACPI_I2C_ID_LEN];

static int sof_es8336_probe(struct platform_device *pdev)
{}

static void sof_es8336_remove(struct platform_device *pdev)
{}

static const struct platform_device_id board_ids[] =;
MODULE_DEVICE_TABLE(platform, board_ids);

static struct platform_driver sof_es8336_driver =;
module_platform_driver();

MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_IMPORT_NS();