Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 110944
b: refs/heads/master
c: f0062a9
h: refs/heads/master
v: v3
  • Loading branch information
Mark Brown authored and Jaroslav Kysela committed Aug 29, 2008
1 parent d19b16a commit 2fa3ade
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 34 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2922c9aff22ea65f33a891af894331f0f883d127
refs/heads/master: f0062a92c330cf5a45fe6c8bf30a9ee82e88f530
53 changes: 20 additions & 33 deletions trunk/sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <linux/bitops.h>
#include <linux/platform_device.h>
#include <linux/jiffies.h>
#include <linux/debugfs.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
Expand Down Expand Up @@ -67,7 +68,9 @@ static int dapm_status = 1;
module_param(dapm_status, int, 0);
MODULE_PARM_DESC(dapm_status, "enable DPM sysfs entries");

static unsigned int pop_time;
static struct dentry *asoc_debugfs;

static u32 pop_time;

static void pop_wait(void)
{
Expand Down Expand Up @@ -817,51 +820,35 @@ static ssize_t dapm_widget_show(struct device *dev,

static DEVICE_ATTR(dapm_widget, 0444, dapm_widget_show, NULL);

/* pop/click delay times */
static ssize_t dapm_pop_time_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
return sprintf(buf, "%d\n", pop_time);
}

static ssize_t dapm_pop_time_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)

{
unsigned long val;

if (strict_strtoul(buf, 10, &val) >= 0)
pop_time = val;
else
printk(KERN_ERR "Unable to parse pop_time setting\n");

return count;
}

static DEVICE_ATTR(dapm_pop_time, 0744, dapm_pop_time_show,
dapm_pop_time_store);

int snd_soc_dapm_sys_add(struct device *dev)
{
int ret = 0;

if (dapm_status) {
ret = device_create_file(dev, &dev_attr_dapm_widget);
if (!dapm_status)
return 0;

if (ret == 0)
ret = device_create_file(dev, &dev_attr_dapm_pop_time);
}
ret = device_create_file(dev, &dev_attr_dapm_widget);
if (ret != 0)
return ret;

return ret;
asoc_debugfs = debugfs_create_dir("asoc", NULL);
if (!IS_ERR(asoc_debugfs))
debugfs_create_u32("dapm_pop_time", 0744, asoc_debugfs,
&pop_time);
else
asoc_debugfs = NULL;

return 0;
}

static void snd_soc_dapm_sys_remove(struct device *dev)
{
if (dapm_status) {
device_remove_file(dev, &dev_attr_dapm_pop_time);
device_remove_file(dev, &dev_attr_dapm_widget);
}

if (asoc_debugfs)
debugfs_remove_recursive(asoc_debugfs);
}

/* free all dapm widgets and resources */
Expand Down

0 comments on commit 2fa3ade

Please sign in to comment.