linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Garlic Tseng <garlic.tseng@mediatek.com>
To: Mark Brown <broonie@kernel.org>
Cc: <tiwai@suse.de>, <srv_heupstream@mediatek.com>,
	<linux-mediatek@lists.infradead.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <alsa-devel@alsa-project.org>,
	<koro.chen@mediatek.com>, <PC.Liao@mediatek.com>,
	<ir.lian@mediatek.com>
Subject: Re: [alsa-devel] [PATCH 3/4] ASoC: mediatek: add BT implementation
Date: Tue, 5 Jul 2016 09:52:13 +0800	[thread overview]
Message-ID: <1467683533.4212.16.camel@mtksdaap41> (raw)
In-Reply-To: <20160704144406.GH6247@sirena.org.uk>

On Mon, 2016-07-04 at 16:44 +0200, Mark Brown wrote:
> On Mon, Jul 04, 2016 at 06:56:27PM +0800, Garlic Tseng wrote:
> 
> > +static int mt2701_btmrg_startup(struct snd_pcm_substream *substream,
> > +				struct snd_soc_dai *dai)
> > +{
> > +	struct snd_soc_pcm_runtime *rtd = substream->private_data;
> > +	struct mtk_base_afe *afe = snd_soc_platform_get_drvdata(rtd->platform);
> > +	struct mt2701_afe_private *afe_priv = afe->platform_priv;
> > +
> > +	regmap_update_bits(afe->regmap, AUDIO_TOP_CON4,
> > +			   AUDIO_TOP_CON4_PDN_MRGIF, 0);
> 
> We really shouldn't be writing the registers or other internal data of
> the device.  Instead we should be getting the driver for the relevant
> hardware component to do it.  If we just write to registers that makes
> the interoperation with the real driver for the device more fragile than
> it should be, people might update the main driver without noticing the
> external driver.

The AUDIO_TOP_CON4 is a reg of the ASoC hw module. All the registers
which are set in the btmrg operator belong to ASoC hardware. The reg
writing you mention above is to power up the MRG interface in the ASoC
module.

When we start BT link, we need to start some hardware component belongs
to ASoC module. Of course we also need to start up the BT module
(including start up the MRG interface hw in BT chip), but it is not in
the ASoC driver.

  reply	other threads:[~2016-07-05  1:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-04 10:56 [alsa-devel] [PATCH 0/4] ASoC: Mediatek: add MT2701 platform and machine driver Garlic Tseng
2016-07-04 10:56 ` [alsa-devel] [PATCH 1/4] ASoC: mediatek: add mt2701 platform driver implementation Garlic Tseng
2016-07-04 14:49   ` Applied "ASoC: mediatek: add mt2701 platform driver implementation." to the asoc tree Mark Brown
2016-07-04 10:56 ` [alsa-devel] [PATCH 2/4] ASoC: bt-sco: extend rate and add a general compatible string Garlic Tseng
2016-07-04 14:49   ` Applied "ASoC: bt-sco: extend rate and add a general compatible string" to the asoc tree Mark Brown
2016-07-04 10:56 ` [alsa-devel] [PATCH 3/4] ASoC: mediatek: add BT implementation Garlic Tseng
2016-07-04 14:44   ` Mark Brown
2016-07-05  1:52     ` Garlic Tseng [this message]
2016-07-05  8:12       ` Mark Brown
2016-07-05  8:59         ` Garlic Tseng
2016-07-05  9:55   ` Applied "ASoC: mediatek: add BT implementation" to the asoc tree Mark Brown
2016-07-04 10:56 ` [alsa-devel] [PATCH 4/4] ASoC: mediatek: Add mt2701-cs42448 driver and config option Garlic Tseng
2016-07-04 14:49   ` Applied "ASoC: mediatek: Add mt2701-cs42448 driver and config option." to the asoc tree Mark Brown

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=1467683533.4212.16.camel@mtksdaap41 \
    --to=garlic.tseng@mediatek.com \
    --cc=PC.Liao@mediatek.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=ir.lian@mediatek.com \
    --cc=koro.chen@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=srv_heupstream@mediatek.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).