From: Stas Sergeev <stsp@aknet.ru>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org, Andreas Mohr <andi@lisas.de>
Subject: [patch] snd-pcsp: fix pcsp_treble_info() to honour the item number
Date: Sat, 24 May 2008 00:04:33 +0400 [thread overview]
Message-ID: <48372351.9090900@aknet.ru> (raw)
[-- Attachment #1: Type: text/plain, Size: 214 bytes --]
Hello.
The attached patch fixes the problem
with mixers not properly displaying
the PWM freq. The bug was that the
pcsp_treble_info() didn't take the
item number into an account.
Takashi, could you please apply?
[-- Attachment #2: pcsp_tre.diff --]
[-- Type: text/x-patch, Size: 1967 bytes --]
# HG changeset patch
# User Stas Sergeev <stsp@users.sourceforge.net>
# Date 1211572692 -14400
# Node ID 15efd0d72bdec6b30cad2ea225c0d9d2be07e150
# Parent 2278b9a6058f5b45081f8227902df585474a81a6
snd-pcsp: fix pcsp_treble_info() to honour an item number.
This solves the problem with mixers wrongly displaying the PWM freq.
Signed-off-by: Stas Sergeev <stsp@aknet.ru>
CC: Andreas Mohr <andi@lisas.de>
diff -r 2278b9a6058f -r 15efd0d72bde drivers/pcsp/pcsp.h
--- a/drivers/pcsp/pcsp.h Sat May 17 19:40:49 2008 +0400
+++ b/drivers/pcsp/pcsp.h Fri May 23 23:58:12 2008 +0400
@@ -24,7 +24,8 @@
/* default timer freq for PC-Speaker: 18643 Hz */
#define DIV_18KHZ 64
#define MAX_DIV DIV_18KHZ
-#define CUR_DIV() (MAX_DIV >> chip->treble)
+#define CALC_DIV(d) (MAX_DIV >> (d))
+#define CUR_DIV() CALC_DIV(chip->treble)
#define PCSP_MAX_TREBLE 1
/* unfortunately, with hrtimers 37KHz does not work very well :( */
@@ -36,7 +37,8 @@
#define PCSP_DEFAULT_SDIV (DIV_18KHZ >> 1)
#define PCSP_DEFAULT_SRATE (PIT_TICK_RATE / PCSP_DEFAULT_SDIV)
#define PCSP_INDEX_INC() (1 << (PCSP_MAX_TREBLE - chip->treble))
-#define PCSP_RATE() (PIT_TICK_RATE / CUR_DIV())
+#define PCSP_CALC_RATE(i) (PIT_TICK_RATE / CALC_DIV(i))
+#define PCSP_RATE() PCSP_CALC_RATE(chip->treble)
#define PCSP_MIN_RATE__1 MAX_DIV/PIT_TICK_RATE
#define PCSP_MAX_RATE__1 MIN_DIV/PIT_TICK_RATE
#define PCSP_MAX_PERIOD_NS (1000000000ULL * PCSP_MIN_RATE__1)
diff -r 2278b9a6058f -r 15efd0d72bde drivers/pcsp/pcsp_mixer.c
--- a/drivers/pcsp/pcsp_mixer.c Sat May 17 19:40:49 2008 +0400
+++ b/drivers/pcsp/pcsp_mixer.c Fri May 23 23:58:12 2008 +0400
@@ -50,7 +50,8 @@
uinfo->value.enumerated.items = chip->max_treble + 1;
if (uinfo->value.enumerated.item > chip->max_treble)
uinfo->value.enumerated.item = chip->max_treble;
- sprintf(uinfo->value.enumerated.name, "%d", PCSP_RATE());
+ sprintf(uinfo->value.enumerated.name, "%d",
+ PCSP_CALC_RATE(uinfo->value.enumerated.item));
return 0;
}
[-- Attachment #3: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
next reply other threads:[~2008-05-23 20:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-23 20:04 Stas Sergeev [this message]
2008-05-26 10:57 ` [patch] snd-pcsp: fix pcsp_treble_info() to honour the item number Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48372351.9090900@aknet.ru \
--to=stsp@aknet.ru \
--cc=alsa-devel@alsa-project.org \
--cc=andi@lisas.de \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.