devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: YoungJun Cho <yj44.cho@samsung.com>
Cc: mark.rutland@arm.com, devicetree@vger.kernel.org,
	linux-samsung-soc@vger.kernel.org, pawel.moll@arm.com,
	ijc+devicetree@hellion.org.uk, sw0312.kim@samsung.com,
	dri-devel@lists.freedesktop.org, a.hajda@samsung.com,
	kyungmin.park@samsung.com, robh+dt@kernel.org,
	galak@codeaurora.org, kgene.kim@samsung.com
Subject: Re: [PATCH v6 10/14] drm/panel: add S6E3FA0 driver
Date: Mon, 21 Jul 2014 11:35:50 +0200	[thread overview]
Message-ID: <20140721093549.GL8843@ulmo> (raw)
In-Reply-To: <53C87D2F.9000906@samsung.com>


[-- Attachment #1.1: Type: text/plain, Size: 2466 bytes --]

On Fri, Jul 18, 2014 at 10:49:35AM +0900, YoungJun Cho wrote:
> Hi Thierry,
> 
> Thank you a lot for kind comments.
> 
> On 07/17/2014 07:36 PM, Thierry Reding wrote:
> > On Thu, Jul 17, 2014 at 06:01:25PM +0900, YoungJun Cho wrote:
[...]
> > >diff --git a/drivers/gpu/drm/panel/panel-s6e3fa0.c b/drivers/gpu/drm/panel/panel-s6e3fa0.c
[...]
> > >+static void s6e3fa0_set_maximum_return_packet_size(struct s6e3fa0 *ctx,
> > >+							unsigned int size)
> > >+{
> > >+	struct mipi_dsi_device *dsi = to_mipi_dsi_device(ctx->dev);
> > >+	const struct mipi_dsi_host_ops *ops = dsi->host->ops;
> > >+
> > >+	if (ops && ops->transfer) {
> > >+		unsigned char buf[] = {size, 0};
> > >+		struct mipi_dsi_msg msg = {
> > >+			.channel = dsi->channel,
> > >+			.type = MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE,
> > >+			.tx_len = sizeof(buf),
> > >+			.tx_buf = buf
> > >+		};
> > >+
> > >+		ops->transfer(dsi->host, &msg);
> > >+	}
> > >+}
> >
> > The Set Maximum Return Packet Size command is a standard command, so
> > please turn that into a generic function exposed by the DSI core.
> >
> 
> For this and below standard DCS commands, you want to use generic functions,
> but I have no idea for that.
> Could you explain more detail?

The goal should be to make these standard DCS commands available to all
DSI peripherals, so the implementation should look something like this:

static int mipi_dsi_set_maximum_return_packet_size(struct mipi_dsi_device *dsi,
						   u16 size)
{
	struct mipi_dsi_msg msg;

	if (!dsi->ops || !dsi->ops->transfer)
		return -ENOSYS;

	memset(&msg, 0, sizeof(msg));
	msg.channel = dsi->channel;
	msg.type = MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE;
	msg.tx_len = sizeof(size);
	msg.tx_buf = &size;

	return dsi->ops->transfer(dsi->host, &msg);
}

The above is somewhat special, since it isn't DCS. For DCS I'd suggest a
common prefix, like so:

enum mipi_dcs_tear_mode {
	MIPI_DCS_TEAR_VBLANK,
	MIPI_DCS_TEAR_BLANK,
};

static int mipi_dcs_set_tear_on(struct mipi_dsi_device *dsi,
				enum mipi_dcs_tear_mode mode)
{
	u8 data[2] = { MIPI_DSI_DCS_SET_TEAR_ON, mode };
	struct mipi_dsi_msg msg;

	if (!dsi->ops || !dsi->ops->transfer)
		return -ENOSYS;

	memset(&msg, 0, sizeof(msg));
	msg.channel = dsi->channel;
	msg.type = MIPI_DSI_DCS_SHORT_WRITE_PARAM;
	msg.tx_len = sizeof(data);
	msg.tx_buf = data;

	return dsi->ops->transfer(dsi->host, &msg);
}

Thierry

[-- Attachment #1.2: Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2014-07-21  9:35 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-17  9:01 [PATCH v6 00/14] drm/exynos: support LCD I80 interface display YoungJun Cho
2014-07-17  9:01 ` [PATCH v6 01/14] drm/exynos: dsi: move the EoT packets configuration point YoungJun Cho
2014-07-17  9:01 ` [PATCH v6 02/14] drm/exynos: use wait_event_timeout() for safety usage YoungJun Cho
2014-07-17  9:01 ` [PATCH v6 03/14] ARM: dts: samsung-fimd: add LCD I80 interface specific properties YoungJun Cho
2014-07-17  9:01 ` [PATCH v6 04/14] drm/exynos: add TE handler to support LCD I80 interface YoungJun Cho
2014-07-17  9:01 ` [PATCH v6 05/14] drm/exynos: dsi: add TE interrupt " YoungJun Cho
2014-07-21 14:01   ` Andrzej Hajda
2014-07-22  1:23     ` Inki Dae
2014-07-22  2:15       ` YoungJun Cho
2014-07-22 10:12       ` Andrzej Hajda
2014-07-22 10:26         ` YoungJun Cho
2014-07-22 10:49           ` YoungJun Cho
2014-07-22 10:57             ` Varka Bhadram
2014-07-22 11:10               ` YoungJun Cho
2014-07-22 11:14                 ` Varka Bhadram
2014-07-22 11:53                   ` YoungJun Cho
2014-07-22 12:01                     ` Varka Bhadram
2014-07-17  9:01 ` [PATCH v6 06/14] drm/exynos: fimd: " YoungJun Cho
2014-07-17  9:01 ` [PATCH v6 07/14] ARM: dts: exynos_dsim: add exynos5410 compatible to DT bindings YoungJun Cho
2014-07-17  9:01 ` [PATCH v6 08/14] drm/exynos: dsi: add driver data to support Exynos5410/5420/5440 SoCs YoungJun Cho
2014-07-17  9:01 ` [PATCH v6 09/14] ARM: dts: s6e3fa0: add DT bindings YoungJun Cho
2014-07-17 10:38   ` Thierry Reding
2014-07-18  2:00     ` YoungJun Cho
2014-07-17  9:01 ` [PATCH v6 10/14] drm/panel: add S6E3FA0 driver YoungJun Cho
2014-07-17 10:36   ` Thierry Reding
2014-07-18  1:49     ` YoungJun Cho
2014-07-21  8:56       ` Andrzej Hajda
2014-07-21  9:19         ` Thierry Reding
2014-07-21 11:18           ` Andrzej Hajda
2014-07-22  3:41             ` YoungJun Cho
2014-07-22  7:49               ` Thierry Reding
2014-07-22 10:20                 ` YoungJun Cho
2014-07-30 13:44                 ` Tomi Valkeinen
2014-07-30 14:36                   ` Thierry Reding
2014-07-30 13:40               ` Tomi Valkeinen
2014-07-21  9:35       ` Thierry Reding [this message]
2014-07-22  3:56         ` YoungJun Cho
2014-07-29 13:08           ` YoungJun Cho
2014-07-17  9:01 ` [PATCH v6 11/14] ARM: dts: exynos4: add system register property YoungJun Cho
2014-07-17  9:01 ` [PATCH v6 12/14] ARM: dts: exynos5: " YoungJun Cho
2014-07-17  9:01 ` [PATCH v6 13/14] ARM: dts: exynos5420: add mipi-phy node YoungJun Cho
2014-07-17  9:01 ` [PATCH v6 14/14] ARM: dts: exynos5420: add dsi node YoungJun Cho
2014-07-22 13:48 ` [PATCH v6 00/14] drm/exynos: support LCD I80 interface display Inki Dae

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=20140721093549.GL8843@ulmo \
    --to=thierry.reding@gmail.com \
    --cc=a.hajda@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=kgene.kim@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=sw0312.kim@samsung.com \
    --cc=yj44.cho@samsung.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).