Merge remote-tracking branches 'asoc/topic/ssm2518' and 'asoc/topic/sunxi' into asoc-next
This commit is contained in:
commit
9939b14b74
|
@ -13,10 +13,6 @@ Required properties:
|
||||||
- clock-names: should contain followings:
|
- clock-names: should contain followings:
|
||||||
- "apb": the parent APB clock for this controller
|
- "apb": the parent APB clock for this controller
|
||||||
- "codec": the parent module clock
|
- "codec": the parent module clock
|
||||||
- routing : A list of the connections between audio components. Each
|
|
||||||
entry is a pair of strings, the first being the connection's sink,
|
|
||||||
the second being the connection's source.
|
|
||||||
|
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
codec: codec@01c22c00 {
|
codec: codec@01c22c00 {
|
||||||
|
@ -28,6 +24,4 @@ codec: codec@01c22c00 {
|
||||||
clock-names = "apb", "codec";
|
clock-names = "apb", "codec";
|
||||||
dmas = <&dma 0 19>, <&dma 0 19>;
|
dmas = <&dma 0 19>, <&dma 0 19>;
|
||||||
dma-names = "rx", "tx";
|
dma-names = "rx", "tx";
|
||||||
routing = "Headphone Jack", "HP Right",
|
|
||||||
"Headphone Jack", "HP Left";
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -723,17 +723,11 @@ static struct snd_soc_codec_driver ssm2518_codec_driver = {
|
||||||
.num_dapm_routes = ARRAY_SIZE(ssm2518_routes),
|
.num_dapm_routes = ARRAY_SIZE(ssm2518_routes),
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool ssm2518_register_volatile(struct device *dev, unsigned int reg)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct regmap_config ssm2518_regmap_config = {
|
static const struct regmap_config ssm2518_regmap_config = {
|
||||||
.val_bits = 8,
|
.val_bits = 8,
|
||||||
.reg_bits = 8,
|
.reg_bits = 8,
|
||||||
|
|
||||||
.max_register = SSM2518_REG_DRC_9,
|
.max_register = SSM2518_REG_DRC_9,
|
||||||
.volatile_reg = ssm2518_register_volatile,
|
|
||||||
|
|
||||||
.cache_type = REGCACHE_RBTREE,
|
.cache_type = REGCACHE_RBTREE,
|
||||||
.reg_defaults = ssm2518_reg_defaults,
|
.reg_defaults = ssm2518_reg_defaults,
|
||||||
|
|
|
@ -283,7 +283,7 @@ static int sun4i_codec_hw_params(struct snd_pcm_substream *substream,
|
||||||
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
struct snd_soc_pcm_runtime *rtd = substream->private_data;
|
||||||
struct sun4i_codec *scodec = snd_soc_card_get_drvdata(rtd->card);
|
struct sun4i_codec *scodec = snd_soc_card_get_drvdata(rtd->card);
|
||||||
unsigned long clk_freq;
|
unsigned long clk_freq;
|
||||||
int hwrate;
|
int ret, hwrate;
|
||||||
u32 val;
|
u32 val;
|
||||||
|
|
||||||
if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK)
|
if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK)
|
||||||
|
@ -293,8 +293,9 @@ static int sun4i_codec_hw_params(struct snd_pcm_substream *substream,
|
||||||
if (!clk_freq)
|
if (!clk_freq)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (clk_set_rate(scodec->clk_module, clk_freq))
|
ret = clk_set_rate(scodec->clk_module, clk_freq);
|
||||||
return -EINVAL;
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
hwrate = sun4i_codec_get_hw_rate(params);
|
hwrate = sun4i_codec_get_hw_rate(params);
|
||||||
if (hwrate < 0)
|
if (hwrate < 0)
|
||||||
|
@ -388,8 +389,7 @@ static struct snd_soc_dai_driver sun4i_codec_dai = {
|
||||||
.rate_max = 192000,
|
.rate_max = 192000,
|
||||||
.rates = SNDRV_PCM_RATE_8000_48000 |
|
.rates = SNDRV_PCM_RATE_8000_48000 |
|
||||||
SNDRV_PCM_RATE_96000 |
|
SNDRV_PCM_RATE_96000 |
|
||||||
SNDRV_PCM_RATE_192000 |
|
SNDRV_PCM_RATE_192000,
|
||||||
SNDRV_PCM_RATE_KNOT,
|
|
||||||
.formats = SNDRV_PCM_FMTBIT_S16_LE |
|
.formats = SNDRV_PCM_FMTBIT_S16_LE |
|
||||||
SNDRV_PCM_FMTBIT_S32_LE,
|
SNDRV_PCM_FMTBIT_S32_LE,
|
||||||
.sig_bits = 24,
|
.sig_bits = 24,
|
||||||
|
@ -571,7 +571,6 @@ static struct snd_soc_dai_link *sun4i_codec_create_link(struct device *dev,
|
||||||
static struct snd_soc_card *sun4i_codec_create_card(struct device *dev)
|
static struct snd_soc_card *sun4i_codec_create_card(struct device *dev)
|
||||||
{
|
{
|
||||||
struct snd_soc_card *card;
|
struct snd_soc_card *card;
|
||||||
int ret;
|
|
||||||
|
|
||||||
card = devm_kzalloc(dev, sizeof(*card), GFP_KERNEL);
|
card = devm_kzalloc(dev, sizeof(*card), GFP_KERNEL);
|
||||||
if (!card)
|
if (!card)
|
||||||
|
@ -584,12 +583,6 @@ static struct snd_soc_card *sun4i_codec_create_card(struct device *dev)
|
||||||
card->dev = dev;
|
card->dev = dev;
|
||||||
card->name = "sun4i-codec";
|
card->name = "sun4i-codec";
|
||||||
|
|
||||||
ret = snd_soc_of_parse_audio_routing(card, "routing");
|
|
||||||
if (ret) {
|
|
||||||
dev_err(dev, "Failed to create our audio routing\n");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return card;
|
return card;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue