Message ID | 20221128070229.4394-3-samuel@sholland.org |
---|---|
State | Accepted |
Commit | 2f52be8b8def41e74fa9dce585d7819bab28ec11 |
Delegated to: | Andre Przywara |
Headers | show |
Series | video: sunxi: dw-hdmi: Partial OF conversion | expand |
On Mon, 28 Nov 2022 01:02:25 -0600 Samuel Holland <samuel@sholland.org> wrote: > From: Jernej Skrabec <jernej.skrabec@gmail.com> > > Currently the sunxi dw-hdmi driver is probed unconditionally, > even if there is no such device. > > Switch the driver to probing via a compatible string. This brings many > benefits; the driver is only probed when needed, and now it can read the > DT node. > > Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> > Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Cheers, Andre > --- > > drivers/video/sunxi/sunxi_dw_hdmi.c | 18 ++++++++++-------- > 1 file changed, 10 insertions(+), 8 deletions(-) > > diff --git a/drivers/video/sunxi/sunxi_dw_hdmi.c b/drivers/video/sunxi/sunxi_dw_hdmi.c > index 19ed80b48a4..e7265af7d8f 100644 > --- a/drivers/video/sunxi/sunxi_dw_hdmi.c > +++ b/drivers/video/sunxi/sunxi_dw_hdmi.c > @@ -370,14 +370,16 @@ static const struct dm_display_ops sunxi_dw_hdmi_ops = { > .mode_valid = sunxi_dw_hdmi_mode_valid, > }; > > -U_BOOT_DRIVER(sunxi_dw_hdmi) = { > - .name = "sunxi_dw_hdmi", > - .id = UCLASS_DISPLAY, > - .ops = &sunxi_dw_hdmi_ops, > - .probe = sunxi_dw_hdmi_probe, > - .priv_auto = sizeof(struct sunxi_dw_hdmi_priv), > +static const struct udevice_id sunxi_dw_hdmi_ids[] = { > + { .compatible = "allwinner,sun8i-a83t-dw-hdmi" }, > + { } > }; > > -U_BOOT_DRVINFO(sunxi_dw_hdmi) = { > - .name = "sunxi_dw_hdmi" > +U_BOOT_DRIVER(sunxi_dw_hdmi) = { > + .name = "sunxi_dw_hdmi", > + .id = UCLASS_DISPLAY, > + .of_match = sunxi_dw_hdmi_ids, > + .probe = sunxi_dw_hdmi_probe, > + .priv_auto = sizeof(struct sunxi_dw_hdmi_priv), > + .ops = &sunxi_dw_hdmi_ops, > };
diff --git a/drivers/video/sunxi/sunxi_dw_hdmi.c b/drivers/video/sunxi/sunxi_dw_hdmi.c index 19ed80b48a4..e7265af7d8f 100644 --- a/drivers/video/sunxi/sunxi_dw_hdmi.c +++ b/drivers/video/sunxi/sunxi_dw_hdmi.c @@ -370,14 +370,16 @@ static const struct dm_display_ops sunxi_dw_hdmi_ops = { .mode_valid = sunxi_dw_hdmi_mode_valid, }; -U_BOOT_DRIVER(sunxi_dw_hdmi) = { - .name = "sunxi_dw_hdmi", - .id = UCLASS_DISPLAY, - .ops = &sunxi_dw_hdmi_ops, - .probe = sunxi_dw_hdmi_probe, - .priv_auto = sizeof(struct sunxi_dw_hdmi_priv), +static const struct udevice_id sunxi_dw_hdmi_ids[] = { + { .compatible = "allwinner,sun8i-a83t-dw-hdmi" }, + { } }; -U_BOOT_DRVINFO(sunxi_dw_hdmi) = { - .name = "sunxi_dw_hdmi" +U_BOOT_DRIVER(sunxi_dw_hdmi) = { + .name = "sunxi_dw_hdmi", + .id = UCLASS_DISPLAY, + .of_match = sunxi_dw_hdmi_ids, + .probe = sunxi_dw_hdmi_probe, + .priv_auto = sizeof(struct sunxi_dw_hdmi_priv), + .ops = &sunxi_dw_hdmi_ops, };