Skip to content
Snippets Groups Projects
Commit ae4e4dde authored by Jernej Skrabec's avatar Jernej Skrabec Committed by Maxime Ripard
Browse files

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: default avatarJernej Skrabec <jernej.skrabec@siol.net>
Reviewed-by: default avatarHeiko Schocher <hs@denx.de>
Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
parent e8f86a02
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#define SY8106A_VOUT1_SEL 1 #define SY8106A_VOUT1_SEL 1
#define SY8106A_VOUT1_SEL_ENABLE (1 << 7) #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) static u8 sy8106a_mvolt_to_cfg(int mvolt, int min, int max, int div)
{ {
if (mvolt < min) if (mvolt < min)
...@@ -27,3 +28,4 @@ int sy8106a_set_vout1(unsigned int mvolt) ...@@ -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; 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); return i2c_write(SY8106A_I2C_ADDR, SY8106A_VOUT1_SEL, 1, &data, 1);
} }
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment