linux/sound/soc/codecs/sdw-mockup.c

// SPDX-License-Identifier: GPL-2.0-only
//
// sdw-mockup.c -- a mockup SoundWire codec for tests where only the host
// drives the bus.
//
// Copyright(c) 2021 Intel Corporation
//
//

#include <linux/device.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/soundwire/sdw.h>
#include <linux/soundwire/sdw_type.h>
#include <linux/soundwire/sdw_registers.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/sdw.h>
#include <sound/soc.h>

struct  sdw_mockup_priv {};

static int sdw_mockup_component_probe(struct snd_soc_component *component)
{}

static void sdw_mockup_component_remove(struct snd_soc_component *component)
{}

static const struct snd_soc_component_driver snd_soc_sdw_mockup_component =;

static int sdw_mockup_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream,
				     int direction)
{}

static void sdw_mockup_shutdown(struct snd_pcm_substream *substream,
				struct snd_soc_dai *dai)
{}

static int sdw_mockup_pcm_hw_params(struct snd_pcm_substream *substream,
				    struct snd_pcm_hw_params *params,
				    struct snd_soc_dai *dai)
{}

static int sdw_mockup_pcm_hw_free(struct snd_pcm_substream *substream,
				  struct snd_soc_dai *dai)
{}

static const struct snd_soc_dai_ops sdw_mockup_ops =;

static struct snd_soc_dai_driver sdw_mockup_dai[] =;

static int sdw_mockup_update_status(struct sdw_slave *slave,
				    enum sdw_slave_status status)
{}

static int sdw_mockup_read_prop(struct sdw_slave *slave)
{}

static int sdw_mockup_bus_config(struct sdw_slave *slave,
				 struct sdw_bus_params *params)
{}

static int sdw_mockup_interrupt_callback(struct sdw_slave *slave,
					 struct sdw_slave_intr_status *status)
{}

static const struct sdw_slave_ops sdw_mockup_slave_ops =;

static int sdw_mockup_sdw_probe(struct sdw_slave *slave,
				const struct sdw_device_id *id)
{}

static int sdw_mockup_sdw_remove(struct sdw_slave *slave)
{}

/*
 * Intel reserved parts ID with the following mapping expected:
 * 0xAAAA: generic full-duplex codec
 * 0xAA55: headset codec (mock-up of RT711/RT5682) - full-duplex
 * 0x55AA: amplifier (mock-up of RT1308/Maxim 98373) - playback only with
 * IV feedback
 * 0x5555: mic codec (mock-up of RT715) - capture-only
 */
static const struct sdw_device_id sdw_mockup_id[] =;
MODULE_DEVICE_TABLE(sdw, sdw_mockup_id);

static struct sdw_driver sdw_mockup_sdw_driver =;
module_sdw_driver();

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