From: Andre Przywara <andre.przywara@arm.com>
To: u-boot@lists.denx.de
Subject: [PATCH 06/19] video: sunxi: Use DW-HDMI hpd function
Date: Thu, 4 Mar 2021 01:42:08 +0000 [thread overview]
Message-ID: <20210304014208.53e8ee56@slackpad.fritz.box> (raw)
In-Reply-To: <20210223204631.1609597-7-jernej.skrabec@siol.net>
On Tue, 23 Feb 2021 21:46:18 +0100
Jernej Skrabec <jernej.skrabec@siol.net> wrote:
> It turns out that even though A64, H3 and H5 have custom PHY, standard
> hot plug detection for DW-HDMI works just fine.
But the generic code looks for a different bit in a different register,
doesn't it?
I see SUNXI_HDMI_BASE + 0x10000 + 56, bit 19 before vs.
SUNXI_HDMI_BASE + 0x3004, bit 2 in the new code.
Is that duplicated functionality in the AW PHY?
Cheers,
Andre
>
> Remove custom hpd method to reduce amount of custom code.
>
> Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net>
> ---
> drivers/video/sunxi/sunxi_dw_hdmi.c | 34 +++++------------------------
> 1 file changed, 6 insertions(+), 28 deletions(-)
>
> diff --git a/drivers/video/sunxi/sunxi_dw_hdmi.c b/drivers/video/sunxi/sunxi_dw_hdmi.c
> index e3811a2ec15f..37e78ff24111 100644
> --- a/drivers/video/sunxi/sunxi_dw_hdmi.c
> +++ b/drivers/video/sunxi/sunxi_dw_hdmi.c
> @@ -114,28 +114,6 @@ static void sunxi_dw_hdmi_phy_init(void)
> writel(0x42494E47, &phy->unscramble);
> }
>
> -static int sunxi_dw_hdmi_get_plug_in_status(void)
> -{
> - struct sunxi_hdmi_phy * const phy =
> - (struct sunxi_hdmi_phy *)(SUNXI_HDMI_BASE + HDMI_PHY_OFFS);
> -
> - return !!(readl(&phy->status) & (1 << 19));
> -}
> -
> -static int sunxi_dw_hdmi_wait_for_hpd(void)
> -{
> - ulong start;
> -
> - start = get_timer(0);
> - do {
> - if (sunxi_dw_hdmi_get_plug_in_status())
> - return 0;
> - udelay(100);
> - } while (get_timer(start) < 300);
> -
> - return -1;
> -}
> -
> static void sunxi_dw_hdmi_phy_set(uint clock, int phy_div)
> {
> struct sunxi_hdmi_phy * const phy =
> @@ -370,12 +348,6 @@ static int sunxi_dw_hdmi_probe(struct udevice *dev)
>
> sunxi_dw_hdmi_phy_init();
>
> - ret = sunxi_dw_hdmi_wait_for_hpd();
> - if (ret < 0) {
> - debug("hdmi can not get hpd signal\n");
> - return -1;
> - }
> -
> priv->hdmi.ioaddr = SUNXI_HDMI_BASE;
> priv->hdmi.i2c_clk_high = 0xd8;
> priv->hdmi.i2c_clk_low = 0xfe;
> @@ -383,6 +355,12 @@ static int sunxi_dw_hdmi_probe(struct udevice *dev)
> priv->hdmi.phy_set = sunxi_dw_hdmi_phy_cfg;
> priv->mux = uc_plat->source_id;
>
> + ret = dw_hdmi_phy_wait_for_hpd(&priv->hdmi);
> + if (ret < 0) {
> + debug("hdmi can not get hpd signal\n");
> + return -1;
> + }
> +
> uclass_get_device_by_phandle(UCLASS_I2C, dev, "ddc-i2c-bus",
> &priv->hdmi.ddc_bus);
>
next prev parent reply other threads:[~2021-03-04 1:42 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-23 20:46 [PATCH 00/19] video: sunxi: Rework DE2 driver Jernej Skrabec
2021-02-23 20:46 ` [PATCH 01/19] sunxi: video: select dw-hdmi in Kconfig, not Makefile Jernej Skrabec
2021-03-04 1:40 ` Andre Przywara
2021-02-23 20:46 ` [PATCH 02/19] video: sunxi: Add mode_valid callback to sunxi_dw_hdmi Jernej Skrabec
2021-03-04 1:41 ` Andre Przywara
2021-02-23 20:46 ` [PATCH 03/19] common: edid: check for digital display earlier Jernej Skrabec
2021-03-04 1:41 ` Andre Przywara
2021-02-23 20:46 ` [PATCH 04/19] common: edid: extract code for detailed timing search Jernej Skrabec
2021-03-04 1:41 ` Andre Przywara
2021-03-06 19:16 ` Jernej Škrabec
2021-02-23 20:46 ` [PATCH 05/19] common: edid: Search for valid timing in extension block Jernej Skrabec
2021-02-23 20:46 ` [PATCH 06/19] video: sunxi: Use DW-HDMI hpd function Jernej Skrabec
2021-03-04 1:42 ` Andre Przywara [this message]
2021-03-04 17:27 ` Jernej Škrabec
2021-02-23 20:46 ` [PATCH 07/19] video: sunxi: Remove check for ddc-i2c-bus property Jernej Skrabec
2021-03-04 1:42 ` Andre Przywara
2021-03-04 19:41 ` Jernej Škrabec
2021-02-23 20:46 ` [PATCH 08/19] video: sunxi: Remove TV probe from DE2 Jernej Skrabec
2021-02-23 20:46 ` [PATCH 09/19] video: sunxi: de2: switch to public uclass functions Jernej Skrabec
2021-02-23 20:46 ` [PATCH 10/19] video: sunxi: dw-hdmi: probe driver by compatible Jernej Skrabec
2021-02-23 20:46 ` [PATCH 11/19] video: sunxi: dw-hdmi: read address from DT node Jernej Skrabec
2021-02-23 20:46 ` [PATCH 12/19] video: dw-hdmi: modify phy init callback to include full timings Jernej Skrabec
2021-02-23 20:46 ` [PATCH 13/19] video: sunxi: dw-hdmi: move PHY config to appropriate place Jernej Skrabec
2021-02-23 20:46 ` [PATCH 14/19] video: sunxi: dw-hdmi: rework PHY initialization Jernej Skrabec
2021-02-24 18:21 ` [linux-sunxi] " Jernej Škrabec
2021-02-23 20:46 ` [PATCH 15/19] video: sunxi: de2: switch to DT probing Jernej Skrabec
2021-02-23 20:46 ` [PATCH 16/19] video: sunxi: de2: read address from DT node Jernej Skrabec
2021-02-23 20:46 ` [PATCH 17/19] clk: sunxi: Add DE2 clocks to H3 and A64 Jernej Skrabec
2021-02-23 20:46 ` [PATCH 18/19] clk: sunxi: add DE2 clock driver Jernej Skrabec
2021-02-23 20:46 ` [PATCH 19/19] video: sunxi: de2: switch clock setup to DM model 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=20210304014208.53e8ee56@slackpad.fritz.box \
--to=andre.przywara@arm.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox