public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Jagan Teki <jagan@amarulasolutions.com>
Cc: David Airlie <airlied@linux.ie>, Sean Paul <sean@poorly.run>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Michael Trimarchi <michael@amarulasolutions.com>,
	linux-amarula@amarulasolutions.com
Subject: Re: [PATCH V7 2/2] drm/panel: Add Sitronix ST7701 panel driver
Date: Sat, 12 Jan 2019 16:33:48 +0100	[thread overview]
Message-ID: <20190112153348.GA12461@ravnborg.org> (raw)
In-Reply-To: <CAMty3ZAvEzatWMPbtPKUhVRMSzC9icarsxK7KfXAp+gvCR74Lw@mail.gmail.com>

Hi Jagan.

> > But as we just assert reset (set it to 0), this timing constraint can be ignored.
> 
> But we unaware of reset pulse duration right? it's the hardware that
> bring the reset assert if we set the line 0. am I correct or do we
> need to explicitly wait 10us after reset initiated?
> there is family of chip Sitronix st7789v which don't taking care of
> this sequence (I don't know why?) in
> drivers/gpu/drm/panel/panel-sitronix-st7789v.c with Page 48 of
> datasheet[2]


The prepare sequence used is:
1) reset
   20 ms
2) regulator enable
   20 ms
3) unassert reset
   20 ms
4) assert reset
   30 ms
4) unassert reset
   150 ms
5) SOFT RESET
   5 ms
6) Exit SLEEP mode
   sleep_delay (120 ms)
7) COMMANDS

The enable sequence is
1) Display ON
2) backlight enable


The disable sequence is
1) backlight disable
2) Display OFF

The unprepare sequence is
1) Exit SLEEP mode  <= this should be Enter SLEEP mode (covered by previous mail)
   sleep_delay (120 ms)
2) assert reset
3) unassert reset
4) assert reset
5) regulator disable


The implementation in simple-panel supports a long list of panels so we
can assume this is a good reference implementation.
Unless your combo of st7701 + panel has special requirements.

Prepare sequence:
-----------------
- Just set reset to 1 - no need to trigger an edge.
  But if you somehow think the edge is required keep the current code
  but drop the delays that are not required.
  We can assume power is OK when it is enabled, no extra waiting required.
- No reason to unassert and then assert and then unassert reset.

In other words:
- Delay between 1 and 2 can be dropped.
- step 3 and step 4 can be dropped

Unprepare sequence:
-------------------
Enter SLEEP mode may take 120 ms so delay between 1) and 2) is OK.
No reason to do the reset dance, drop 2) and 3)
Make sure reset is completed, so wait before leaving the function.
See note 3. on page 54 in datasheet:

	"During the Resetting period, the display will be blanked
	 (The display is entering blanking sequence, which maximum
	 time is 120 ms, when Reset Starts in Sleep Out –mode.
	 The display remains the blank state in Sleep In –mode.) and
	  then return to Default condition for Hardware Reset."

We have already sent an Enter SLEEP command but we have no timing constrains
when panel is in SLEEP mode, So stick to the 120 ms.
Just use sleep_delay.

Thats my best understanding, your reading of the datasheet or your testing
may prove different.

	Sam

  reply	other threads:[~2019-01-12 15:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-11 12:47 [PATCH V7 1/2] dt-bindings: panel: Add Sitronix ST7701 panel documentation Jagan Teki
2019-01-11 12:47 ` [PATCH V7 2/2] drm/panel: Add Sitronix ST7701 panel driver Jagan Teki
2019-01-11 21:19   ` Sam Ravnborg
2019-01-11 21:41     ` Noralf Trønnes
2019-01-12  3:44     ` Jagan Teki
2019-01-12 10:14       ` Sam Ravnborg
2019-01-12 10:46         ` Jagan Teki
2019-01-12 12:00           ` Sam Ravnborg
2019-01-12 13:25             ` Jagan Teki
2019-01-12 15:33               ` Sam Ravnborg [this message]
2019-01-12 16:32                 ` Jagan Teki
2019-01-12 16:53                   ` Sam Ravnborg

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=20190112153348.GA12461@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jagan@amarulasolutions.com \
    --cc=linux-amarula@amarulasolutions.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael@amarulasolutions.com \
    --cc=sean@poorly.run \
    --cc=thierry.reding@gmail.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