devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lori Hikichi <lori.hikichi@broadcom.com>
To: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>, Ray Jui <rjui@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	Jon Mason <jonmason@broadcom.com>,
	bcm-kernel-feedback-list@broadcom.com,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>
Cc: alsa-devel@alsa-project.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Lori Hikichi <lori.hikichi@broadcom.com>
Subject: [PATCH 4/9] ASoC: cygnus: Only enable MCLK pins when in use
Date: Mon, 14 Aug 2017 15:06:52 -0700	[thread overview]
Message-ID: <1502748417-26417-5-git-send-email-lori.hikichi@broadcom.com> (raw)
In-Reply-To: <1502748417-26417-1-git-send-email-lori.hikichi@broadcom.com>

The MCLK pins are now only enabled when they are in use.

Signed-off-by: Lori Hikichi <lori.hikichi@broadcom.com>
---
 sound/soc/bcm/cygnus-ssp.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/sound/soc/bcm/cygnus-ssp.c b/sound/soc/bcm/cygnus-ssp.c
index 00fd4dc..4c476ce 100644
--- a/sound/soc/bcm/cygnus-ssp.c
+++ b/sound/soc/bcm/cygnus-ssp.c
@@ -41,10 +41,10 @@
 /* Begin register offset defines */
 #define AUD_MISC_SEROUT_OE_REG_BASE  0x01c
 #define AUD_MISC_SEROUT_SPDIF_OE  12
-#define AUD_MISC_SEROUT_MCLK_OE   3
-#define AUD_MISC_SEROUT_LRCK_OE   2
-#define AUD_MISC_SEROUT_SCLK_OE   1
-#define AUD_MISC_SEROUT_SDAT_OE   0
+#define AUD_MISC_SEROUT_MCLK_OE    3
+#define AUD_MISC_SEROUT_LRCK_OE    2
+#define AUD_MISC_SEROUT_SCLK_OE    1
+#define AUD_MISC_SEROUT_SDAT_OE    0
 
 /* AUD_FMM_BF_CTRL_xxx regs */
 #define BF_DST_CFG0_OFFSET  0x100
@@ -684,6 +684,11 @@ static int cygnus_ssp_set_sysclk(struct snd_soc_dai *dai,
 	value |= (sel << I2S_OUT_PLLCLKSEL_SHIFT);
 	writel(value, aio->cygaud->audio + aio->regs.i2s_mclk_cfg);
 
+	/* Clear bit for active */
+	value = readl(aio->cygaud->audio + AUD_MISC_SEROUT_OE_REG_BASE);
+	value &= ~BIT(AUD_MISC_SEROUT_MCLK_OE + (aio->portnum * 4));
+	writel(value, aio->cygaud->audio + AUD_MISC_SEROUT_OE_REG_BASE);
+
 	return 0;
 }
 
@@ -827,15 +832,12 @@ static int cygnus_ssp_set_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
 	 * Shift the mask based upon port number.
 	 */
 	mask = BIT(AUD_MISC_SEROUT_LRCK_OE)
-			| BIT(AUD_MISC_SEROUT_SCLK_OE)
-			| BIT(AUD_MISC_SEROUT_MCLK_OE);
+			| BIT(AUD_MISC_SEROUT_SCLK_OE);
 	mask = mask << (aio->portnum * 4);
 	if (aio->is_slave)
-		/* Set bit for tri-state */
-		val |= mask;
+		val |= mask;   /* Set bit for tri-state */
 	else
-		/* Clear bit for drive */
-		val &= ~mask;
+		val &= ~mask;  /* Clear bit for drive */
 
 	dev_dbg(aio->cygaud->dev, "%s  Set OE bits 0x%x\n", __func__, val);
 	writel(val, aio->cygaud->audio + AUD_MISC_SEROUT_OE_REG_BASE);
-- 
1.9.1

  parent reply	other threads:[~2017-08-14 22:06 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-14 22:06 [PATCH 0/9] ASoC: cygnus: Various improvements and fixes Lori Hikichi
2017-08-14 22:06 ` [PATCH 1/9] ASoC: cygnus: Add support for 384kHz frame rates Lori Hikichi
2017-08-15 17:15   ` Applied "ASoC: cygnus: Add support for 384kHz frame rates" to the asoc tree Mark Brown
2017-08-14 22:06 ` [PATCH 2/9] ASoC: cygnus: Update bindings for audio clock changes Lori Hikichi
2017-08-15 17:14   ` Mark Brown
2017-08-15 19:29     ` Lori Hikichi
2017-08-16 10:59       ` Mark Brown
2017-08-16 19:39         ` Lori Hikichi
2017-08-22 16:07           ` Mark Brown
     [not found]             ` <20170822160703.nusf7sv6k4gj3pti-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2017-09-07  1:45               ` Lori Hikichi
2017-09-25 16:28                 ` Mark Brown
2017-08-14 22:06 ` Lori Hikichi [this message]
2017-08-14 22:06 ` [PATCH 6/9] ASoc: cygnus: Fix problems with multichannel transfers Lori Hikichi
     [not found] ` <1502748417-26417-1-git-send-email-lori.hikichi-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2017-08-14 22:06   ` [PATCH 3/9] ASoC: cygnus: Allow each port to select its clock source Lori Hikichi
2017-08-14 22:06   ` [PATCH 5/9] ASoC: cygnus: Remove support for 8 bit audio and for mono Lori Hikichi
2017-08-14 22:06   ` [PATCH 7/9] ASoC: cygnus: Remove set_fmt from SPDIF dai ops Lori Hikichi
2017-08-14 22:06   ` [PATCH 9/9] ASoC: cygnus: Tidy up of structure access Lori Hikichi
2017-08-14 22:06 ` [PATCH 8/9] ASoC: cygnus: Add EXPORT_SYMBOL for helper function Lori Hikichi
2017-10-04 11:27   ` Applied "ASoC: cygnus: Add EXPORT_SYMBOL for helper function" 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=1502748417-26417-5-git-send-email-lori.hikichi@broadcom.com \
    --to=lori.hikichi@broadcom.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jonmason@broadcom.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=perex@perex.cz \
    --cc=rjui@broadcom.com \
    --cc=robh+dt@kernel.org \
    --cc=sbranden@broadcom.com \
    --cc=tiwai@suse.com \
    /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).