Merge tag 'for-v3.19' of git://git.infradead.org/battery-2.6
Pull power supply updates from Sebastian Reichel:: "Power supply and reset changes for the v3.19 series - update power/reset drivers to use kernel restart handler - add power off driver for i.mx6 - add DT support for gpio-charger" * tag 'for-v3.19' of git://git.infradead.org/battery-2.6: power: reset: adjust priority of simple syscon reboot driver power: ds2782_battery: Simplify the PM hooks power/reset: brcmstb: Register with kernel restart handler power/reset: hisi: Register with kernel restart handler power/reset: keystone: Register with kernel restart handler power/reset: axxia: Register with kernel restart handler power/reset: xgene: Register with kernel restart handler power/reset: xgene: Use mdelay instead of jiffies based timeout power/reset: xgene: Use local variable dev instead of pdev->dev power/reset: xgene: Drop devm_kfree power/reset: xgene: Return -ENOMEM if out of memory power/reset: vexpress: Register with kernel restart handler power: reset: imx-snvs-poweroff: add power off driver for i.mx6 power: gpio-charger: add device tree support dt-bindings: document gpio-charger bindings
This commit is contained in:
@@ -12,9 +12,9 @@
|
||||
|
||||
#include <linux/io.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/notifier.h>
|
||||
#include <linux/reboot.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <asm/system_misc.h>
|
||||
#include <linux/mfd/syscon.h>
|
||||
#include <linux/of_platform.h>
|
||||
|
||||
@@ -52,7 +52,8 @@ static inline int rsctrl_enable_rspll_write(void)
|
||||
RSCTRL_KEY_MASK, RSCTRL_KEY);
|
||||
}
|
||||
|
||||
static void rsctrl_restart(enum reboot_mode mode, const char *cmd)
|
||||
static int rsctrl_restart_handler(struct notifier_block *this,
|
||||
unsigned long mode, void *cmd)
|
||||
{
|
||||
/* enable write access to RSTCTRL */
|
||||
rsctrl_enable_rspll_write();
|
||||
@@ -60,8 +61,15 @@ static void rsctrl_restart(enum reboot_mode mode, const char *cmd)
|
||||
/* reset the SOC */
|
||||
regmap_update_bits(pllctrl_regs, rspll_offset + RSCTRL_RG,
|
||||
RSCTRL_RESET_MASK, 0);
|
||||
|
||||
return NOTIFY_DONE;
|
||||
}
|
||||
|
||||
static struct notifier_block rsctrl_restart_nb = {
|
||||
.notifier_call = rsctrl_restart_handler,
|
||||
.priority = 128,
|
||||
};
|
||||
|
||||
static struct of_device_id rsctrl_of_match[] = {
|
||||
{.compatible = "ti,keystone-reset", },
|
||||
{},
|
||||
@@ -114,8 +122,6 @@ static int rsctrl_probe(struct platform_device *pdev)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
arm_pm_restart = rsctrl_restart;
|
||||
|
||||
/* disable a reset isolation for all module clocks */
|
||||
ret = regmap_write(pllctrl_regs, rspll_offset + RSISO_RG, 0);
|
||||
if (ret)
|
||||
@@ -147,7 +153,11 @@ static int rsctrl_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
ret = register_restart_handler(&rsctrl_restart_nb);
|
||||
if (ret)
|
||||
dev_err(dev, "cannot register restart handler (err=%d)\n", ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct platform_driver rsctrl_driver = {
|
||||
|
Verwijs in nieuw issue
Block a user