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

// SPDX-License-Identifier: GPL-2.0-only
// Copyright (c) 2018-2020, Intel Corporation
//
// sof-wm8804.c - ASoC machine driver for Up and Up2 board
// based on WM8804/Hifiberry Digi+


#include <linux/acpi.h>
#include <linux/dmi.h>
#include <linux/gpio/consumer.h>
#include <linux/gpio/machine.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/soc-acpi.h>
#include "../../codecs/wm8804.h"

struct sof_card_private {};

#define SOF_WM8804_UP2_QUIRK

static unsigned long sof_wm8804_quirk;

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

static const struct dmi_system_id sof_wm8804_quirk_table[] =;

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

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

SND_SOC_DAILINK_DEF(ssp5_pin,
	DAILINK_COMP_ARRAY(COMP_CPU("SSP5 Pin")));

SND_SOC_DAILINK_DEF(ssp5_codec,
	DAILINK_COMP_ARRAY(COMP_CODEC("i2c-1AEC8804:00", "wm8804-spdif")));

SND_SOC_DAILINK_DEF(platform,
	DAILINK_COMP_ARRAY(COMP_PLATFORM("0000:00:0e.0")));

static struct snd_soc_dai_link dailink[] =;

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

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

/*
 * to control the HifiBerry Digi+ PRO, it's required to toggle GPIO to
 * select the clock source. On the Up2 board, this means
 * Pin29/BCM5/Linux GPIO 430 and Pin 31/BCM6/ Linux GPIO 404.
 *
 * Using the ACPI device name is not very nice, but since we only use
 * the value for the Up2 board there is no risk of conflict with other
 * platforms.
 */

static struct gpiod_lookup_table up2_gpios_table =;

static int sof_wm8804_probe(struct platform_device *pdev)
{}

static void sof_wm8804_remove(struct platform_device *pdev)
{}

static struct platform_driver sof_wm8804_driver =;
module_platform_driver();

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