From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758002Ab2GMPBp (ORCPT ); Fri, 13 Jul 2012 11:01:45 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:34921 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757821Ab2GMPBn (ORCPT ); Fri, 13 Jul 2012 11:01:43 -0400 Message-ID: <1342191674.10881.2.camel@phoenix> Subject: [PATCH RFC] regulator: mc13xxx: Populate selector from mc13xxx_fixed_regulator_set_voltage From: Axel Lin To: Mark Brown Cc: Yong Shen , Fabio Estevam , Sascha Hauer , Arnaud Patard , Liam Girdwood , linux-kernel@vger.kernel.org Date: Fri, 13 Jul 2012 23:01:14 +0800 Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This was missing until now and the underlying _regulator_do_set_voltage is using this value when calling list_voltage. Signed-off-by: Axel Lin --- Not very sure if we should implement set_voltage callback for fixed voltage. ( Other drivers do not implement set_voltage callback for fixed voltage. Since the voltage is fixed, implement set_voltage callback seems does not make sense.) If we do implement the callback, we need to populate selector. Or alternative, we can just remove mc13xxx_fixed_regulator_set_voltage. Axel drivers/regulator/mc13xxx-regulator-core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/mc13xxx-regulator-core.c b/drivers/regulator/mc13xxx-regulator-core.c index d6eda28..8151889 100644 --- a/drivers/regulator/mc13xxx-regulator-core.c +++ b/drivers/regulator/mc13xxx-regulator-core.c @@ -143,10 +143,12 @@ int mc13xxx_fixed_regulator_set_voltage(struct regulator_dev *rdev, int min_uV, __func__, id, min_uV, max_uV); if (min_uV <= rdev->desc->volt_table[0] && - rdev->desc->volt_table[0] <= max_uV) + rdev->desc->volt_table[0] <= max_uV) { + *selector = 0; return 0; - else + } else { return -EINVAL; + } } EXPORT_SYMBOL_GPL(mc13xxx_fixed_regulator_set_voltage); -- 1.7.9.5