1. 23 10月, 2010 4 次提交
  2. 22 10月, 2010 1 次提交
    • G
      of/device: Rework to use common platform_device_alloc() for allocating devices · 7096d042
      Grant Likely 提交于
      The current code allocates and manages platform_devices created from
      the device tree manually.  It also uses an unsafe shortcut for
      allocating the platform_device and the resource table at the same
      time. (which I added in the last rework; sorry).
      
      This patch refactors the code to use platform_device_alloc() for
      allocating new devices.  This reduces the amount of custom code
      implemented by of_platform, eliminates the unsafe alloc trick, and has
      the side benefit of letting the platform_bus code manage freeing the
      device data and resources when the device is freed.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Michal Simek <monstr@monstr.eu>
      7096d042
  3. 06 8月, 2010 3 次提交
  4. 24 7月, 2010 2 次提交
    • G
      of: Merge of_platform_bus_type with platform_bus_type · eca39301
      Grant Likely 提交于
      of_platform_bus was being used in the same manner as the platform_bus.
      The only difference being that of_platform_bus devices are generated
      from data in the device tree, and platform_bus devices are usually
      statically allocated in platform code.  Having them separate causes
      the problem of device drivers having to be registered twice if it
      was possible for the same device to appear on either bus.
      
      This patch removes of_platform_bus_type and registers all of_platform
      bus devices and drivers on the platform bus instead.  A previous patch
      made the of_device structure an alias for the platform_device structure,
      and a shim is used to adapt of_platform_drivers to the platform bus.
      
      After all of of_platform_bus drivers are converted to be normal platform
      drivers, the shim code can be removed.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      eca39301
    • G
      drivercore/of: Add OF style matching to platform bus · 05212157
      Grant Likely 提交于
      As part of the merge between platform bus and of_platform bus, add the
      ability to do of-style matching to the platform bus.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      CC: Michal Simek <monstr@monstr.eu>
      CC: Grant Likely <grant.likely@secretlab.ca>
      CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      CC: Stephen Rothwell <sfr@canb.auug.org.au>
      CC: linux-kernel@vger.kernel.org
      CC: microblaze-uclinux@itee.uq.edu.au
      CC: linuxppc-dev@ozlabs.org
      CC: devicetree-discuss@lists.ozlabs.org
      05212157
  5. 22 5月, 2010 1 次提交
  6. 18 5月, 2010 1 次提交
  7. 13 5月, 2010 1 次提交
    • P
      driver core: Early dev_name() depends on slab_is_available(). · 06fe53be
      Paul Mundt 提交于
      The early dev_name() setup needs to do an allocation which can only be
      satisfied under slab_is_available() conditions. Some of the early
      platform drivers may be initialized before this point, and those still
      need to contend themselves with an empty dev_name.
      
      This fixes up a regression with the SH earlyprintk which was bailing out
      prior to hitting the early probe path due to not being able to satisfy
      the early allocation. Other early platform drivers (such as the early
      timers) that need to match the dev name are sufficiently late that
      allocations are already possible.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      06fe53be
  8. 11 5月, 2010 1 次提交
  9. 29 3月, 2010 1 次提交
  10. 19 3月, 2010 2 次提交
  11. 10 3月, 2010 1 次提交
    • P
      driver core: Early dev_name() support. · a636ee7f
      Paul Mundt 提交于
      Presently early platform devices suffer from the fact they are unable to
      use dev_xxx() calls early on due to dev_name() and others being
      unavailable at the time ->probe() is called.
      
      This implements early init_name construction from the matched name/id
      pair following the semantics of the late device/driver match. As a
      result, matched IDs (inclusive of requested ones) are preserved when the
      handoff from the early platform code happens at kobject initialization
      time.
      
      Since we still require kmalloc slabs to be available at this point, using
      kstrdup() for establishing the init_name works fine. This subsequently
      needs to be tested from dev_name() prior to the init_name being cleared
      by the driver core. We don't kfree() since others will already have a
      handle on the string long before the kobject initialization takes place.
      
      This is also needed to permit drivers to use the clock framework early,
      without having to manually construct their own device IDs from the match
      id/name pair locally (needed by the early console and timer code on sh
      and arm).
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      a636ee7f
  12. 08 3月, 2010 3 次提交
  13. 24 12月, 2009 1 次提交
  14. 12 12月, 2009 1 次提交
    • M
      Driver Core: Early platform driver buffer · c60e0504
      Magnus Damm 提交于
      Add early_platform_init_buffer() support and update the
      early platform driver code to allow passing parameters
      to the driver on the kernel command line.
      
      early_platform_init_buffer() simply allows early platform
      drivers to provide a pointer and length to a memory area
      where the remaining part of the kernel command line option
      will be stored.
      
      Needed to pass baud rate and other serial port options
      to the reworked early serial console code on SuperH.
      Signed-off-by: NMagnus Damm <damm@opensource.se>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      c60e0504
  15. 31 10月, 2009 1 次提交
  16. 16 9月, 2009 1 次提交
  17. 23 8月, 2009 1 次提交
  18. 11 8月, 2009 1 次提交
    • M
      PM / Driver Core: Kill dev_pm_ops platform warning for now · 651b1f12
      Magnus Damm 提交于
      Commit 783ea7d4
      (Driver Core: Rework platform suspend/resume, print warning)
      added a warning message printed for platform drivers that use the
      legacy PM callbacks rather than struct dev_pm_ops.  Unfortunately,
      this resulted in some confusion and made some people try to convert
      drivers by replacing the old callbacks with struct dev_pm_ops in
      automatic way, which generally is not a good idea.
      
      Remove the platform device runtime dev_pm_ops warning for now,
      because it's annoying to users and it's not really necessary right
      now.
      
      [rjw: Modified the changelog to be more informative.]
      Signed-off-by: NMagnus Damm <damm@igel.co.jp>
      Acked-by: NGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      651b1f12
  19. 25 7月, 2009 1 次提交
  20. 24 7月, 2009 1 次提交
  21. 22 7月, 2009 1 次提交
  22. 16 6月, 2009 2 次提交
  23. 13 6月, 2009 1 次提交
  24. 09 5月, 2009 3 次提交
    • G
      Revert driver core: move platform_data into platform_device · e67c8562
      Greg Kroah-Hartman 提交于
      This reverts commit 006f4571:
      
      	This patch moves platform_data from struct device into
      	struct platform_device, based on the two ideas:
      
      	1. Now all platform_driver is registered by platform_driver_register,
      	   which makes probe()/release()/... of platform_driver passed parameter
      	   of platform_device *, so platform driver can get platform_data from
      	   platform_device;
      
      	2. Other kind of devices do not need to use platform_data, we can
      	   decrease size of device if moving it to platform_device.
      
      	Taking into consideration of thousands of files to be fixed and they
      	can't be finished in one night(maybe it will take a long time), so we
      	keep platform_data in device to allow two kind of cases coexist until
      	all platform devices pass its platfrom data from
      	platform_device->platform_data.
      
      	All patches to do this kind of conversion are welcome.
      
      As we don't really want to do it, it was a bad idea.
      
      Cc: David Brownell <david-b@pacbell.net>
      Cc: Ming Lei <tom.leiming@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      e67c8562
    • M
      Revert driver core: fix passing platform_data · bee86321
      Ming Lei 提交于
      This reverts commit ce21c7bc:
      	We will remove platform_data field from struct device until
      	all platform devices pass its specific data from platfom_device
      	and all platform drivers use platform specific data passed by
      	platform_device->platform_data. This kind of conversion will
      	need a long time, for thousands of files is affected.
      
      	To make the conversion easily, we allow platform specific data
      	passed by struct device or struct platform_device and platform
      	driver may use it from struct device or struct platform_device.
      
      As we really don't want to do this at all.
      
      
      Cc: David Brownell <david-b@pacbell.net>
      Cc: Ming Lei <tom.leiming@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      bee86321
    • R
      Driver core: platform: fix kernel-doc warnings · d86c1302
      Randy Dunlap 提交于
      Fix function parameter notation in platform.c;
      fixes kernel-doc warnings.
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      d86c1302
  25. 17 4月, 2009 1 次提交
    • M
      Driver Core: early platform driver · 13977091
      Magnus Damm 提交于
      V3 of the early platform driver implementation.
      
      Platform drivers are great for embedded platforms because we can separate
      driver configuration from the actual driver.  So base addresses,
      interrupts and other configuration can be kept with the processor or board
      code, and the platform driver can be reused by many different platforms.
      
      For early devices we have nothing today.  For instance, to configure early
      timers and early serial ports we cannot use platform devices.  This
      because the setup order during boot.  Timers are needed before the
      platform driver core code is available.  The same goes for early printk
      support.  Early in this case means before initcalls.
      
      These early drivers today have their configuration either hard coded or
      they receive it using some special configuration method.  This is working
      quite well, but if we want to support both regular kernel modules and
      early devices then we need to have two ways of configuring the same
      driver.  A single way would be better.
      
      The early platform driver patch is basically a set of functions that allow
      drivers to register themselves and architecture code to locate them and
      probe.  Registration happens through early_param().  The time for the
      probe is decided by the architecture code.
      
      See Documentation/driver-model/platform.txt for more details.
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NMagnus Damm <damm@igel.co.jp>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Cc: David Brownell <david-b@pacbell.net>
      Cc: Tejun Heo <htejun@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      13977091
  26. 25 3月, 2009 3 次提交
    • M
      driver core: fix passing platform_data · ce21c7bc
      Ming Lei 提交于
      We will remove platform_data field from struct device until
      all platform devices pass its specific data from platfom_device
      and all platform drivers use platform specific data passed by
      platform_device->platform_data. This kind of conversion will
      need a long time, for thousands of files is affected.
      
      To make the conversion easily, we allow platform specific data
      passed by struct device or struct platform_device and platform
      driver may use it from struct device or struct platform_device.
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ce21c7bc
    • M
      driver core: move platform_data into platform_device · 006f4571
      Ming Lei 提交于
      This patch moves platform_data from struct device into
      struct platform_device, based on the two ideas:
      
      1. Now all platform_driver is registered by platform_driver_register,
         which makes probe()/release()/... of platform_driver passed parameter
         of platform_device *, so platform driver can get platform_data from
         platform_device;
      
      2. Other kind of devices do not need to use platform_data, we can
         decrease size of device if moving it to platform_device.
      
      Taking into consideration of thousands of files to be fixed and they
      can't be finished in one night(maybe it will take a long time), so we
      keep platform_data in device to allow two kind of cases coexist until
      all platform devices pass its platfrom data from
      platform_device->platform_data.
      
      All patches to do this kind of conversion are welcome.
      Signed-off-by: NMing Lei <tom.leiming@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      006f4571
    • E
      platform: introduce module id table for platform devices · 57fee4a5
      Eric Miao 提交于
      Now platform_device is being widely used on SoC processors where the
      peripherals are attached to the system bus, which is simple enough.
      
      However, silicon IPs for these SoCs are usually shared heavily across
      a family of processors, even products from different companies.  This
      makes the original simple driver name based matching insufficient, or
      simply not straight-forward.
      
      Introduce a module id table for platform devices, and makes it clear
      that a platform driver is able to support some shared IP and handle
      slight differences across different platforms (by 'driver_data').
      Module alias is handled automatically when a MODULE_DEVICE_TABLE()
      is defined.
      
      To not disturb the current platform drivers too much, the matched id
      entry is recorded and can be retrieved by platform_get_device_id().
      Signed-off-by: NEric Miao <eric.miao@marvell.com>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Cc: Ben Dooks <ben-linux@fluff.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      57fee4a5