2024年4月28日发(作者:)

/*

* sound/soc/codecs/cs4344.c

*

* CS4344 -- SoC audio driver

*

* This program is free software; you can redistribute it and/or modify

* it under the terms of the GNU General Public License version 2 as

* published by the Free Software Foundation.

*

*/

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#include

#define AUDIO_NAME "CS4344"

#ifdef CS4344_DEBUG

#define dbg(format, )

printk(KERN_DEBUG AUDIO_NAME ": " format "n" , ## arg)

#else

#define dbg(format, ) do {} while (0)

#endif

#define err(format, )

printk(KERN_ERR AUDIO_NAME ": " format "n" , ## arg)

printk(KERN_INFO AUDIO_NAME ": " format "n" , ## arg)

printk(KERN_WARNING AUDIO_NAME ": " format "n" , ## arg)

#define info(format, )

#define warn(format, )

/* There are no software controls for DAC so they need to be faked */

#define CS4344_DUMMY_CTRL 0x00 /* DAC Channel Dummy Control */

static struct snd_soc_codec *cs4344_codec = NULL;

struct snd_kcontrol_new cs4344_snd_controls[] = {

SOC_SINGLE("Control",

CS4344_DUMMY_CTRL, 0, 0xFF, 1)

};

static unsigned int cs4344_read_reg(struct snd_soc_codec *codec, unsigned int

reg)

{

}

static int cs4344_write_reg(struct snd_soc_codec *codec, unsigned int reg,

unsigned int value)

{

}

static int cs4344_pcm_hw_params(struct snd_pcm_substream *substream,

{

}

static int cs4344_mute(struct snd_soc_dai *dai, int mute)

{

}

static int cs4344_set_dai_fmt(struct snd_soc_dai *codec_dai,

{

}

static int cs4344_set_dai_sysclk(struct snd_soc_dai *codec_dai,

{

}

#define CS4344_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |

};

struct snd_soc_dai cs4344_dai = {

.name = "CS4344",

.playback = {

.stream_name = "Playback",

SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000)

#define CS4344_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |

SNDRV_PCM_FMTBIT_S24_LE)

.hw_params = cs4344_pcm_hw_params,

.set_fmt = cs4344_set_dai_fmt,

static struct snd_soc_dai_ops cs4344_dai_ops = {

SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 |

return 0;

int clk_id, unsigned int freq, int dir)

return 0;

unsigned int fmt)

return 0;

return 0;

struct snd_pcm_hw_params *params)

return 0;

return 0;