All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Yan <andy.yan@rock-chips.com>
To: airlied@linux.ie, heiko@sntech.de, fabio.estevam@freescale.com,
	rmk+kernel@arm.linux.org.uk
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Grant Likely <grant.likely@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Shawn Guo <shawn.guo@linaro.org>,
	Andy yan <andy.yan@rock-chips.com>,
	Josh Boyer <jwboyer@redhat.com>,
	Sean Paul <seanpaul@chromium.org>,
	Inki Dae <inki.dae@samsung.com>, Dave Airlie <airlied@redhat.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Lucas Stach <l.stach@pengutronix.de>,
	Zubair.Kakakhel@imgtec.com, djkurtz@google.com,
	ykk@rock-chips.com, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, devel@driverdev.osuosl.org,
	devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org,
	jay.xu@rock-chips.com, Pawel Moll <pawel.moll@arm.com>,
	mark.yao@rock-chips.com, Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>
Subject: [PATCH v11 09/12] drm: bridge/dw_hdmi: clear i2cmphy_stat0 reg in hdmi_phy_wait_i2c_done
Date: Fri, 14 Nov 2014 21:45:41 +0800	[thread overview]
Message-ID: <1415972741-8718-1-git-send-email-andy.yan@rock-chips.com> (raw)
In-Reply-To: <1415972231-8283-1-git-send-email-andy.yan@rock-chips.com>

HDMI_IH_I2CMPHY_STAT0 is a clear on write register, which indicates i2cm
operation status(i2c transfer done or error), every hdmi phy register
configuration must check this register to make sure the configuration
has complete. But the indication bit should be cleared after check, otherwise
the corresponding bit will hold on forever, this may give a wrong signal for
next check.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>

---

Changes in v11:
- split form patch <dw_hdmi: add rk3288 support>

Changes in v10: None
Changes in v9: None
Changes in v8: None
Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 drivers/gpu/drm/bridge/dw_hdmi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/dw_hdmi.c b/drivers/gpu/drm/bridge/dw_hdmi.c
index e94f6bb..d5d5207 100644
--- a/drivers/gpu/drm/bridge/dw_hdmi.c
+++ b/drivers/gpu/drm/bridge/dw_hdmi.c
@@ -668,11 +668,15 @@ static inline void hdmi_phy_test_dout(struct dw_hdmi *hdmi,
 
 static bool hdmi_phy_wait_i2c_done(struct dw_hdmi *hdmi, int msec)
 {
-	while ((hdmi_readb(hdmi, HDMI_IH_I2CMPHY_STAT0) & 0x3) == 0) {
+	u32 val;
+
+	while ((val = hdmi_readb(hdmi, HDMI_IH_I2CMPHY_STAT0) & 0x3) == 0) {
 		if (msec-- == 0)
 			return false;
 		udelay(1000);
 	}
+	hdmi_writeb(hdmi, val, HDMI_IH_I2CMPHY_STAT0);
+
 	return true;
 }
 
-- 
1.9.1


WARNING: multiple messages have this Message-ID (diff)
From: Andy Yan <andy.yan@rock-chips.com>
To: airlied@linux.ie, heiko@sntech.de, fabio.estevam@freescale.com,
	rmk+kernel@arm.linux.org.uk
Cc: Mark Rutland <mark.rutland@arm.com>,
	dri-devel@lists.freedesktop.org, ykk@rock-chips.com,
	devel@driverdev.osuosl.org, Arnd Bergmann <arnd@arndb.de>,
	linux-rockchip@lists.infradead.org,
	Grant Likely <grant.likely@linaro.org>,
	Dave Airlie <airlied@redhat.com>,
	jay.xu@rock-chips.com, devicetree@vger.kernel.org,
	Zubair.Kakakhel@imgtec.com, Pawel Moll <pawel.moll@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Inki Dae <inki.dae@samsung.com>, Rob Herring <robh+dt@kernel.org>,
	Sean Paul <seanpaul@chromium.org>,
	mark.yao@rock-chips.com, Josh Boyer <jwboyer@redhat.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, djkurtz@google.com,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Kumar Gala <galak@codeaurora.org>,
	Andy yan <andy.yan@rock-chips.com>,
	Shawn Guo <shawn.guo@linaro.org>,
	Lucas Stach <l.stach@pengutronix.de>
Subject: [PATCH v11 09/12] drm: bridge/dw_hdmi: clear i2cmphy_stat0 reg in hdmi_phy_wait_i2c_done
Date: Fri, 14 Nov 2014 21:45:41 +0800	[thread overview]
Message-ID: <1415972741-8718-1-git-send-email-andy.yan@rock-chips.com> (raw)
In-Reply-To: <1415972231-8283-1-git-send-email-andy.yan@rock-chips.com>

HDMI_IH_I2CMPHY_STAT0 is a clear on write register, which indicates i2cm
operation status(i2c transfer done or error), every hdmi phy register
configuration must check this register to make sure the configuration
has complete. But the indication bit should be cleared after check, otherwise
the corresponding bit will hold on forever, this may give a wrong signal for
next check.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>

---

Changes in v11:
- split form patch <dw_hdmi: add rk3288 support>

Changes in v10: None
Changes in v9: None
Changes in v8: None
Changes in v7: None
Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 drivers/gpu/drm/bridge/dw_hdmi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/dw_hdmi.c b/drivers/gpu/drm/bridge/dw_hdmi.c
index e94f6bb..d5d5207 100644
--- a/drivers/gpu/drm/bridge/dw_hdmi.c
+++ b/drivers/gpu/drm/bridge/dw_hdmi.c
@@ -668,11 +668,15 @@ static inline void hdmi_phy_test_dout(struct dw_hdmi *hdmi,
 
 static bool hdmi_phy_wait_i2c_done(struct dw_hdmi *hdmi, int msec)
 {
-	while ((hdmi_readb(hdmi, HDMI_IH_I2CMPHY_STAT0) & 0x3) == 0) {
+	u32 val;
+
+	while ((val = hdmi_readb(hdmi, HDMI_IH_I2CMPHY_STAT0) & 0x3) == 0) {
 		if (msec-- == 0)
 			return false;
 		udelay(1000);
 	}
+	hdmi_writeb(hdmi, val, HDMI_IH_I2CMPHY_STAT0);
+
 	return true;
 }
 
-- 
1.9.1

  parent reply	other threads:[~2014-11-14 13:46 UTC|newest]

Thread overview: 165+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-12 11:59 [PATCH v8 0/9] dw-hdmi: convert imx hdmi to bridge/dw_hdmi Andy Yan
2014-11-12 11:59 ` Andy Yan
2014-11-12 12:01 ` [PATCH v8 1/9] staging: imx-drm: imx-hdmi: make checkpatch happy Andy Yan
2014-11-12 12:01   ` Andy Yan
2014-11-12 12:01 ` [PATCH v8 2/9] staging: imx-drm: imx-hdmi: return defer if can't get ddc i2c adapter Andy Yan
2014-11-12 12:01   ` Andy Yan
2014-11-12 12:02 ` [PATCH v8 3/9] staging: imx-drm: imx-hdmi: split imx soc specific code from imx-hdmi Andy Yan
2014-11-12 12:02   ` Andy Yan
2014-11-12 12:03 ` [PATCH v8 4/9] staging: imx-drm: imx-hdmi: move imx-hdmi to bridge/dw_hdmi Andy Yan
2014-11-12 12:03   ` Andy Yan
2014-11-12 12:03 ` [PATCH v8 5/9] dt-bindings: add document for dw_hdmi Andy Yan
2014-11-12 12:03   ` Andy Yan
2014-11-12 12:03 ` [PATCH v8 6/9] drm: bridge/dw_hdmi: add support for multi byte register width access Andy Yan
2014-11-12 12:03   ` Andy Yan
2014-11-12 12:04 ` [PATCH v8 7/9] drm: bridge/dw_hdmi: convert dw-hdmi to drm_bridge mode Andy Yan
2014-11-12 12:04   ` Andy Yan
2014-11-12 12:05 ` [PATCH v8 8/9] dt-bindings: Add documentation for rockchip dw hdmi Andy Yan
2014-11-12 12:05   ` Andy Yan
2014-11-12 12:05 ` [PATCH v8 9/9] drm: bridge/dw_hdmi: add rockchip rk3288 support Andy Yan
2014-11-12 12:05   ` Andy Yan
2014-11-13 12:52 ` [PATCH v9 0/9] dw-hdmi: convert imx hdmi to bridge/dw_hdmi Andy Yan
2014-11-13 12:52   ` Andy Yan
2014-11-14  3:09   ` [PATCH v10 0/11] " Andy Yan
2014-11-14  3:09     ` Andy Yan
2014-11-14  3:24     ` [PATCH v10 01/11] staging: imx-drm: imx-hdmi: make checkpatch happy Andy Yan
2014-11-14  3:24       ` Andy Yan
2014-11-14  3:25     ` [PATCH v10 02/11] staging: imx-drm: imx-hdmi: return defer if can't get ddc i2c adapter Andy Yan
2014-11-14  3:25       ` Andy Yan
2014-11-14  3:25     ` [PATCH v10 03/11] staging: imx-drm: imx-hdmi: split imx soc specific code from imx-hdmi Andy Yan
2014-11-14  3:25       ` Andy Yan
2014-11-14  3:26     ` [PATCH v10 04/11] staging: imx-drm: imx-hdmi: move imx-hdmi to bridge/dw_hdmi Andy Yan
2014-11-14  3:26       ` Andy Yan
2014-11-14  3:27     ` [PATCH v10 05/11] drm: bridge/dw_hdmi:split some phy configuration to platform driver Andy Yan
2014-11-14  3:27       ` Andy Yan
2014-11-14 10:19       ` Zubair Lutfullah Kakakhel
2014-11-14 10:19         ` Zubair Lutfullah Kakakhel
2014-11-14 10:53         ` Andy Yan
2014-11-14 10:53           ` Andy Yan
2014-11-14 10:55           ` Zubair Lutfullah Kakakhel
2014-11-14 10:55             ` Zubair Lutfullah Kakakhel
2014-11-14 11:08             ` Andy Yan
2014-11-14 11:08               ` Andy Yan
2014-11-14 11:13               ` Zubair Lutfullah Kakakhel
2014-11-14 11:13                 ` Zubair Lutfullah Kakakhel
2014-11-15 10:07                 ` Daniel Kurtz
2014-11-15 10:07                   ` Daniel Kurtz
2014-11-15 10:12                   ` Russell King - ARM Linux
2014-11-15 10:12                     ` Russell King - ARM Linux
2014-11-15 10:54                     ` Russell King - ARM Linux
2014-11-15 10:54                       ` Russell King - ARM Linux
2014-11-14  3:27     ` [PATCH v10 06/11] drm: bridge/dw_hdmi: clear i2cmphy_stat0 reg in hdmi_phy_wait_i2c_done Andy Yan
2014-11-14  3:27       ` Andy Yan
2014-11-14  3:28     ` [PATCH v10 07/11] dt-bindings: add document for dw_hdmi Andy Yan
2014-11-14  3:28       ` Andy Yan
2014-11-14  3:29     ` [PATCH v10 08/11] drm: bridge/dw_hdmi: add support for multi byte register width access Andy Yan
2014-11-14  3:29       ` Andy Yan
2014-11-14  3:29     ` [PATCH v10 09/11] drm: bridge/dw_hdmi: convert dw-hdmi to drm_bridge mode Andy Yan
2014-11-14  3:29       ` Andy Yan
2014-11-14  3:30     ` [PATCH v10 10/11] dt-bindings: Add documentation for rockchip dw hdmi Andy Yan
2014-11-14  3:30       ` Andy Yan
2014-11-14  3:31     ` [PATCH v10 11/11] drm: bridge/dw_hdmi: add rockchip rk3288 support Andy Yan
2014-11-14  3:31       ` Andy Yan
2014-11-14 10:23       ` Zubair Lutfullah Kakakhel
2014-11-14 10:23         ` Zubair Lutfullah Kakakhel
2014-11-14 10:37         ` Andy Yan
2014-11-14 10:37           ` Andy Yan
2014-11-14 10:53           ` Zubair Lutfullah Kakakhel
2014-11-14 10:53             ` Zubair Lutfullah Kakakhel
2014-11-14 11:13             ` Andy Yan
2014-11-14 11:13               ` Andy Yan
2014-11-14 11:16               ` Zubair Lutfullah Kakakhel
2014-11-14 11:16                 ` Zubair Lutfullah Kakakhel
2014-11-14 11:21                 ` Andy Yan
2014-11-14 11:21                   ` Andy Yan
2014-11-14 13:37     ` [PATCH v11 0/12] dw-hdmi: convert imx hdmi to bridge/dw_hdmi Andy Yan
2014-11-14 13:37       ` Andy Yan
2014-11-14 13:38       ` [PATCH v11 01/12] staging: imx-drm: imx-hdmi: make checkpatch happy Andy Yan
2014-11-14 13:38         ` Andy Yan
2014-11-15  5:38         ` Daniel Kurtz
2014-11-15  5:38           ` Daniel Kurtz
2014-11-14 13:39       ` [PATCH v11 02/12] staging: imx-drm: imx-hdmi: return defer if can't get ddc i2c adapter Andy Yan
2014-11-14 13:39         ` Andy Yan
2014-11-15  5:41         ` Daniel Kurtz
2014-11-15  5:41           ` Daniel Kurtz
2014-11-17  1:35           ` Andy Yan
2014-11-17  1:35             ` Andy Yan
2014-11-14 13:39       ` [PATCH v11 03/12] staging: imx-drm: imx-hdmi: split imx soc specific code from imx-hdmi Andy Yan
2014-11-14 13:39         ` Andy Yan
2014-11-14 13:40       ` [PATCH v11 04/12] staging: imx-drm: imx-hdmi: move imx-hdmi to bridge/dw_hdmi Andy Yan
2014-11-14 13:40         ` Andy Yan
2014-11-14 13:41       ` [PATCH v11 05/12] drm: bridge/dw_hdmi: convert dw-hdmi to drm_bridge mode Andy Yan
2014-11-14 13:41         ` Andy Yan
2014-11-14 13:42       ` [PATCH v11 06/12] dt-bindings: add document for dw_hdmi Andy Yan
2014-11-14 13:42         ` Andy Yan
2014-11-14 13:43       ` [PATCH v11 07/12] drm: bridge/dw_hdmi: add support for multi-byte register width access Andy Yan
2014-11-14 13:43         ` Andy Yan
2014-11-14 13:45       ` [PATCH v11 08/12] drm: bridge/dw_hdmi: add mode_valid support Andy Yan
2014-11-14 13:45         ` Andy Yan
2014-11-14 13:45       ` Andy Yan [this message]
2014-11-14 13:45         ` [PATCH v11 09/12] drm: bridge/dw_hdmi: clear i2cmphy_stat0 reg in hdmi_phy_wait_i2c_done Andy Yan
2014-11-14 13:46       ` [PATCH v11 10/12] drm: bridge/dw_hdmi: add function dw_hdmi_phy_enable_spare Andy Yan
2014-11-14 13:46         ` Andy Yan
2014-11-14 13:47       ` [PATCH v11 11/12] dt-bindings: Add documentation for rockchip dw hdmi Andy Yan
2014-11-14 13:47         ` Andy Yan
2014-11-14 13:48       ` [PATCH v11 12/12] drm: bridge/dw_hdmi: add rockchip rk3288 support Andy Yan
2014-11-14 13:48         ` Andy Yan
2014-11-15  5:42       ` [PATCH v11 0/12] dw-hdmi: convert imx hdmi to bridge/dw_hdmi Daniel Kurtz
2014-11-15  5:46       ` Daniel Kurtz
2014-11-15  5:46         ` Daniel Kurtz
2014-11-13 12:53 ` [PATCH v9 1/9] staging: imx-drm: imx-hdmi: make checkpatch happy Andy Yan
2014-11-13 12:53   ` Andy Yan
2014-11-13 12:54 ` [PATCH v9 2/9] staging: imx-drm: imx-hdmi: return defer if can't get ddc i2c adapter Andy Yan
2014-11-13 12:54   ` Andy Yan
2014-11-13 12:55 ` [PATCH v9 3/9] staging: imx-drm: imx-hdmi: split imx soc specific code from imx-hdmi Andy Yan
2014-11-13 12:55   ` Andy Yan
2014-11-13 12:55 ` [PATCH v9 4/9] staging: imx-drm: imx-hdmi: move imx-hdmi to bridge/dw_hdmi Andy Yan
2014-11-13 12:55   ` Andy Yan
2014-11-13 12:55 ` [PATCH v9 5/9] dt-bindings: add document for dw_hdmi Andy Yan
2014-11-13 12:55   ` Andy Yan
2014-11-13 12:55 ` [PATCH v9 6/9] drm: bridge/dw_hdmi: add support for multi byte register width access Andy Yan
2014-11-13 12:55   ` Andy Yan
2014-11-13 12:56 ` [PATCH v9 7/9] drm: bridge/dw_hdmi: convert dw-hdmi to drm_bridge mode Andy Yan
2014-11-13 12:56   ` Andy Yan
2014-11-13 12:56 ` [PATCH v9 8/9] dt-bindings: Add documentation for rockchip dw hdmi Andy Yan
2014-11-13 12:56   ` Andy Yan
2014-11-13 12:57 ` [PATCH v9 9/9] drm: bridge/dw_hdmi: add rockchip rk3288 support Andy Yan
2014-11-13 12:57   ` Andy Yan
2014-11-13 13:09   ` Zubair Lutfullah Kakakhel
2014-11-13 13:09     ` Zubair Lutfullah Kakakhel
2014-11-13 13:38     ` Andy Yan
2014-11-13 13:38       ` Andy Yan
2014-11-17 10:53 ` [PATCH v12 0/11] dw-hdmi: convert imx hdmi to bridge/dw_hdmi Andy Yan
2014-11-17 10:53   ` Andy Yan
2014-11-24 14:17   ` Andy Yan
2014-11-24 14:17     ` Andy Yan
2014-11-24 14:22     ` Zubair Lutfullah Kakakhel
2014-11-24 14:22       ` Zubair Lutfullah Kakakhel
2014-11-24 14:35       ` Andy Yan
2014-11-24 14:35         ` Andy Yan
2014-11-26  2:14   ` Fabio Estevam
2014-11-26  2:14     ` Fabio Estevam
2014-11-26  2:29     ` Andy Yan
2014-11-26  2:29       ` Andy Yan
2014-11-17 10:54 ` [PATCH v12 01/11] staging: imx-drm: imx-hdmi: make checkpatch happy Andy Yan
2014-11-17 10:54   ` Andy Yan
2014-11-17 10:55 ` [PATCH v12 02/11] staging: imx-drm: imx-hdmi: return defer if can't get ddc i2c adapter Andy Yan
2014-11-17 10:55   ` Andy Yan
2014-11-17 10:55 ` [PATCH v12 03/11] staging: imx-drm: imx-hdmi: convert imx-hdmi to drm_bridge mode Andy Yan
2014-11-17 10:55   ` Andy Yan
2014-11-17 10:56 ` [PATCH v12 04/11] staging: imx-drm: imx-hdmi: move imx-hdmi to bridge/dw_hdmi Andy Yan
2014-11-17 10:56   ` Andy Yan
2014-11-17 10:56 ` [PATCH v12 05/11] dt-bindings: add document for dw_hdmi Andy Yan
2014-11-17 10:56   ` Andy Yan
2014-11-17 10:56 ` [PATCH v12 06/11] drm: bridge/dw_hdmi: add support for multi-byte register width access Andy Yan
2014-11-17 10:56   ` Andy Yan
2014-11-17 10:57 ` [PATCH v12 07/11] drm: bridge/dw_hdmi: add mode_valid support Andy Yan
2014-11-17 10:57   ` Andy Yan
2014-11-17 10:57 ` [PATCH v12 08/11] drm: bridge/dw_hdmi: clear i2cmphy_stat0 reg in hdmi_phy_wait_i2c_done Andy Yan
2014-11-17 10:57   ` Andy Yan
2014-11-17 10:58 ` [PATCH v12 09/11] drm: bridge/dw_hdmi: add function dw_hdmi_phy_enable_spare Andy Yan
2014-11-17 10:58   ` Andy Yan
2014-11-17 10:58 ` [PATCH v12 10/11] dt-bindings: Add documentation for rockchip dw hdmi Andy Yan
2014-11-17 10:58   ` Andy Yan
2014-11-17 10:59 ` [PATCH v12 11/11] drm: bridge/dw_hdmi: add rockchip rk3288 support Andy Yan
2014-11-17 10:59   ` Andy Yan

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=1415972741-8718-1-git-send-email-andy.yan@rock-chips.com \
    --to=andy.yan@rock-chips.com \
    --cc=Zubair.Kakakhel@imgtec.com \
    --cc=airlied@linux.ie \
    --cc=airlied@redhat.com \
    --cc=arnd@arndb.de \
    --cc=devel@driverdev.osuosl.org \
    --cc=devicetree@vger.kernel.org \
    --cc=djkurtz@google.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fabio.estevam@freescale.com \
    --cc=galak@codeaurora.org \
    --cc=grant.likely@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heiko@sntech.de \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=inki.dae@samsung.com \
    --cc=jay.xu@rock-chips.com \
    --cc=jwboyer@redhat.com \
    --cc=l.stach@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=mark.yao@rock-chips.com \
    --cc=p.zabel@pengutronix.de \
    --cc=pawel.moll@arm.com \
    --cc=rmk+kernel@arm.linux.org.uk \
    --cc=robh+dt@kernel.org \
    --cc=seanpaul@chromium.org \
    --cc=shawn.guo@linaro.org \
    --cc=ykk@rock-chips.com \
    /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.