mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Samuel Ortiz <sameo@linux.intel.com>
Cc: linux-kernel@vger.kernel.org,
	patches@opensource.wolfsonmicro.com,
	Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: [PATCH 1/2] mfd: arizona: Add support for multiple PDM speaker outputs
Date: Mon,  9 Jul 2012 19:33:14 +0100	[thread overview]
Message-ID: <1341858795-27504-1-git-send-email-broonie@opensource.wolfsonmicro.com> (raw)

The registers have stride 2 so we can write the loop properly now.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/mfd/arizona-core.c        |    5 ++---
 include/linux/mfd/arizona/pdata.h |    2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
index 83558b5..b4978b5 100644
--- a/drivers/mfd/arizona-core.c
+++ b/drivers/mfd/arizona-core.c
@@ -462,18 +462,17 @@ int __devinit arizona_dev_init(struct arizona *arizona)
 				   ARIZONA_OUT1_MONO, val);
 	}
 
-	BUILD_BUG_ON(ARIZONA_MAX_PDM_SPK > 1);
 	for (i = 0; i < ARIZONA_MAX_PDM_SPK; i++) {
 		if (arizona->pdata.spk_mute[i])
 			regmap_update_bits(arizona->regmap,
-					   ARIZONA_PDM_SPK1_CTRL_1,
+					   ARIZONA_PDM_SPK1_CTRL_1 + (i * 2),
 					   ARIZONA_SPK1_MUTE_ENDIAN_MASK |
 					   ARIZONA_SPK1_MUTE_SEQ1_MASK,
 					   arizona->pdata.spk_mute[i]);
 
 		if (arizona->pdata.spk_fmt[i])
 			regmap_update_bits(arizona->regmap,
-					   ARIZONA_PDM_SPK1_CTRL_2,
+					   ARIZONA_PDM_SPK1_CTRL_2 + (i * 2),
 					   ARIZONA_SPK1_FMT_MASK,
 					   arizona->pdata.spk_fmt[i]);
 	}
diff --git a/include/linux/mfd/arizona/pdata.h b/include/linux/mfd/arizona/pdata.h
index fa2cb98..68ff91a 100644
--- a/include/linux/mfd/arizona/pdata.h
+++ b/include/linux/mfd/arizona/pdata.h
@@ -62,7 +62,7 @@
 
 #define ARIZONA_MAX_OUTPUT 5
 
-#define ARIZONA_MAX_PDM_SPK 1
+#define ARIZONA_MAX_PDM_SPK 2
 
 struct regulator_init_data;
 
-- 
1.7.10


             reply	other threads:[~2012-07-09 18:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-09 18:33 Mark Brown [this message]
2012-07-09 18:33 ` [PATCH 2/2] mfd: arizona: Add even more register definitions Mark Brown
2012-07-10  9:03 ` [PATCH 1/2] mfd: arizona: Add support for multiple PDM speaker outputs Samuel Ortiz

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=1341858795-27504-1-git-send-email-broonie@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.wolfsonmicro.com \
    --cc=sameo@linux.intel.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

all inboxes | Powered by JetHome®