08 Jul, 2011

1 commit

  • On some architectures we need to setup pdev_archdata before we add the
    device. Waiting til a bus_notifier is too late since we might need the
    pdev_archdata in the bus notifier. One example is setting up of dma_mask
    pointers such that it can be used in a bus_notifier.

    We add weak noop version of arch_setup_pdev_archdata() and allow the arch
    code to override with access the full definitions of struct device,
    struct platform_device, and struct pdev_archdata.

    Acked-by: Greg Kroah-Hartman
    Signed-off-by: Kumar Gala

    Kumar Gala
     

17 May, 2011

1 commit


29 Apr, 2011

1 commit


12 Apr, 2011

1 commit

  • In order for MFD drivers to fetch their cell pointer but also their
    platform data one, an mfd cell pointer is added to the platform_device
    structure.
    That allows all MFD sub devices drivers to be MFD agnostic, unless
    they really need to access their MFD cell data. Most of them don't,
    especially the ones for IPs used by both MFD and non MFD SoCs.

    Cc: Grant Likely
    Acked-by: Greg KH
    Signed-off-by: Samuel Ortiz

    Samuel Ortiz
     

19 Feb, 2011

1 commit


23 Oct, 2010

1 commit

  • Currently, the platform_bus allows customization of several of the
    busses dev_pm_ops methods by using weak symbols so that platform code
    can override them. The weak-symbol approach is not scalable when
    wanting to support multiple platforms in a single kernel binary.

    Instead, provide __init methods for platform code to customize the
    dev_pm_ops methods at runtime.

    NOTE: after these dynamic methods are merged, the weak symbols should
    be removed from drivers/base/platform.c. AFAIK, this will only
    affect SH and sh-mobile which should be converted to use this
    runtime approach instead of the weak symbols. After SH &
    sh-mobile are converted, the weak symobols could be removed.

    Tested on OMAP3.

    Cc: Magnus Damm
    Acked-by: Grant Likely
    Signed-off-by: Kevin Hilman
    Signed-off-by: Greg Kroah-Hartman

    Kevin Hilman
     

06 Aug, 2010

1 commit


18 May, 2010

1 commit


08 Mar, 2010

3 commits


12 Dec, 2009

1 commit

  • 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: Magnus Damm
    Signed-off-by: Greg Kroah-Hartman

    Magnus Damm
     

22 Jul, 2009

2 commits

  • This is V2 of the platform driver power management late/early
    callback removal patch. The callbacks ->suspend_late() and
    ->resume_early() are removed since all in-tree users now have
    been migrated to dev_pm_ops.

    Signed-off-by: Magnus Damm
    Acked-by: Greg Kroah-Hartman
    Acked-by: Pavel Machek
    Signed-off-by: Rafael J. Wysocki

    Magnus Damm
     
  • Allow architecture specific data in struct platform_device V3.

    With this patch struct pdev_archdata is added to struct
    platform_device, similar to struct dev_archdata in found in
    struct device. Useful for architecture code that needs to
    keep extra data associated with each platform device.

    Struct pdev_archdata is different from dev.platform_data, the
    convention is that dev.platform_data points to driver-specific
    data. It may or may not be required by the driver. The format
    of this depends on driver but is the same across architectures.

    The structure pdev_archdata is a place for architecture specific
    data. This data is handled by architecture specific code (for
    example runtime PM), and since it is architecture specific it
    should _never_ be touched by device driver code. Exactly like
    struct dev_archdata but for platform devices.

    [rjw: This change is for power management mostly and that's why it
    goes through the suspend tree.]

    Signed-off-by: Magnus Damm
    Acked-by: Kevin Hilman
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: Rafael J. Wysocki

    Magnus Damm
     

16 Jun, 2009

1 commit


09 May, 2009

1 commit

  • This reverts commit 006f4571a15fae3a0575f2a0f9e9b63b3d1012f8:

    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
    Cc: Ming Lei
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

17 Apr, 2009

1 commit

  • 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: Magnus Damm
    Cc: Paul Mundt
    Cc: Kay Sievers
    Cc: David Brownell
    Cc: Tejun Heo
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Magnus Damm
     

25 Mar, 2009

2 commits

  • 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: Ming Lei
    Signed-off-by: Greg Kroah-Hartman

    Ming Lei
     
  • 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: Eric Miao
    Cc: Kay Sievers
    Cc: Ben Dooks
    Signed-off-by: Greg Kroah-Hartman

    Eric Miao
     

07 Jan, 2009

1 commit

  • PM: Simplify the new suspend/hibernation framework for devices

    Following the discussion at the Kernel Summit, simplify the new
    device PM framework by merging 'struct pm_ops' and
    'struct pm_ext_ops' and removing pointers to 'struct pm_ext_ops'
    from 'struct platform_driver' and 'struct pci_driver'.

    After this change, the suspend/hibernation callbacks will only
    reside in 'struct device_driver' as well as at the bus type/
    device class/device type level. Accordingly, PCI and platform
    device drivers are now expected to put their suspend/hibernation
    callbacks into the 'struct device_driver' embedded in
    'struct pci_driver' or 'struct platform_driver', respectively.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Pavel Machek
    Cc: Jesse Barnes
    Signed-off-by: Greg Kroah-Hartman

    Rafael J. Wysocki
     

17 Oct, 2008

1 commit

  • Add a helper that registers simple platform_device w/o resources but with
    parent and device data.

    This is usefull to cleanup platform code from code that registers such
    simple devices as leds-gpio, generic-bl, etc.

    Signed-off-by: Dmitry Baryshkov
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Dmitry Baryshkov
     

11 Jun, 2008

1 commit


25 Jan, 2008

1 commit


13 Oct, 2007

1 commit

  • While platform_device.id is a u32, platform_device_add() handles "-1"
    as a special id value. This has potential for confusion and bugs.
    Making it an int instead should prevent problems from happening in
    the future.

    Signed-off-by: Jean Delvare
    Signed-off-by: Greg Kroah-Hartman

    Jean Delvare
     

14 Dec, 2006

1 commit

  • platform_device_add_data() makes a copy of the data that is given to it,
    and thus the parameter can be const. This removes a warning when data
    from get_property() on powerpc is handed to platform_device_add_data(),
    as get_property() returns a const pointer.

    Signed-off-by: Scott Wood
    Signed-off-by: Andrew Morton
    Signed-off-by: Greg Kroah-Hartman

    Scott Wood
     

02 Dec, 2006

1 commit

  • This defines a new platform_driver_probe() method allowing the driver's
    probe() method, and its support code+data, to safely live in __init
    sections for typical system configurations.

    Many system-on-chip processors could benefit from this API, to the tune
    of recovering hundreds to thousands of bytes per driver. That's memory
    which is currently wasted holding code which can never be called after
    system startup, yet can not be removed. It can't be removed because of
    the linkage requirement that pointers to init section code (like, ideally,
    probe support) must not live in other sections (like driver method tables)
    after those pointers would be invalid.

    Signed-off-by: David Brownell
    Signed-off-by: Greg Kroah-Hartman

    David Brownell
     

26 Sep, 2006

1 commit

  • Teach platform_bus about the new suspend_late/resume_early PM calls,
    issued with IRQs off. Do we really need sysdev and friends any more,
    or can janitors start switching its users over to platform_device so
    we can do a minor code-ectomy?

    Signed-off-by: David Brownell
    Signed-off-by: Greg Kroah-Hartman

    David Brownell
     

05 Jan, 2006

1 commit


10 Nov, 2005

1 commit

  • Introduce struct platform_driver. This allows the platform device
    driver methods to be passed a platform_device structure instead of
    instead of a plain device structure, and therefore requiring casting
    in every platform driver.

    We introduce this in such a way that any existing platform drivers
    registered directly via driver_register continue to work as before,
    thereby allowing a gradual conversion to the new platform_driver
    methods.

    Signed-off-by: Russell King
    Acked-by: Greg Kroah-Hartman

    Russell King
     

06 Nov, 2005

1 commit

  • Re-jig the simple platform device support to allow private data
    to be attached to a platform device, as well as allowing the
    parent device to be set.

    Example usage:

    pdev = platform_device_alloc("mydev", id);
    if (pdev) {
    err = platform_device_add_resources(pdev, &resources,
    ARRAY_SIZE(resources));
    if (err == 0)
    err = platform_device_add_data(pdev, &platform_data,
    sizeof(platform_data));
    if (err == 0)
    err = platform_device_add(pdev);
    } else {
    err = -ENOMEM;
    }
    if (err)
    platform_device_put(pdev);

    Signed-off-by: Russell King
    Acked-by: Greg Kroah-Hartman

    Russell King
     

30 Oct, 2005

1 commit