linux/sound/soc/codecs/zl38060.c

// SPDX-License-Identifier: GPL-2.0-only
//
// Codec driver for Microsemi ZL38060 Connected Home Audio Processor.
//
// Copyright(c) 2020 Sven Van Asbroeck

// The ZL38060 is very flexible and configurable. This driver implements only a
// tiny subset of the chip's possible configurations:
//
// - DSP block bypassed: DAI        routed straight to DACs
//                       microphone routed straight to DAI
// - chip's internal clock is driven by a 12 MHz external crystal
// - chip's DAI connected to CPU is I2S, and bit + frame clock master
// - chip must be strapped for "host boot": in this mode, firmware will be
//   provided by this driver.

#include <linux/gpio/consumer.h>
#include <linux/gpio/driver.h>
#include <linux/property.h>
#include <linux/spi/spi.h>
#include <linux/regmap.h>
#include <linux/module.h>
#include <linux/ihex.h>

#include <sound/pcm_params.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/soc.h>

#define DRV_NAME

#define ZL38_RATES
#define ZL38_FORMATS

#define HBI_FIRMWARE_PAGE
#define ZL38_MAX_RAW_XFER

#define REG_TDMA_CFG_CLK
#define CFG_CLK_PCLK_SHIFT
#define CFG_CLK_PCLK_MASK
#define CFG_CLK_PCLK(bits)
#define CFG_CLK_MASTER
#define CFG_CLK_FSRATE_MASK
#define CFG_CLK_FSRATE_8KHZ
#define CFG_CLK_FSRATE_16KHZ
#define CFG_CLK_FSRATE_48KHZ

#define REG_CLK_CFG
#define CLK_CFG_SOURCE_XTAL

#define REG_CLK_STATUS
#define CLK_STATUS_HWRST

#define REG_PARAM_RESULT
#define PARAM_RESULT_READY

#define REG_PG255_BASE_HI
#define REG_PG255_OFFS(addr)
#define REG_FWR_EXEC

#define REG_CMD
#define REG_HW_REV
#define REG_FW_PROD
#define REG_FW_REV

#define REG_SEMA_FLAGS
#define SEMA_FLAGS_BOOT_CMD
#define SEMA_FLAGS_APP_REBOOT

#define REG_HW_REV
#define REG_FW_PROD
#define REG_FW_REV
#define REG_GPIO_DIR
#define REG_GPIO_DAT

#define BOOTCMD_LOAD_COMPLETE
#define BOOTCMD_FW_GO

#define FIRMWARE_MAJOR
#define FIRMWARE_MINOR

struct zl38_codec_priv {};

static int zl38_fw_issue_command(struct regmap *regmap, u16 cmd)
{}

static int zl38_fw_go(struct regmap *regmap)
{}

static int zl38_fw_enter_boot_mode(struct regmap *regmap)
{}

static int
zl38_fw_send_data(struct regmap *regmap, u32 addr, const void *data, u16 len)
{}

static int zl38_fw_send_xaddr(struct regmap *regmap, const void *data)
{}

static int zl38_load_firmware(struct device *dev, struct regmap *regmap)
{}


static int zl38_software_reset(struct regmap *regmap)
{}

static int zl38_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{}

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

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

/* stereo bypass with no AEC */
static const struct reg_sequence cp_config_stereo_bypass[] =;

static const struct snd_soc_dai_ops zl38_dai_ops =;

static struct snd_soc_dai_driver zl38_dai =;

static const struct snd_soc_dapm_widget zl38_dapm_widgets[] =;

static const struct snd_soc_dapm_route zl38_dapm_routes[] =;

static const struct snd_soc_component_driver zl38_component_dev =;

static void chip_gpio_set(struct gpio_chip *c, unsigned int offset, int val)
{}

static int chip_gpio_get(struct gpio_chip *c, unsigned int offset)
{}

static int chip_direction_input(struct gpio_chip *c, unsigned int offset)
{}

static int
chip_direction_output(struct gpio_chip *c, unsigned int offset, int val)
{}

static const struct gpio_chip template_chip =;

static int zl38_check_revision(struct device *dev, struct regmap *regmap)
{}

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

static int zl38_bus_write(void *context, const void *data, size_t count)
{}

static const struct regmap_bus zl38_regmap_bus =;

static const struct regmap_config zl38_regmap_conf =;

static int zl38_spi_probe(struct spi_device *spi)
{}

static const struct of_device_id zl38_dt_ids[] __maybe_unused =;
MODULE_DEVICE_TABLE(of, zl38_dt_ids);

static const struct spi_device_id zl38_spi_ids[] =;
MODULE_DEVICE_TABLE(spi, zl38_spi_ids);

static struct spi_driver zl38060_spi_driver =;
module_spi_driver();

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