linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Conditions for mydriver_probe to be called
@ 2007-02-06 15:42 DI BACCO ANTONIO - technolabs
  2007-02-06 16:23 ` Vitaly Bordug
  0 siblings, 1 reply; 3+ messages in thread
From: DI BACCO ANTONIO - technolabs @ 2007-02-06 15:42 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 291 bytes --]

I'm realizing a controller driver for the mpc8xx spi master device. My
driver has a mpc8xx_spi_probe method that I expected to be called. I'm
sure that platform_device_register is called for my spi platform_device
but nothing happens,  mpc8xx_spi_probe is not called.
 
Bye,
Antonio.

[-- Attachment #2: Type: text/html, Size: 881 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Conditions for mydriver_probe to be called
  2007-02-06 15:42 Conditions for mydriver_probe to be called DI BACCO ANTONIO - technolabs
@ 2007-02-06 16:23 ` Vitaly Bordug
  2007-02-06 16:32   ` DI BACCO ANTONIO - technolabs
  0 siblings, 1 reply; 3+ messages in thread
From: Vitaly Bordug @ 2007-02-06 16:23 UTC (permalink / raw)
  To: DI BACCO ANTONIO - technolabs; +Cc: linuxppc-embedded

On Tue, 6 Feb 2007 16:42:30 +0100
"DI BACCO ANTONIO - technolabs" <Antonio.DiBacco@technolabs.it> wrote:

> I'm realizing a controller driver for the mpc8xx spi master device. My
> driver has a mpc8xx_spi_probe method that I expected to be called. I'm
> sure that platform_device_register is called for my spi platform_device
> but nothing happens,  mpc8xx_spi_probe is not called.
I'd dump ppc_sys.c in the place where it puts devices into the bus, and peek into driver_register.
Note that for 8xx, spi normally resides on scc, so you'll have to use ...set_func and ...device_enable() stuff (see in ppc_sys.c for exact prototypes) to have foo-bar-scc:spi or alike registered on bus.

-- 
Sincerely, 
Vitaly

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: Conditions for mydriver_probe to be called
  2007-02-06 16:23 ` Vitaly Bordug
@ 2007-02-06 16:32   ` DI BACCO ANTONIO - technolabs
  0 siblings, 0 replies; 3+ messages in thread
From: DI BACCO ANTONIO - technolabs @ 2007-02-06 16:32 UTC (permalink / raw)
  To: Vitaly Bordug; +Cc: linuxppc-embedded

>Note that for 8xx, spi normally resides on scc, so you'll have to use
...set_func and >...device_enable() stuff (see in ppc_sys.c for exact
prototypes) to have foo-bar-scc:spi or=20
> alike registered on bus.

In my MPC880 the SPI is a standalone device not an SCC.=20

I found my problem, and I'm sorry that I disturbed the community for a
stupid mistake. Anyway I'm answering because someone could meet the same
problem.

In mpc8xx_devices.c I addedd the following:

        [MPC8xx_CPM_SPI] =3D {
                .name =3D "fsl-cpm-spi",
                .id     =3D 1,
                .num_resources  =3D 3,
                .resource =3D (struct resource[]) {
                        {
                                .name   =3D "regs",
                                .start  =3D 0xaa0,
                                .end    =3D 0xab1,
                                .flags  =3D IORESOURCE_MEM,
                        },
                        {
                                .name   =3D "pram",
                                .start  =3D 0x3d80,
                                .end    =3D 0x3daf,
                                .flags  =3D IORESOURCE_MEM,

                        },
                        {
                                .name   =3D "interrupt",
                                .start  =3D MPC8xx_INT_SPI,
                                .end    =3D MPC8xx_INT_SPI,
                                .flags  =3D IORESOURCE_IRQ,
                        },
                },
        },

But by mistake I registered mydriver with fsl_cpm_spi (with underscores
instead of -). The driver name should match the name in platform_device
structure or at least the default match function should be overriden.

I'm a newbie don't trust me completely (wait for an expert
confirmation).=20

Bye and thank you,
Antonio.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-02-06 16:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-06 15:42 Conditions for mydriver_probe to be called DI BACCO ANTONIO - technolabs
2007-02-06 16:23 ` Vitaly Bordug
2007-02-06 16:32   ` DI BACCO ANTONIO - technolabs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).