Skip to contentSkip to conversation

alsa: Add support for timberdale I2S block

PATCH In review Richard Röjfors 3 participants 7 messages Oct 26, 2009 – Feb 1, 2010 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 alsa: Add support for timberdale I2S block

This driver adds support for the I2S block of the timberdale FPGA.

The timberdale is a FPGA found on intel development boards for In-Vehicle Infotainment.

The block has support for up to 8 I2S channels, can be clocked from either the FPGA or the device side.

This driver introduces support for this block, by exposing each I2S channel as an ALSA PCM channel.

---

include/sound/timbi2s.h new file +32 -0
new file mode 100644
index 0000000..4ab810c
@@ -0,0 +1,32 @@
+/*
+ * timbi2s.h timberdale FPGA I2S platform data
+ * Copyright (c) 2009 Intel Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#ifndef __INCLUDE_SOUND_TIMBI2S_H
+#define __INCLUDE_SOUND_TIMBI2S_H
+
+struct timbi2s_bus_data {
+	u8	rx;
+	u16	sample_rate;
+};
+
+struct timbi2s_platform_data {
+	const struct timbi2s_bus_data	*busses;
+	int				num_busses;
+	u32				main_clk;
+};
+
+#endif
sound/drivers/Kconfig +13 -0
index 84714a6..54ad4e7 100644
@@ -182,4 +182,17 @@ config SND_AC97_POWER_SAVE_DEFAULT
 	  The default time-out value in seconds for AC97 automatic
 	  power-save mode.  0 means to disable the power-save mode.
 
+config SND_TIMBERDALE_I2S
+	tristate "The timberdale FPGA I2S driver"
+	depends on MFD_TIMBERDALE && HAS_IOMEM
+	default y
+	help
+	  Say Y here to enable driver for the I2S block found within the
+	  Timberdale FPGA.
+	  There is support for up to 8 I2S channels, in either transmitter
+	  or receiver mode.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called snd-timbi2s.
+
 endif	# SND_DRIVERS
sound/drivers/Makefile +2 -0
index d4a07f9..dea2eed 100644
@@ -10,6 +10,7 @@ snd-portman2x4-objs := portman2x4.o
 snd-serial-u16550-objs := serial-u16550.o
 snd-virmidi-objs := virmidi.o
 snd-ml403-ac97cr-objs := ml403-ac97cr.o pcm-indirect2.o
+snd-timbi2s-objs := timbi2s.o
 
 # Toplevel Module Dependency
 obj-$(CONFIG_SND_DUMMY) += snd-dummy.o
@@ -19,5 +20,6 @@ obj-$(CONFIG_SND_MTPAV) += snd-mtpav.o
 obj-$(CONFIG_SND_MTS64) += snd-mts64.o
 obj-$(CONFIG_SND_PORTMAN2X4) += snd-portman2x4.o
 obj-$(CONFIG_SND_ML403_AC97CR) += snd-ml403-ac97cr.o
+obj-$(CONFIG_SND_TIMBERDALE_I2S) += snd-timbi2s.o
 
 obj-$(CONFIG_SND) += opl3/ opl4/ mpu401/ vx/ pcsp/
sound/drivers/timbi2s.c new file +755 -0

755 lines not on this page · raw message

#1 lore raw
Quoted 5 lines · Richard R?jfors

This driver adds support for the I2S block of the timberdale FPGA.

The timberdale is a FPGA found on intel development boards for In-Vehicle Infotainment.

Quoted 7 lines

The block has support for up to 8 I2S channels, can be clocked from either the FPGA or the device side.

This driver introduces support for this block, by exposing each I2S channel as an ALSA PCM channel.

Without having investigated in any great detail I'd really expect this driver to be done within ASoC if it's producing generic I2S output. If it's producing I2S out then presumably system designers will be able to attach whatever CODECs they desire and if those CODECs require any soft control then there will be a need to interoperate with CODEC drivers.

#2 lore raw

At Mon, 26 Oct 2009 13:09:31 +0000,

Quoted 13 lines · Mark Brown
Quoted 11 lines · Richard R?jfors

This driver adds support for the I2S block of the timberdale FPGA.

The timberdale is a FPGA found on intel development boards for In-Vehicle Infotainment.

The block has support for up to 8 I2S channels, can be clocked from either the FPGA or the device side.

This driver introduces support for this block, by exposing each I2S channel as an ALSA PCM channel.

Quoted 7 lines
Quoted 1 line

Without having investigated in any great detail I'd really expect this driver to be done within ASoC if it's producing generic I2S output. If it's producing I2S out then presumably system designers will be able to attach whatever CODECs they desire and if those CODECs require any soft control then there will be a need to interoperate with CODEC drivers.

I don't mind to keep non-ASoC driver if Richard is reachable :) But I agree with Mark basically. This kind of device would match better with ASoC in general.

Richard, if you are going to rewrite it for ASoC, I'll postpone this patch. If you would like only this version, I can apply it.

thanks,

Takashi

#3 lore raw

ASoC updates for 2.6.33

The following changes since commit 98078bf90495729e59edbec088d00b9d98f4cc0f:
Mark Brown (1):

        Merge branch 'for-2.6.32' into for-2.6.33

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git for-2.6.33

Eero Nurkkala (2):
ASoC: remove io_mutex
ASoC: refactor snd_soc_update_bits()

Manuel Lauss (1):
ASoC: au1x: convert to platform drivers.

Neil Jones (1):
ASoC: Add support for the WM8727 DAC.

Peter Ujfalusi (1):
ASoC: TWL4030: Make sure, that the codec is powered on startup

 sound/soc/au1x/dbdma2.c    |  117 ++++++++++++++++++++++-----
 sound/soc/au1x/psc-ac97.c  |  194 +++++++++++++++++++++++++++-----------------
 sound/soc/au1x/psc-i2s.c   |  189 +++++++++++++++++++++++++++----------------
 sound/soc/au1x/psc.h       |    7 ++-
 sound/soc/codecs/Kconfig   |    4 +
 sound/soc/codecs/Makefile  |    2 +
 sound/soc/codecs/twl4030.c |    1 +
 sound/soc/codecs/wm8727.c  |  143 ++++++++++++++++++++++++++++++++
 sound/soc/codecs/wm8727.h  |   21 +++++
 sound/soc/soc-core.c       |   41 +++++++---
 10 files changed, 545 insertions(+), 174 deletions(-)
 create mode 100644 sound/soc/codecs/wm8727.c
 create mode 100644 sound/soc/codecs/wm8727.h
#4 lore raw

Re: ASoC updates for 2.6.33

At Mon, 2 Nov 2009 18:26:37 +0000,

Quoted 8 lines · Mark Brown

The following changes since commit 98078bf90495729e59edbec088d00b9d98f4cc0f:
Mark Brown (1):

        Merge branch 'for-2.6.32' into for-2.6.33

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git for-2.6.33

Pulled now. Thanks.

Takashi

Quoted 27 lines

Eero Nurkkala (2):
ASoC: remove io_mutex
ASoC: refactor snd_soc_update_bits()

Manuel Lauss (1):
ASoC: au1x: convert to platform drivers.

Neil Jones (1):
ASoC: Add support for the WM8727 DAC.

Peter Ujfalusi (1):
ASoC: TWL4030: Make sure, that the codec is powered on startup

 sound/soc/au1x/dbdma2.c    |  117 ++++++++++++++++++++++-----
 sound/soc/au1x/psc-ac97.c  |  194 +++++++++++++++++++++++++++-----------------
 sound/soc/au1x/psc-i2s.c   |  189 +++++++++++++++++++++++++++----------------
 sound/soc/au1x/psc.h       |    7 ++-
 sound/soc/codecs/Kconfig   |    4 +
 sound/soc/codecs/Makefile  |    2 +
 sound/soc/codecs/twl4030.c |    1 +
 sound/soc/codecs/wm8727.c  |  143 ++++++++++++++++++++++++++++++++
 sound/soc/codecs/wm8727.h  |   21 +++++
 sound/soc/soc-core.c       |   41 +++++++---
 10 files changed, 545 insertions(+), 174 deletions(-)
 create mode 100644 sound/soc/codecs/wm8727.c
 create mode 100644 sound/soc/codecs/wm8727.h
#5 lore raw
In reply to Mark Brown
Quoted 12 lines · Mark Brown
Quoted 11 lines · Richard R?jfors

This driver adds support for the I2S block of the timberdale FPGA.

The timberdale is a FPGA found on intel development boards for In-Vehicle Infotainment.

The block has support for up to 8 I2S channels, can be clocked from either the FPGA or the device side.

This driver introduces support for this block, by exposing each I2S channel as an ALSA PCM channel.

Quoted 7 lines
Quoted 1 line

Without having investigated in any great detail I'd really expect this driver to be done within ASoC if it's producing generic I2S output. If it's producing I2S out then presumably system designers will be able to attach whatever CODECs they desire and if those CODECs require any soft control then there will be a need to interoperate with CODEC drivers.

This thing produces raw I2S/captures raw I2S as you say. It's used to connect to bluetooth chips and radio DSP:s. So there are no CODEC:s involved. Does it make sense to do it within ASoC?

--Richard

#6 lore raw
Quoted 11 lines · Richard Röjfors
Quoted 5 lines · Mark Brown

Without having investigated in any great detail I'd really expect this driver to be done within ASoC if it's producing generic I2S output. If it's producing I2S out then presumably system designers will be able to attach whatever CODECs they desire and if those CODECs require any soft control then there will be a need to interoperate with CODEC drivers.

This thing produces raw I2S/captures raw I2S as you say. It's used to connect to bluetooth chips and radio DSP:s. So there are no CODEC:s involved. Does it make sense to do it within ASoC?

Presumably there's nothing intrinsic in the hardware which makes this specific to bluetooth and other radios? If it's just vanilla I2S out I'd be shocked if nobody ever decided to hook it up to a CODEC for some reason or other, even if that CODEC is just being used to hook up to an analogue baseband that's been selected for some reason.

In any case, due to mobile phones things like the bluetooth are getting represented in ASoC and it's trivial to provide a stub for them where they aren't so it seems sensible to have the option to hook the device up in ASoC.