Skip to content

Commit

Permalink
Merge remote-tracking branches 'asoc/topic/davinci', 'asoc/topic/debu…
Browse files Browse the repository at this point in the history
…gfs', 'asoc/topic/disconnect', 'asoc/topic/ep93xx' and 'asoc/topic/eukrea-tlv320' into asoc-next
  • Loading branch information
Mark Brown committed Jan 18, 2018
6 parents 6ec2c85 + d43c17d + 700c17c + df53218 + 8d6fb0b + 8f1a1df commit 262db3b
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 78 deletions.
6 changes: 3 additions & 3 deletions sound/soc/cirrus/ep93xx-ac97.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ static int ep93xx_ac97_probe(struct platform_device *pdev)
{
struct ep93xx_ac97_info *info;
struct resource *res;
unsigned int irq;
int irq;
int ret;

info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
Expand All @@ -378,8 +378,8 @@ static int ep93xx_ac97_probe(struct platform_device *pdev)
return PTR_ERR(info->regs);

irq = platform_get_irq(pdev, 0);
if (!irq)
return -ENODEV;
if (irq <= 0)
return irq < 0 ? irq : -ENODEV;

ret = devm_request_irq(&pdev->dev, irq, ep93xx_ac97_interrupt,
IRQF_TRIGGER_HIGH, pdev->name, info);
Expand Down
19 changes: 19 additions & 0 deletions sound/soc/davinci/davinci-mcasp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1242,6 +1242,20 @@ static int davinci_mcasp_hw_rule_format(struct snd_pcm_hw_params *params,
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,
struct snd_soc_dai *cpu_dai)
{
Expand Down Expand Up @@ -1333,6 +1347,11 @@ static int davinci_mcasp_startup(struct snd_pcm_substream *substream,
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;
}

Expand Down
1 change: 0 additions & 1 deletion sound/soc/fsl/eukrea-tlv320.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

#include "../codecs/tlv320aic23.h"
#include "imx-ssi.h"
#include "fsl_ssi.h"
#include "imx-audmux.h"

#define CODEC_CLOCK 12000000
Expand Down
112 changes: 38 additions & 74 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,120 +349,84 @@ static void soc_init_codec_debugfs(struct snd_soc_component *component)
"ASoC: Failed to create codec register debugfs file\n");
}

static ssize_t codec_list_read_file(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
static int codec_list_seq_show(struct seq_file *m, void *v)
{
char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
ssize_t len, ret = 0;
struct snd_soc_codec *codec;

if (!buf)
return -ENOMEM;

mutex_lock(&client_mutex);

list_for_each_entry(codec, &codec_list, list) {
len = snprintf(buf + ret, PAGE_SIZE - ret, "%s\n",
codec->component.name);
if (len >= 0)
ret += len;
if (ret > PAGE_SIZE) {
ret = PAGE_SIZE;
break;
}
}
list_for_each_entry(codec, &codec_list, list)
seq_printf(m, "%s\n", codec->component.name);

mutex_unlock(&client_mutex);

if (ret >= 0)
ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret);

kfree(buf);
return 0;
}

return ret;
static int codec_list_seq_open(struct inode *inode, struct file *file)
{
return single_open(file, codec_list_seq_show, NULL);
}

static const struct file_operations codec_list_fops = {
.read = codec_list_read_file,
.llseek = default_llseek,/* read accesses f_pos */
.open = codec_list_seq_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};

static ssize_t dai_list_read_file(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
static int dai_list_seq_show(struct seq_file *m, void *v)
{
char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
ssize_t len, ret = 0;
struct snd_soc_component *component;
struct snd_soc_dai *dai;

if (!buf)
return -ENOMEM;

mutex_lock(&client_mutex);

list_for_each_entry(component, &component_list, list) {
list_for_each_entry(dai, &component->dai_list, list) {
len = snprintf(buf + ret, PAGE_SIZE - ret, "%s\n",
dai->name);
if (len >= 0)
ret += len;
if (ret > PAGE_SIZE) {
ret = PAGE_SIZE;
break;
}
}
}
list_for_each_entry(component, &component_list, list)
list_for_each_entry(dai, &component->dai_list, list)
seq_printf(m, "%s\n", dai->name);

mutex_unlock(&client_mutex);

ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret);

kfree(buf);
return 0;
}

return ret;
static int dai_list_seq_open(struct inode *inode, struct file *file)
{
return single_open(file, dai_list_seq_show, NULL);
}

static const struct file_operations dai_list_fops = {
.read = dai_list_read_file,
.llseek = default_llseek,/* read accesses f_pos */
.open = dai_list_seq_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};

static ssize_t platform_list_read_file(struct file *file,
char __user *user_buf,
size_t count, loff_t *ppos)
static int platform_list_seq_show(struct seq_file *m, void *v)
{
char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
ssize_t len, ret = 0;
struct snd_soc_platform *platform;

if (!buf)
return -ENOMEM;

mutex_lock(&client_mutex);

list_for_each_entry(platform, &platform_list, list) {
len = snprintf(buf + ret, PAGE_SIZE - ret, "%s\n",
platform->component.name);
if (len >= 0)
ret += len;
if (ret > PAGE_SIZE) {
ret = PAGE_SIZE;
break;
}
}
list_for_each_entry(platform, &platform_list, list)
seq_printf(m, "%s\n", platform->component.name);

mutex_unlock(&client_mutex);

ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret);

kfree(buf);
return 0;
}

return ret;
static int platform_list_seq_open(struct inode *inode, struct file *file)
{
return single_open(file, platform_list_seq_show, NULL);
}

static const struct file_operations platform_list_fops = {
.read = platform_list_read_file,
.llseek = default_llseek,/* read accesses f_pos */
.open = platform_list_seq_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};

static void soc_init_card_debugfs(struct snd_soc_card *card)
Expand Down Expand Up @@ -491,7 +455,6 @@ static void soc_cleanup_card_debugfs(struct snd_soc_card *card)
debugfs_remove_recursive(card->debugfs_card_root);
}


static void snd_soc_debugfs_init(void)
{
snd_soc_debugfs_root = debugfs_create_dir("asoc", NULL);
Expand Down Expand Up @@ -1402,6 +1365,7 @@ void snd_soc_disconnect_sync(struct device *dev)

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
Expand Down

0 comments on commit 262db3b

Please sign in to comment.