LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* platform_driver_register() ??
@ 2007-07-03  7:28 Midhun Agnihotram
  2007-07-03 12:58 ` Nobin Mathew
  0 siblings, 1 reply; 5+ messages in thread
From: Midhun Agnihotram @ 2007-07-03  7:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Pierre Ossman

Hi All,

  I have an MMC driver for my kit (i.MX21 based cogent board
CSB535FS), which is supplied by Cogent (Kernel version 2.6.16).

   The original driver (linux/drivers/mmc/mmc_block.c) uses
mmc_register_driver() method to register the driver but the one
supplied by Cogent uses platform_driver_register() method. What is the
difference between the two?


Thanks,
Midhun.

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

* Re: platform_driver_register() ??
  2007-07-03  7:28 platform_driver_register() ?? Midhun Agnihotram
@ 2007-07-03 12:58 ` Nobin Mathew
  2007-07-03 19:15   ` Pierre Ossman
  0 siblings, 1 reply; 5+ messages in thread
From: Nobin Mathew @ 2007-07-03 12:58 UTC (permalink / raw)
  To: Midhun Agnihotram; +Cc: linux-kernel, Pierre Ossman

Hi Midhun,
    I think mmc driver is layered modules, only top block driver
registers driver under  "mmc_bus_type" bus, see
drivers/mmc/mmc_sysfs.c and mmc_block.c. I think they are creating a
tree of devices of same characteristics under that bus.
I think your driver is linux/drivers/mmc/imxmmc.c where it registers a
driver for device of type "platform_bus_type". This module will come
under above mentioned block driver.
Corresponding platform device is registered in
linux/arch/arm/mach-imx/generic.c see platform_device imx_mmc_device.

Nobin Mathew




On 7/3/07, Midhun Agnihotram <agnimidhun@gmail.com> wrote:
> Hi All,
>
>  I have an MMC driver for my kit (i.MX21 based cogent board
> CSB535FS), which is supplied by Cogent (Kernel version 2.6.16).
>
>   The original driver (linux/drivers/mmc/mmc_block.c) uses
> mmc_register_driver() method to register the driver but the one
> supplied by Cogent uses platform_driver_register() method. What is the
> difference between the two?
>
>
> Thanks,
> Midhun.
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

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

* Re: platform_driver_register() ??
  2007-07-03 12:58 ` Nobin Mathew
@ 2007-07-03 19:15   ` Pierre Ossman
  2007-07-05  9:21     ` Midhun Agnihotram
  0 siblings, 1 reply; 5+ messages in thread
From: Pierre Ossman @ 2007-07-03 19:15 UTC (permalink / raw)
  To: Nobin Mathew; +Cc: Midhun Agnihotram, linux-kernel

On Tue, 3 Jul 2007 18:28:40 +0530
"Nobin Mathew" <nobin.mathew@gmail.com> wrote:

> Hi Midhun,
>     I think mmc driver is layered modules, only top block driver
> registers driver under  "mmc_bus_type" bus, see
> drivers/mmc/mmc_sysfs.c and mmc_block.c. I think they are creating a
> tree of devices of same characteristics under that bus.
> I think your driver is linux/drivers/mmc/imxmmc.c where it registers a
> driver for device of type "platform_bus_type". This module will come
> under above mentioned block driver.
> Corresponding platform device is registered in
> linux/arch/arm/mach-imx/generic.c see platform_device imx_mmc_device.
> 

Indeed. You seem to have the hang of this ;)

Rgds
-- 
     -- Pierre Ossman

  Linux kernel, MMC maintainer        http://www.kernel.org
  PulseAudio, core developer          http://pulseaudio.org
  rdesktop, core developer          http://www.rdesktop.org

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

* Re: platform_driver_register() ??
  2007-07-03 19:15   ` Pierre Ossman
@ 2007-07-05  9:21     ` Midhun Agnihotram
  2007-07-08 12:23       ` Pierre Ossman
  0 siblings, 1 reply; 5+ messages in thread
From: Midhun Agnihotram @ 2007-07-05  9:21 UTC (permalink / raw)
  To: Pierre Ossman; +Cc: Nobin Mathew, linux-kernel

Hi All,


> >     I think mmc driver is layered modules, only top block driver
> > registers driver under  "mmc_bus_type" bus, see
> > drivers/mmc/mmc_sysfs.c and mmc_block.c. I think they are creating a
> > tree of devices of same characteristics under that bus.
> > I think your driver is linux/drivers/mmc/imxmmc.c where it registers a
> > driver for device of type "platform_bus_type". This module will come
> > under above mentioned block driver.
> > Corresponding platform device is registered in
> > linux/arch/arm/mach-imx/generic.c see platform_device imx_mmc_device.


    Is it necessary that the firmware (may be bootloader) notify about
the MMC host to Linux? The kernel documentation (platform.txt) says :

 "The firmware should notify the platform bus about devices before the
legacy drivers have had a chance to load."

   Have I interpreted the above sentence correctly?

Thanks,
Midhun.

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

* Re: platform_driver_register() ??
  2007-07-05  9:21     ` Midhun Agnihotram
@ 2007-07-08 12:23       ` Pierre Ossman
  0 siblings, 0 replies; 5+ messages in thread
From: Pierre Ossman @ 2007-07-08 12:23 UTC (permalink / raw)
  To: Midhun Agnihotram; +Cc: Nobin Mathew, linux-kernel

On Thu, 5 Jul 2007 14:51:35 +0530
"Midhun Agnihotram" <agnimidhun@gmail.com> wrote:

> 
>     Is it necessary that the firmware (may be bootloader) notify about
> the MMC host to Linux? The kernel documentation (platform.txt) says :
> 
>  "The firmware should notify the platform bus about devices before the
> legacy drivers have had a chance to load."
> 
>    Have I interpreted the above sentence correctly?
> 

I don't know what the meaning of that sentence was supposed to be, but
platform devices are everything the kernel cannot probe in a "normal"
way. Usually this covers devices that cannot be probed at all, but must
be listed some other way (i.e. manually).

Commonly the arch and machine specific code adds the devices. The
machine code is usually specific to a certain hardware, so the code
"knows" which devices are present, even though it can't probe them.

So to answer your question; no, the firmware doesn't have to tell Linux
about the devices.

Rgds
-- 
     -- Pierre Ossman

  Linux kernel, MMC maintainer        http://www.kernel.org
  PulseAudio, core developer          http://pulseaudio.org
  rdesktop, core developer          http://www.rdesktop.org

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

end of thread, other threads:[~2007-07-08 12:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-03  7:28 platform_driver_register() ?? Midhun Agnihotram
2007-07-03 12:58 ` Nobin Mathew
2007-07-03 19:15   ` Pierre Ossman
2007-07-05  9:21     ` Midhun Agnihotram
2007-07-08 12:23       ` Pierre Ossman

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).