From e93588288ec31cef005be6304e562250f469a2e7 Mon Sep 17 00:00:00 2001 From: David Wu Date: Tue, 23 Dec 2014 19:25:51 +0800 Subject: [PATCH] rk3368: io-domain: sync with upstream to add REGULATOR_EVENT_PRE_VOLTAGE_CHANGE Signed-off-by: David Wu --- drivers/power/avs/rockchip-io-domain.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/power/avs/rockchip-io-domain.c b/drivers/power/avs/rockchip-io-domain.c index ef7967e21869..b16013202cf9 100755 --- a/drivers/power/avs/rockchip-io-domain.c +++ b/drivers/power/avs/rockchip-io-domain.c @@ -116,15 +116,12 @@ static int rockchip_iodomain_notify(struct notifier_block *nb, * request something like a max of 3.6V when they really want 3.3V. * We could attempt to come up with better rules if this fails. */ -/* if (event & REGULATOR_EVENT_PRE_VOLTAGE_CHANGE) { struct pre_voltage_change_data *pvc_data = data; uV = max_t(unsigned long, pvc_data->old_uV, pvc_data->max_uV); - } else -*/ - if (event & (REGULATOR_EVENT_VOLTAGE_CHANGE)) {// | - //REGULATOR_EVENT_ABORT_VOLTAGE_CHANGE)) { + } else if (event & (REGULATOR_EVENT_VOLTAGE_CHANGE | + REGULATOR_EVENT_ABORT_VOLTAGE_CHANGE)) { uV = (unsigned long)data; } else { return NOTIFY_OK; @@ -135,15 +132,13 @@ static int rockchip_iodomain_notify(struct notifier_block *nb, if (uV > MAX_VOLTAGE_3_3) { dev_err(supply->iod->dev, "Voltage too high: %d\n", uV); - //if (event == REGULATOR_EVENT_PRE_VOLTAGE_CHANGE) + if (event == REGULATOR_EVENT_PRE_VOLTAGE_CHANGE) return NOTIFY_BAD; } ret = rockchip_iodomain_write(supply, uV); -/* if (ret && event == REGULATOR_EVENT_PRE_VOLTAGE_CHANGE) return NOTIFY_BAD; -*/ dev_info(supply->iod->dev, "Setting to %d done\n", uV); return NOTIFY_OK; -- 2.34.1