* [PATCH 1/2] ASoC: Advertise 16000Hz rate for WM9713 PCM interface
@ 2008-07-02 10:51 Mark Brown
2008-07-02 10:51 ` [PATCH 2/2] ASoC: Make pop/click debug wait times dynamically configurable Mark Brown
2008-07-02 12:27 ` [PATCH 1/2] ASoC: Advertise 16000Hz rate for WM9713 PCM interface Takashi Iwai
0 siblings, 2 replies; 3+ messages in thread
From: Mark Brown @ 2008-07-02 10:51 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel, Mark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
sound/soc/codecs/wm9713.c | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c
index 0db9637..a480618 100644
--- a/sound/soc/codecs/wm9713.c
+++ b/sound/soc/codecs/wm9713.c
@@ -1001,9 +1001,18 @@ static int ac97_aux_prepare(struct snd_pcm_substream *substream)
return ac97_write(codec, AC97_PCM_SURR_DAC_RATE, runtime->rate);
}
-#define WM9713_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\
- SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 |\
- SNDRV_PCM_RATE_48000)
+#define WM9713_RATES (SNDRV_PCM_RATE_8000 | \
+ SNDRV_PCM_RATE_11025 | \
+ SNDRV_PCM_RATE_22050 | \
+ SNDRV_PCM_RATE_44100 | \
+ SNDRV_PCM_RATE_48000)
+
+#define WM9713_PCM_RATES (SNDRV_PCM_RATE_8000 | \
+ SNDRV_PCM_RATE_11025 | \
+ SNDRV_PCM_RATE_16000 | \
+ SNDRV_PCM_RATE_22050 | \
+ SNDRV_PCM_RATE_44100 | \
+ SNDRV_PCM_RATE_48000)
#define WM9713_PCM_FORMATS \
(SNDRV_PCM_FORMAT_S16_LE | SNDRV_PCM_FORMAT_S20_3LE | \
@@ -1051,13 +1060,13 @@ struct snd_soc_codec_dai wm9713_dai[] = {
.stream_name = "Voice Playback",
.channels_min = 1,
.channels_max = 1,
- .rates = WM9713_RATES,
+ .rates = WM9713_PCM_RATES,
.formats = WM9713_PCM_FORMATS,},
.capture = {
.stream_name = "Voice Capture",
.channels_min = 1,
.channels_max = 2,
- .rates = WM9713_RATES,
+ .rates = WM9713_PCM_RATES,
.formats = WM9713_PCM_FORMATS,},
.ops = {
.hw_params = wm9713_pcm_hw_params,
--
1.5.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] ASoC: Make pop/click debug wait times dynamically configurable
2008-07-02 10:51 [PATCH 1/2] ASoC: Advertise 16000Hz rate for WM9713 PCM interface Mark Brown
@ 2008-07-02 10:51 ` Mark Brown
2008-07-02 12:27 ` [PATCH 1/2] ASoC: Advertise 16000Hz rate for WM9713 PCM interface Takashi Iwai
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2008-07-02 10:51 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel, Mark Brown
DAPM supports adding a compile time configurable delay to the widget power
sequences, aiding diagnosis of problems with pops and clicks being
generated during them. This patch converts this to be configurable at run
time via a sysfs file.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
sound/soc/soc-dapm.c | 67 +++++++++++++++++++++++++++++++++++++++----------
1 files changed, 53 insertions(+), 14 deletions(-)
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 2536382..7c2dd4e 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -54,16 +54,6 @@
#define dbg(format, arg...)
#endif
-#define POP_DEBUG 0
-#if POP_DEBUG
-#define POP_TIME 500 /* 500 msecs - change if pop debug is too fast */
-#define pop_wait(time) schedule_timeout_uninterruptible(msecs_to_jiffies(time))
-#define pop_dbg(format, arg...) printk(format, ## arg); pop_wait(POP_TIME)
-#else
-#define pop_dbg(format, arg...)
-#define pop_wait(time)
-#endif
-
/* dapm power sequences - make this per codec in the future */
static int dapm_up_seq[] = {
snd_soc_dapm_pre, snd_soc_dapm_micbias, snd_soc_dapm_mic,
@@ -80,6 +70,28 @@ 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 void pop_wait(void)
+{
+ if (pop_time)
+ schedule_timeout_uninterruptible(msecs_to_jiffies(pop_time));
+}
+
+static void pop_dbg(const char *fmt, ...)
+{
+ va_list args;
+
+ va_start(args, fmt);
+
+ if (pop_time) {
+ vprintk(fmt, args);
+ pop_wait();
+ }
+
+ va_end(args);
+}
+
/* create a new dapm widget */
static inline struct snd_soc_dapm_widget *dapm_cnew_widget(
const struct snd_soc_dapm_widget *_widget)
@@ -217,9 +229,9 @@ static int dapm_update_bits(struct snd_soc_dapm_widget *widget)
change = old != new;
if (change) {
pop_dbg("pop test %s : %s in %d ms\n", widget->name,
- widget->power ? "on" : "off", POP_TIME);
+ widget->power ? "on" : "off", pop_time);
snd_soc_write(codec, widget->reg, new);
- pop_wait(POP_TIME);
+ pop_wait();
}
dbg("reg %x old %x new %x change %d\n", widget->reg, old, new, change);
return change;
@@ -803,20 +815,47 @@ 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)
+
+{
+ if (strict_strtoul(buf, 10, &pop_time) < 0)
+ 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)
+ if (dapm_status) {
ret = device_create_file(dev, &dev_attr_dapm_widget);
+ if (ret == 0)
+ ret = device_create_file(dev, &dev_attr_dapm_pop_time);
+ }
+
return ret;
}
static void snd_soc_dapm_sys_remove(struct device *dev)
{
- if (dapm_status)
+ if (dapm_status) {
+ device_remove_file(dev, &dev_attr_dapm_pop_time);
device_remove_file(dev, &dev_attr_dapm_widget);
+ }
}
/* free all dapm widgets and resources */
--
1.5.6
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] ASoC: Advertise 16000Hz rate for WM9713 PCM interface
2008-07-02 10:51 [PATCH 1/2] ASoC: Advertise 16000Hz rate for WM9713 PCM interface Mark Brown
2008-07-02 10:51 ` [PATCH 2/2] ASoC: Make pop/click debug wait times dynamically configurable Mark Brown
@ 2008-07-02 12:27 ` Takashi Iwai
1 sibling, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2008-07-02 12:27 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel
At Wed, 2 Jul 2008 11:51:19 +0100,
Mark Brown wrote:
>
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Thanks, I applied both patches.
Takashi
> ---
> sound/soc/codecs/wm9713.c | 19 ++++++++++++++-----
> 1 files changed, 14 insertions(+), 5 deletions(-)
>
> diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c
> index 0db9637..a480618 100644
> --- a/sound/soc/codecs/wm9713.c
> +++ b/sound/soc/codecs/wm9713.c
> @@ -1001,9 +1001,18 @@ static int ac97_aux_prepare(struct snd_pcm_substream *substream)
> return ac97_write(codec, AC97_PCM_SURR_DAC_RATE, runtime->rate);
> }
>
> -#define WM9713_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\
> - SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_44100 |\
> - SNDRV_PCM_RATE_48000)
> +#define WM9713_RATES (SNDRV_PCM_RATE_8000 | \
> + SNDRV_PCM_RATE_11025 | \
> + SNDRV_PCM_RATE_22050 | \
> + SNDRV_PCM_RATE_44100 | \
> + SNDRV_PCM_RATE_48000)
> +
> +#define WM9713_PCM_RATES (SNDRV_PCM_RATE_8000 | \
> + SNDRV_PCM_RATE_11025 | \
> + SNDRV_PCM_RATE_16000 | \
> + SNDRV_PCM_RATE_22050 | \
> + SNDRV_PCM_RATE_44100 | \
> + SNDRV_PCM_RATE_48000)
>
> #define WM9713_PCM_FORMATS \
> (SNDRV_PCM_FORMAT_S16_LE | SNDRV_PCM_FORMAT_S20_3LE | \
> @@ -1051,13 +1060,13 @@ struct snd_soc_codec_dai wm9713_dai[] = {
> .stream_name = "Voice Playback",
> .channels_min = 1,
> .channels_max = 1,
> - .rates = WM9713_RATES,
> + .rates = WM9713_PCM_RATES,
> .formats = WM9713_PCM_FORMATS,},
> .capture = {
> .stream_name = "Voice Capture",
> .channels_min = 1,
> .channels_max = 2,
> - .rates = WM9713_RATES,
> + .rates = WM9713_PCM_RATES,
> .formats = WM9713_PCM_FORMATS,},
> .ops = {
> .hw_params = wm9713_pcm_hw_params,
> --
> 1.5.6
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-07-02 12:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-02 10:51 [PATCH 1/2] ASoC: Advertise 16000Hz rate for WM9713 PCM interface Mark Brown
2008-07-02 10:51 ` [PATCH 2/2] ASoC: Make pop/click debug wait times dynamically configurable Mark Brown
2008-07-02 12:27 ` [PATCH 1/2] ASoC: Advertise 16000Hz rate for WM9713 PCM interface Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox