[PATCH v3] ARM: imx: Switch Data Modul i.MX8M Mini eDM SBC to USB251x Hub driver

Stefan Herbrechtsmeier stefan.herbrechtsmeier-oss at weidmueller.com
Wed Jun 15 12:34:02 CEST 2022


Hi Marek,

Am 14.06.2022 um 22:05 schrieb Marek Vasut:
> Replace the ad-hoc I2C register programming scripted in board
> environment with U-Boot DM driver.
> 
> Signed-off-by: Marek Vasut <marex at denx.de>
> Cc: Fabio Estevam <festevam at gmail.com>
> Cc: Peng Fan <peng.fan at nxp.com>
> Cc: Stefano Babic <sbabic at denx.de>
> ---
> V2: Use uclass_get_device_by_name()
> V3: Reinstate the device-internal.h, needed for device_probe()
> ---
>   .../imx8mm_data_modul_edm_sbc.c               |  9 +++++++++
>   configs/imx8mm_data_modul_edm_sbc_defconfig   |  1 +
>   include/configs/imx8mm_data_modul_edm_sbc.h   | 20 -------------------
>   3 files changed, 10 insertions(+), 20 deletions(-)
> 
> diff --git a/board/data_modul/imx8mm_edm_sbc/imx8mm_data_modul_edm_sbc.c b/board/data_modul/imx8mm_edm_sbc/imx8mm_data_modul_edm_sbc.c
> index 46cb6f77b59..07d9effbbb9 100644
> --- a/board/data_modul/imx8mm_edm_sbc/imx8mm_data_modul_edm_sbc.c
> +++ b/board/data_modul/imx8mm_edm_sbc/imx8mm_data_modul_edm_sbc.c
> @@ -9,6 +9,7 @@
>   #include <asm/io.h>
>   #include <asm/mach-imx/boot_mode.h>
>   #include <dm.h>
> +#include <dm/device-internal.h>
>   #include <i2c_eeprom.h>
>   #include <malloc.h>
>   #include <net.h>
> @@ -104,7 +105,15 @@ int board_init(void)
>   
>   int board_late_init(void)
>   {
> +	struct udevice *dev;
> +	int ret;
> +
>   	setup_boot_device();
>   	setup_mac_address();
> +
> +	ret = uclass_get_device_by_name(UCLASS_MISC, "usb-hub at 2c", &dev);
> +	if (!ret)
> +		device_probe(dev);

You could remove the device_probe. The uclass_get_device_by_name call 
uclass_find_device_by_name and uclass_get_device_tail which call 
device_probe.


More information about the U-Boot mailing list