(MCF5485EVB, Linux 2.6.25) Trouble getting second SPI device probe() function to run

cancel
Showing results for 
Search instead for 
Did you mean: 

(MCF5485EVB, Linux 2.6.25) Trouble getting second SPI device probe() function to run

1,142 Views
jkimble
Contributor III

Hi all,

 

I'm running a customized deriviative of the MCF5485EVB board with the 2.6.25 linux BSP (with many mods for our hardware). I've got an ADS7846 touch screen encoder tied to my spi bus and this is working fine. Now I'm trying to add a rtc-ds1306  real time clock device to the SPI bus and I cannot get it to run the probe function. The "ds1305_init()" function gets called but never the probe. It's making me crazy. I can't even debug it without it getting that far. So far the mods I've made to the 547x_8x-devices.c file look like the attached file.

 

My biggest confusion is with the following:

 

static int ads7846_get_pendown_state ( void )
{
    return ( !(MCF_EPPDR & 0x10) );    /* FIXME: magic number 0x10 */
}

static struct coldfire_dspi_chip coldfire_dspi_chip_info =
{
    .bits_per_word = 8,
};

static struct ads7846_platform_data ads7846_chip_info =
{
    .model              = 7846,
    .vref_delay_usecs   = 0,
    .keep_vref_on       = 0,
    .settle_delay_usecs = 0,
    .get_pendown_state  = ads7846_get_pendown_state,
};

static struct ds1305_platform_data ds1305_chip_info =
{
    .is_ds1306 = true,
    .en_1hz    = true,
};

static struct spi_board_info spi_board_info[] =
{
    {
        .modalias        = "ads7846",
        .platform_data   = &ads7846_chip_info,
        .controller_data = &coldfire_dspi_chip_info,
        .irq             = 64 + ISC_EPORT_Fn(4),
        .max_speed_hz    = 1000000, /* Speeds exceeding 1MHz cause TS issues */
        .bus_num         = 1,
        .chip_select     = 3,       /* "post-demux" CS3 (touchscreen controller) */
    },
    {
        .modalias        = "ds1305",
        .platform_data   = &ds1305_chip_info,
        .controller_data = &coldfire_dspi_chip_info,
        .irq             = 64 + ISC_EPORT_Fn(4),
        .max_speed_hz    = 1000000, /* Speeds exceeding 1MHz cause TS issues */
        .bus_num         = 1,
        .chip_select     = 4,       /* "post-demux" CS3 (touchscreen controller) */
    }
};

 

static struct resource coldfire_spi_resources[] = {
        [0] = {
                .name = "spi-par",
                .start = MCF_MBAR + 0x00000a50, /* PAR_DSPI */
                .end = MCF_MBAR + 0x00000a50,   /* PAR_DSPI */
                .flags = IORESOURCE_MEM
        },

        [1] = {
                .name = "spi-module",
                .start = MCF_MBAR + 0x00008a00, /* DSPI MCR Base */
                .end = MCF_MBAR + 0x00008ab8,   /* DSPI mem map end */
                .flags = IORESOURCE_MEM
        },

        [2] = {
                .name = "spi-int-level",
                .start = MCF_MBAR + 0x740,               /* ICR start */
                .end = MCF_MBAR + 0x740 + ISC_DSPI_EOQF, /* ICR end */
                .flags = IORESOURCE_MEM
        },

        [3] = {
                .name = "spi-int-mask",
                .start = MCF_MBAR + 0x70c,      /* IMRL */
                .end = MCF_MBAR + 0x70c,        /* IMRL */
                .flags = IORESOURCE_MEM
        }
};

static struct platform_device coldfire_spi = {
        .name = "spi_coldfire",
        .id = -1,
        .resource = coldfire_spi_resources,
        .num_resources = ARRAY_SIZE(coldfire_spi_resources),
        .dev = {
                .platform_data = &coldfire_master_info,
        }
};

 

 

 

In the end I do a:

 

retval = platform_device_register(&coldfire_spi);

 

And then:

 

retval = spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));

 

With the set of devices configured in the spi_board_info array I just don't get why probe doesn't get called. I thought the call to spi_register_board_info would do that. It does do it for my touchscreen device so how the heck can it "not" do it for the RTC device!! 

 

Clearly I'm missing something important here. Any help much appreciated...

 

 

m547x_8x_devices.c

Message Edited by t.dowe on 2009-09-30 11:30 AM
Labels (1)
0 Kudos
2 Replies

263 Views
pmatil
Contributor I

Hi,

I know this is an old thread and you may have solved this already but recently I've been playing around with another RTC chip and devices.c (yes, devices.c, not m547x_8x_devices.c). The thing that I noticed from your entry for the ds1305 was that you have the modalias as "ds1305". For me the RTC chip is rtc9701 and the modalias is "rtc-r9701". So maybe you should try to change that into "rtc-ds1305" because that is what the module is called. Good luck.

0 Kudos

263 Views
Poloni
Contributor II

Hi jkimble!

 

Did you communicate with this device? I noticed that touch controller is 8-bits, and I'm problems to communicate with this type of device (Ethernet switch). I have AD converter that use 16-bits, and this work fine.

 

Thanks!

Poloni

0 Kudos