devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Maxime Ripard <maxime@cerno.tech>
Cc: Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	devicetree@vger.kernel.org, Heiko Stuebner <heiko@sntech.de>,
	linux-rockchip@lists.infradead.org,
	Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@linux.ie>,
	Sandy Huang <hjc@rock-chips.com>,
	linux-arm-kernel@lists.infradead.org,
	Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
	Maxime Chevallier <maxime.chevallier@bootlin.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 09/12] drm/rockchip: lvds: Add PX30 support
Date: Mon, 16 Dec 2019 12:03:12 +0100	[thread overview]
Message-ID: <20191216120312.4aa478da@xps13> (raw)
In-Reply-To: <20191216105827.rxkfbwemkqw446jx@gilmour.lan>

Hi Maxime,

Maxime Ripard <maxime@cerno.tech> wrote on Mon, 16 Dec 2019 11:58:27
+0100:

> Hi,
> 
> On Fri, Dec 13, 2019 at 07:10:48PM +0100, Miquel Raynal wrote:
> > +static int px30_lvds_grf_config(struct drm_encoder *encoder,
> > +				struct drm_display_mode *mode)
> > +{
> > +	struct rockchip_lvds *lvds = encoder_to_lvds(encoder);
> > +	u8 nhsync = !(mode->flags & DRM_MODE_FLAG_PHSYNC);
> > +	u8 nvsync = !(mode->flags & DRM_MODE_FLAG_PVSYNC);
> > +	u8 ndclk = !(mode->flags & DRM_MODE_FLAG_PCSYNC);
> > +	int ret;
> > +
> > +	if (lvds->output != DISPLAY_OUTPUT_LVDS) {
> > +		DRM_DEV_ERROR(lvds->dev, "Unsupported display output %d\n",
> > +			      lvds->output);
> > +		return -EINVAL;
> > +	}
> > +
> > +	if (nhsync ^ nvsync) {
> > +		DRM_DEV_ERROR(lvds->dev, "Unsupported Hsync/Vsync polarity\n");
> > +		return -EINVAL;
> > +	}
> > +
> > +	/* Set format */
> > +	ret = regmap_update_bits(lvds->grf, PX30_LVDS_GRF_PD_VO_CON1,
> > +				 PX30_LVDS_FORMAT(lvds->format),
> > +				 PX30_LVDS_FORMAT(lvds->format));
> > +	if (ret)
> > +		return ret;
> > +
> > +	/* Control Hsync/Vsync polarity */
> > +	ret = regmap_update_bits(lvds->grf, PX30_LVDS_GRF_PD_VO_CON0,
> > +				 PX30_LVDS_TIE_CLKS(1),
> > +				 PX30_LVDS_TIE_CLKS(1));
> > +	if (ret)
> > +		return ret;
> > +
> > +	/* Set Hsync/Vsync polarity */
> > +	ret = regmap_update_bits(lvds->grf, PX30_LVDS_GRF_PD_VO_CON0,
> > +				 PX30_LVDS_INVERT_CLKS(1),
> > +				 PX30_LVDS_INVERT_CLKS(nhsync));
> > +	if (ret)
> > +		return ret;  
> 
> I don't know the hardware but it seems pretty weird to me. hsync and
> vsync in LVDS are not clocks (or even signals), they're a bit in the
> payload. Is there any explanation in the datasheet (or even a
> datasheet in the first place)?

There is no explanation about this in the PX30 TRM part 1 (public). But
you are right the naming is weird. Could the "tie clocks" thing above
mean something to you/people knowing the LVDS world?

Cheers,
Miquèl

  reply	other threads:[~2019-12-16 11:03 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-13 18:10 [PATCH 00/12] Add PX30 LVDS support Miquel Raynal
2019-12-13 18:10 ` [PATCH 01/12] dt-bindings: display: rockchip-lvds: Declare PX30 compatible Miquel Raynal
2019-12-19 23:47   ` Rob Herring
2019-12-13 18:10 ` [PATCH 02/12] dt-bindings: display: rockchip-lvds: Document PX30 PHY Miquel Raynal
2019-12-16 10:48   ` Maxime Ripard
2019-12-13 18:10 ` [PATCH 03/12] drm/rockchip: lvds: Fix indentation of a #define Miquel Raynal
2019-12-13 18:10 ` [PATCH 04/12] drm/rockchip: lvds: Harmonize function names Miquel Raynal
2019-12-13 18:10 ` [PATCH 05/12] drm/rockchip: lvds: Change platform data Miquel Raynal
2019-12-13 18:10 ` [PATCH 06/12] drm/rockchip: lvds: Create an RK3288 specific probe function Miquel Raynal
2019-12-13 18:10 ` [PATCH 07/12] drm/rockchip: lvds: Helpers should return decent values Miquel Raynal
2019-12-13 18:10 ` [PATCH 08/12] drm/rockchip: lvds: Pack functions together Miquel Raynal
2019-12-13 18:10 ` [PATCH 09/12] drm/rockchip: lvds: Add PX30 support Miquel Raynal
2019-12-16 10:58   ` Maxime Ripard
2019-12-16 11:03     ` Miquel Raynal [this message]
2019-12-16 11:14       ` Maxime Ripard
     [not found]         ` <64f6c582-8ffd-1082-f161-1e8c1a8dda44@rock-chips.com>
2019-12-18  6:26           ` sandy.huang
2019-12-16 12:00   ` [PATCH 09/12] drm/rockchip: lvds: Add PX30 support【请注意,邮件由linux-rockchip-bounces+andy.yan=rock-chips.com@lists.infradead.org代发】 Andy Yan
2019-12-16 12:10     ` Miquel Raynal
2019-12-13 18:10 ` [PATCH 10/12] arm64: dts: rockchip: Add PX30 CRTCs graph LVDS endpoints Miquel Raynal
2019-12-13 18:28   ` Heiko Stübner
2019-12-13 18:38     ` Miquel Raynal
2019-12-13 18:10 ` [PATCH 11/12] arm64: dts: rockchip: Add PX30 DSI DPHY Miquel Raynal
2019-12-13 18:10 ` [PATCH 12/12] arm64: dts: rockchip: Add PX30 LVDS Miquel Raynal

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=20191216120312.4aa478da@xps13 \
    --to=miquel.raynal@bootlin.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=hjc@rock-chips.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=maxime.chevallier@bootlin.com \
    --cc=maxime@cerno.tech \
    --cc=paul.kocialkowski@bootlin.com \
    --cc=robh+dt@kernel.org \
    --cc=thomas.petazzoni@bootlin.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).