Commit b07b4e29 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Linus Walleij

ARM: ep93xx: vision_ep9307: add audio support

Add I2S audio support to the vision_ep9307 system.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 25105231
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
#include <linux/spi/mmc_spi.h> #include <linux/spi/mmc_spi.h>
#include <linux/mmc/host.h> #include <linux/mmc/host.h>
#include <sound/cs4271.h>
#include <mach/hardware.h> #include <mach/hardware.h>
#include <linux/platform_data/video-ep93xx.h> #include <linux/platform_data/video-ep93xx.h>
#include <linux/platform_data/spi-ep93xx.h> #include <linux/platform_data/spi-ep93xx.h>
...@@ -168,6 +170,35 @@ static struct i2c_board_info vision_i2c_info[] __initdata = { ...@@ -168,6 +170,35 @@ static struct i2c_board_info vision_i2c_info[] __initdata = {
}, },
}; };
/*************************************************************************
* SPI CS4271 Audio Codec
*************************************************************************/
static struct cs4271_platform_data vision_cs4271_data = {
.gpio_nreset = EP93XX_GPIO_LINE_H(2),
};
static int vision_cs4271_hw_setup(struct spi_device *spi)
{
return gpio_request_one(EP93XX_GPIO_LINE_EGPIO6,
GPIOF_OUT_INIT_HIGH, spi->modalias);
}
static void vision_cs4271_hw_cleanup(struct spi_device *spi)
{
gpio_free(EP93XX_GPIO_LINE_EGPIO6);
}
static void vision_cs4271_hw_cs_control(struct spi_device *spi, int value)
{
gpio_set_value(EP93XX_GPIO_LINE_EGPIO6, value);
}
static struct ep93xx_spi_chip_ops vision_cs4271_hw = {
.setup = vision_cs4271_hw_setup,
.cleanup = vision_cs4271_hw_cleanup,
.cs_control = vision_cs4271_hw_cs_control,
};
/************************************************************************* /*************************************************************************
* SPI Flash * SPI Flash
*************************************************************************/ *************************************************************************/
...@@ -262,12 +293,20 @@ static struct ep93xx_spi_chip_ops vision_spi_mmc_hw = { ...@@ -262,12 +293,20 @@ static struct ep93xx_spi_chip_ops vision_spi_mmc_hw = {
*************************************************************************/ *************************************************************************/
static struct spi_board_info vision_spi_board_info[] __initdata = { static struct spi_board_info vision_spi_board_info[] __initdata = {
{ {
.modalias = "cs4271",
.platform_data = &vision_cs4271_data,
.controller_data = &vision_cs4271_hw,
.max_speed_hz = 6000000,
.bus_num = 0,
.chip_select = 0,
.mode = SPI_MODE_3,
}, {
.modalias = "sst25l", .modalias = "sst25l",
.platform_data = &vision_spi_flash_data, .platform_data = &vision_spi_flash_data,
.controller_data = &vision_spi_flash_hw, .controller_data = &vision_spi_flash_hw,
.max_speed_hz = 20000000, .max_speed_hz = 20000000,
.bus_num = 0, .bus_num = 0,
.chip_select = 0, .chip_select = 1,
.mode = SPI_MODE_3, .mode = SPI_MODE_3,
}, { }, {
.modalias = "mmc_spi", .modalias = "mmc_spi",
...@@ -275,7 +314,7 @@ static struct spi_board_info vision_spi_board_info[] __initdata = { ...@@ -275,7 +314,7 @@ static struct spi_board_info vision_spi_board_info[] __initdata = {
.controller_data = &vision_spi_mmc_hw, .controller_data = &vision_spi_mmc_hw,
.max_speed_hz = 20000000, .max_speed_hz = 20000000,
.bus_num = 0, .bus_num = 0,
.chip_select = 1, .chip_select = 2,
.mode = SPI_MODE_3, .mode = SPI_MODE_3,
}, },
}; };
...@@ -285,6 +324,20 @@ static struct ep93xx_spi_info vision_spi_master __initdata = { ...@@ -285,6 +324,20 @@ static struct ep93xx_spi_info vision_spi_master __initdata = {
.use_dma = 1, .use_dma = 1,
}; };
/*************************************************************************
* I2S Audio
*************************************************************************/
static struct platform_device vision_audio_device = {
.name = "edb93xx-audio",
.id = -1,
};
static void __init vision_register_i2s(void)
{
ep93xx_register_i2s();
platform_device_register(&vision_audio_device);
}
/************************************************************************* /*************************************************************************
* Machine Initialization * Machine Initialization
*************************************************************************/ *************************************************************************/
...@@ -310,6 +363,7 @@ static void __init vision_init_machine(void) ...@@ -310,6 +363,7 @@ static void __init vision_init_machine(void)
ARRAY_SIZE(vision_i2c_info)); ARRAY_SIZE(vision_i2c_info));
ep93xx_register_spi(&vision_spi_master, vision_spi_board_info, ep93xx_register_spi(&vision_spi_master, vision_spi_board_info,
ARRAY_SIZE(vision_spi_board_info)); ARRAY_SIZE(vision_spi_board_info));
vision_register_i2s();
} }
MACHINE_START(VISION_EP9307, "Vision Engraving Systems EP9307") MACHINE_START(VISION_EP9307, "Vision Engraving Systems EP9307")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment