lkml.org 
[lkml]   [2013]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/5] regulator: s5m8767: Add symbols for hard-coded DVS_RAMP register
> 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 <k.kozlowski@samsung.com>
> Cc: Kyungmin Park <kyungmin.park@samsung.com>
> Cc: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
> drivers/regulator/s5m8767.c | 22 ++++++++++------------
> include/linux/mfd/samsung/s5m8767.h | 15 +++++++++++++++
> 2 files changed, 25 insertions(+), 12 deletions(-)

<snip>

> 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
--
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/

\
 
 \ /
  Last update: 2013-12-17 15:41    [W:0.072 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site