Commit ae4e4dde5246cd27d0cce29a64761c33cb4ceee4

Authored by Jernej Skrabec
Committed by Maxime Ripard
1 parent e8f86a0261

sunxi: power: Compile sy8106a driver only during SPL build

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@siol.net>
Reviewed-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Showing 1 changed file with 2 additions and 0 deletions Side-by-side Diff

drivers/power/sy8106a.c
... ... @@ -12,6 +12,7 @@
12 12 #define SY8106A_VOUT1_SEL 1
13 13 #define SY8106A_VOUT1_SEL_ENABLE (1 << 7)
14 14  
  15 +#ifdef CONFIG_SPL_BUILD
15 16 static u8 sy8106a_mvolt_to_cfg(int mvolt, int min, int max, int div)
16 17 {
17 18 if (mvolt < min)
... ... @@ -27,4 +28,5 @@
27 28 u8 data = sy8106a_mvolt_to_cfg(mvolt, 680, 1950, 10) | SY8106A_VOUT1_SEL_ENABLE;
28 29 return i2c_write(SY8106A_I2C_ADDR, SY8106A_VOUT1_SEL, 1, &data, 1);
29 30 }
  31 +#endif