diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2014-03-12 15:07:31 +0100 |
---|---|---|
committer | Stefan Agner <stefan.agner@toradex.com> | 2014-03-12 15:07:31 +0100 |
commit | 2f4cb1554a644f481fe315ae34d5974caeafa94b (patch) | |
tree | 0455ac3e44c3e647ef4cfc3f2d6129e85de087ab | |
parent | 6e321f784be67474a886301d9f5dcc07475c8025 (diff) |
mvf: clock/colibri_vf: add dspi1 clock definition/enable dspi1
Enable Colibri SPI pins using DSPI1. Define required clocks for
DSPI1 and initialize the device on init. Currently the device
is available through spidev (/dev/spidev1.0).
-rw-r--r-- | arch/arm/configs/colibri_vf_defconfig | 2 | ||||
-rw-r--r-- | arch/arm/mach-mvf/board-colibri_vf.c | 22 | ||||
-rw-r--r-- | arch/arm/mach-mvf/clock.c | 10 |
3 files changed, 31 insertions, 3 deletions
diff --git a/arch/arm/configs/colibri_vf_defconfig b/arch/arm/configs/colibri_vf_defconfig index 8a505ac4b565..5c6a1f8f6088 100644 --- a/arch/arm/configs/colibri_vf_defconfig +++ b/arch/arm/configs/colibri_vf_defconfig @@ -203,7 +203,7 @@ CONFIG_I2C_CHARDEV=y CONFIG_I2C_IMX=y CONFIG_SPI=y CONFIG_SPI_MVF=y -CONFIG_SPI_MVF_DSPI_EDMA=y +# CONFIG_SPI_MVF_DSPI_EDMA is not set CONFIG_SPI_SPIDEV=y CONFIG_GPIO_SYSFS=y CONFIG_POWER_SUPPLY=y diff --git a/arch/arm/mach-mvf/board-colibri_vf.c b/arch/arm/mach-mvf/board-colibri_vf.c index e9048676faad..b85c42c3c91e 100644 --- a/arch/arm/mach-mvf/board-colibri_vf.c +++ b/arch/arm/mach-mvf/board-colibri_vf.c @@ -389,7 +389,23 @@ static const struct spi_mvf_master mvf_vf600_spi_data __initconst = { .cs_control = NULL, }; +static struct spi_mvf_chip spidev_chip_info = { + .mode = SPI_MODE_0, + .bits_per_word = 8, + .void_write_data = 0, + .dbr = 0, + .pbr = 0, + .br = 0, + .pcssck = 0, + .pasc = 0, + .pdt = 0, + .cssck = 0, + .asc = 0, + .dt = 0, +}; + static struct spi_board_info mvf_spi_board_info[] __initdata = { +#if defined(CONFIG_SPI_MVF) { .bus_num = 1, /* DSPI1: Colibri SSP */ .chip_select = 0, @@ -398,7 +414,9 @@ static struct spi_board_info mvf_spi_board_info[] __initdata = { .modalias = "spidev", .mode = SPI_MODE_0, .platform_data = NULL, + .controller_data = &spidev_chip_info, }, +#endif }; static void spi_device_init(void) @@ -609,8 +627,8 @@ static void __init mvf_board_init(void) i2c_register_board_info(0, mxc_i2c0_board_info, ARRAY_SIZE(mxc_i2c0_board_info)); -// mvf_add_dspi(0, &mvf_vf600_spi_data); -// spi_device_init(); + mvf_add_dspi(1, &mvf_vf600_spi_data); + spi_device_init(); mvfa5_add_dcu(0, &mvf_dcu_pdata); mvf_add_mxc_pwm(0); diff --git a/arch/arm/mach-mvf/clock.c b/arch/arm/mach-mvf/clock.c index e1637a4a36d2..7c95a2638128 100644 --- a/arch/arm/mach-mvf/clock.c +++ b/arch/arm/mach-mvf/clock.c @@ -1240,6 +1240,15 @@ static struct clk dspi_clk[] = { .enable = _clk_enable, .disable = _clk_disable, }, + { + __INIT_CLK_DEBUG(dspi1_clk) + .id = 1, + .parent = &ipg_clk, + .enable_reg = MXC_CCM_CCGR0, + .enable_shift = MXC_CCM_CCGRx_CG13_OFFSET, + .enable = _clk_enable, + .disable = _clk_disable, + }, }; static int _clk_esdhc1_set_parent(struct clk *clk, struct clk *parent) @@ -2052,6 +2061,7 @@ static struct clk_lookup lookups[] = { _REGISTER_CLOCK(NULL, "mvf-uart.2", uart_clk[0]), _REGISTER_CLOCK(NULL, "mvf-uart.3", uart_clk[0]), _REGISTER_CLOCK("mvf-dspi.0", NULL, dspi_clk[0]), + _REGISTER_CLOCK("mvf-dspi.1", NULL, dspi_clk[1]), _REGISTER_CLOCK("pit", NULL, pit_clk), _REGISTER_CLOCK("fec.0", NULL, enet_clk[0]), _REGISTER_CLOCK("fec.1", NULL, enet_clk[1]), |