[U-Boot] [PATCH 1/4] sunxi: power: Compile sy8106a driver only during SPL build
Heiko Schocher
hs at denx.de
Fri Apr 28 03:42:10 UTC 2017
Hello Jernej,
Am 27.04.2017 um 00:03 schrieb Jernej Skrabec:
> Driver for that regulator is used only in SPL and it uses old I2C
> interface. If we want to use DM I2C in U-Boot proper, compilation of
> this driver has to be limited only to SPL.
>
> Signed-off-by: Jernej Skrabec <jernej.skrabec at siol.net>
> ---
>
> drivers/power/sy8106a.c | 2 ++
> 1 file changed, 2 insertions(+)
Reviewed-by: Heiko Schocher <hs at denx.de>
bye,
Heiko
>
> diff --git a/drivers/power/sy8106a.c b/drivers/power/sy8106a.c
> index bbf116f655..f9db3965f2 100644
> --- a/drivers/power/sy8106a.c
> +++ b/drivers/power/sy8106a.c
> @@ -12,6 +12,7 @@
> #define SY8106A_VOUT1_SEL 1
> #define SY8106A_VOUT1_SEL_ENABLE (1 << 7)
>
> +#ifdef CONFIG_SPL_BUILD
> static u8 sy8106a_mvolt_to_cfg(int mvolt, int min, int max, int div)
> {
> if (mvolt < min)
> @@ -27,3 +28,4 @@ int sy8106a_set_vout1(unsigned int mvolt)
> u8 data = sy8106a_mvolt_to_cfg(mvolt, 680, 1950, 10) | SY8106A_VOUT1_SEL_ENABLE;
> return i2c_write(SY8106A_I2C_ADDR, SY8106A_VOUT1_SEL, 1, &data, 1);
> }
> +#endif
>
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
More information about the U-Boot
mailing list