Some hardware modules need strict flows according
to regulator's enable/disable, such as for i.MX6
SOC's PU regulator, there is another power gate
in GPC module, it needs to disable PU modules' clock
before PU regulator is disabled and need to enable
clock right after PU regulator is enabled, then it
can do GPC's power gate operation.
So we need to add REGULATOR_EVENT_PRE_DISABLE and
REGULATOR_EVENT_ENABLE for regulator's notifier events.
Signed-off-by: Anson Huang <b20788@freescale.com>
*
* Copyright 2007, 2008 Wolfson Microelectronics PLC.
* Copyright 2008 SlimLogic Ltd.
+ * Copyright (C) 2013 Freescale Semiconductor, Inc.
*
* Author: Liam Girdwood <lrg@slimlogic.co.uk>
*
}
trace_regulator_enable_complete(rdev_get_name(rdev));
+ _notifier_call_chain(rdev, REGULATOR_EVENT_ENABLE, NULL);
return 0;
}
{
int ret;
+ _notifier_call_chain(rdev, REGULATOR_EVENT_PRE_DISABLE, NULL);
trace_regulator_disable(rdev_get_name(rdev));
if (rdev->ena_pin) {
* consumer.h -- SoC Regulator consumer support.
*
* Copyright (C) 2007, 2008 Wolfson Microelectronics PLC.
+ * Copyright (C) 2013 Freescale Semiconductor, Inc.
*
* Author: Liam Girdwood <lrg@slimlogic.co.uk>
*
#define REGULATOR_EVENT_FORCE_DISABLE 0x20
#define REGULATOR_EVENT_VOLTAGE_CHANGE 0x40
#define REGULATOR_EVENT_DISABLE 0x80
+#define REGULATOR_EVENT_PRE_DISABLE 0x100
+#define REGULATOR_EVENT_ENABLE 0x200
struct regulator;