Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932697Ab2KNHri (ORCPT ); Wed, 14 Nov 2012 02:47:38 -0500 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:43743 "EHLO opensource.wolfsonmicro.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932680Ab2KNHrg (ORCPT ); Wed, 14 Nov 2012 02:47:36 -0500 From: Mark Brown To: Liam Girdwood Cc: linux-kernel@vger.kernel.org, Mark Brown Subject: [PATCH] regulator: core: Add regulator_is_supported_voltage_tol() Date: Wed, 14 Nov 2012 16:47:29 +0900 Message-Id: <1352879249-6074-1-git-send-email-broonie@opensource.wolfsonmicro.com> X-Mailer: git-send-email 1.7.10.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1150 Lines: 33 If consumers wish to set voltages based on a tolerance it stands to reason that they will also want to query for support in the same manner. Signed-off-by: Mark Brown --- include/linux/regulator/consumer.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index 07838c9..528e32a 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h @@ -367,4 +367,12 @@ static inline int regulator_set_voltage_tol(struct regulator *regulator, new_uV - tol_uV, new_uV + tol_uV); } +static inline int regulator_is_supported_voltage_tol(struct regulator *regulator, + int target_uV, int tol_uV) +{ + return regulator_is_supported_voltage(regulator, + target_uV - tol_uV, + target_uV + tol_uV); +} + #endif -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/