From: Linus Walleij <linus.walleij@linaro.org>
To: Jakob Hauser <jahau@rocketmail.com>
Cc: Neil Armstrong <neil.armstrong@linaro.org>,
Jessica Zhang <quic_jesszhan@quicinc.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Thierry Reding <thierry.reding@gmail.com>,
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
Andrzej Hajda <andrzej.hajda@intel.com>,
dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
~postmarketos/upstreaming@lists.sr.ht
Subject: Re: [PATCH v3 3/5] drm/panel: samsung-s6e88a0-ams427ap24: Add initial driver
Date: Fri, 25 Oct 2024 18:36:59 +0200 [thread overview]
Message-ID: <CACRpkdY6w1LmKP+69TDRLJCszPpz_XAM_uoe8oC07MH-9ALAig@mail.gmail.com> (raw)
In-Reply-To: <bef462116190c26e6339cd58240773f035efcca9.1729738189.git.jahau@rocketmail.com>
Hi Jakob,
thanks for your patch!
On Thu, Oct 24, 2024 at 5:18 AM Jakob Hauser <jahau@rocketmail.com> wrote:
> This initial part of the panel driver was mostly generated by the
> "linux-mdss-dsi-panel-driver-generator" tool [1], reading downstream
> Android kernel file "dsi_panel_S6E88A0_AMS427AP24_qhd_octa_video.dtsi" [2].
>
> On top of the generic output of the tool, there were a couple of changes
> applied:
> - Added mipi_dsi_dcs_set_display_on() to function s6e88a0_ams427ap24_on(),
> otherwise the display does not show up.
> - In functions s6e88a0_ams427ap24_on() and s6e88a0_ams427ap24_off()
> changed DSI commands to multi context and used "accum_err" returns.
> - In functions s6e88a0_ams427ap24_on() and s6e88a0_ams427ap24_off() replaced
> msleep() by mipi_dsi_msleep().
> - The function s6e88a0_ams427ap24_get_modes() was changed to make use of
> drm_connector_helper_get_modes_fixed(). This also required to include
> drm/drm_probe_helper.h.
> - In function s6e88a0_ams427ap24_probe() registring the regulators was changed
> to devm_regulator_bulk_get_const(). This required to change supplies in struct
> s6e88a0_ams427ap24 to a pointer.
> - Removed bool "prepared" from struct s6e88a0_ams427ap24 and according parts in
> functions s6e88a0_ams427ap24_prepare() and s6e88a0_ams427ap24_unprepare().
>
> [1] https://github.com/msm8916-mainline/linux-mdss-dsi-panel-driver-generator
> [2] https://github.com/msm8916-mainline/linux-downstream/blob/GT-I9195I/drivers/video/msm/mdss/samsung/S6E88A0_AMS427AP24/dsi_panel_S6E88A0_AMS427AP24_qhd_octa_video.dtsi
>
> Signed-off-by: Jakob Hauser <jahau@rocketmail.com>
Nice job on this driver so far!
> +#include <linux/delay.h>
> +#include <linux/gpio/consumer.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
Why do you need this include? .of_match_table is part of
<linux/driver.h>
> +static int s6e88a0_ams427ap24_on(struct s6e88a0_ams427ap24 *ctx)
> +{
> + struct mipi_dsi_device *dsi = ctx->dsi;
> + struct mipi_dsi_multi_context dsi_ctx = { .dsi = dsi };
> +
> + dsi->mode_flags |= MIPI_DSI_MODE_LPM;
> +
> + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0x5a, 0x5a);
Can we provide #defines for at least some of this magic?
See other drivers for a very good idea of what some of them mean.
panel-samsung-s6d27a1.c:#define S6D27A1_PASSWD_L2 0xF0 /*
Password Command for Level 2 Control */
panel-samsung-s6d7aa0.c:#define MCS_PASSWD1 0xf0
> + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xfc, 0x5a, 0x5a);
panel-samsung-s6d7aa0.c:#define MCS_PASSWD3 0xfc
> + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb0, 0x11);
> + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xfd, 0x11);
> + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb0, 0x13);
> + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xfd, 0x18);
> + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb0, 0x02);
> + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb8, 0x30);
(...)
> + mipi_dsi_dcs_exit_sleep_mode_multi(&dsi_ctx);
> + mipi_dsi_msleep(&dsi_ctx, 20);
> +
> + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf1, 0x5a, 0x5a);
panel-samsung-s6d7aa0.c:#define MCS_PASSWD2 0xf1
> + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xcc, 0x4c);
> + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf2, 0x03, 0x0d);
> + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf1, 0xa5, 0xa5);
panel-samsung-s6d7aa0.c:#define MCS_PASSWD2 0xf1
Send in the reverse password: disable access.
> + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xca,
> + 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x80,
> + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
> + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
> + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
> + 0x80, 0x80, 0x00, 0x00, 0x00);
> + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb2,
> + 0x40, 0x08, 0x20, 0x00, 0x08);
> + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xb6, 0x28, 0x0b);
> + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf7, 0x03);
> + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0x55, 0x00);
> + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xf0, 0xa5, 0xa5);
> + mipi_dsi_dcs_write_seq_multi(&dsi_ctx, 0xfc, 0xa5, 0xa5);
Send in the reverse password: disable access.
A bit of #defines and comments would make it much more clear what
is going on.
Yours,
Linus Walleij
next prev parent reply other threads:[~2024-10-25 16:37 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-24 3:18 [PATCH v3 0/5] Add new panel driver Samsung S6E88A0-AMS427AP24 Jakob Hauser
2024-10-24 3:18 ` [PATCH v3 1/5] dt-bindings: display: panel: Move flip properties to panel-common Jakob Hauser
2024-10-25 16:25 ` Linus Walleij
2024-10-24 3:18 ` [PATCH v3 2/5] dt-bindings: display: panel: Add Samsung S6E88A0-AMS427AP24 Jakob Hauser
2024-10-25 16:24 ` Linus Walleij
2024-10-24 3:18 ` [PATCH v3 3/5] drm/panel: samsung-s6e88a0-ams427ap24: Add initial driver Jakob Hauser
2024-10-25 16:36 ` Linus Walleij [this message]
2024-10-26 8:51 ` Jakob Hauser
2024-10-24 3:18 ` [PATCH v3 4/5] drm/panel: samsung-s6e88a0-ams427ap24: Add brightness control Jakob Hauser
2024-10-25 19:27 ` Linus Walleij
2024-10-26 10:47 ` Jakob Hauser
2024-10-24 3:18 ` [PATCH v3 5/5] drm/panel: samsung-s6e88a0-ams427ap24: Add flip option Jakob Hauser
2024-10-25 19:32 ` Linus Walleij
2024-10-26 11:13 ` Jakob Hauser
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=CACRpkdY6w1LmKP+69TDRLJCszPpz_XAM_uoe8oC07MH-9ALAig@mail.gmail.com \
--to=linus.walleij@linaro.org \
--cc=andrzej.hajda@intel.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jahau@rocketmail.com \
--cc=krzk+dt@kernel.org \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=quic_jesszhan@quicinc.com \
--cc=robh@kernel.org \
--cc=thierry.reding@gmail.com \
--cc=~postmarketos/upstreaming@lists.sr.ht \
/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).