devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	"Menon, Nishanth" <nm@ti.com>, Pawel Moll <pawel.moll@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	David Airlie <airlied@linux.ie>,
	Simon Hatliff <hatliff@cadence.com>,
	Mark Rutland <mark.rutland@arm.com>,
	dri-devel@lists.freedesktop.org,
	Alan Douglas <adouglas@cadence.com>,
	Rob Herring <robh+dt@kernel.org>, Jyri Sarha <jsarha@ti.com>,
	Suresh Punnoose <sureshp@cadence.com>,
	Kumar Gala <galak@codeaurora.org>,
	Maxime Ripard <maxime.ripard@free-electrons.com>,
	Richard Sproul <sproul@cadence.com>,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v5 1/2] drm/bridge: Add Cadence DSI driver
Date: Mon, 29 Jan 2018 14:46:23 +0100	[thread overview]
Message-ID: <20180129144623.495f66bf@bbrezillon> (raw)
In-Reply-To: <20180129141409.0ec356d1@bbrezillon>

On Mon, 29 Jan 2018 14:14:09 +0100
Boris Brezillon <boris.brezillon@free-electrons.com> wrote:

> On Mon, 29 Jan 2018 13:56:21 +0200
> Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
> 
> > > +
> > > +static void cdns_dsi_init_link(struct cdns_dsi *dsi)
> > > +{
> > > +	struct cdns_dsi_output *output = &dsi->output;
> > > +	unsigned long sysclk_period, ulpout;
> > > +	u32 val;
> > > +	int i;
> > > +
> > > +	if (dsi->link_initialized)
> > > +		return;
> > > +
> > > +	val = 0;
> > > +	for (i = 1; i < output->dev->lanes; i++)
> > > +		val |= DATA_LANE_EN(i);
> > > +
> > > +	if (!(output->dev->mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS))
> > > +		val |= CLK_CONTINUOUS;
> > > +
> > > +	writel(val, dsi->regs + MCTL_MAIN_PHY_CTL);
> > > +
> > > +	/* ULPOUT should be set to 1ms and is expressed in sysclk cycles. */
> > > +	sysclk_period = NSEC_PER_SEC / clk_get_rate(dsi->dsi_sys_clk);
> > > +	ulpout = DIV_ROUND_UP(NSEC_PER_MSEC, sysclk_period);
> > > +	writel(CLK_LANE_ULPOUT_TIME(ulpout) | DATA_LANE_ULPOUT_TIME(ulpout),
> > > +	       dsi->regs + MCTL_ULPOUT_TIME);
> > > +
> > > +	writel(LINK_EN, dsi->regs + MCTL_MAIN_DATA_CTL);
> > > +
> > > +	val = CLK_LANE_EN | PLL_START;
> > > +	for (i = 0; i < output->dev->lanes; i++)
> > > +		val |= DATA_LANE_START(i);
> > > +
> > > +	writel(val, dsi->regs + MCTL_MAIN_EN);
> > > +
> > > +	ndelay(100);    
> > 
> > It's good to have a comment about each sleep/delay on what is for and
> > where does the value come from.  
> 
> Yep, I'll figure this out.

Looks like this delay is not needed in the end. I'll remove it.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-01-29 13:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-18 13:43 [PATCH v5 1/2] drm/bridge: Add Cadence DSI driver Boris Brezillon
     [not found] ` <20180118134309.13123-1-boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2018-01-18 13:43   ` [PATCH v5 2/2] dt-bindings: drm/bridge: Document Cadence DSI bridge bindings Boris Brezillon
2018-01-29 11:56   ` [PATCH v5 1/2] drm/bridge: Add Cadence DSI driver Tomi Valkeinen
     [not found]     ` <9b45c6a3-f26b-59f5-d313-88290a2c5b42-l0cyMroinI0@public.gmane.org>
2018-01-29 13:14       ` Boris Brezillon
2018-01-29 13:46         ` Boris Brezillon [this message]
2018-01-29 13:59         ` Tomi Valkeinen
2018-01-29 14:16           ` Boris Brezillon
2018-01-29 13:16       ` Boris Brezillon
2018-01-29 14:29   ` Tomi Valkeinen
     [not found]     ` <47b5af31-4870-9109-291c-894455a1a15c-l0cyMroinI0@public.gmane.org>
2018-01-29 16:38       ` Boris Brezillon
2018-01-30  7:51         ` Tomi Valkeinen
     [not found]           ` <19cc13ff-d2eb-bc46-6ceb-c020ea3ddad3-l0cyMroinI0@public.gmane.org>
2018-01-30  8:17             ` Boris Brezillon

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=20180129144623.495f66bf@bbrezillon \
    --to=boris.brezillon@free-electrons.com \
    --cc=adouglas@cadence.com \
    --cc=airlied@linux.ie \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=galak@codeaurora.org \
    --cc=hatliff@cadence.com \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=jsarha@ti.com \
    --cc=mark.rutland@arm.com \
    --cc=maxime.ripard@free-electrons.com \
    --cc=nm@ti.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=sproul@cadence.com \
    --cc=sureshp@cadence.com \
    --cc=thomas.petazzoni@free-electrons.com \
    --cc=tomi.valkeinen@ti.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).