@@ -31,7 +31,7 @@
#include <mach/serial.h>
#include <mach/common.h>
#include <mach/asp.h>
-
+#include <mach/spi.h>
#include "clock.h"
#include "mux.h"
@@ -365,9 +365,9 @@ static struct davinci_clk dm355_clks[] = {
CLK(NULL, "asp1", &asp1_clk),
CLK("davinci_mmc.0", NULL, &mmcsd0_clk),
CLK("davinci_mmc.1", NULL, &mmcsd1_clk),
- CLK(NULL, "spi0", &spi0_clk),
- CLK(NULL, "spi1", &spi1_clk),
- CLK(NULL, "spi2", &spi2_clk),
+ CLK("spi_davinci.0", NULL, &spi0_clk),
+ CLK("spi_davinci.1", NULL, &spi1_clk),
+ CLK("spi_davinci.2", NULL, &spi2_clk),
CLK(NULL, "gpio", &gpio_clk),
CLK(NULL, "aemif", &aemif_clk),
CLK(NULL, "pwm0", &pwm0_clk),
@@ -406,12 +406,31 @@ static struct resource dm355_spi0_resources[] = {
*/
};
+/*
+ * The davinci_spi_platform_data can have a "chip_sel" array of GPIOs
+ * For example :
+ * static u8 dm355_spi0_chip_sel[] = {23, 45, DAVINCI_SPI_INTERN_CS};
+ * This array should then become be a part of the platform data
+ * .chip_sel = dm355_spi0_chip_sel,
+ * Appropriately change the 'num_chipselect' in the structure below
+ */
+
+static struct davinci_spi_platform_data dm355_spi0_pdata = {
+ .version = DAVINCI_SPI_VERSION_1,
+ .num_chipselect = 2,
+ .clk_internal = 1,
+ .cs_hold = 1,
+ .intr_level = 0,
+ .poll_mode = 1,
+};
+
static struct platform_device dm355_spi0_device = {
.name = "spi_davinci",
.id = 0,
.dev = {
.dma_mask = &dm355_spi0_dma_mask,
.coherent_dma_mask = DMA_BIT_MASK(32),
+ .platform_data = &dm355_spi0_pdata,
},
.num_resources = ARRAY_SIZE(dm355_spi0_resources),
.resource = dm355_spi0_resources,