Re: [RFC 1/3] system-power: Add system power and restart framework

2017-02-01 Thread Pavel Machek
On Tue 2017-01-31 18:46:58, Thierry Reding wrote: > On Mon, Jan 30, 2017 at 10:53:01PM +0100, Pavel Machek wrote: > > Hi! > > > > > > > +struct system_power_chip; > > > + > > > +struct system_power_ops { > > > + int (*restart)(struct system_power_chip *chip, enum reboot_mode mode, > > > +

Re: [RFC 1/3] system-power: Add system power and restart framework

2017-01-31 Thread Thierry Reding
On Mon, Jan 30, 2017 at 10:53:01PM +0100, Pavel Machek wrote: > Hi! > > > > +struct system_power_chip; > > + > > +struct system_power_ops { > > + int (*restart)(struct system_power_chip *chip, enum reboot_mode mode, > > + char *cmd); > > + int (*power_off_prepare)(struct syst

Re: [RFC 1/3] system-power: Add system power and restart framework

2017-01-30 Thread Pavel Machek
Hi! > +struct system_power_chip; > + > +struct system_power_ops { > + int (*restart)(struct system_power_chip *chip, enum reboot_mode mode, > +char *cmd); > + int (*power_off_prepare)(struct system_power_chip *chip); > + int (*power_off)(struct system_power_chip *c

[RFC 1/3] system-power: Add system power and restart framework

2017-01-30 Thread Thierry Reding
From: Thierry Reding This adds a very simple framework that allows drivers to register system power and restart controllers. The goal of this framework is to replace the current notifier based mechanism for restart handlers and the power off equivalent that is the global pm_power_off() function.