alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ALSA: ASoC: ak4104: handle more sample rates
@ 2012-10-07 15:51 Daniel Mack
  2012-10-07 15:51 ` [PATCH 2/2] ALSA: ASoC: ak4104: add DT bindings Daniel Mack
  2012-10-09  5:40 ` [PATCH 1/2] ALSA: ASoC: ak4104: handle more sample rates Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Daniel Mack @ 2012-10-07 15:51 UTC (permalink / raw)
  To: alsa-devel; +Cc: broonie, lrg, Daniel Mack

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 sound/soc/codecs/ak4104.c | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/ak4104.c b/sound/soc/codecs/ak4104.c
index 31d4483..d14163f 100644
--- a/sound/soc/codecs/ak4104.c
+++ b/sound/soc/codecs/ak4104.c
@@ -98,14 +98,32 @@ static int ak4104_hw_params(struct snd_pcm_substream *substream,
 	val = 0;
 
 	switch (params_rate(params)) {
+	case 22050:
+		val |= IEC958_AES3_CON_FS_22050;
+		break;
+	case 24000:
+		val |= IEC958_AES3_CON_FS_24000;
+		break;
+	case 32000:
+		val |= IEC958_AES3_CON_FS_32000;
+		break;
 	case 44100:
 		val |= IEC958_AES3_CON_FS_44100;
 		break;
 	case 48000:
 		val |= IEC958_AES3_CON_FS_48000;
 		break;
-	case 32000:
-		val |= IEC958_AES3_CON_FS_32000;
+	case 88200:
+		val |= IEC958_AES3_CON_FS_88200;
+		break;
+	case 96000:
+		val |= IEC958_AES3_CON_FS_96000;
+		break;
+	case 176400:
+		val |= IEC958_AES3_CON_FS_176400;
+		break;
+	case 192000:
+		val |= IEC958_AES3_CON_FS_192000;
 		break;
 	default:
 		dev_err(codec->dev, "unsupported sampling rate\n");
-- 
1.7.11.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] ALSA: ASoC: ak4104: add DT bindings
  2012-10-07 15:51 [PATCH 1/2] ALSA: ASoC: ak4104: handle more sample rates Daniel Mack
@ 2012-10-07 15:51 ` Daniel Mack
  2012-10-09  5:40 ` [PATCH 1/2] ALSA: ASoC: ak4104: handle more sample rates Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Mack @ 2012-10-07 15:51 UTC (permalink / raw)
  To: alsa-devel; +Cc: broonie, lrg, Daniel Mack

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 Documentation/devicetree/bindings/sound/ak4104.txt | 17 +++++++++++++++++
 sound/soc/codecs/ak4104.c                          |  7 +++++++
 2 files changed, 24 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/ak4104.txt

diff --git a/Documentation/devicetree/bindings/sound/ak4104.txt b/Documentation/devicetree/bindings/sound/ak4104.txt
new file mode 100644
index 0000000..1f8e506
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/ak4104.txt
@@ -0,0 +1,17 @@
+AK4104 S/PDIF transmitter
+
+This device supports SPI mode only.
+
+Required properties:
+
+  - compatible : "asahi-kasei,ak4104"
+
+  - reg : The chip select number on the SPI bus
+
+Example:
+
+spdif: ak4104@0 {
+	compatible = "asahi-kasei,ak4104";
+	reg = <0>;
+	spi-max-frequency = <5000000>;
+};
diff --git a/sound/soc/codecs/ak4104.c b/sound/soc/codecs/ak4104.c
index d14163f..d4d4858 100644
--- a/sound/soc/codecs/ak4104.c
+++ b/sound/soc/codecs/ak4104.c
@@ -258,10 +258,17 @@ static int __devexit ak4104_spi_remove(struct spi_device *spi)
 	return 0;
 }
 
+static const struct of_device_id ak4104_of_match[] = {
+	{ .compatible = "asahi-kasei,ak4104", },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, ak4104_of_match);
+
 static struct spi_driver ak4104_spi_driver = {
 	.driver  = {
 		.name   = DRV_NAME,
 		.owner  = THIS_MODULE,
+		.of_match_table = ak4104_of_match,
 	},
 	.probe  = ak4104_spi_probe,
 	.remove = __devexit_p(ak4104_spi_remove),
-- 
1.7.11.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] ALSA: ASoC: ak4104: handle more sample rates
  2012-10-07 15:51 [PATCH 1/2] ALSA: ASoC: ak4104: handle more sample rates Daniel Mack
  2012-10-07 15:51 ` [PATCH 2/2] ALSA: ASoC: ak4104: add DT bindings Daniel Mack
@ 2012-10-09  5:40 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2012-10-09  5:40 UTC (permalink / raw)
  To: Daniel Mack; +Cc: alsa-devel, lrg

On Sun, Oct 07, 2012 at 05:51:23PM +0200, Daniel Mack wrote:
> Signed-off-by: Daniel Mack <zonque@gmail.com>

Applied both, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-10-09  5:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-07 15:51 [PATCH 1/2] ALSA: ASoC: ak4104: handle more sample rates Daniel Mack
2012-10-07 15:51 ` [PATCH 2/2] ALSA: ASoC: ak4104: add DT bindings Daniel Mack
2012-10-09  5:40 ` [PATCH 1/2] ALSA: ASoC: ak4104: handle more sample rates Mark Brown

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).