android_kernel_xiaomi_sm8450/arch/powerpc/platforms/powermac
Alexander Graf 9178ba294b powerpc: Convert power off logic to pm_power_off
The generic Linux framework to power off the machine is a function pointer
called pm_power_off. The trick about this pointer is that device drivers can
potentially implement it rather than board files.

Today on powerpc we set pm_power_off to invoke our generic full machine power
off logic which then calls ppc_md.power_off to invoke machine specific power
off.

However, when we want to add a power off GPIO via the "gpio-poweroff" driver,
this card house falls apart. That driver only registers itself if pm_power_off
is NULL to ensure it doesn't override board specific logic. However, since we
always set pm_power_off to the generic power off logic (which will just not
power off the machine if no ppc_md.power_off call is implemented), we can't
implement power off via the generic GPIO power off driver.

To fix this up, let's get rid of the ppc_md.power_off logic and just always use
pm_power_off as was intended. Then individual drivers such as the GPIO power off
driver can implement power off logic via that function pointer.

With this patch set applied and a few patches on top of QEMU that implement a
power off GPIO on the virt e500 machine, I can successfully turn off my virtual
machine after halt.

Signed-off-by: Alexander Graf <agraf@suse.de>
[mpe: Squash into one patch and update changelog based on cover letter]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2014-11-03 12:12:51 +11:00
..
backlight.c powerpc: add export.h to files making use of EXPORT_SYMBOL 2011-10-31 19:30:37 -04:00
bootx_init.c Disintegrate asm/system.h for PowerPC 2012-03-28 18:30:02 +01:00
cache.S Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
feature.c The branch contains the following device tree changes the v3.17 merge 2014-08-14 09:53:39 -06:00
Kconfig powerpc: Remove CONFIG_POWER4 2014-07-28 14:10:26 +10:00
low_i2c.c tree-wide: use reinit_completion instead of INIT_COMPLETION 2013-11-15 09:32:21 +09:00
Makefile cpufreq: powerpc: move cpufreq driver to drivers/cpufreq 2013-06-07 13:44:39 +02:00
nvram.c Disintegrate asm/system.h for PowerPC 2012-03-28 18:30:02 +01:00
pci.c of: Migrate of_find_node_by_name() users to for_each_node_by_name() 2014-06-26 17:12:24 +01:00
pfunc_base.c powerpc: add explicit OF includes 2013-10-09 20:04:11 -05:00
pfunc_core.c powerpc: Delete non-required instances of include <linux/init.h> 2014-01-15 13:46:44 +11:00
pic.c of/irq: Replace of_irq with of_phandle_args 2013-10-24 11:42:51 +01:00
pmac.h powerpc/psurge: Create a irq_host for secondary cpus 2011-05-19 15:31:51 +10:00
setup.c powerpc: Convert power off logic to pm_power_off 2014-11-03 12:12:51 +11:00
sleep.S powerpc/mm: Introduce MMU features 2008-12-21 14:21:16 +11:00
smp.c of: Migrate of_find_node_by_name() users to for_each_node_by_name() 2014-06-26 17:12:24 +01:00
time.c Disintegrate asm/system.h for PowerPC 2012-03-28 18:30:02 +01:00
udbg_adb.c of: Migrate of_find_node_by_name() users to for_each_node_by_name() 2014-06-26 17:12:24 +01:00
udbg_scc.c of: add 'of_' prefix to machine_is_compatible() 2010-02-09 08:33:00 -07:00