linux/arch/powerpc/platforms/85xx
Benjamin Collins 5611fe48c5 powerpc: Add support for CTS-1000 GPIO controlled system poweroff
CTS-1000 is based on P4080. GPIO 27 is used to signal the FPGA to
switch off power, and also associates IRQ 8 with front-panel button
press (which we use to call orderly_poweroff()).

The relevant device-tree looks like this:

	gpio0: gpio@130000 {
		compatible = "fsl,qoriq-gpio";
		reg = <0x130000 0x1000>;
		interrupts = <55 2 0 0>;
		#gpio-cells = <2>;
		gpio-controller;

		/* Allows powering off the system via GPIO signal. */
		gpio-halt@27 {
			compatible = "sgy,gpio-halt";
			gpios = <&gpio0 27 0>;
			interrupts = <8 1 0 0>;
		};
	};

Because the driver cannot match on sgy,gpio-halt (because the node is never
processed through of_platform), it matches on fsl,qoriq-gpio and then
checks child nodes for the matching sgy,gpio-halt. This also ensures that
the GPIO controller is detected prior to sgy_cts1000's probe callback,
since that node wont match via of_platform until the controller is
registered.

Also, because the GPIO handler for triggering system poweroff might sleep,
the IRQ uses a workqueue to call orderly_poweroff().

As a final note, this driver may be expanded for other features specific to
the CTS-1000.

Signed-off-by: Ben Collins <ben.c@servergy.com>
Cc: Jack Smith <jack.s@servergy.com>
Cc: Vihar Rai <vihar.r@servergy.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-01-29 11:35:05 +11:00
..
bsc913x_rdb.c powerpc/85xx: Add BSC9131 RDB Support 2012-07-10 07:07:22 -05:00
common.c powerpc/fsl-pci: Unify pci/pcie initialization code 2012-09-12 14:57:12 -05:00
corenet_ds.c POWERPC: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
corenet_ds.h powerpc/p4080: Add basic support for p4080ds platform 2009-11-20 16:45:38 -06:00
ge_imp3a.c powerpc/fsl-pci: Unify pci/pcie initialization code 2012-09-12 14:57:12 -05:00
Kconfig powerpc: Add support for CTS-1000 GPIO controlled system poweroff 2013-01-29 11:35:05 +11:00
ksi8560.c Disintegrate asm/system.h for PowerPC 2012-03-28 18:30:02 +01:00
Makefile powerpc: Add support for CTS-1000 GPIO controlled system poweroff 2013-01-29 11:35:05 +11:00
mpc85xx_ads.c powerpc/fsl-pci: Unify pci/pcie initialization code 2012-09-12 14:57:12 -05:00
mpc85xx_cds.c POWERPC: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
mpc85xx_ds.c powerpc/fsl-pci: Unify pci/pcie initialization code 2012-09-12 14:57:12 -05:00
mpc85xx_mds.c powerpc: Fix typos in Freescale copyright claims 2012-11-15 13:00:58 +11:00
mpc85xx_rdb.c powerpc/fsl-pci: Unify pci/pcie initialization code 2012-09-12 14:57:12 -05:00
mpc85xx.h powerpc/85xx: consolidate of_platform_bus_probe calls 2011-11-24 02:01:41 -06:00
mpc8536_ds.c powerpc/fsl-pci: Unify pci/pcie initialization code 2012-09-12 14:57:12 -05:00
p1010rdb.c powerpc/fsl-pci: Unify pci/pcie initialization code 2012-09-12 14:57:12 -05:00
p1022_ds.c powerpc/85xx: p1022ds: Use NULL instead of 0 for pointers 2012-11-25 07:00:19 -06:00
p1022_rdk.c powerpc/fsl-pci: Unify pci/pcie initialization code 2012-09-12 14:57:12 -05:00
p1023_rds.c powerpc/fsl-pci: Unify pci/pcie initialization code 2012-09-12 14:57:12 -05:00
p2041_rdb.c powerpc/fsl-pci: Unify pci/pcie initialization code 2012-09-12 14:57:12 -05:00
p3041_ds.c powerpc/fsl-pci: Unify pci/pcie initialization code 2012-09-12 14:57:12 -05:00
p4080_ds.c powerpc/fsl-pci: Unify pci/pcie initialization code 2012-09-12 14:57:12 -05:00
p5020_ds.c powerpc/fsl-pci: Unify pci/pcie initialization code 2012-09-12 14:57:12 -05:00
p5040_ds.c powerpc/fsl-pci: Unify pci/pcie initialization code 2012-09-12 14:57:12 -05:00
qemu_e500.c powerpc/fsl-pci: Unify pci/pcie initialization code 2012-09-12 14:57:12 -05:00
sbc8548.c powerpc/fsl-pci: Unify pci/pcie initialization code 2012-09-12 14:57:12 -05:00
sgy_cts1000.c powerpc: Add support for CTS-1000 GPIO controlled system poweroff 2013-01-29 11:35:05 +11:00
smp.c powerpc/mpc85xx: Change spin table to cached memory 2012-11-25 07:00:31 -06:00
smp.h powerpc/85xx: Move mpc85xx_smp_init() decl to a new "smp.h" 2011-12-07 13:43:06 +11:00
socrates_fpga_pic.c irq_domain/powerpc: constify irq_domain_ops 2012-02-16 06:11:24 -07:00
socrates_fpga_pic.h powerpc/85xx: Add support for the "socrates" board (MPC8544). 2009-03-27 06:42:08 -05:00
socrates.c powerpc/fsl-pci: Unify pci/pcie initialization code 2012-09-12 14:57:12 -05:00
stx_gp3.c powerpc/fsl-pci: Unify pci/pcie initialization code 2012-09-12 14:57:12 -05:00
tqm85xx.c POWERPC: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
xes_mpc85xx.c powerpc/fsl-pci: Unify pci/pcie initialization code 2012-09-12 14:57:12 -05:00