alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Sverdlin <subaparts@yandex.ru>
To: alsa-devel@alsa-project.org, Liam Girdwood <lrg@slimlogic.co.uk>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Cc: H Hartley Sweeten <hsweeten@visionengravers.com>,
	George Kashperko <george@chas.com.ua>,
	Lennert Buytenhek <buytenh@wantstofly.org>
Subject: [PATCH] EDB93xx: Add support for CS4271 CODEC on EDB93xx boards
Date: Sun, 23 Jan 2011 03:51:24 +0300	[thread overview]
Message-ID: <1295743884.14515.35.camel@r60e> (raw)

From: Alexander Sverdlin <subaparts@yandex.ru>

Add support for CS4271 SPI-connected CODEC on EDB93xx boards.
        
Signed-off-by: Alexander Sverdlin <subaparts@yandex.ru>
---
 arch/arm/mach-ep93xx/edb93xx.c |   54 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 54 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-ep93xx/edb93xx.c b/arch/arm/mach-ep93xx/edb93xx.c
index 4b04316..9f9193d 100644
--- a/arch/arm/mach-ep93xx/edb93xx.c
+++ b/arch/arm/mach-ep93xx/edb93xx.c
@@ -30,12 +30,21 @@
 #include <linux/gpio.h>
 #include <linux/i2c.h>
 #include <linux/i2c-gpio.h>
+#include <linux/spi/spi.h>
+#include <mach/ep93xx_spi.h>
 
 #include <mach/hardware.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
+#include <sound/cs4271.h>
+
+#define edb93xx_has_audio() (machine_is_edb9301() ||	\
+			     machine_is_edb9302() ||	\
+			     machine_is_edb9302a() ||	\
+			     machine_is_edb9307a() ||	\
+			     machine_is_edb9315a())
 
 static void __init edb93xx_register_flash(void)
 {
@@ -93,6 +102,49 @@ static void __init edb93xx_register_i2c(void)
 
 
 /*************************************************************************
+ * EDB93xx SPI peripheral handling
+ *************************************************************************/
+static struct cs4271_platform_data cs4271_edb93xx_gpio = {
+	.gpio_nreset	= EP93XX_GPIO_LINE_EGPIO1,
+	.gpio_disable	= EP93XX_GPIO_LINE_EGPIO6,
+};
+
+static struct spi_board_info edb93xx_spi_board_info[] = {
+	{
+		.modalias	= "cs4271",
+		.max_speed_hz	= 6000000,
+		.bus_num	= 0,
+		.chip_select	= 0,
+		.mode		= SPI_MODE_3,
+		.platform_data	= &cs4271_edb93xx_gpio,
+	},
+};
+
+static struct ep93xx_spi_info edb93xx_spi_info = {
+	.num_chipselect	= ARRAY_SIZE(edb93xx_spi_board_info),
+};
+
+static void __init edb93xx_register_spi(void)
+{
+	if (edb93xx_has_audio()) {
+		ep93xx_register_spi(&edb93xx_spi_info,
+				    edb93xx_spi_board_info,
+				    ARRAY_SIZE(edb93xx_spi_board_info));
+	}
+}
+
+/*************************************************************************
+ * EDB93xx I2S
+ *************************************************************************/
+static void __init edb93xx_register_i2s(void)
+{
+	if (edb93xx_has_audio()) {
+		ep93xx_register_i2s();
+	}
+}
+
+
+/*************************************************************************
  * EDB93xx pwm
  *************************************************************************/
 static void __init edb93xx_register_pwm(void)
@@ -117,6 +169,8 @@ static void __init edb93xx_init_machine(void)
 	edb93xx_register_flash();
 	ep93xx_register_eth(&edb93xx_eth_data, 1);
 	edb93xx_register_i2c();
+	edb93xx_register_spi();
+	edb93xx_register_i2s();
 	edb93xx_register_pwm();
 }

             reply	other threads:[~2011-01-23  0:51 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-23  0:51 Alexander Sverdlin [this message]
2011-01-24 16:30 ` [PATCH] EDB93xx: Add support for CS4271 CODEC on EDB93xx boards H Hartley Sweeten
2011-01-25 11:46   ` Mark Brown
2011-01-25 12:08     ` Alexander Sverdlin
  -- strict thread matches above, loose matches on Subject: below --
2011-02-01 23:40 Alexander Sverdlin
2011-02-02  0:02 ` H Hartley Sweeten
2011-02-02 10:48   ` Alexander Sverdlin
2011-02-02 10:49     ` Mark Brown
2011-02-02 11:12       ` Alexander Sverdlin
2011-02-02 12:53         ` Mark Brown
2011-02-02 13:26           ` Alexander Sverdlin
2011-02-02 16:53             ` H Hartley Sweeten
2011-02-02 17:00               ` Mark Brown
2011-02-02 17:21                 ` H Hartley Sweeten
2011-02-02 17:33                 ` Alexander Sverdlin
2011-02-02 17:48                   ` H Hartley Sweeten
2011-02-02 18:31                   ` Mark Brown
2011-02-02 18:18             ` H Hartley Sweeten
2011-02-02 16:45     ` H Hartley Sweeten
2011-02-02  7:54 ` Mika Westerberg
2011-02-02 10:51 ` 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=1295743884.14515.35.camel@r60e \
    --to=subaparts@yandex.ru \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=buytenh@wantstofly.org \
    --cc=dp@opensource.wolfsonmicro.com \
    --cc=george@chas.com.ua \
    --cc=hsweeten@visionengravers.com \
    --cc=lrg@slimlogic.co.uk \
    /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).