07 Aug, 2010
1 commit
-
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (28 commits)
driver core: device_rename's new_name can be const
sysfs: Remove owner field from sysfs struct attribute
powerpc/pci: Remove owner field from attribute initialization in PCI bridge init
regulator: Remove owner field from attribute initialization in regulator core driver
leds: Remove owner field from attribute initialization in bd2802 driver
scsi: Remove owner field from attribute initialization in ARCMSR driver
scsi: Remove owner field from attribute initialization in LPFC driver
cgroupfs: create /sys/fs/cgroup to mount cgroupfs on
Driver core: Add BUS_NOTIFY_BIND_DRIVER
driver core: fix memory leak on one error path in bus_register()
debugfs: no longer needs to depend on SYSFS
sysfs: Fix one more signature discrepancy between sysfs implementation and docs.
sysfs: fix discrepancies between implementation and documentation
dcdbas: remove a redundant smi_data_buf_free in dcdbas_exit
dmi-id: fix a memory leak in dmi_id_init error path
sysfs: sysfs_chmod_file's attr can be const
firmware: Update hotplug script
Driver core: move platform device creation helpers to .init.text (if MODULE=n)
Driver core: reduce duplicated code for platform_device creation
Driver core: use kmemdup in platform_device_add_resources
...
06 Aug, 2010
3 commits
-
Platform devices should only be called by init code, so it should be
possible to move creation helpers to .init.text -- at least if modules
are disabled.Signed-off-by: Uwe Kleine-König
Signed-off-by: Greg Kroah-Hartman -
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 -
This makes platform_device_add_resources look like
platform_device_add_data.Signed-off-by: Uwe Kleine-König
Signed-off-by: Greg Kroah-Hartman
24 Jul, 2010
2 commits
-
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: Grant Likely
Acked-by: David S. Miller -
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: Grant Likely
Acked-by: Greg Kroah-Hartman
CC: Michal Simek
CC: Grant Likely
CC: Benjamin Herrenschmidt
CC: Stephen Rothwell
CC: linux-kernel@vger.kernel.org
CC: microblaze-uclinux@itee.uq.edu.au
CC: linuxppc-dev@ozlabs.org
CC: devicetree-discuss@lists.ozlabs.org
22 May, 2010
1 commit
-
When runtime PM for platform_bus was added, it allowed for platforms
to customize the runtime PM methods since they are defined as weak
symbols.This patch allows platforms to also extend the system PM methods with
custom hooks so runtime PM and system PM extensions can be managed
together by custom platform-specific code.Signed-off-by: Kevin Hilman
Cc: Magnus Damm
Cc: Rafael Wysocki
Cc: Dmitry Torokhov
Cc: Eric Miao
Signed-off-by: Greg Kroah-Hartman
21 May, 2010
1 commit
-
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6:
PM: PM QOS update fix
Freezer / cgroup freezer: Update stale locking comments
PM / platform_bus: Allow runtime PM by default
i2c: Fix bus-level power management callbacks
PM QOS update
PM / Hibernate: Fix block_io.c printk warning
PM / Hibernate: Group swap ops
PM / Hibernate: Move the first_sector out of swsusp_write
PM / Hibernate: Separate block_io
PM / Hibernate: Snapshot cleanup
FS / libfs: Implement simple_write_to_buffer
PM / Hibernate: document open(/dev/snapshot) side effects
PM / Runtime: Add sysfs debug files
PM: Improve device power management document
PM: Update device power management document
PM: Allow runtime_suspend methods to call pm_schedule_suspend()
PM: pm_wakeup - switch to using bool
20 May, 2010
1 commit
-
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (127 commits)
sh: update defconfigs.
sh: Fix up the NUMA build for recent LMB changes.
sh64: provide a stub per_cpu_trap_init() definition.
sh: fix up CONFIG_KEXEC=n build.
sh: fixup the docbook paths for clock framework shuffling.
driver core: Early dev_name() depends on slab_is_available().
sh: simplify WARN usage in SH clock driver
sh: Check return value of clk_get on ms7724
sh: Check return value of clk_get on ecovec24
sh: move sh clock-cpg.c contents to drivers/sh/clk-cpg.c
sh: move sh clock.c contents to drivers/sh/clk.
sh: move sh asm/clock.h contents to linux/sh_clk.h V2
sh: remove unused clock lookup
sh: switch boards to clkdev
sh: switch sh4-202 to clkdev
sh: switch shx3 to clkdev
sh: switch sh7757 to clkdev
sh: switch sh7763 to clkdev
sh: switch sh7780 to clkdev
sh: switch sh7786 to clkdev
...
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
13 May, 2010
2 commits
-
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: Paul Mundt
11 May, 2010
1 commit
-
Currently the default runtime PM callbacks for platform devices return
-ENOSYS, preventing the use of runtime PM platforms until they have
provided at least a default implementation. This hinders the use of
runtime PM by devices which work with many platforms such as memory
mapped devices, MFDs and on chip IPs shared by multiple architectures.Change the default implementation to the standard pm_generic_runtime
one, allowing drivers to use runtime PM without per-architecture
changes.Signed-off-by: Mark Brown
Acked-by: Greg Kroah-Hartman
Signed-off-by: Rafael J. Wysocki
30 Mar, 2010
1 commit
-
Conflicts:
arch/sh/kernel/cpu/clock.cSigned-off-by: Paul Mundt
29 Mar, 2010
1 commit
-
This is just a simple refactoring patch on top of the early dev_name()
support, converting from kstrdup() to kasprintf() as suggested by Kay.Signed-off-by: Paul Mundt
19 Mar, 2010
2 commits
-
A number of functions in the driver core return ERR_PTR() values on
error. Document this in the kernel-doc of the functions.Signed-off-by: Jani Nikula
Signed-off-by: Greg Kroah-Hartman -
This patch updates the kernel-doc notation for early
platform functions.Signed-off-by: Magnus Damm
Acked-by: Randy Dunlap
Signed-off-by: Greg Kroah-Hartman
10 Mar, 2010
1 commit
-
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: Paul Mundt
Acked-by: Greg Kroah-Hartman
08 Mar, 2010
3 commits
-
The function name must be followed by a space, hypen, space, and a
short description.Signed-off-by: Ben Hutchings
Signed-off-by: Greg Kroah-Hartman -
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 -
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
24 Dec, 2009
1 commit
-
This allows MFD's to register/bind drivers for their sub devices while
still being compiled as a module.Signed-off-by: Michael Hennerich
Signed-off-by: Mike Frysinger
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
31 Oct, 2009
1 commit
-
Platform drivers registered via platform_driver_probe() can be bound
to devices only once, upon registration, because discard their probe()
routines to save memory. Unbinding the driver through sysfs 'unbind'
leaves the device stranded and confuses users so let's not create
bind and unbind attributes for such drivers.Signed-off-by: Dmitry Torokhov
Cc: Éric Piel
Signed-off-by: Greg Kroah-Hartman
16 Sep, 2009
1 commit
-
Instead of open-coding it.
Signed-off-by: Andrew Morton
Signed-off-by: Greg Kroah-Hartman
23 Aug, 2009
1 commit
-
This patch adds default Runtime PM callbacks to the dev_pm_ops
belonging to the platform bus. The callbacks are weak symbols
that architecture specific code can override.Allows Runtime PM even though CONFIG_PM_SLEEP=n.
Signed-off-by: Magnus Damm
Acked-by: Greg Kroah-Hartman
Signed-off-by: Rafael J. Wysocki
16 Aug, 2009
1 commit
11 Aug, 2009
1 commit
-
Commit 783ea7d4eeefe895f2731fe73ac951e94418927b
(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: Magnus Damm
Acked-by: Greg Kroah-Hartman
Signed-off-by: Rafael J. Wysocki
24 Jul, 2009
1 commit
-
They are not supposed to be modified by drivers, so make them const.
Signed-off-by: Dmitry Torokhov
Acked-by: Greg Kroah-Hartman
Signed-off-by: Rafael J. Wysocki
22 Jul, 2009
1 commit
-
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
16 Jun, 2009
2 commits
-
This removes the
warning: format not a string literal and no format arguments
warnings in the driver core that gcc 4.3.3 complains about.Signed-off-by: Greg Kroah-Hartman
-
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
13 Jun, 2009
1 commit
-
This patch reworks the platform driver code for legacy
suspend and resume to avoid installing callbacks in
struct device_driver. A warning is also added telling
users to update the platform driver to use dev_pm_ops.The functions platform_legacy_suspend()/resume() directly
call suspend and resume callbacks in struct platform_driver
instead of wrapping things in platform_drv_suspend()/resume().Signed-off-by: Magnus Damm
Acked-by: Greg Kroah-Hartman
Signed-off-by: Rafael J. Wysocki
09 May, 2009
3 commits
-
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 -
This reverts commit ce21c7bcd796fc4f45d48781b7e85f493cc55ee5:
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
Cc: Ming Lei
Signed-off-by: Greg Kroah-Hartman -
Fix function parameter notation in platform.c;
fixes kernel-doc warnings.Signed-off-by: Randy Dunlap
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
3 commits
-
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: Ming Lei
Signed-off-by: Greg Kroah-Hartman -
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