Why can't I use m25p80 and spidev simultaneously?
If each one of them is in separate bus (SSP2 and SSP3), for example?
- I've edited my board info like this in mx28evk.c:
static struct spi_board_info spi_board_info[] __initdata = {
#if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE)
{
/* the modalias must be the same as spi device driver name */
.modalias = "m25p80", /* Name of spi_driver for this device */
.max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
.bus_num = 1, /* Framework bus number */
.chip_select = 0, /* Framework chip select. */
.platform_data = &mx28_spi_flash_data,
},
#endif
{
.modalias = "spidev",
.max_speed_hz = 20000000,
.bus_num = 2,
.chip_select = 0,
.mode = SPI_MODE_0,
},
};
- in addition I've added support for SSP3 in device.c:
static struct mxs_spi_platform_data spi1_data = {
.clk = "ssp.3",
.slave_mode = 0,
};
static struct resource ssp3_resources[] = {
{
.start = SSP3_PHYS_ADDR,
.end = SSP3_PHYS_ADDR + 0x2000 - 1,
.flags = IORESOURCE_MEM,
}, {
.start = MXS_DMA_CHANNEL_AHB_APBH_SSP3,
.end = MXS_DMA_CHANNEL_AHB_APBH_SSP3,
.flags = IORESOURCE_DMA,
}, {
.start = IRQ_SSP3_DMA,
.end = IRQ_SSP3_DMA,
.flags = IORESOURCE_IRQ,
}, {
.start = IRQ_SSP3,
.end = IRQ_SSP3,
.flags = IORESOURCE_IRQ,
},
};
static void __init mx28_init_spi1(void)
{
struct platform_device *pdev;
pdev = mxs_get_device("mxs-spi", 1);
if (pdev == NULL || IS_ERR(pdev))
return;
pdev->resource = ssp3_resources;
pdev->num_resources = ARRAY_SIZE(ssp3_resources);
pdev->dev.platform_data = &spi1_data;
mxs_add_device(pdev, 3);
}
- and, of course, defined the SSP3 pins in mx28evk_pins.c:
#if defined(CONFIG_SPI_MXS) || defined(CONFIG_SPI_MXS_MODULE)
static struct pin_desc mx28evk_spi_pins[] = {
{
.name = "SSP2 MOSI",
.id = PINID_SSP2_MOSI,
.fun = PIN_FUN1,
.strength = PAD_4MA,
.voltage = PAD_3_3V,
.drive = 1,
},
{
.name = "SSP2 MISO",
.id = PINID_SSP2_MISO,
.fun = PIN_FUN1,
.strength = PAD_4MA,
.voltage = PAD_3_3V,
.drive = 1,
},
{
.name = "SSP2 SCK",
.id = PINID_SSP2_SCK,
.fun = PIN_FUN1,
.strength = PAD_4MA,
.voltage = PAD_3_3V,
.drive = 1,
},
{
.name = "SSP2 SS0",
.id = PINID_SSP2_SS0,
.fun = PIN_FUN1,
.strength = PAD_8MA,
.voltage = PAD_3_3V,
.drive = 1,
},
{
.name = "SSP3 MOSI",
.id = PINID_SSP3_MOSI,
.fun = PIN_FUN1,
.strength = PAD_4MA,
.voltage = PAD_3_3V,
.drive = 1,
},
{
.name = "SSP3 MISO",
.id = PINID_SSP3_MISO,
.fun = PIN_FUN1,
.strength = PAD_4MA,
.voltage = PAD_3_3V,
.drive = 1,
},
{
.name = "SSP3 SCK",
.id = PINID_SSP3_SCK,
.fun = PIN_FUN1,
.strength = PAD_4MA,
.voltage = PAD_3_3V,
.drive = 1,
},
{
.name = "SSP3 SS0",
.id = PINID_SSP3_SS0,
.fun = PIN_FUN1,
.strength = PAD_8MA,
.voltage = PAD_3_3V,
.drive = 1,
},
};
#endif
But still SPIDEV won't create the device driver...
The m25p80 is working fine though...
Thanks a lot for anyone's help with this.....