aboutsummaryrefslogtreecommitdiff
path: root/include/linux/platform_device.h
AgeCommit message (Collapse)AuthorFilesLines
2009-03-24platform: introduce module id table for platform devicesEric Miao1-0/+6
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 <[email protected]> Cc: Kay Sievers <[email protected]> Cc: Ben Dooks <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2009-01-06PM: Simplify the new suspend/hibernation framework for devicesRafael J. Wysocki1-1/+0
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 <[email protected]> Acked-by: Pavel Machek <[email protected]> Cc: Jesse Barnes <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2008-10-16platform: add new device registration helperDmitry Baryshkov1-0/+2
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 <[email protected]> Cc: David Brownell <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2008-06-10Implement new suspend and hibernation callbacks for platform bussesRafael J. Wysocki1-0/+1
Implement new suspend and hibernation callbacks for the platform bus type. Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Pavel Machek <[email protected]> Signed-off-by: Greg KH <[email protected]> Signed-off-by: Jesse Barnes <[email protected]>
2008-01-24Driver Core: constify the name passed to platform_device_register_simpleStephen Rothwell1-1/+1
This name is just passed to platform_device_alloc which has its parameter declared const. Signed-off-by: Stephen Rothwell <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2007-10-12Driver core: Make platform_device.id an intJean Delvare1-3/+4
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-12-13Driver core: Make platform_device_add_data accept a const pointerScott Wood1-1/+1
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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-12-01Driver core: platform_driver_probe(), can save codespaceDavid Brownell1-0/+6
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-09-25PM: platform_bus and late_suspend/early_resumeDavid Brownell1-0/+2
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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2006-01-04[PATCH] Driver Core: Add platform_device_del()Dmitry Torokhov1-0/+1
Driver core: add platform_device_del function Having platform_device_del90 allows more straightforward error handling code in drivers registering platform devices. Signed-off-by: Dmitry Torokhov <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2005-11-09[DRIVER MODEL] Add platform_driverRussell King1-0/+15
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 <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]>
2005-11-05[DRIVER MODEL] Improved dynamically allocated platform_device interfaceRussell King1-0/+6
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 <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]>
2005-10-29[DRIVER MODEL] Add missing platform_device.h header.Russell King1-0/+40
Signed-off-by: Russell King <[email protected]>