From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761224AbcALGcI (ORCPT ); Tue, 12 Jan 2016 01:32:08 -0500 Received: from regular1.263xmail.com ([211.150.99.135]:38556 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760907AbcALGbz (ORCPT ); Tue, 12 Jan 2016 01:31:55 -0500 X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-ADDR-CHECKED: 0 X-RL-SENDER: zhangqing@rock-chips.com X-FST-TO: linux-kernel@vger.kernel.org X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: zhangqing@rock-chips.com X-UNIQUE-TAG: <3ee775493eb43caa5c028cec3cf51b63> X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Message-ID: <56950D8F.8080902@rock-chips.com> Date: Tue, 12 Jan 2016 06:28:31 -0800 From: zhangqing User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Krzysztof Kozlowski CC: heiko@sntech.de, lgirdwood@gmail.com, broonie@kernel.org, huangtao@rock-chips.com, zyw@rock-chips.com, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] regulator: fan53555: fill set_suspend_enable/disable callback References: <1452596756-16617-1-git-send-email-zhangqing@rock-chips.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/11/2016 09:03 PM, Krzysztof Kozlowski wrote: > 2016-01-12 20:05 GMT+09:00 zhangqing : >> Setting the set_suspend_enable/disable callback to support >> enable and disable the dcdc when system is suspend. >> >> Signed-off-by: zhangqing >> --- >> drivers/regulator/fan53555.c | 18 ++++++++++++++++++ >> 1 file changed, 18 insertions(+) >> >> diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c >> index 4940e82..2cb5cc3 100644 >> --- a/drivers/regulator/fan53555.c >> +++ b/drivers/regulator/fan53555.c >> @@ -114,6 +114,22 @@ static int fan53555_set_suspend_voltage(struct regulator_dev *rdev, int uV) >> return 0; >> } >> >> +static int fan53555_set_suspend_enable(struct regulator_dev *rdev) >> +{ >> + struct fan53555_device_info *di = rdev_get_drvdata(rdev); >> + >> + return regmap_update_bits(di->regmap, di->sleep_reg, >> + VSEL_BUCK_EN, VSEL_BUCK_EN); > > You are just writing the enable_mask (BTW, just use the enable_mask, > not the value itself in such case) instead of enabling the suspend > mode. In the disable callback you are just disabling the regulator. > > What do you want to achieve with these callbacks? return regmap_update_bits(di->regmap, di->sleep_reg, VSEL_BUCK_EN, VSEL_BUCK_EN); This callback is setting sleep_reg, setting this dcdc output is enable or disable when system enter sleep. In our system this dcdc need disabled when sleep. But the current software not support. > > Best regards, > Krzysztof > >> +} >> + >> +static int fan53555_set_suspend_disable(struct regulator_dev *rdev) >> +{ >> + struct fan53555_device_info *di = rdev_get_drvdata(rdev); >> + >> + return regmap_update_bits(di->regmap, di->sleep_reg, >> + VSEL_BUCK_EN, 0); >> +} >> + >> static int fan53555_set_mode(struct regulator_dev *rdev, unsigned int mode) >> { >> struct fan53555_device_info *di = rdev_get_drvdata(rdev); >> @@ -192,6 +208,8 @@ static struct regulator_ops fan53555_regulator_ops = { >> .set_mode = fan53555_set_mode, >> .get_mode = fan53555_get_mode, >> .set_ramp_delay = fan53555_set_ramp, >> + .set_suspend_enable = fan53555_set_suspend_enable, >> + .set_suspend_disable = fan53555_set_suspend_disable, >> }; >> >> static int fan53555_voltages_setup_fairchild(struct fan53555_device_info *di) >> -- >> 1.9.1 >> >> > > >