This adds new panel type to the mantix driver as found on the Librem 5 and
fixes a glitch in the init sequence (affecting both panels). The fix is at the
start of the series to make backporting simpler.
It also adds a patch to make st7703 use dev_err_probe().
changes from v1
- as per review comments by Linus Walleij
- fix alphabetical ordering in Documentation/devicetree/bindings/vendor-prefixes.yaml
https://lore.kernel.org/dri-devel/CACRpkdao_TMcpRsdK=7K5fNKJse0Bqwk58iWu0xsXdDNdcffVA@mail.gmail.com/
- add reviewed by to all except 5/6, thanks
Guido Günther (6):
drm/panel: st7703: Use dev_err_probe
drm/panel: mantix: Tweak init sequence
drm/panel: mantix: Allow to specify default mode for different panels
drm/panel: mantix: Support panel from Shenzhen Yashi Changhua
Intelligent Technology Co
dt-bindings: vendor-prefixes: Add ys vendor prefix
dt-binding: display: mantix: Add compatible for panel from YS
.../display/panel/mantix,mlaf057we51-x.yaml | 1 +
.../devicetree/bindings/vendor-prefixes.yaml | 2 +
.../gpu/drm/panel/panel-mantix-mlaf057we51.c | 39 +++++++++++++++----
drivers/gpu/drm/panel/panel-sitronix-st7703.c | 24 ++++--------
4 files changed, 43 insertions(+), 23 deletions(-)
--
2.29.2
The panel uses the same driver IC and has the same resolution but a
slightly different default mode. It seems it can work with the same
init sequence.
Signed-off-by: Guido Günther <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
---
drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
index b057857165b0..30f28ad4df6b 100644
--- a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
+++ b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
@@ -205,6 +205,21 @@ static const struct drm_display_mode default_mode_mantix = {
.height_mm = 130,
};
+static const struct drm_display_mode default_mode_ys = {
+ .hdisplay = 720,
+ .hsync_start = 720 + 45,
+ .hsync_end = 720 + 45 + 14,
+ .htotal = 720 + 45 + 14 + 25,
+ .vdisplay = 1440,
+ .vsync_start = 1440 + 175,
+ .vsync_end = 1440 + 175 + 8,
+ .vtotal = 1440 + 175 + 8 + 50,
+ .clock = 85298,
+ .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
+ .width_mm = 65,
+ .height_mm = 130,
+};
+
static int mantix_get_modes(struct drm_panel *panel,
struct drm_connector *connector)
{
@@ -326,6 +341,7 @@ static int mantix_remove(struct mipi_dsi_device *dsi)
static const struct of_device_id mantix_of_match[] = {
{ .compatible = "mantix,mlaf057we51-x", .data = &default_mode_mantix },
+ { .compatible = "ys,ys57pss36bh5gq", .data = &default_mode_ys },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, mantix_of_match);
--
2.29.2
This can be used to use different modes for differnt panels via OF
device match.
Signed-off-by: Guido Günther <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
---
.../gpu/drm/panel/panel-mantix-mlaf057we51.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
index 624d17b96a69..b057857165b0 100644
--- a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
+++ b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
@@ -9,6 +9,7 @@
#include <linux/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/module.h>
+#include <linux/of_device.h>
#include <linux/regulator/consumer.h>
#include <video/mipi_display.h>
@@ -34,6 +35,8 @@ struct mantix {
struct regulator *avdd;
struct regulator *avee;
struct regulator *vddi;
+
+ const struct drm_display_mode *default_mode;
};
static inline struct mantix *panel_to_mantix(struct drm_panel *panel)
@@ -187,7 +190,7 @@ static int mantix_prepare(struct drm_panel *panel)
return 0;
}
-static const struct drm_display_mode default_mode = {
+static const struct drm_display_mode default_mode_mantix = {
.hdisplay = 720,
.hsync_start = 720 + 45,
.hsync_end = 720 + 45 + 14,
@@ -208,11 +211,11 @@ static int mantix_get_modes(struct drm_panel *panel,
struct mantix *ctx = panel_to_mantix(panel);
struct drm_display_mode *mode;
- mode = drm_mode_duplicate(connector->dev, &default_mode);
+ mode = drm_mode_duplicate(connector->dev, ctx->default_mode);
if (!mode) {
dev_err(ctx->dev, "Failed to add mode %ux%u@%u\n",
- default_mode.hdisplay, default_mode.vdisplay,
- drm_mode_vrefresh(&default_mode));
+ ctx->default_mode->hdisplay, ctx->default_mode->vdisplay,
+ drm_mode_vrefresh(ctx->default_mode));
return -ENOMEM;
}
@@ -243,6 +246,7 @@ static int mantix_probe(struct mipi_dsi_device *dsi)
ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
if (!ctx)
return -ENOMEM;
+ ctx->default_mode = of_device_get_match_data(dev);
ctx->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
if (IS_ERR(ctx->reset_gpio)) {
@@ -293,8 +297,8 @@ static int mantix_probe(struct mipi_dsi_device *dsi)
}
dev_info(dev, "%ux%u@%u %ubpp dsi %udl - ready\n",
- default_mode.hdisplay, default_mode.vdisplay,
- drm_mode_vrefresh(&default_mode),
+ ctx->default_mode->hdisplay, ctx->default_mode->vdisplay,
+ drm_mode_vrefresh(ctx->default_mode),
mipi_dsi_pixel_format_to_bpp(dsi->format), dsi->lanes);
return 0;
@@ -321,7 +325,7 @@ static int mantix_remove(struct mipi_dsi_device *dsi)
}
static const struct of_device_id mantix_of_match[] = {
- { .compatible = "mantix,mlaf057we51-x" },
+ { .compatible = "mantix,mlaf057we51-x", .data = &default_mode_mantix },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, mantix_of_match);
--
2.29.2
We've seen some (non permanent) burn in and bad white balance
on some of the panels. Adding this bit from a vendor supplied
sequence fixes it.
Fixes: 72967d5616d3 ("drm/panel: Add panel driver for the Mantix MLAF057WE51-X DSI panel")
Signed-off-by: Guido Günther <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
---
drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
index 0c5f22e95c2d..624d17b96a69 100644
--- a/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
+++ b/drivers/gpu/drm/panel/panel-mantix-mlaf057we51.c
@@ -22,6 +22,7 @@
/* Manufacturer specific Commands send via DSI */
#define MANTIX_CMD_OTP_STOP_RELOAD_MIPI 0x41
#define MANTIX_CMD_INT_CANCEL 0x4C
+#define MANTIX_CMD_SPI_FINISH 0x90
struct mantix {
struct device *dev;
@@ -66,6 +67,10 @@ static int mantix_init_sequence(struct mantix *ctx)
dsi_generic_write_seq(dsi, 0x80, 0x64, 0x00, 0x64, 0x00, 0x00);
msleep(20);
+ dsi_generic_write_seq(dsi, MANTIX_CMD_SPI_FINISH, 0xA5);
+ dsi_generic_write_seq(dsi, MANTIX_CMD_OTP_STOP_RELOAD_MIPI, 0x00, 0x2F);
+ msleep(20);
+
dev_dbg(dev, "Panel init sequence done\n");
return 0;
}
--
2.29.2
On Wed, Nov 18, 2020 at 9:29 AM Guido Günther <[email protected]> wrote:
> This adds new panel type to the mantix driver as found on the Librem 5 and
> fixes a glitch in the init sequence (affecting both panels). The fix is at the
> start of the series to make backporting simpler.
> It also adds a patch to make st7703 use dev_err_probe().
>
> changes from v1
> - as per review comments by Linus Walleij
> - fix alphabetical ordering in Documentation/devicetree/bindings/vendor-prefixes.yaml
> https://lore.kernel.org/dri-devel/CACRpkdao_TMcpRsdK=7K5fNKJse0Bqwk58iWu0xsXdDNdcffVA@mail.gmail.com/
> - add reviewed by to all except 5/6, thanks
The whole v2 looks fine to me, I'd give the devicetree
maintainers some slack to review the DT patches then I can
apply the whole series unless you have commit access yourself,
just tell me.
For all v2 patches:
Reviewed-by: Linus Walleij <[email protected]>
If you have time, please review my s6e63m0 series.
https://lore.kernel.org/dri-devel/[email protected]/
https://lore.kernel.org/dri-devel/[email protected]/
https://lore.kernel.org/dri-devel/[email protected]/
Yours,
Linus Walleij
Hi Linus,
On Thu, Nov 19, 2020 at 09:35:17AM +0100, Linus Walleij wrote:
> On Wed, Nov 18, 2020 at 9:29 AM Guido G?nther <[email protected]> wrote:
>
> > This adds new panel type to the mantix driver as found on the Librem 5 and
> > fixes a glitch in the init sequence (affecting both panels). The fix is at the
> > start of the series to make backporting simpler.
> > It also adds a patch to make st7703 use dev_err_probe().
> >
> > changes from v1
> > - as per review comments by Linus Walleij
> > - fix alphabetical ordering in Documentation/devicetree/bindings/vendor-prefixes.yaml
> > https://lore.kernel.org/dri-devel/CACRpkdao_TMcpRsdK=7K5fNKJse0Bqwk58iWu0xsXdDNdcffVA@mail.gmail.com/
> > - add reviewed by to all except 5/6, thanks
>
> The whole v2 looks fine to me, I'd give the devicetree
> maintainers some slack to review the DT patches then I can
> apply the whole series unless you have commit access yourself,
> just tell me.
I have commit access, so i can push in a couple of days. Thanks!
>
> For all v2 patches:
> Reviewed-by: Linus Walleij <[email protected]>
>
> If you have time, please review my s6e63m0 series.
> https://lore.kernel.org/dri-devel/[email protected]/
> https://lore.kernel.org/dri-devel/[email protected]/
> https://lore.kernel.org/dri-devel/[email protected]/
Done. The panel stuff is always scary with all those magic values.
-- Guido
>
> Yours,
> Linus Walleij
>
Hi Guido,
On Wed, Nov 18, 2020 at 09:29:47AM +0100, Guido G?nther wrote:
> This adds new panel type to the mantix driver as found on the Librem 5 and
> fixes a glitch in the init sequence (affecting both panels). The fix is at the
> start of the series to make backporting simpler.
> It also adds a patch to make st7703 use dev_err_probe().
>
> changes from v1
> - as per review comments by Linus Walleij
> - fix alphabetical ordering in Documentation/devicetree/bindings/vendor-prefixes.yaml
> https://lore.kernel.org/dri-devel/CACRpkdao_TMcpRsdK=7K5fNKJse0Bqwk58iWu0xsXdDNdcffVA@mail.gmail.com/
> - add reviewed by to all except 5/6, thanks
>
> Guido G?nther (6):
> drm/panel: st7703: Use dev_err_probe
> drm/panel: mantix: Tweak init sequence
> drm/panel: mantix: Allow to specify default mode for different panels
> drm/panel: mantix: Support panel from Shenzhen Yashi Changhua
> Intelligent Technology Co
> dt-bindings: vendor-prefixes: Add ys vendor prefix
The above are all:
Reviewed-by: Sam Ravnborg <[email protected]>
> dt-binding: display: mantix: Add compatible for panel from YS
Please fix the subjects to read "dt-bindings" - just to be consistent.
With that:
Reviewed-by: Sam Ravnborg <[email protected]>
Sam
Hi,
On Mon, Nov 23, 2020 at 10:48:26PM +0100, Sam Ravnborg wrote:
> Hi Guido,
>
> On Wed, Nov 18, 2020 at 09:29:47AM +0100, Guido G?nther wrote:
> > This adds new panel type to the mantix driver as found on the Librem 5 and
> > fixes a glitch in the init sequence (affecting both panels). The fix is at the
> > start of the series to make backporting simpler.
> > It also adds a patch to make st7703 use dev_err_probe().
> >
> > changes from v1
> > - as per review comments by Linus Walleij
> > - fix alphabetical ordering in Documentation/devicetree/bindings/vendor-prefixes.yaml
> > https://lore.kernel.org/dri-devel/CACRpkdao_TMcpRsdK=7K5fNKJse0Bqwk58iWu0xsXdDNdcffVA@mail.gmail.com/
> > - add reviewed by to all except 5/6, thanks
> >
> > Guido G?nther (6):
> > drm/panel: st7703: Use dev_err_probe
> > drm/panel: mantix: Tweak init sequence
> > drm/panel: mantix: Allow to specify default mode for different panels
> > drm/panel: mantix: Support panel from Shenzhen Yashi Changhua
> > Intelligent Technology Co
> > dt-bindings: vendor-prefixes: Add ys vendor prefix
> The above are all:
> Reviewed-by: Sam Ravnborg <[email protected]>
>
> > dt-binding: display: mantix: Add compatible for panel from YS
> Please fix the subjects to read "dt-bindings" - just to be consistent.
> With that:
> Reviewed-by: Sam Ravnborg <[email protected]>
Fixed locally, thanks!
-- Guido
>
>
> Sam
>
Hi Linus,
On Thu, Nov 19, 2020 at 09:35:17AM +0100, Linus Walleij wrote:
> On Wed, Nov 18, 2020 at 9:29 AM Guido G?nther <[email protected]> wrote:
>
> > This adds new panel type to the mantix driver as found on the Librem 5 and
> > fixes a glitch in the init sequence (affecting both panels). The fix is at the
> > start of the series to make backporting simpler.
> > It also adds a patch to make st7703 use dev_err_probe().
> >
> > changes from v1
> > - as per review comments by Linus Walleij
> > - fix alphabetical ordering in Documentation/devicetree/bindings/vendor-prefixes.yaml
> > https://lore.kernel.org/dri-devel/CACRpkdao_TMcpRsdK=7K5fNKJse0Bqwk58iWu0xsXdDNdcffVA@mail.gmail.com/
> > - add reviewed by to all except 5/6, thanks
>
> The whole v2 looks fine to me, I'd give the devicetree
> maintainers some slack to review the DT patches then I can
> apply the whole series unless you have commit access yourself,
> just tell me.
Thanks. Is 2 weeks enough slack? Checking what's the rule of thumb here.
Cheers,
-- Guido
>
> For all v2 patches:
> Reviewed-by: Linus Walleij <[email protected]>
>
> If you have time, please review my s6e63m0 series.
> https://lore.kernel.org/dri-devel/[email protected]/
> https://lore.kernel.org/dri-devel/[email protected]/
> https://lore.kernel.org/dri-devel/[email protected]/
>
> Yours,
> Linus Walleij
>