coreboot-kgpe-d16/src
Nico Huber f898f7ba4d pnp: Provide alternative pnp_enable() implementation
The current default implementation of pnp_enable() only disables devices
- if set so in the devicetree - but does not enable them. Enablement takes
place in pnp_enable_resources(). Yet, many PnP chips implement their own
version of pnp_enable() which also enables devices if set in the devicetree.

It's arguable, if enabling those devices makes sense, before they get
resources assigned. Maybe we can't write the resource registers if not,
who knows? The least we can do is providing a common implementation for
this behavior, and get rid of some code duplication.

Used the following cocci:
    @@
    expression e;
    @@
    +pnp_alt_enable(e);
    -pnp_set_logical_device(e);
    (
    -pnp_set_enable(e, !!e->enabled);
    |
    -(e->enabled) ? pnp_set_enable(e, 1) : pnp_set_enable(e, 0);
    |
    -if (e->enabled) { pnp_set_enable(e, 1); }
    -else { pnp_set_enable(e, 0); }
    )

Change-Id: I8d695e8fcd3cf8b847b1aa99326b51a554700bc4
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: http://review.coreboot.org/3480
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
2013-06-17 21:38:37 +02:00
..
arch ARM: Put the ROM stage into the image before other bits. 2013-06-10 17:52:15 +02:00
console usbdebug: Fix use without EARLY_CONSOLE 2013-06-07 09:50:12 +02:00
cpu qemu: add q35 support 2013-06-17 17:04:17 +02:00
device pnp: Provide alternative pnp_enable() implementation 2013-06-17 21:38:37 +02:00
drivers pc80/tpm: allow for cache-as-ram migration 2013-05-16 01:29:59 +02:00
ec pnp: Unify some alignment to ease autogenerating patches 2013-06-17 18:11:35 +02:00
include pnp: Provide alternative pnp_enable() implementation 2013-06-17 21:38:37 +02:00
lib usbdebug: Improve solving EHCI debug port problems 2013-06-12 05:20:04 +02:00
mainboard qemu: i440fx whitespace fixup 2013-06-17 17:04:43 +02:00
northbridge AMD: Kconfig cleanup 2013-06-13 01:08:12 +02:00
southbridge Make intel blob locations configurable 2013-06-17 19:16:52 +02:00
superio pnp: Provide alternative pnp_enable() implementation 2013-06-17 21:38:37 +02:00
vendorcode fam15 vendorcode: Change license to BSD from AMD software license 2013-06-09 17:37:16 +02:00
Kconfig Yabel : Add tracing option needed by i915tool. 2013-06-04 22:57:26 +02:00