1. 03 11月, 2014 1 次提交
    • A
      powerpc: Convert power off logic to pm_power_off · 9178ba29
      Alexander Graf 提交于
      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: NAlexander Graf <agraf@suse.de>
      [mpe: Squash into one patch and update changelog based on cover letter]
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      9178ba29
  2. 25 9月, 2014 1 次提交
  3. 15 1月, 2014 1 次提交
  4. 11 11月, 2013 1 次提交
    • R
      powerpc: add missing explicit OF includes for ppc · c11eede6
      Rob Herring 提交于
      Commit b5b4bb3f (of: only include prom.h on sparc) removed implicit
      includes of of_*.h headers by powerpc's prom.h. Some components were
      missed in initial clean-up patch, so add the necessary includes to fix
      powerpc builds.
      Signed-off-by: NRob Herring <rob.herring@calxeda.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Matt Mackall <mpm@selenic.com>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Vinod Koul <vinod.koul@intel.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: linuxppc-dev@lists.ozlabs.org
      Cc: linux-ide@vger.kernel.org
      Cc: linux-crypto@vger.kernel.org
      c11eede6
  5. 04 4月, 2013 1 次提交
  6. 19 3月, 2013 1 次提交
  7. 29 1月, 2013 1 次提交
    • B
      powerpc: Add support for CTS-1000 GPIO controlled system poweroff · 5611fe48
      Benjamin Collins 提交于
      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: NBen 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: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      5611fe48