All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jernej Škrabec" <jernej.skrabec@siol.net>
To: u-boot@lists.denx.de
Subject: [PATCH v2 09/19] video: sunxi: de2: switch to public uclass functions
Date: Sun, 07 Mar 2021 08:35:23 +0100	[thread overview]
Message-ID: <14293686.rKD1xP5lg2@jernej-laptop> (raw)
In-Reply-To: <20210307013252.7ded7286@slackpad.fritz.box>

Dne nedelja, 07. marec 2021 ob 02:32:52 CET je Andre Przywara napisal(a):
> On Sat,  6 Mar 2021 20:54:27 +0100
> 
> Jernej Skrabec <jernej.skrabec@siol.net> wrote:
> > Currently DE2 driver uses functions which are defined in internal
> > headers. They are not meant to be used outside of uclass framework.
> > Switch DE2 driver to public ones. This has additional benefit that
> > device_probe doesn't need to be called manually.
> 
> Indeed, good solution: for the calls in _probe(), we call de2_init()
> right afterwards, which would explicitly call probe for the display, so
> this both saves this call and the usage of the internal function.
> For the calls in simplefb_setup: the DM framework checks if a device
> has already been activated, so there is no problem with double probes.
> 
> However, actually testing this on a Pine64-LTS revealed that this breaks
> on the A64: I only get a black screen (bisecting down to this commit).
> 
> I didn't investigate any further yet, just wanted to give a heads up.

Thanks! I'll check what's going on.

Best regards,
Jernej

> 
> Cheers,
> Andre
> 
> > Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
> > ---
> > 
> >  drivers/video/sunxi/sunxi_de2.c | 29 ++++++++++-------------------
> >  1 file changed, 10 insertions(+), 19 deletions(-)
> > 
> > diff --git a/drivers/video/sunxi/sunxi_de2.c
> > b/drivers/video/sunxi/sunxi_de2.c index 6b836a011944..e02d359cd259 100644
> > --- a/drivers/video/sunxi/sunxi_de2.c
> > +++ b/drivers/video/sunxi/sunxi_de2.c
> > @@ -19,8 +19,6 @@
> > 
> >  #include <asm/io.h>
> >  #include <asm/arch/clock.h>
> >  #include <asm/arch/display2.h>
> > 
> > -#include <dm/device-internal.h>
> > -#include <dm/uclass-internal.h>
> > 
> >  #include <linux/bitops.h>
> >  #include "simplefb_common.h"
> > 
> > @@ -198,13 +196,6 @@ static int sunxi_de2_init(struct udevice *dev, ulong
> > fbbase,> 
> >  	disp_uc_plat->source_id = mux;
> > 
> > -	ret = device_probe(disp);
> > -	if (ret) {
> > -		debug("%s: device '%s' display won't probe (ret=%d)\n",
> > -		      __func__, dev->name, ret);
> > -		return ret;
> > -	}
> > -
> > 
> >  	ret = display_read_timing(disp, &timing);
> >  	if (ret) {
> >  	
> >  		debug("%s: Failed to read timings\n", __func__);
> > 
> > @@ -245,8 +236,8 @@ static int sunxi_de2_probe(struct udevice *dev)
> > 
> >  	if (!(gd->flags & GD_FLG_RELOC))
> >  	
> >  		return 0;
> > 
> > -	ret = uclass_find_device_by_name(UCLASS_DISPLAY,
> > -					 "sunxi_lcd", &disp);
> > +	ret = uclass_get_device_by_driver(UCLASS_DISPLAY,
> > +					  
DM_DRIVER_GET(sunxi_lcd), &disp);
> > 
> >  	if (!ret) {
> >  	
> >  		int mux;
> > 
> > @@ -262,8 +253,8 @@ static int sunxi_de2_probe(struct udevice *dev)
> > 
> >  	debug("%s: lcd display not found (ret=%d)\n", __func__, ret);
> > 
> > -	ret = uclass_find_device_by_name(UCLASS_DISPLAY,
> > -					 "sunxi_dw_hdmi", 
&disp);
> > +	ret = uclass_get_device_by_driver(UCLASS_DISPLAY,
> > +					  
DM_DRIVER_GET(sunxi_dw_hdmi), &disp);
> > 
> >  	if (!ret) {
> >  	
> >  		int mux;
> >  		if (IS_ENABLED(CONFIG_MACH_SUNXI_H3_H5))
> > 
> > @@ -332,8 +323,8 @@ int sunxi_simplefb_setup(void *blob)
> > 
> >  		mux = 1;
> >  	
> >  	/* Skip simplefb setting if DE2 / HDMI is not present */
> > 
> > -	ret = uclass_find_device_by_name(UCLASS_VIDEO,
> > -					 "sunxi_de2", &de2);
> > +	ret = uclass_get_device_by_driver(UCLASS_VIDEO,
> > +					  
DM_DRIVER_GET(sunxi_de2), &de2);
> > 
> >  	if (ret) {
> >  	
> >  		debug("DE2 not present\n");
> >  		return 0;
> > 
> > @@ -342,8 +333,8 @@ int sunxi_simplefb_setup(void *blob)
> > 
> >  		return 0;
> >  	
> >  	}
> > 
> > -	ret = uclass_find_device_by_name(UCLASS_DISPLAY,
> > -					 "sunxi_dw_hdmi", 
&hdmi);
> > +	ret = uclass_get_device_by_driver(UCLASS_DISPLAY,
> > +					  
DM_DRIVER_GET(sunxi_dw_hdmi), &hdmi);
> > 
> >  	if (ret) {
> >  	
> >  		debug("HDMI not present\n");
> >  	
> >  	} else if (device_active(hdmi)) {
> > 
> > @@ -355,8 +346,8 @@ int sunxi_simplefb_setup(void *blob)
> > 
> >  		debug("HDMI present but not probed\n");
> >  	
> >  	}
> > 
> > -	ret = uclass_find_device_by_name(UCLASS_DISPLAY,
> > -					 "sunxi_lcd", &lcd);
> > +	ret = uclass_get_device_by_driver(UCLASS_DISPLAY,
> > +					  
DM_DRIVER_GET(sunxi_lcd), &lcd);
> > 
> >  	if (ret)
> >  	
> >  		debug("LCD not present\n");
> >  	
> >  	else if (device_active(lcd))

  reply	other threads:[~2021-03-07  7:35 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-06 19:54 [PATCH v2 00/19] video: sunxi: rework DE2 driver Jernej Skrabec
2021-03-06 19:54 ` [PATCH v2 01/19] sunxi: video: select dw-hdmi in Kconfig, not Makefile Jernej Skrabec
2021-03-06 19:54 ` [PATCH v2 02/19] video: sunxi: Add mode_valid callback to sunxi_dw_hdmi Jernej Skrabec
2021-03-06 19:54 ` [PATCH v2 03/19] common: edid: check for digital display earlier Jernej Skrabec
2021-03-06 19:54 ` [PATCH v2 04/19] common: edid: extract code for detailed timing search Jernej Skrabec
2021-03-07  1:29   ` Andre Przywara
2021-03-06 19:54 ` [PATCH v2 05/19] common: edid: Search for valid timing in extension block Jernej Skrabec
2021-03-06 19:54 ` [PATCH v2 06/19] video: sunxi: Use DW-HDMI hpd function Jernej Skrabec
2021-03-07  1:30   ` Andre Przywara
2021-03-06 19:54 ` [PATCH v2 07/19] video: sunxi: Remove check for ddc-i2c-bus property Jernej Skrabec
2021-03-06 19:54 ` [PATCH v2 08/19] video: sunxi: Remove TV probe from DE2 Jernej Skrabec
2021-03-07  1:31   ` Andre Przywara
2021-03-06 19:54 ` [PATCH v2 09/19] video: sunxi: de2: switch to public uclass functions Jernej Skrabec
2021-03-07  1:32   ` Andre Przywara
2021-03-07  7:35     ` Jernej Škrabec [this message]
2021-03-09  0:40       ` Andre Przywara
2021-03-09  5:35         ` Jernej Škrabec
2021-03-06 19:54 ` [PATCH v2 10/19] video: sunxi: dw-hdmi: probe driver by compatible Jernej Skrabec
2021-03-07  1:33   ` Andre Przywara
2021-03-06 19:54 ` [PATCH v2 11/19] video: sunxi: dw-hdmi: read address from DT node Jernej Skrabec
2021-04-06  1:09   ` Andre Przywara
2021-03-06 19:54 ` [PATCH v2 12/19] video: sunxi: de2: switch to DT probing Jernej Skrabec
2021-04-06  1:09   ` Andre Przywara
2021-04-06  7:14     ` Simon Glass
2021-03-06 19:54 ` [PATCH v2 13/19] video: sunxi: de2: read address from DT node Jernej Skrabec
2021-04-06  1:10   ` Andre Przywara
2021-03-06 19:54 ` [PATCH v2 14/19] clk: sunxi: Add DE2 and HDMI clocks to H3 and A64 Jernej Skrabec
2021-03-08  8:00   ` Jagan Teki
2021-03-06 19:54 ` [PATCH v2 15/19] clk: sunxi: add DE2 clock driver Jernej Skrabec
2021-03-08  7:59   ` Jagan Teki
2021-03-06 19:54 ` [PATCH v2 16/19] video: sunxi: de2: switch clock setup to DM model Jernej Skrabec
2021-03-08  8:02   ` Jagan Teki
2021-03-06 19:54 ` [PATCH v2 17/19] video: dw-hdmi: modify phy init callback to include full timings Jernej Skrabec
2021-03-06 19:54 ` [PATCH v2 18/19] video: sunxi: Add DW HDMI PHY driver Jernej Skrabec
2021-03-08  7:57   ` Jagan Teki
2021-03-09  5:38     ` Jernej Škrabec
2021-03-06 19:54 ` [PATCH v2 19/19] video: sunxi: dw-hdmi: Use new " Jernej Skrabec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14293686.rKD1xP5lg2@jernej-laptop \
    --to=jernej.skrabec@siol.net \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.