From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754057Ab3LQNwB (ORCPT ); Tue, 17 Dec 2013 08:52:01 -0500 Received: from mail-wi0-f181.google.com ([209.85.212.181]:56971 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753974Ab3LQNv7 (ORCPT ); Tue, 17 Dec 2013 08:51:59 -0500 Date: Tue, 17 Dec 2013 13:51:53 +0000 From: Lee Jones To: Krzysztof Kozlowski Cc: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Rob Landley , Sangbeom Kim , Samuel Ortiz , Liam Girdwood , Mark Brown , Grant Likely , Sachin Kamat , Thomas Abraham , Amit Daniel Kachhap , devicetree@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Kyungmin Park , Marek Szyprowski Subject: Re: [PATCH 1/5] regulator: s5m8767: Add symbols for hard-coded DVS_RAMP register Message-ID: <20131217135153.GI19810@lee--X1> References: <1387286601-21646-1-git-send-email-k.kozlowski@samsung.com> <1387286601-21646-2-git-send-email-k.kozlowski@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1387286601-21646-2-git-send-email-k.kozlowski@samsung.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Add symbols for hard-coded values of BUCK_RAMP field in DVS_RAMP > register. This simplifies a little the code as register update is called > only once. > > Signed-off-by: Krzysztof Kozlowski > Cc: Kyungmin Park > Cc: Marek Szyprowski > --- > drivers/regulator/s5m8767.c | 22 ++++++++++------------ > include/linux/mfd/samsung/s5m8767.h | 15 +++++++++++++++ > 2 files changed, 25 insertions(+), 12 deletions(-) > diff --git a/include/linux/mfd/samsung/s5m8767.h b/include/linux/mfd/samsung/s5m8767.h > index 9198377ee859..2ab0b0f03641 100644 > --- a/include/linux/mfd/samsung/s5m8767.h > +++ b/include/linux/mfd/samsung/s5m8767.h > @@ -186,4 +186,19 @@ enum s5m8767_regulators { > #define S5M8767_ENCTRL_SHIFT 6 > #define S5M8767_ENCTRL_MASK (0x3 << S5M8767_ENCTRL_SHIFT) > > +/* > + * Values for BUCK_RAMP field in DVS_RAMP register, matching raw values > + * in mV/us. > + */ > +enum s5m8767_dvs_buck_ramp_values { > + S5M8767_DVS_BUCK_RAMP_5 = 0x4, > + S5M8767_DVS_BUCK_RAMP_10 = 0x9, > + S5M8767_DVS_BUCK_RAMP_12_5 = 0xb, > + S5M8767_DVS_BUCK_RAMP_25 = 0xd, > + S5M8767_DVS_BUCK_RAMP_50 = 0xe, > + S5M8767_DVS_BUCK_RAMP_100 = 0xf, > +}; Why do these have to be enums? > +#define S5M8767_DVS_BUCK_RAMP_SHIFT 4 > +#define S5M8767_DVS_BUCK_RAMP_MASK (0xf << S5M8767_DVS_BUCK_RAMP_SHIFT) > + > #endif /* __LINUX_MFD_S5M8767_H */ -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog