* [PATCH] vwsnd: Fix setting of cfgval and ctlval in li_setup_dma()
@ 2009-08-26 10:01 Roel Kluin
2009-08-26 10:43 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-08-26 10:01 UTC (permalink / raw)
To: Takashi Iwai, alsa-devel, Andrew Morton
Since !LI_CCFG_* evaluates to 0, this did not change anything to
cfgval and ctlval.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
// vi sound/oss/vwsnd.c +392
# define LI_CCTL_RESET 0x80000000
...
# define LI_CCTL_DMA_ENABLE 0x08000000
...
# define LI_CCFG_LOCK 0x00008000
I am not sure this is what was intended, does anyone have the
specs?
diff --git a/sound/oss/vwsnd.c b/sound/oss/vwsnd.c
index 187f727..6713110 100644
--- a/sound/oss/vwsnd.c
+++ b/sound/oss/vwsnd.c
@@ -628,7 +628,7 @@ static void li_setup_dma(dma_chan_t *chan,
ASSERT(!(buffer_paddr & 0xFF));
chan->baseval = (buffer_paddr >> 8) | 1 << (37 - 8);
- chan->cfgval = (!LI_CCFG_LOCK |
+ chan->cfgval = ((chan->cfgval & ~LI_CCFG_LOCK) |
SHIFT_FIELD(desc->ad1843_slot, LI_CCFG_SLOT) |
desc->direction |
mode |
@@ -638,9 +638,9 @@ static void li_setup_dma(dma_chan_t *chan,
tmask = 13 - fragshift; /* See Lithium DMA Notes above. */
ASSERT(size >= 2 && size <= 7);
ASSERT(tmask >= 1 && tmask <= 7);
- chan->ctlval = (!LI_CCTL_RESET |
+ chan->ctlval = ((chan->ctlval & ~LI_CCTL_RESET) |
SHIFT_FIELD(size, LI_CCTL_SIZE) |
- !LI_CCTL_DMA_ENABLE |
+ (chan->ctlval & ~LI_CCTL_DMA_ENABLE) |
SHIFT_FIELD(tmask, LI_CCTL_TMASK) |
SHIFT_FIELD(0, LI_CCTL_TPTR));
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] vwsnd: Fix setting of cfgval and ctlval in li_setup_dma()
2009-08-26 10:01 [PATCH] vwsnd: Fix setting of cfgval and ctlval in li_setup_dma() Roel Kluin
@ 2009-08-26 10:43 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2009-08-26 10:43 UTC (permalink / raw)
To: Roel Kluin; +Cc: alsa-devel, Andrew Morton
At Wed, 26 Aug 2009 12:01:20 +0200,
Roel Kluin wrote:
>
> Since !LI_CCFG_* evaluates to 0, this did not change anything to
> cfgval and ctlval.
>
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Applied now. Thanks.
> ---
> // vi sound/oss/vwsnd.c +392
> # define LI_CCTL_RESET 0x80000000
> ...
> # define LI_CCTL_DMA_ENABLE 0x08000000
> ...
> # define LI_CCFG_LOCK 0x00008000
>
> I am not sure this is what was intended, does anyone have the
> specs?
Your fix must be correct, judging from the code.
But, I have also no spec, so cannot guarantee it ;)
Takashi
> diff --git a/sound/oss/vwsnd.c b/sound/oss/vwsnd.c
> index 187f727..6713110 100644
> --- a/sound/oss/vwsnd.c
> +++ b/sound/oss/vwsnd.c
> @@ -628,7 +628,7 @@ static void li_setup_dma(dma_chan_t *chan,
> ASSERT(!(buffer_paddr & 0xFF));
> chan->baseval = (buffer_paddr >> 8) | 1 << (37 - 8);
>
> - chan->cfgval = (!LI_CCFG_LOCK |
> + chan->cfgval = ((chan->cfgval & ~LI_CCFG_LOCK) |
> SHIFT_FIELD(desc->ad1843_slot, LI_CCFG_SLOT) |
> desc->direction |
> mode |
> @@ -638,9 +638,9 @@ static void li_setup_dma(dma_chan_t *chan,
> tmask = 13 - fragshift; /* See Lithium DMA Notes above. */
> ASSERT(size >= 2 && size <= 7);
> ASSERT(tmask >= 1 && tmask <= 7);
> - chan->ctlval = (!LI_CCTL_RESET |
> + chan->ctlval = ((chan->ctlval & ~LI_CCTL_RESET) |
> SHIFT_FIELD(size, LI_CCTL_SIZE) |
> - !LI_CCTL_DMA_ENABLE |
> + (chan->ctlval & ~LI_CCTL_DMA_ENABLE) |
> SHIFT_FIELD(tmask, LI_CCTL_TMASK) |
> SHIFT_FIELD(0, LI_CCTL_TPTR));
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-08-26 10:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-26 10:01 [PATCH] vwsnd: Fix setting of cfgval and ctlval in li_setup_dma() Roel Kluin
2009-08-26 10:43 ` Takashi Iwai
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.