From: tiwai@suse.de (Takashi Iwai)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ASoC: mediatek: Enable 33bit memory address to support 4GB DRAM
Date: Tue, 12 Jan 2016 06:42:42 +0100 [thread overview]
Message-ID: <s5h37u3pd4d.wl-tiwai@suse.de> (raw)
In-Reply-To: <1452567284.8331.12.camel@mtksdaap41>
On Tue, 12 Jan 2016 03:54:44 +0100,
PC Liao wrote:
>
> On Mon, 2016-01-11 at 17:02 +0800, Takashi Iwai wrote:
> > On Mon, 11 Jan 2016 09:00:50 +0100,
> > PC Liao wrote:
> > >
> > > @@ -603,7 +606,10 @@ static int mtk_afe_dais_hw_params(struct snd_pcm_substream *substream,
> > > if (ret < 0)
> > > return ret;
> > >
> > > - memif->phys_buf_addr = substream->runtime->dma_addr;
> > > + if (sizeof(dma_addr_t) > 4)
> > > + msb_at_bit33 = (substream->runtime->dma_addr & 0x100000000) ? 1 : 0;
> >
> > Better to put a proper suffix for the constant over 32bit.
> >
> > Or use upper_32_bits(). Then sizeof() check can be omitted, as the
> > compiler should be smart enough to know it beforehand.
> >
> >
> > Takashi
>
>
> Hi Takashi,
>
> Thanks for your comment.
> I change as below:
> @@ -606,10 +606,8 @@ static int mtk_afe_dais_hw_params(struct
> snd_pcm_substream
> if (ret < 0)
> return ret;
>
> - if (sizeof(dma_addr_t) > 4)
> - msb_at_bit33 = (substream->runtime->dma_addr &
> 0x100000000) ? 1
> -
> - memif->phys_buf_addr = substream->runtime->dma_addr &
> 0xffffffff;
> + msb_at_bit33 = upper_32_bits(substream->runtime->dma_addr) ? 1 :
> 0;
> + memif->phys_buf_addr =
> lower_32_bits(substream->runtime->dma_addr);
>
>
> Dose this change follow your idea?
Yes.
Takashi
prev parent reply other threads:[~2016-01-12 5:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-11 8:00 [PATCH] ASoC: mediatek: Enable 33bit memory address to support 4GB DRAM PC Liao
2016-01-11 9:02 ` Takashi Iwai
2016-01-12 2:54 ` PC Liao
2016-01-12 5:42 ` Takashi Iwai [this message]
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=s5h37u3pd4d.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=linux-arm-kernel@lists.infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox