summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>2014-05-09 14:43:07 +0200
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2014-05-09 14:43:07 +0200
commit277321a36fcc2fde4baa61568b3b116e42a188e9 (patch)
treed698ccb02673843b8b2c542b1be742d580d9cd0b
parent059383eea2120cf0cb3fd5e15dc0f09b38ad5bc1 (diff)
colibri t20/t30: add spi controller platform data for hw cs
Add SPI controller platform data required for use of hardware chip selects. While at it pull-up SPI chip select pin due to NVIDIA's designers taking the term chip select a little too personal: they indeed only select a chip otherwise all the chip select pins are just left floating!
-rw-r--r--arch/arm/mach-tegra/board-colibri_t20-pinmux.c4
-rw-r--r--arch/arm/mach-tegra/board-colibri_t20.c28
-rw-r--r--arch/arm/mach-tegra/board-colibri_t30-pinmux.c4
-rw-r--r--arch/arm/mach-tegra/board-colibri_t30.c28
4 files changed, 42 insertions, 22 deletions
diff --git a/arch/arm/mach-tegra/board-colibri_t20-pinmux.c b/arch/arm/mach-tegra/board-colibri_t20-pinmux.c
index 85a28213dbe2..e84e7958ff16 100644
--- a/arch/arm/mach-tegra/board-colibri_t20-pinmux.c
+++ b/arch/arm/mach-tegra/board-colibri_t20-pinmux.c
@@ -1,7 +1,7 @@
/*
* arch/arm/mach-tegra/board-colibri_t20-pinmux.c
*
- * Copyright (C) 2011 Toradex, Inc.
+ * Copyright (c) 2011-2014 Toradex, Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
@@ -283,7 +283,7 @@ static __initdata struct tegra_pingroup_config colibri_t20_pinmux[] = {
/* SPI4 */
{TEGRA_PINGROUP_SLXA, TEGRA_MUX_SPI4, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
- {TEGRA_PINGROUP_SLXC, TEGRA_MUX_SPI4, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
+ {TEGRA_PINGROUP_SLXC, TEGRA_MUX_SPI4, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL},
{TEGRA_PINGROUP_SLXD, TEGRA_MUX_SPI4, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
{TEGRA_PINGROUP_SLXK, TEGRA_MUX_SPI4, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL},
diff --git a/arch/arm/mach-tegra/board-colibri_t20.c b/arch/arm/mach-tegra/board-colibri_t20.c
index cb160adb4f17..35e483e79653 100644
--- a/arch/arm/mach-tegra/board-colibri_t20.c
+++ b/arch/arm/mach-tegra/board-colibri_t20.c
@@ -29,6 +29,7 @@
#include <linux/platform_device.h>
#include <linux/reboot.h>
#include <linux/serial_8250.h>
+#include <linux/spi-tegra.h>
#include <linux/spi/spi.h>
#if defined(CONFIG_SPI_GPIO) || defined(CONFIG_SPI_GPIO_MODULE)
#include <linux/spi/spi_gpio.h>
@@ -292,6 +293,8 @@ static int __init colibri_t20_mcp2515_setup(struct spi_device *spi)
return 0;
}
+static struct tegra_spi_device_controller_data spi_controller_data;
+
static struct mcp251x_platform_data mcp251x_pdata = {
.board_specific_setup = colibri_t20_mcp2515_setup,
.oscillator_frequency = 16000000,
@@ -310,7 +313,7 @@ static struct spi_board_info mcp251x_board_info[] = {
#ifdef MECS_TELLURIUM_XPOD2
.controller_data = (void *) CAN_CS_GPIO,
#else
-// .controller_data = ,
+ .controller_data = &spi_controller_data,
#endif
.max_speed_hz = 10000000,
.modalias = "mcp2515",
@@ -952,19 +955,26 @@ static struct platform_device xpod2_spi_device = {
#endif /* CONFIG_SPI_GPIO | CONFIG_SPI_GPIO_MODULE */
#if defined(CONFIG_SPI_TEGRA) && defined(CONFIG_SPI_SPIDEV)
+static struct tegra_spi_device_controller_data spi_controller_data = {
+ .cs_hold_clk_count = 1,
+ .cs_setup_clk_count = 1,
+ .is_hw_based_cs = 1,
+};
+
static struct spi_board_info tegra_spi_devices[] __initdata = {
{
- .bus_num = 3, /* SPI4: Colibri SSP */
+ .bus_num = 3, /* SPI4: Colibri SSP */
#if !defined(CONFIG_CAN_MCP251X) && !defined(CONFIG_CAN_MCP251X_MODULE)
- .chip_select = 0,
+ .chip_select = 0,
#else /* !CONFIG_CAN_MCP251X & !CONFIG_CAN_MCP251X_MODULE */
- .chip_select = 1,
+ .chip_select = 1,
#endif /* !CONFIG_CAN_MCP251X & !CONFIG_CAN_MCP251X_MODULE */
- .irq = 0,
- .max_speed_hz = 50000000,
- .modalias = "spidev",
- .mode = SPI_MODE_0,
- .platform_data = NULL,
+ .controller_data = &spi_controller_data,
+ .irq = 0,
+ .max_speed_hz = 50000000,
+ .modalias = "spidev",
+ .mode = SPI_MODE_0,
+ .platform_data = NULL,
},
};
diff --git a/arch/arm/mach-tegra/board-colibri_t30-pinmux.c b/arch/arm/mach-tegra/board-colibri_t30-pinmux.c
index f02060c3d535..a4f21cfe6e25 100644
--- a/arch/arm/mach-tegra/board-colibri_t30-pinmux.c
+++ b/arch/arm/mach-tegra/board-colibri_t30-pinmux.c
@@ -1,7 +1,7 @@
/*
* arch/arm/mach-tegra/board-colibri_t30-pinmux.c
*
- * Copyright (C) 2012 Toradex, Inc.
+ * Copyright (c) 2012-2014 Toradex, Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
@@ -595,7 +595,7 @@ static __initdata struct tegra_pingroup_config colibri_t30_pinmux[] = {
DEFAULT_PINMUX(ULPI_DIR, SPI1, NORMAL, NORMAL, INPUT),
DEFAULT_PINMUX(ULPI_NXT, SPI1, NORMAL, NORMAL, INPUT),
//multiplexed SDMMC3_DAT6
- DEFAULT_PINMUX(ULPI_STP, SPI1, NORMAL, NORMAL, INPUT),
+ DEFAULT_PINMUX(ULPI_STP, SPI1, PULL_UP, NORMAL, INPUT),
//VI pins are all input level-shifted and multiplexed
//unused VI pins could disable input drivers
diff --git a/arch/arm/mach-tegra/board-colibri_t30.c b/arch/arm/mach-tegra/board-colibri_t30.c
index bd1f63b7c3ef..39f0b7c7d8a0 100644
--- a/arch/arm/mach-tegra/board-colibri_t30.c
+++ b/arch/arm/mach-tegra/board-colibri_t30.c
@@ -26,8 +26,8 @@
#include <linux/platform_data/tegra_usb.h>
#include <linux/platform_device.h>
#include <linux/serial_8250.h>
-#include <linux/spi/spi.h>
#include <linux/spi-tegra.h>
+#include <linux/spi/spi.h>
#include <linux/tegra_uart.h>
#include <mach/io_dpd.h>
@@ -260,6 +260,8 @@ static int __init colibri_t20_mcp2515_setup(struct spi_device *spi)
return 0;
}
+static struct tegra_spi_device_controller_data spi_controller_data;
+
static struct mcp251x_platform_data mcp251x_pdata = {
.board_specific_setup = colibri_t20_mcp2515_setup,
.oscillator_frequency = 16000000,
@@ -271,6 +273,7 @@ static struct spi_board_info mcp251x_board_info[] = {
{
.bus_num = 0,
.chip_select = 0,
+ .controller_data = &spi_controller_data,
.max_speed_hz = 10000000,
.modalias = "mcp2515",
.platform_data = &mcp251x_pdata,
@@ -776,19 +779,26 @@ static struct platform_device tegra_rtc_device = {
/* SPI */
#if defined(CONFIG_SPI_TEGRA) && defined(CONFIG_SPI_SPIDEV)
+static struct tegra_spi_device_controller_data spi_controller_data = {
+ .cs_hold_clk_count = 1,
+ .cs_setup_clk_count = 1,
+ .is_hw_based_cs = 1,
+};
+
static struct spi_board_info tegra_spi_devices[] __initdata = {
{
- .bus_num = 0, /* SPI1: Colibri SSP */
+ .bus_num = 0, /* SPI1: Colibri SSP */
#if !defined(CONFIG_CAN_MCP251X) && !defined(CONFIG_CAN_MCP251X_MODULE)
- .chip_select = 0,
+ .chip_select = 0,
#else /* !CONFIG_CAN_MCP251X & !CONFIG_CAN_MCP251X_MODULE */
- .chip_select = 1,
+ .chip_select = 1,
#endif /* !CONFIG_CAN_MCP251X & !CONFIG_CAN_MCP251X_MODULE */
- .irq = 0,
- .max_speed_hz = 50000000,
- .modalias = "spidev",
- .mode = SPI_MODE_0,
- .platform_data = NULL,
+ .controller_data = &spi_controller_data,
+ .irq = 0,
+ .max_speed_hz = 50000000,
+ .modalias = "spidev",
+ .mode = SPI_MODE_0,
+ .platform_data = NULL,
},
};