board: stm32mp1: use IS_ENABLED to prevent ifdef in dk2_i2c1_fix

Use IS_ENABLED to prevent ifdef in dk2_i2c1_fix.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
This commit is contained in:
Patrick Delaunay 2020-07-31 16:31:47 +02:00 committed by Patrice Chotard
parent 75f9b190e4
commit e817c8eca5

View file

@ -521,7 +521,6 @@ static void sysconf_init(void)
clrbits_le32(syscfg + SYSCFG_CMPCR, SYSCFG_CMPCR_SW_CTRL); clrbits_le32(syscfg + SYSCFG_CMPCR, SYSCFG_CMPCR_SW_CTRL);
} }
#ifdef CONFIG_DM_REGULATOR
/* Fix to make I2C1 usable on DK2 for touchscreen usage in kernel */ /* Fix to make I2C1 usable on DK2 for touchscreen usage in kernel */
static int dk2_i2c1_fix(void) static int dk2_i2c1_fix(void)
{ {
@ -529,6 +528,9 @@ static int dk2_i2c1_fix(void)
struct gpio_desc hdmi, audio; struct gpio_desc hdmi, audio;
int ret = 0; int ret = 0;
if (!IS_ENABLED(CONFIG_DM_REGULATOR))
return -ENODEV;
node = ofnode_path("/soc/i2c@40012000/hdmi-transmitter@39"); node = ofnode_path("/soc/i2c@40012000/hdmi-transmitter@39");
if (!ofnode_valid(node)) { if (!ofnode_valid(node)) {
pr_debug("%s: no hdmi-transmitter@39 ?\n", __func__); pr_debug("%s: no hdmi-transmitter@39 ?\n", __func__);
@ -586,7 +588,6 @@ static bool board_is_dk2(void)
return false; return false;
} }
#endif
static bool board_is_ev1(void) static bool board_is_ev1(void)
{ {
@ -634,12 +635,11 @@ int board_init(void)
if (board_is_ev1()) if (board_is_ev1())
board_ev1_init(); board_ev1_init();
#ifdef CONFIG_DM_REGULATOR
if (board_is_dk2()) if (board_is_dk2())
dk2_i2c1_fix(); dk2_i2c1_fix();
regulators_enable_boot_on(_DEBUG); if (IS_ENABLED(CONFIG_DM_REGULATOR))
#endif regulators_enable_boot_on(_DEBUG);
if (!IS_ENABLED(CONFIG_TFABOOT)) if (!IS_ENABLED(CONFIG_TFABOOT))
sysconf_init(); sysconf_init();