|
@@ -24,7 +24,7 @@
|
|
|
#include <net.h>
|
|
|
#include <reset.h>
|
|
|
#include <dt-bindings/pinctrl/sun4i-a10.h>
|
|
|
-#ifdef CONFIG_DM_GPIO
|
|
|
+#if CONFIG_IS_ENABLED(DM_GPIO)
|
|
|
#include <asm-generic/gpio.h>
|
|
|
#endif
|
|
|
|
|
@@ -142,7 +142,7 @@ struct emac_eth_dev {
|
|
|
struct clk ephy_clk;
|
|
|
struct reset_ctl tx_rst;
|
|
|
struct reset_ctl ephy_rst;
|
|
|
-#ifdef CONFIG_DM_GPIO
|
|
|
+#if CONFIG_IS_ENABLED(DM_GPIO)
|
|
|
struct gpio_desc reset_gpio;
|
|
|
#endif
|
|
|
};
|
|
@@ -696,7 +696,7 @@ err_tx_clk:
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-#if defined(CONFIG_DM_GPIO)
|
|
|
+#if CONFIG_IS_ENABLED(DM_GPIO)
|
|
|
static int sun8i_mdio_reset(struct mii_dev *bus)
|
|
|
{
|
|
|
struct udevice *dev = bus->priv;
|
|
@@ -743,7 +743,7 @@ static int sun8i_mdio_init(const char *name, struct udevice *priv)
|
|
|
bus->write = sun8i_mdio_write;
|
|
|
snprintf(bus->name, sizeof(bus->name), name);
|
|
|
bus->priv = (void *)priv;
|
|
|
-#if defined(CONFIG_DM_GPIO)
|
|
|
+#if CONFIG_IS_ENABLED(DM_GPIO)
|
|
|
bus->reset = sun8i_mdio_reset;
|
|
|
#endif
|
|
|
|
|
@@ -905,7 +905,7 @@ static int sun8i_emac_eth_ofdata_to_platdata(struct udevice *dev)
|
|
|
const fdt32_t *reg;
|
|
|
int node = dev_of_offset(dev);
|
|
|
int offset = 0;
|
|
|
-#ifdef CONFIG_DM_GPIO
|
|
|
+#if CONFIG_IS_ENABLED(DM_GPIO)
|
|
|
int reset_flags = GPIOD_IS_OUT;
|
|
|
#endif
|
|
|
int ret;
|
|
@@ -999,7 +999,7 @@ static int sun8i_emac_eth_ofdata_to_platdata(struct udevice *dev)
|
|
|
printf("%s: Invalid RX delay value %d\n", __func__,
|
|
|
sun8i_pdata->rx_delay_ps);
|
|
|
|
|
|
-#ifdef CONFIG_DM_GPIO
|
|
|
+#if CONFIG_IS_ENABLED(DM_GPIO)
|
|
|
if (fdtdec_get_bool(gd->fdt_blob, dev_of_offset(dev),
|
|
|
"snps,reset-active-low"))
|
|
|
reset_flags |= GPIOD_ACTIVE_LOW;
|