From: "何小龙 (Leon He)" <Leon.He@unisoc.com>
To: Paul Cercueil <paul@crapouillou.net>,
Thierry Reding <thierry.reding@gmail.com>,
Sam Ravnborg <sam@ravnborg.org>, David Airlie <airlied@linux.ie>,
Daniel Vetter <daniel@ffwll.ch>, Rob Herring <robh+dt@kernel.org>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
Noralf Tronnes <noralf@tronnes.org>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Linus Walleij <linus.walleij@linaro.org>
Cc: "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"od@zcrc.me" <od@zcrc.me>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>
Subject: 答复: [PATCH v2 6/6] drm/panel: Add Ilitek ILI9341 DBI panel driver
Date: Sun, 30 Aug 2020 16:36:42 +0000 [thread overview]
Message-ID: <edf38d68214247f486db3cc1f81ec404@shmbx04.spreadtrum.com> (raw)
In-Reply-To: <20200822163250.63664-7-paul@crapouillou.net>
> +struct ili9341 {
> + struct drm_panel panel;
> + struct mipi_dsi_device *dsi;
> + const struct ili9341_pdata *pdata;
> +
> + struct gpio_desc *reset_gpiod;
> + u32 rotation;
> +};
> +
Hi Paul, you put the mipi_dsi_device inside the struct. I think it maybe not
a good idea. That means the panel has a MIPI-DSI interface but it doesn't
have actually.
> +static int ili9341_probe(struct mipi_dsi_device *dsi)
> +{
> + struct device *dev = &dsi->dev;
> + struct ili9341 *priv;
> + int ret;
> +
> + /* See comment for mipi_dbi_spi_init() */
> + if (!dev->coherent_dma_mask) {
> + ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32));
> + if (ret) {
> + dev_warn(dev, "Failed to set dma mask %d\n", ret);
> + return ret;
> + }
> + }
> +
> + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> + if (!priv)
> + return -ENOMEM;
> +
> + mipi_dsi_set_drvdata(dsi, priv);
> + priv->dsi = dsi;
> +
> + device_property_read_u32(dev, "rotation", &priv->rotation);
> +
> + priv->pdata = device_get_match_data(dev);
> + if (!priv->pdata)
> + return -EINVAL;
> +
> + drm_panel_init(&priv->panel, dev, &ili9341_funcs,
> + DRM_MODE_CONNECTOR_DPI);
> +
> + priv->reset_gpiod = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
> + if (IS_ERR(priv->reset_gpiod)) {
> + dev_err(dev, "Couldn't get our reset GPIO\n");
> + return PTR_ERR(priv->reset_gpiod);
> + }
> +
> + ret = drm_panel_of_backlight(&priv->panel);
> + if (ret < 0) {
> + if (ret != -EPROBE_DEFER)
> + dev_err(dev, "Failed to get backlight handle\n");
> + return ret;
> + }
> +
> + drm_panel_add(&priv->panel);
> +
> + dsi->bus_type = priv->pdata->bus_type;
> + dsi->lanes = priv->pdata->lanes;
> + dsi->format = MIPI_DSI_FMT_RGB565;
> +
> + ret = mipi_dsi_attach(dsi);
> + if (ret) {
> + dev_err(dev, "Failed to attach DSI panel\n");
> + goto err_panel_remove;
> + }
> +
> + ret = mipi_dsi_maybe_register_tiny_driver(dsi);
> + if (ret) {
> + dev_err(dev, "Failed to init TinyDRM driver\n");
> + goto err_mipi_dsi_detach;
> + }
> +
> + return 0;
> +
> +err_mipi_dsi_detach:
> + mipi_dsi_detach(dsi);
> +err_panel_remove:
> + drm_panel_remove(&priv->panel);
> + return ret;
> +}
> +
> +static int ili9341_remove(struct mipi_dsi_device *dsi)
> +{
> + struct ili9341 *priv = mipi_dsi_get_drvdata(dsi);
> +
> + mipi_dsi_detach(dsi);
> + drm_panel_remove(&priv->panel);
> +
> + drm_panel_disable(&priv->panel);
> + drm_panel_unprepare(&priv->panel);
> +
> + return 0;
> +}
> +
> +static const struct ili9341_pdata yx240qv29_pdata = {
> + .mode = { DRM_SIMPLE_MODE(240, 320, 37, 49) },
> + .width_mm = 0, // TODO
> + .height_mm = 0, // TODO
> + .bus_type = MIPI_DCS_BUS_TYPE_DBI_SPI_C3,
> + .lanes = 1,
> +};
> +
> +static const struct of_device_id ili9341_of_match[] = {
> + { .compatible = "adafruit,yx240qv29", .data = &yx240qv29_pdata },
> + { }
> +};
> +MODULE_DEVICE_TABLE(of, ili9341_of_match);
> +
> +static struct mipi_dsi_driver ili9341_dsi_driver = {
> + .probe = ili9341_probe,
> + .remove = ili9341_remove,
> + .driver = {
> + .name = "ili9341-dsi",
> + .of_match_table = ili9341_of_match,
> + },
> +};
> +module_mipi_dsi_driver(ili9341_dsi_driver);
Again, you treat this driver as a mipi dsi driver but for a MIPI-DBI (I8080/SPI)
panel device. That will make developers confused.
Is it possible to just add a mipi_dbi_driver for I8080/SPI interface panel?
Thanks!
Best regards
________________________________
This email (including its attachments) is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. Unauthorized use, dissemination, distribution or copying of this email or the information herein or taking any action in reliance on the contents of this email or the information herein, by anyone other than the intended recipient, or an employee or agent responsible for delivering the message to the intended recipient, is strictly prohibited. If you are not the intended recipient, please do not read, copy, use or disclose any part of this e-mail to others. Please notify the sender immediately and permanently delete this e-mail and any attachments if you received it in error. Internet communications cannot be guaranteed to be timely, secure, error-free or virus-free. The sender does not accept liability for any errors or omissions.
本邮件及其附件具有保密性质,受法律保护不得泄露,仅发送给本邮件所指特定收件人。严禁非经授权使用、宣传、发布或复制本邮件或其内容。若非该特定收件人,请勿阅读、复制、 使用或披露本邮件的任何内容。若误收本邮件,请从系统中永久性删除本邮件及所有附件,并以回复邮件的方式即刻告知发件人。无法保证互联网通信及时、安全、无误或防毒。发件人对任何错漏均不承担责任。
next prev parent reply other threads:[~2020-08-30 16:42 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-22 16:32 [PATCH v2 0/6] DSI/DBI, panel drivers, & tinyDRM v2 Paul Cercueil
2020-08-22 16:32 ` [PATCH v2 1/6] dt-bindings: display: Document NewVision NV3052C DT node Paul Cercueil
2020-09-08 21:50 ` Rob Herring
2020-09-09 11:41 ` Linus Walleij
2020-08-22 16:32 ` [PATCH v2 2/6] drm: dsi: Let host and device specify supported bus Paul Cercueil
2020-08-22 16:32 ` [PATCH v2 3/6] drm: Add SPI DBI host driver Paul Cercueil
2020-09-09 11:57 ` Linus Walleij
2020-08-22 16:32 ` [PATCH v2 4/6] drm/tiny: Add TinyDRM for DSI/DBI panels Paul Cercueil
2020-08-22 16:32 ` [PATCH v2 5/6] drm/panel: Add panel driver for NewVision NV3052C based LCDs Paul Cercueil
2020-08-24 20:55 ` Linus Walleij
2020-08-22 16:32 ` [PATCH v2 6/6] drm/panel: Add Ilitek ILI9341 DBI panel driver Paul Cercueil
2020-08-30 16:36 ` 何小龙 (Leon He) [this message]
2020-08-30 16:48 ` 答复: " Paul Cercueil
2020-08-30 19:11 ` Laurent Pinchart
2020-08-30 20:28 ` Sam Ravnborg
2020-09-07 12:57 ` Paul Cercueil
2020-09-08 7:18 ` Neil Armstrong
2020-09-09 11:38 ` Linus Walleij
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=edf38d68214247f486db3cc1f81ec404@shmbx04.spreadtrum.com \
--to=leon.he@unisoc.com \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=noralf@tronnes.org \
--cc=od@zcrc.me \
--cc=paul@crapouillou.net \
--cc=robh+dt@kernel.org \
--cc=sam@ravnborg.org \
--cc=thierry.reding@gmail.com \
--cc=tzimmermann@suse.de \
/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
all inboxes | Powered by JetHome®