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

// SPDX-License-Identifier: GPL-2.0-only
//
// CS35L56 ALSA SoC audio driver SoundWire binding
//
// Copyright (C) 2023 Cirrus Logic, Inc. and
//                    Cirrus Logic International Semiconductor Ltd.

#include <linux/delay.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/soundwire/sdw.h>
#include <linux/soundwire/sdw_registers.h>
#include <linux/soundwire/sdw_type.h>
#include <linux/swab.h>
#include <linux/types.h>
#include <linux/workqueue.h>

#include "cs35l56.h"

/* Register addresses are offset when sent over SoundWire */
#define CS35L56_SDW_ADDR_OFFSET

/* Cirrus bus bridge registers */
#define CS35L56_SDW_MEM_ACCESS_STATUS
#define CS35L56_SDW_MEM_READ_DATA

#define CS35L56_SDW_LAST_LATE
#define CS35L56_SDW_CMD_IN_PROGRESS
#define CS35L56_SDW_RDATA_RDY

#define CS35L56_LATE_READ_POLL_US
#define CS35L56_LATE_READ_TIMEOUT_US

static int cs35l56_sdw_poll_mem_status(struct sdw_slave *peripheral,
				       unsigned int mask,
				       unsigned int match)
{}

static int cs35l56_sdw_slow_read(struct sdw_slave *peripheral, unsigned int reg,
				 u8 *buf, size_t val_size)
{}

static int cs35l56_sdw_read_one(struct sdw_slave *peripheral, unsigned int reg, void *buf)
{}

static int cs35l56_sdw_read(void *context, const void *reg_buf,
			    const size_t reg_size, void *val_buf,
			    size_t val_size)
{}

static inline void cs35l56_swab_copy(void *dest, const void *src, size_t nbytes)
{}

static int cs35l56_sdw_write_one(struct sdw_slave *peripheral, unsigned int reg, const void *buf)
{}

static int cs35l56_sdw_gather_write(void *context,
				    const void *reg_buf, size_t reg_size,
				    const void *val_buf, size_t val_size)
{}

static int cs35l56_sdw_write(void *context, const void *val_buf, size_t val_size)
{}

/*
 * Registers are big-endian on I2C and SPI but little-endian on SoundWire.
 * Exported firmware controls are big-endian on I2C/SPI but little-endian on
 * SoundWire. Firmware files are always big-endian and are opaque blobs.
 * Present a big-endian regmap and hide the endianness swap, so that the ALSA
 * byte controls always have the same byte order, and firmware file blobs
 * can be written verbatim.
 */
static const struct regmap_bus cs35l56_regmap_bus_sdw =;

static int cs35l56_sdw_set_cal_index(struct cs35l56_private *cs35l56)
{}

static void cs35l56_sdw_init(struct sdw_slave *peripheral)
{}

static int cs35l56_sdw_interrupt(struct sdw_slave *peripheral,
				 struct sdw_slave_intr_status *status)
{}

static void cs35l56_sdw_irq_work(struct work_struct *work)
{}

static int cs35l56_sdw_read_prop(struct sdw_slave *peripheral)
{}

static int cs35l56_sdw_update_status(struct sdw_slave *peripheral,
				     enum sdw_slave_status status)
{}

static int __maybe_unused cs35l56_sdw_clk_stop(struct sdw_slave *peripheral,
					       enum sdw_clk_stop_mode mode,
					       enum sdw_clk_stop_type type)
{}

static const struct sdw_slave_ops cs35l56_sdw_ops =;

static int __maybe_unused cs35l56_sdw_handle_unattach(struct cs35l56_private *cs35l56)
{}

static int __maybe_unused cs35l56_sdw_runtime_suspend(struct device *dev)
{}

static int __maybe_unused cs35l56_sdw_runtime_resume(struct device *dev)
{}

static int __maybe_unused cs35l56_sdw_system_suspend(struct device *dev)
{}

static int __maybe_unused cs35l56_sdw_system_resume(struct device *dev)
{}

static int cs35l56_sdw_probe(struct sdw_slave *peripheral, const struct sdw_device_id *id)
{}

static int cs35l56_sdw_remove(struct sdw_slave *peripheral)
{}

static const struct dev_pm_ops cs35l56_sdw_pm =;

static const struct sdw_device_id cs35l56_sdw_id[] =;
MODULE_DEVICE_TABLE(sdw, cs35l56_sdw_id);

static struct sdw_driver cs35l56_sdw_driver =;

module_sdw_driver();

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