Merge remote-tracking branches 'asoc/topic/davinci', 'asoc/topic/debugfs', 'asoc/topic/disconnect', 'asoc/topic/ep93xx' and 'asoc/topic/eukrea-tlv320' into asoc-next
This commit is contained in:
commit
262db3bea5
4 changed files with 60 additions and 78 deletions
|
@ -365,7 +365,7 @@ static int ep93xx_ac97_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct ep93xx_ac97_info *info;
|
struct ep93xx_ac97_info *info;
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
unsigned int irq;
|
int irq;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
|
info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
|
||||||
|
@ -378,8 +378,8 @@ static int ep93xx_ac97_probe(struct platform_device *pdev)
|
||||||
return PTR_ERR(info->regs);
|
return PTR_ERR(info->regs);
|
||||||
|
|
||||||
irq = platform_get_irq(pdev, 0);
|
irq = platform_get_irq(pdev, 0);
|
||||||
if (!irq)
|
if (irq <= 0)
|
||||||
return -ENODEV;
|
return irq < 0 ? irq : -ENODEV;
|
||||||
|
|
||||||
ret = devm_request_irq(&pdev->dev, irq, ep93xx_ac97_interrupt,
|
ret = devm_request_irq(&pdev->dev, irq, ep93xx_ac97_interrupt,
|
||||||
IRQF_TRIGGER_HIGH, pdev->name, info);
|
IRQF_TRIGGER_HIGH, pdev->name, info);
|
||||||
|
|
|
@ -1242,6 +1242,20 @@ static int davinci_mcasp_hw_rule_format(struct snd_pcm_hw_params *params,
|
||||||
return snd_mask_refine(fmt, &nfmt);
|
return snd_mask_refine(fmt, &nfmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int davinci_mcasp_hw_rule_min_periodsize(
|
||||||
|
struct snd_pcm_hw_params *params, struct snd_pcm_hw_rule *rule)
|
||||||
|
{
|
||||||
|
struct snd_interval *period_size = hw_param_interval(params,
|
||||||
|
SNDRV_PCM_HW_PARAM_PERIOD_SIZE);
|
||||||
|
struct snd_interval frames;
|
||||||
|
|
||||||
|
snd_interval_any(&frames);
|
||||||
|
frames.min = 64;
|
||||||
|
frames.integer = 1;
|
||||||
|
|
||||||
|
return snd_interval_refine(period_size, &frames);
|
||||||
|
}
|
||||||
|
|
||||||
static int davinci_mcasp_startup(struct snd_pcm_substream *substream,
|
static int davinci_mcasp_startup(struct snd_pcm_substream *substream,
|
||||||
struct snd_soc_dai *cpu_dai)
|
struct snd_soc_dai *cpu_dai)
|
||||||
{
|
{
|
||||||
|
@ -1333,6 +1347,11 @@ static int davinci_mcasp_startup(struct snd_pcm_substream *substream,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
snd_pcm_hw_rule_add(substream->runtime, 0,
|
||||||
|
SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
|
||||||
|
davinci_mcasp_hw_rule_min_periodsize, NULL,
|
||||||
|
SNDRV_PCM_HW_PARAM_PERIOD_SIZE, -1);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
|
|
||||||
#include "../codecs/tlv320aic23.h"
|
#include "../codecs/tlv320aic23.h"
|
||||||
#include "imx-ssi.h"
|
#include "imx-ssi.h"
|
||||||
#include "fsl_ssi.h"
|
|
||||||
#include "imx-audmux.h"
|
#include "imx-audmux.h"
|
||||||
|
|
||||||
#define CODEC_CLOCK 12000000
|
#define CODEC_CLOCK 12000000
|
||||||
|
|
|
@ -349,120 +349,84 @@ static void soc_init_codec_debugfs(struct snd_soc_component *component)
|
||||||
"ASoC: Failed to create codec register debugfs file\n");
|
"ASoC: Failed to create codec register debugfs file\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t codec_list_read_file(struct file *file, char __user *user_buf,
|
static int codec_list_seq_show(struct seq_file *m, void *v)
|
||||||
size_t count, loff_t *ppos)
|
|
||||||
{
|
{
|
||||||
char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
|
|
||||||
ssize_t len, ret = 0;
|
|
||||||
struct snd_soc_codec *codec;
|
struct snd_soc_codec *codec;
|
||||||
|
|
||||||
if (!buf)
|
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
mutex_lock(&client_mutex);
|
mutex_lock(&client_mutex);
|
||||||
|
|
||||||
list_for_each_entry(codec, &codec_list, list) {
|
list_for_each_entry(codec, &codec_list, list)
|
||||||
len = snprintf(buf + ret, PAGE_SIZE - ret, "%s\n",
|
seq_printf(m, "%s\n", codec->component.name);
|
||||||
codec->component.name);
|
|
||||||
if (len >= 0)
|
|
||||||
ret += len;
|
|
||||||
if (ret > PAGE_SIZE) {
|
|
||||||
ret = PAGE_SIZE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
mutex_unlock(&client_mutex);
|
mutex_unlock(&client_mutex);
|
||||||
|
|
||||||
if (ret >= 0)
|
return 0;
|
||||||
ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret);
|
}
|
||||||
|
|
||||||
kfree(buf);
|
static int codec_list_seq_open(struct inode *inode, struct file *file)
|
||||||
|
{
|
||||||
return ret;
|
return single_open(file, codec_list_seq_show, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct file_operations codec_list_fops = {
|
static const struct file_operations codec_list_fops = {
|
||||||
.read = codec_list_read_file,
|
.open = codec_list_seq_open,
|
||||||
.llseek = default_llseek,/* read accesses f_pos */
|
.read = seq_read,
|
||||||
|
.llseek = seq_lseek,
|
||||||
|
.release = single_release,
|
||||||
};
|
};
|
||||||
|
|
||||||
static ssize_t dai_list_read_file(struct file *file, char __user *user_buf,
|
static int dai_list_seq_show(struct seq_file *m, void *v)
|
||||||
size_t count, loff_t *ppos)
|
|
||||||
{
|
{
|
||||||
char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
|
|
||||||
ssize_t len, ret = 0;
|
|
||||||
struct snd_soc_component *component;
|
struct snd_soc_component *component;
|
||||||
struct snd_soc_dai *dai;
|
struct snd_soc_dai *dai;
|
||||||
|
|
||||||
if (!buf)
|
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
mutex_lock(&client_mutex);
|
mutex_lock(&client_mutex);
|
||||||
|
|
||||||
list_for_each_entry(component, &component_list, list) {
|
list_for_each_entry(component, &component_list, list)
|
||||||
list_for_each_entry(dai, &component->dai_list, list) {
|
list_for_each_entry(dai, &component->dai_list, list)
|
||||||
len = snprintf(buf + ret, PAGE_SIZE - ret, "%s\n",
|
seq_printf(m, "%s\n", dai->name);
|
||||||
dai->name);
|
|
||||||
if (len >= 0)
|
|
||||||
ret += len;
|
|
||||||
if (ret > PAGE_SIZE) {
|
|
||||||
ret = PAGE_SIZE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
mutex_unlock(&client_mutex);
|
mutex_unlock(&client_mutex);
|
||||||
|
|
||||||
ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret);
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
kfree(buf);
|
static int dai_list_seq_open(struct inode *inode, struct file *file)
|
||||||
|
{
|
||||||
return ret;
|
return single_open(file, dai_list_seq_show, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct file_operations dai_list_fops = {
|
static const struct file_operations dai_list_fops = {
|
||||||
.read = dai_list_read_file,
|
.open = dai_list_seq_open,
|
||||||
.llseek = default_llseek,/* read accesses f_pos */
|
.read = seq_read,
|
||||||
|
.llseek = seq_lseek,
|
||||||
|
.release = single_release,
|
||||||
};
|
};
|
||||||
|
|
||||||
static ssize_t platform_list_read_file(struct file *file,
|
static int platform_list_seq_show(struct seq_file *m, void *v)
|
||||||
char __user *user_buf,
|
|
||||||
size_t count, loff_t *ppos)
|
|
||||||
{
|
{
|
||||||
char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
|
|
||||||
ssize_t len, ret = 0;
|
|
||||||
struct snd_soc_platform *platform;
|
struct snd_soc_platform *platform;
|
||||||
|
|
||||||
if (!buf)
|
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
mutex_lock(&client_mutex);
|
mutex_lock(&client_mutex);
|
||||||
|
|
||||||
list_for_each_entry(platform, &platform_list, list) {
|
list_for_each_entry(platform, &platform_list, list)
|
||||||
len = snprintf(buf + ret, PAGE_SIZE - ret, "%s\n",
|
seq_printf(m, "%s\n", platform->component.name);
|
||||||
platform->component.name);
|
|
||||||
if (len >= 0)
|
|
||||||
ret += len;
|
|
||||||
if (ret > PAGE_SIZE) {
|
|
||||||
ret = PAGE_SIZE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
mutex_unlock(&client_mutex);
|
mutex_unlock(&client_mutex);
|
||||||
|
|
||||||
ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret);
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
kfree(buf);
|
static int platform_list_seq_open(struct inode *inode, struct file *file)
|
||||||
|
{
|
||||||
return ret;
|
return single_open(file, platform_list_seq_show, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct file_operations platform_list_fops = {
|
static const struct file_operations platform_list_fops = {
|
||||||
.read = platform_list_read_file,
|
.open = platform_list_seq_open,
|
||||||
.llseek = default_llseek,/* read accesses f_pos */
|
.read = seq_read,
|
||||||
|
.llseek = seq_lseek,
|
||||||
|
.release = single_release,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void soc_init_card_debugfs(struct snd_soc_card *card)
|
static void soc_init_card_debugfs(struct snd_soc_card *card)
|
||||||
|
@ -491,7 +455,6 @@ static void soc_cleanup_card_debugfs(struct snd_soc_card *card)
|
||||||
debugfs_remove_recursive(card->debugfs_card_root);
|
debugfs_remove_recursive(card->debugfs_card_root);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void snd_soc_debugfs_init(void)
|
static void snd_soc_debugfs_init(void)
|
||||||
{
|
{
|
||||||
snd_soc_debugfs_root = debugfs_create_dir("asoc", NULL);
|
snd_soc_debugfs_root = debugfs_create_dir("asoc", NULL);
|
||||||
|
@ -1402,6 +1365,7 @@ void snd_soc_disconnect_sync(struct device *dev)
|
||||||
|
|
||||||
snd_card_disconnect_sync(component->card->snd_card);
|
snd_card_disconnect_sync(component->card->snd_card);
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(snd_soc_disconnect_sync);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* snd_soc_add_dai_link - Add a DAI link dynamically
|
* snd_soc_add_dai_link - Add a DAI link dynamically
|
||||||
|
|
Loading…
Reference in a new issue