Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67329
b: refs/heads/master
c: 8237bf0
h: refs/heads/master
i:
  67327: 4b07e22
v: v3
  • Loading branch information
Anton Vorontsov authored and Kumar Gala committed Sep 14, 2007
1 parent 0eaa1ff commit d339468
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 26f6cb999366a71b8e318bceaf8fafc1ffecae40
refs/heads/master: 8237bf080e9ef6adc3f2adce26060722685bbb15
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/boot/dts/mpc832x_rdb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
reg = <4c0 40>;
interrupts = <2>;
interrupt-parent = <&qeic>;
mode = "cpu";
mode = "cpu-qe";
};

spi@500 {
Expand Down
46 changes: 46 additions & 0 deletions trunk/arch/powerpc/platforms/83xx/mpc832x_rdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@
*/

#include <linux/pci.h>
#include <linux/spi/spi.h>

#include <asm/of_platform.h>
#include <asm/time.h>
#include <asm/ipic.h>
#include <asm/udbg.h>
#include <asm/qe.h>
#include <asm/qe_ic.h>
#include <sysdev/fsl_soc.h>

#include "mpc83xx.h"

Expand All @@ -32,6 +34,50 @@
#define DBG(fmt...)
#endif

static void mpc83xx_spi_activate_cs(u8 cs, u8 polarity)
{
pr_debug("%s %d %d\n", __func__, cs, polarity);
par_io_data_set(3, 13, polarity);
}

static void mpc83xx_spi_deactivate_cs(u8 cs, u8 polarity)
{
pr_debug("%s %d %d\n", __func__, cs, polarity);
par_io_data_set(3, 13, !polarity);
}

static struct spi_board_info mpc832x_spi_boardinfo = {
.bus_num = 0x4c0,
.chip_select = 0,
.max_speed_hz = 50000000,
/*
* XXX: This is spidev (spi in userspace) stub, should
* be replaced by "mmc_spi" when mmc_spi will hit mainline.
*/
.modalias = "spidev",
};

static int __init mpc832x_spi_init(void)
{
if (!machine_is(mpc832x_rdb))
return 0;

par_io_config_pin(3, 0, 3, 0, 1, 0); /* SPI1 MOSI, I/O */
par_io_config_pin(3, 1, 3, 0, 1, 0); /* SPI1 MISO, I/O */
par_io_config_pin(3, 2, 3, 0, 1, 0); /* SPI1 CLK, I/O */
par_io_config_pin(3, 3, 2, 0, 1, 0); /* SPI1 SEL, I */

par_io_config_pin(3, 13, 1, 0, 0, 0); /* !SD_CS, O */
par_io_config_pin(3, 14, 2, 0, 0, 0); /* SD_INSERT, I */
par_io_config_pin(3, 15, 2, 0, 0, 0); /* SD_PROTECT,I */

return fsl_spi_init(&mpc832x_spi_boardinfo, 1,
mpc83xx_spi_activate_cs,
mpc83xx_spi_deactivate_cs);
}

device_initcall(mpc832x_spi_init);

/* ************************************************************************
*
* Setup the architecture
Expand Down

0 comments on commit d339468

Please sign in to comment.