Some gpc operations are mandatory required when
iMX6SX PCIe PHY is powered on/off.
use the notify framwork to encapsulate the
pre-operations in gpc driver
- add two pre-xxx macros into consumer.h
- kick off the pre-xxx events in enable/disalbe call back.
Signed-off-by: Richard Zhu <Richard.Zhu@freescale.com>
{
int ret, delay;
+ _notifier_call_chain(rdev, REGULATOR_EVENT_PRE_ENABLE, NULL);
/* Query before enabling in case configuration dependent. */
ret = _regulator_get_enable_time(rdev);
if (ret >= 0) {
{
int ret;
+ _notifier_call_chain(rdev, REGULATOR_EVENT_PRE_DISABLE, NULL);
trace_regulator_disable(rdev_get_name(rdev));
if (rdev->ena_pin) {
#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_PRE_ENABLE 0x200
struct regulator;