27 Sep, 2013
1 commit
-
Prevent drivers relying on platform_driver_probe from requesting
deferred probing in order to avoid further futile probe attempts (either
the driver has been unregistered or its probe function has been set to
platform_drv_probe_fail when probing is retried).Note that several platform drivers currently return subsystem errors
from probe and that these can include -EPROBE_DEFER (e.g. if a gpio
request fails).Add a warning to platform_drv_probe that can be used to catch drivers
that inadvertently request probe deferral while using
platform_driver_probe.Signed-off-by: Johan Hovold
Signed-off-by: Greg Kroah-Hartman
05 Jul, 2013
1 commit
-
Pull device tree updates from Grant Likely:
"This branch contains the following changes:
- Removal of CONFIG_OF_DEVICE, it is always enabled by CONFIG_OF
- Remove #ifdef from linux/of_platform.h to increase compiler syntax
coverage
- Bug fix for address decoding on Bimini and js2x powerpc platforms.
- miscellaneous binding changesOne note on the above. The binding changes going in from all kinds of
different trees has gotten rather out of hand. I picked up some
during this cycle, but even going though my tree isn't a great fit.Ian Campbell has prototyped splitting the bindings and .dtb files into
a separate repository. The plan is to migrate to using that sometime
in the next few kernel releases which should get rid of a lot of the
churn on binding docs and .dts files"* tag 'devicetree-for-linus' of git://git.secretlab.ca/git/linux:
of: Fix address decoding on Bimini and js2x machines
of: remove CONFIG_OF_DEVICE
usb: chipidea: depend on CONFIG_OF instead of CONFIG_OF_DEVICE
of: remove of_platform_driver
ibmebus: convert of_platform_driver to platform_driver
driver core: move to_platform_driver to platform_device.h
mfd: DT bindings for the palmas family MFD
ARM: dts: omap3-devkit8000: fix NAND memory binding
of/base: fix typos
of: remove #ifdef from linux/of_platform.h
12 Jun, 2013
1 commit
-
In converting the last remaining of_platform_driver (ibmebus) to a regular
platform driver, to_platform_driver is needed to replace
to_of_platform_driver.Signed-off-by: Rob Herring
Acked-by: Arnd Bergmann
Tested-by: Benjamin Herrenschmidt
Signed-off-by: Grant Likely
04 Jun, 2013
1 commit
-
I found a lot of mistakes using struct platform_driver without owner
so I make a macro instead of the function platform_driver_register.
It can set owner in it, then guys don`t care about module owner again.Signed-off-by: Libo Chen
Signed-off-by: Greg Kroah-Hartman
30 Mar, 2013
1 commit
-
Signed-off-by: Fabio Porcedda
Signed-off-by: Greg Kroah-Hartman
18 Jan, 2013
1 commit
-
For simple modules that contain a single platform_driver without any
additional setup code then ends up being a block of duplicated
boilerplate. This patch adds a new macro,
module_platform_driver_probe(), which replaces the
module_init()/module_exit() registrations with template functions.This macro use the same idea of module_platform_driver().
This macro is useful to stop the misuse of module_platform_driver() for
removing the platform_driver_probe() boilerplate.Signed-off-by: Fabio Porcedda
Signed-off-by: Greg Kroah-Hartman
21 Nov, 2012
1 commit
-
The current platform device creation and registration code in
acpi_create_platform_device() is quite convoluted. This function
takes an ACPI device node as an argument and eventually calls
platform_device_register_resndata() to create and register a
platform device object on the basis of the information contained
in that code. However, it doesn't associate the new platform
device with the ACPI node directly, but instead it relies on
acpi_platform_notify(), called from within device_add(), to find
that ACPI node again with the help of acpi_platform_find_device()
and acpi_platform_match() and then attach the new platform device
to it. This causes an additional ACPI namespace walk to happen and
is clearly suboptimal.Use the observation that it is now possible to initialize the ACPI
handle of a device before calling device_add() for it to make this
code more straightforward. Namely, add a new field to struct
platform_device_info allowing us to pass the ACPI handle of interest
to platform_device_register_full(), which will then use it to
initialize the new device's ACPI handle before registering it.
This will cause acpi_platform_notify() to use the ACPI handle from
the device structure directly instead of using the .find_device()
routine provided by the device's bus type. In consequence,
acpi_platform_bus, acpi_platform_find_device(), and
acpi_platform_match() are not necessary any more, so remove them.Signed-off-by: Rafael J. Wysocki
Reviewed-by: Mika Westerberg
Acked-by: Greg Kroah-Hartman
17 Aug, 2012
1 commit
-
Right now we have support for explicit platform device IDs, as well as
ID-less platform devices when a given device type can only have one
instance. However there are cases where multiple instances of a device
type can exist, and their IDs aren't (and can't be) known in advance
and do not matter. In that case we need automatic device IDs to avoid
device name collisions.I am using magic ID value -2 (PLATFORM_DEVID_AUTO) for this, similar
to -1 for ID-less devices. The automatically allocated device IDs are
global (to avoid an additional per-driver cost.) We keep note that the
ID was automatically allocated so that it can be freed later.Note that we also restore the ID to PLATFORM_DEVID_AUTO on error and
device deletion, to avoid avoid unexpected behavior on retry. I don't
really expect retries on platform device addition, but better safe
than sorry.Signed-off-by: Jean Delvare
Signed-off-by: Greg Kroah-Hartman
09 Jan, 2012
1 commit
-
* 'pm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (76 commits)
PM / Hibernate: Implement compat_ioctl for /dev/snapshot
PM / Freezer: fix return value of freezable_schedule_timeout_killable()
PM / shmobile: Allow the A4R domain to be turned off at run time
PM / input / touchscreen: Make st1232 use device PM QoS constraints
PM / QoS: Introduce dev_pm_qos_add_ancestor_request()
PM / shmobile: Remove the stay_on flag from SH7372's PM domains
PM / shmobile: Don't include SH7372's INTCS in syscore suspend/resume
PM / shmobile: Add support for the sh7372 A4S power domain / sleep mode
PM: Drop generic_subsys_pm_ops
PM / Sleep: Remove forward-only callbacks from AMBA bus type
PM / Sleep: Remove forward-only callbacks from platform bus type
PM: Run the driver callback directly if the subsystem one is not there
PM / Sleep: Make pm_op() and pm_noirq_op() return callback pointers
PM/Devfreq: Add Exynos4-bus device DVFS driver for Exynos4210/4212/4412.
PM / Sleep: Merge internal functions in generic_ops.c
PM / Sleep: Simplify generic system suspend callbacks
PM / Hibernate: Remove deprecated hibernation snapshot ioctls
PM / Sleep: Fix freezer failures due to racy usermodehelper_is_disabled()
ARM: S3C64XX: Implement basic power domain support
PM / shmobile: Use common always on power domain governor
...Fix up trivial conflict in fs/xfs/xfs_buf.c due to removal of unused
XBT_FORCE_SLEEP bit
22 Dec, 2011
1 commit
-
The forward-only PM callbacks provided by the platform bus type are
not necessary any more, because the PM core executes driver callbacks
when the corresponding subsystem callbacks are not present, so drop
them.Signed-off-by: Rafael J. Wysocki
10 Dec, 2011
1 commit
-
platform_device_register_full doesn't modify *pdevinfo so it can be
marked as const without further adaptions.Signed-off-by: Uwe Kleine-König
Signed-off-by: Greg Kroah-Hartman
18 Nov, 2011
1 commit
-
This patch generalizes the module_platform_driver macro and introduces a new
module_driver macro. The module_driver macro takes a driver name, a register
and a unregister function for this driver type. Using these it construct the
module init and exit sections which register and unregister the driver. Since
such init/exit sections are commonly found in drivers this macro can be used
to eliminate a lot of boilerplate code.The macro is not intended to be used by driver modules directly, instead it
should be used to generate bus specific macros for registering drivers like
the module_platform_driver macro.Signed-off-by: Lars-Peter Clausen
Acked-by: Grant Likely
Acked-by: Jonathan Cameron
Acked-by: Wolfram Sang
Signed-off-by: Greg Kroah-Hartman
29 Oct, 2011
1 commit
-
* 'spi/next' of git://git.secretlab.ca/git/linux-2.6:
drivercore: Add helper macro for platform_driver boilerplate
spi: irq: Remove IRQF_DISABLED
OMAP: SPI: Fix the trying to free nonexistent resource error
spi/spi-ep93xx: add module.h include
spi/tegra: fix compilation error in spi-tegra.c
spi: spi-dw: fix all sparse warnings
spi/spi-pl022: Call pl022_dma_remove(pl022) only if enable_dma is true
spi/spi-pl022: calculate_effective_freq() must set rate t allocate more sg than required.
spi/spi-pl022: Use GFP_ATOMIC for allocation from tasklet
spi/spi-pl022: Resolve formatting issues
25 Oct, 2011
1 commit
-
For simple modules that contain a single platform_driver without any
additional setup code then ends up being a block of duplicated
boilerplate. This patch adds a new macro, module_platform_driver(),
which replaces the module_init()/module_exit() registrations with
template functions.Signed-off-by: Grant Likely
Acked-by: Greg Kroah-Hartman
Reviewed-by: Magnus Damm
Reviewed-by: Mark Brown
Reviewed-by: Stephen Boyd
27 Aug, 2011
1 commit
-
compared to the most powerful and already existing helper (namely
platform_device_register_resndata) this allows to specify a dma_mask.
To make eventual extensions later more easy, a struct holding the used
information is created instead of passing the information by function
parameters.Signed-off-by: Uwe Kleine-König
Signed-off-by: Greg Kroah-Hartman
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
17 May, 2011
1 commit
-
The platform_bus_set_pm_ops() operation is deprecated in favor of the
new device power domain infrastructre implemented in commit
7538e3db6e015e890825fbd9f8659952896ddd5b (PM: add support for device
power domains)Signed-off-by: Kevin Hilman
Signed-off-by: Rafael J. Wysocki
29 Apr, 2011
1 commit
-
Export the default PM callbacks defined for the platform bus type so
that they can be used by power domains for suspending and resuming
platform devices in the future.Signed-off-by: Rafael J. Wysocki
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
19 Feb, 2011
1 commit
-
This patch converts the macros for platform_{get,set}_drvdata to
static inline functions to add typechecking.Signed-off-by: Marc Kleine-Budde
Acked-by: Uwe Kleine-König
Signed-off-by: Greg Kroah-Hartman
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
06 Aug, 2010
1 commit
-
This makes the two similar functions platform_device_register_simple
and platform_device_register_data one line inline functions using a new
generic function platform_device_register_resndata.Signed-off-by: Uwe Kleine-König
Signed-off-by: Greg Kroah-Hartman
18 May, 2010
1 commit
-
Make the platform resource input parameters of platform_device_add_resources()
and platform_device_register_simple() const, as the resources are copied and
never modified.Signed-off-by: Geert Uytterhoeven
Acked-by: Greg Kroah-Hartman
08 Mar, 2010
3 commits
-
This fixes a warning on several pxa based machines:
arch/arm/mach-pxa/ssp.c:475: warning: initialization discards qualifiers from pointer target type
Signed-off-by: Uwe Kleine-König
Acked-by: Vikram Dhillon
Acked-by: Eric Miao
Signed-off-by: Greg Kroah-Hartman -
The platform ID table is normally const, force that by adding the attribute.
Signed-off-by: Eric Miao
Signed-off-by: Greg Kroah-Hartman -
Many legacy-style module create singleton platform devices themselves,
along with corresponding platform driver. Instead of replicating error
handling code in all such drivers, provide a helper that allocates and
registers a single platform device and a driver and binds them together.Signed-off-by: Dmitry Torokhov
Signed-off-by: Greg Kroah-Hartman
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
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 -
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
16 Jun, 2009
1 commit
-
This converts resource and IRQ getbyname functions for the platform
bus to use const char *, I ran into compiler moanings when I tried
using a const char * for looking up a certain resource.Signed-off-by: Linus Walleij
Signed-off-by: Greg Kroah-Hartman
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
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
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 -
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
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
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
11 Jun, 2008
1 commit
-
Implement new suspend and hibernation callbacks for the platform bus
type.Signed-off-by: Rafael J. Wysocki
Acked-by: Pavel Machek
Signed-off-by: Greg KH
Signed-off-by: Jesse Barnes
25 Jan, 2008
1 commit
-
This name is just passed to platform_device_alloc which has its parameter
declared const.Signed-off-by: Stephen Rothwell
Signed-off-by: Greg Kroah-Hartman
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
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