From nobody Wed Nov 27 14:37:49 2024 Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A43AF1E25EB; Wed, 9 Oct 2024 15:09:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728486556; cv=none; b=GAkt2KTuQkk7SYuiBJJ/bMmSHeKkmxvuqaIBalWF6k76aQmK7sQDRCeGD6Sc4/43jD95CmvmV5rAJ3fIbppHoWVnBIUHRbCgms5ZCL3wDpLPuAEXnhvGv5D2JiHFaGkVd7GoQYPKGpjNybc7Bp5KsoUm8/h8hNf7Tsc/A4iys9E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728486556; c=relaxed/simple; bh=8E4fr1Sq/NtXc9NlBNm/OB/QNGso+ly2Jqs2ZWzRZDo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gvYcBi7VDVx75bax2FJsIm1GSuvGzEDyARxyKfOAKPyeb82SnHnHR7XdH+fvx+YRDXwEyxcbQXjog4suRUqajGat/ilMZK2r8WXDpctjQkgM7gdyaqJt1vQj/5bXGWh+ggAEkQlJtZHodyM7QpFda5OCDpnZ95Xg7kuPCSlpffY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=BYSCu6RG; arc=none smtp.client-ip=209.85.208.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BYSCu6RG" Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-5c91d0eadbfso1246142a12.0; Wed, 09 Oct 2024 08:09:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728486553; x=1729091353; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=JEvUlk1jL136GgzQVqdT9mrooxY8Q/uLvCPC41MEpWc=; b=BYSCu6RGTBWRZa+gzFarYHW2uxnvLADBuaW5i5DL3Dk2Wdi2277SBIk7hefjy2dnDP mTCiOw7Xsag6UytaxdFCP5O24xghyCT/2xuYsSpg9tzYO3A9wAOKSor5F5PlUFnbO8Xm Ukts1atHYsPbOBx7rnnxxwB7rk0Kc8aVZpNVUC19+F5Rq1xegRzCBQ+Q/ACC5BAb3+Yn deaWcRirRjtfz1XGK1xQ0aY6nv1DXO7+d5GnYdktxngun5v/MIugJtUUWetrw6RRjdFG x4qr1z4p1UTfJn4WsR8RSM/maIcFOn3czdr78GYcHNO8oOLpCpPwjMNSFXsE9dtu2B5V DoXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728486553; x=1729091353; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JEvUlk1jL136GgzQVqdT9mrooxY8Q/uLvCPC41MEpWc=; b=iD31KVN75nIZ07cLAuzJE9O1PeRbNOt6YE5i6hH4Ip1MgmNmwWbARSz8ZqaJrsDZM/ iGnDLG9PJDGMN4F4qzyVoejgWNIyDAPaTxgVrNPX2L8EmJdjdBf1nMw1JbxU6eT2DRfV KvfAwN5scoOsuRdM7qDsVmLMIunQ/ORI0WmsFkG/dmXfGZYMrPjkDxn5s54lDAk7nh4+ i2T+J7Pg8fw/V3Z111zpLg/EV+z/ZvrZhbUa3HHLig3fBjG8QWvprCvbNNYsIJ+giqb6 FM/WwXxwRZTsDp2jwf97FVcZvZmMRlDT5FqEuD3UU4lfV4mH9rcnm1VuZABH63plOLtP i1NQ== X-Forwarded-Encrypted: i=1; AJvYcCWxub6OjtWO+2xtYcp841bW0I1Y+/w9zrbNO2JlSHmODmKsiADcM6lUBFXD1o5UnmXtg8XEFWc5tLia@vger.kernel.org, AJvYcCXc2VzmwzcbmEqC+uDaCrNIAjAtZNtIgUbADuf+t12eVu4dTQB8wVbwCM/hQbhL7MdoAjz4kbGLBmEnOsac@vger.kernel.org X-Gm-Message-State: AOJu0Yyz4TxtO5Q5gr9riXumI3rxBfBe1TCptb1YhYbFwrjKEovWUa0m U7tW/BJnGihCalccT/Hi9/bTvxA9wwJCJkpsJYjdot8Lrzghil5m X-Google-Smtp-Source: AGHT+IFpmC0d/mSmKW6krwhiMHYg5RC1Y698kV0WymUaPKy3TEmRyQ4FGV+J9yIkDTIheiYLIN+iZg== X-Received: by 2002:a17:907:9620:b0:a99:4601:b9d8 with SMTP id a640c23a62f3a-a998d34dd72mr221987366b.63.1728486552647; Wed, 09 Oct 2024 08:09:12 -0700 (PDT) Received: from [127.0.1.1] (leased-line-46-53-189-107.telecom.by. [46.53.189.107]) by smtp.googlemail.com with ESMTPSA id a640c23a62f3a-a992e7b19b8sm668861766b.154.2024.10.09.08.09.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 08:09:12 -0700 (PDT) From: Dzmitry Sankouski Date: Wed, 09 Oct 2024 18:09:06 +0300 Subject: [PATCH v7 1/3] drm/mipi-dsi: add mipi_dsi_compression_mode_multi Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241009-starqltechn_integration_upstream-v7-1-9967bd15c7c5@gmail.com> References: <20241009-starqltechn_integration_upstream-v7-0-9967bd15c7c5@gmail.com> In-Reply-To: <20241009-starqltechn_integration_upstream-v7-0-9967bd15c7c5@gmail.com> To: Neil Armstrong , Jessica Zhang , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Dzmitry Sankouski X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1728486550; l=2054; i=dsankouski@gmail.com; s=20240619; h=from:subject:message-id; bh=8E4fr1Sq/NtXc9NlBNm/OB/QNGso+ly2Jqs2ZWzRZDo=; b=3lUOctdE19ggiM11q2NWrCsulpMt6YIvZwdld84ZfRF1xxEwgUNOc/0E6sjnhacb1QQpmn5rW +UfFVu+REpyCxjbZlh5SXgWHsSvzNbXq/x7EmsExNxjBBTHAO1nUPkG X-Developer-Key: i=dsankouski@gmail.com; a=ed25519; pk=YJcXFcN1EWrzBYuiE2yi5Mn6WLn6L1H71J+f7X8fMag= mipi_dsi_compression_mode_multi can help with error handling. Reviewed-by: Neil Armstrong Signed-off-by: Dzmitry Sankouski --- Changes in v7: - fix kernel doc --- drivers/gpu/drm/drm_mipi_dsi.c | 16 ++++++++++++++++ include/drm/drm_mipi_dsi.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index 2bc3973d35a1..5e5c5f84daac 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -1520,6 +1520,22 @@ void mipi_dsi_compression_mode_ext_multi(struct mipi= _dsi_multi_context *ctx, } EXPORT_SYMBOL(mipi_dsi_compression_mode_ext_multi); =20 +/** + * mipi_dsi_compression_mode_multi() - enable/disable DSC on the peripheral + * @ctx: Context for multiple DSI transactions + * @enable: Whether to enable or disable the DSC + * + * Enable or disable Display Stream Compression on the peripheral using the + * default Picture Parameter Set and VESA DSC 1.1 algorithm. + */ +void mipi_dsi_compression_mode_multi(struct mipi_dsi_multi_context *ctx, + bool enable) +{ + return mipi_dsi_compression_mode_ext_multi(ctx, enable, + MIPI_DSI_COMPRESSION_DSC, 0); +} +EXPORT_SYMBOL(mipi_dsi_compression_mode_multi); + /** * mipi_dsi_dcs_nop_multi() - send DCS NOP packet * @ctx: Context for multiple DSI transactions diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h index f725f8654611..94400a78031f 100644 --- a/include/drm/drm_mipi_dsi.h +++ b/include/drm/drm_mipi_dsi.h @@ -280,6 +280,8 @@ void mipi_dsi_compression_mode_ext_multi(struct mipi_ds= i_multi_context *ctx, bool enable, enum mipi_dsi_compression_algo algo, unsigned int pps_selector); +void mipi_dsi_compression_mode_multi(struct mipi_dsi_multi_context *ctx, + bool enable); void mipi_dsi_picture_parameter_set_multi(struct mipi_dsi_multi_context *c= tx, const struct drm_dsc_picture_parameter_set *pps); =20 --=20 2.39.2 From nobody Wed Nov 27 14:37:49 2024 Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D38711E25FE; Wed, 9 Oct 2024 15:09:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728486557; cv=none; b=u1LFmlGdVN6NWz/AjBoWbSTWBBGcBi0QmWCm6Jl9K8DJQ+KsmaG61zpXFWbxAhxF9GU01uPFnH1JzA/lLMRYspFAvmJBFiwM9/GLiZR/yhGfoLDZp7+Z3mxE9jHgnSYX6MoKQEm3OKEQYeE0xHAvzn7iOmHtov232WE6Wq1wOUA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728486557; c=relaxed/simple; bh=8Nxq3DBjGh+N1qOzmBsPWjVg42NnuOUFW+T5n27Uk9Q=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=B7nNMtbp1tkojI808iW4t5nHdnie8xwvP6xX2pcM3pj+buUwJEnLzDqITuLeqTyFEkC/wYK7HQqXnCMNY6EC8QNxmmlS8GcwMpCT1PYD0Fq95M+NX8+743mX1XOEQH7xBb5kshbA5pd6N0He9T+Xs+3DUJxDJbVj4AEM+GU8ox4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=BNWxBi4f; arc=none smtp.client-ip=209.85.218.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BNWxBi4f" Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-a9957588566so433715666b.3; Wed, 09 Oct 2024 08:09:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728486554; x=1729091354; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=pPRpID3jJTn8I9V4JMm2nGYUdsIJs/RBQaF/mHpfi60=; b=BNWxBi4fUAm1XehdASPQd/bL7/e/v3N2g24jEC1238MRCHWCdLyEOut2+rRHWG98Sa CIJ+E7cy9ntcUFnwIE8+nP705r+L92LyV/hCKnVE0ORDF7SNGI04Zak7GEZ8UprU/Pfp klRp4kbzsYWnXbDBM+5Ka4U9O8dcgUSi1w44iwYGvHqMwNaNbQwsdGzVXKLYoO6m3MwP aam8BGuXat0DoowilGUo9D6woLDibaPshf/G+TTZFAuO/YhIyKVIT/MF7VkG31XhDkTX 5mOqOsjANZw1GDn6qcYThj2uUBIp2hPCdFH5LyqOOUMwhUo02buuRklt9lEe4oQjllgW DSww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728486554; x=1729091354; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pPRpID3jJTn8I9V4JMm2nGYUdsIJs/RBQaF/mHpfi60=; b=ZyCvN15BxlGo3aQF1OYlXvf7Xa8un7mxpxAlLxjU6fR97GPy9ceyU1hjHZcj940fzH fc57yzUvM/UAeKtfpH1A2iDrqAH7sz2rfuVIsabOcarNpsv5GnPus9gPFq/J5cxOeyAa Ur7e+N8rkRzHBy65tsjztSvtqrOHgJaDT2C3ltz8zf5S9GDIZcGlYMuGjLB9ofVCezUV sAcSJ/pGTD7rOW/EaWJu+WIbwTWAyKuQFr4WCgWvluMQkOt3EVcDoWJo5TVWVY2twDMO mGiJdNQ/LDZu+hV/TVTJEZgrIsnwoG3vsELyUxIwXRrmw0D/INeBD19WiXGcyZjFjvgM UMxg== X-Forwarded-Encrypted: i=1; AJvYcCV7Gy+40p8iMDsw7loL9wkcoHKCQpnA70viot2SOVlgWLF8YNhRDMzzePYtcfVUg9piBomodp0AFK2G@vger.kernel.org, AJvYcCVCtmX0wLWKGgM1R/KXvqhDcd4xLMQwh+OB+GuChL4L4z2jvIgQQIAxja9P33iDCXnYKNojzxnU0j0CWF7I@vger.kernel.org X-Gm-Message-State: AOJu0YyEfF5xcw9fP9GT/gVB5PQ9vxo5iEMoRwSD2fSJUiuGjE0+VvBU IRyQuiqHAC8W1e/KiRSa+51OPhUPDaNWuFypkbPKpCfFRH1lhVjj X-Google-Smtp-Source: AGHT+IGGYGjTYmD19xzpwSLKjHIxB0DbuZAy4atQClezI1moGKPNbhTo/EOOQnZ7DkDNbk29GhdCOw== X-Received: by 2002:a17:907:96ab:b0:a99:5c22:fef6 with SMTP id a640c23a62f3a-a998d124293mr231186166b.1.1728486553903; Wed, 09 Oct 2024 08:09:13 -0700 (PDT) Received: from [127.0.1.1] (leased-line-46-53-189-107.telecom.by. [46.53.189.107]) by smtp.googlemail.com with ESMTPSA id a640c23a62f3a-a992e7b19b8sm668861766b.154.2024.10.09.08.09.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 08:09:13 -0700 (PDT) From: Dzmitry Sankouski Date: Wed, 09 Oct 2024 18:09:07 +0300 Subject: [PATCH v7 2/3] dt-bindings: panel: add Samsung s6e3ha8 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241009-starqltechn_integration_upstream-v7-2-9967bd15c7c5@gmail.com> References: <20241009-starqltechn_integration_upstream-v7-0-9967bd15c7c5@gmail.com> In-Reply-To: <20241009-starqltechn_integration_upstream-v7-0-9967bd15c7c5@gmail.com> To: Neil Armstrong , Jessica Zhang , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Dzmitry Sankouski , Conor Dooley X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1728486550; l=3291; i=dsankouski@gmail.com; s=20240619; h=from:subject:message-id; bh=8Nxq3DBjGh+N1qOzmBsPWjVg42NnuOUFW+T5n27Uk9Q=; b=CEaDa7s2RpvOgyvsKNpJkaf+X2Rmwq5fRRg4ToYc5g9Ornc3LI1+WdxcF2VPXLnlZN4QkFTrv 1RKmRDoE04xDKDrAuFR0HmscmkY6J7JYmdD3c52kUCKBwhGNa4QfkfX X-Developer-Key: i=dsankouski@gmail.com; a=ed25519; pk=YJcXFcN1EWrzBYuiE2yi5Mn6WLn6L1H71J+f7X8fMag= Add binding for the Samsung s6e3ha8 panel found in the Samsung S9. Reviewed-by: Conor Dooley Signed-off-by: Dzmitry Sankouski --- Changes for v5: - fix required properties order - fix example indentation Changes in v4: - change dts example intendation from tabs to spaces - remove reset-gpios description --- Documentation/devicetree/bindings/display/panel/samsung,s6e3ha8.yaml | 75 = +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ MAINTAINERS | 5 = +++++ 2 files changed, 80 insertions(+) diff --git a/Documentation/devicetree/bindings/display/panel/samsung,s6e3ha= 8.yaml b/Documentation/devicetree/bindings/display/panel/samsung,s6e3ha8.ya= ml new file mode 100644 index 000000000000..05a78429aaea --- /dev/null +++ b/Documentation/devicetree/bindings/display/panel/samsung,s6e3ha8.yaml @@ -0,0 +1,75 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/panel/samsung,s6e3ha8.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Samsung s6e3ha8 AMOLED DSI panel + +description: The s6e3ha8 is a 1440x2960 DPI display panel from Samsung Mob= ile + Displays (SMD). + +maintainers: + - Dzmitry Sankouski + +allOf: + - $ref: panel-common.yaml# + +properties: + compatible: + const: samsung,s6e3ha8 + + reg: + maxItems: 1 + + reset-gpios: true + + port: true + + vdd3-supply: + description: VDD regulator + + vci-supply: + description: VCI regulator + + vddr-supply: + description: VDDR regulator + +required: + - compatible + - reset-gpios + - vdd3-supply + - vci-supply + - vddr-supply + +unevaluatedProperties: false + +examples: + - | + #include + + dsi { + #address-cells =3D <1>; + #size-cells =3D <0>; + + panel@0 { + compatible =3D "samsung,s6e3ha8"; + reg =3D <0>; + vci-supply =3D <&s2dos05_ldo4>; + vddr-supply =3D <&s2dos05_buck1>; + vdd3-supply =3D <&s2dos05_ldo1>; + te-gpios =3D <&tlmm 10 GPIO_ACTIVE_HIGH>; + reset-gpios =3D <&tlmm 6 GPIO_ACTIVE_HIGH>; + pinctrl-0 =3D <&sde_dsi_active &sde_te_active_sleep>; + pinctrl-1 =3D <&sde_dsi_suspend &sde_te_active_sleep>; + pinctrl-names =3D "default", "sleep"; + + port { + panel_in: endpoint { + remote-endpoint =3D <&mdss_dsi0_out>; + }; + }; + }; + }; + +... diff --git a/MAINTAINERS b/MAINTAINERS index 84086d47db69..ccc3cf5114c6 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7389,6 +7389,11 @@ S: Maintained F: Documentation/devicetree/bindings/display/panel/samsung,s6d7aa0.yaml F: drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c =20 +DRM DRIVER FOR SAMSUNG S6E3HA8 PANELS +M: Dzmitry Sankouski +S: Maintained +F: Documentation/devicetree/bindings/display/panel/samsung,s6e3ha8.yaml + DRM DRIVER FOR SITRONIX ST7586 PANELS M: David Lechner S: Maintained --=20 2.39.2 From nobody Wed Nov 27 14:37:49 2024 Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8887D1E284C; Wed, 9 Oct 2024 15:09:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728486561; cv=none; b=HWHA6aGmQGqHNRusSjxnnV2112NJVsrXDGJ2qfQL1drIcD7NrWn7U8p3oM8eA8zBqRtbG0oKM+9+EkmjMbpizp0Km6eI7LiGsrZqJE8X0Ubq9abLN8C0xQmJq4e1pQ7/zvt7qLRW1s4KTJtdK2A76FbO6J1NJqANBFbLhSCj2Qg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728486561; c=relaxed/simple; bh=pzDMf4OpE5Ssrnr/tT2AV3m8V/QhC8CvNbVtUskzjzc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=N9r7GkiI7Ml5DqPWMnhC4NWl1Jlv5xHkzN2TozDjRY99rwBKVSWnPXyrq7Mo2BWtbLlMgbVu94JeIGZdrf5eSYC8IWFiI4iVvVPBuxQFKIkCXvwVgTVLfSKRVu2CoegjW0MY5ydnwLGI5cpz0/XUBlm1F5F+AV0FsXjTwGl4F2k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=YXatMf8y; arc=none smtp.client-ip=209.85.167.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YXatMf8y" Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-539885dd4bcso8744324e87.0; Wed, 09 Oct 2024 08:09:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728486556; x=1729091356; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=pQzFurxONmfMRW+4iWughlMTvY7MPZaNZ6T0HX1SFog=; b=YXatMf8yI2cR0Ds/ctZNpa7UVZ+s8rg5NDqhMbtBas0MKHcdMaBZNfcUV9HGuHy+cr OglV1gk4KLkFWhGv7ivMT0ZVumFr3cKflpiUyojN1Z9hS/zg+gl3iGeIVvoFnUoAFE33 /1DgIWJ/ewjtHB8LeIURH7UNPzakqPViIgPo686YjTdSiohKB2pzbsyFFgTBjE6iG6cP Gs9WNm7RXzpaUH/yzATlHkWrYnJ7AVPiAH6R2eh7IDd+6l1+eoTLoQm+qdyG6mRq+qHY srG6Ng0pAj4v4V56Ffu8ieb3xRJi94U8DF7/09r6e0L3HWrLtgbn55fhDNl8S+0pOk2i zGcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728486556; x=1729091356; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pQzFurxONmfMRW+4iWughlMTvY7MPZaNZ6T0HX1SFog=; b=V8uXoPdEkp8Z2tfhdBfzche4U7d7h7nRNztLlxuRANJooDAwF2K7yoRCET1WfuQmro hdGCtHAmh1Y7g1c+Xlco2dAiCWWMC/Lnu/n3JNbPLIdgf+jGxGA3IOUbfjxGLkDuVTex VZUy/aRfFBLtaeoWXVCWHszU2bGk4XyxPf9FlH36kX3DIma4VWN0DXZ9dttJnj4Km6kj TymYB786d6Jzy2iD6d+yWk+f47lwBbytpvaxKiau+BTrsNzyw7Y4Jx8bpz6INuaZ4DEu uTv63QvH+A6yiJBdT/KCbIgEB7LuxUU/Zrp5x09FpAR5ICpwWEb+6V73H+wtg4RB8RnK kLXg== X-Forwarded-Encrypted: i=1; AJvYcCU8qE3hhA5uTR/YJLOkwE4Mzm72bPkte+lEQtowebHegBVypqwpHTjhi80y2OQQ0b2i2psemhPB5QmusxCc@vger.kernel.org, AJvYcCV/GIfXqJEXzWrJlhC2HRnCEj6O1hmqwny+O5Hj0//AYEOGalFX4TrvgRk969K9rjISXTJAnw+eMmeC@vger.kernel.org X-Gm-Message-State: AOJu0Yz03VB/NUpesDGwu7EpI87upCLiepWg8E7/wfYeB3ZMd+fLZGss yOkteQYbEQzRgIdHBNmebDD2VKEK5JL28CaLIb0fk7iIWKo9Fox2 X-Google-Smtp-Source: AGHT+IFUqvSE5T8FfIbpWk5yqedZ5Gh1Km+BI/K+LsRl0jVeYwTLYV5GbIBOa366X3pB+0uxwWyRYA== X-Received: by 2002:a05:6512:3b20:b0:539:a3eb:d000 with SMTP id 2adb3069b0e04-539c49580c0mr1813234e87.42.1728486555195; Wed, 09 Oct 2024 08:09:15 -0700 (PDT) Received: from [127.0.1.1] (leased-line-46-53-189-107.telecom.by. [46.53.189.107]) by smtp.googlemail.com with ESMTPSA id a640c23a62f3a-a992e7b19b8sm668861766b.154.2024.10.09.08.09.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 08:09:14 -0700 (PDT) From: Dzmitry Sankouski Date: Wed, 09 Oct 2024 18:09:08 +0300 Subject: [PATCH v7 3/3] drm/panel: Add support for S6E3HA8 panel driver Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241009-starqltechn_integration_upstream-v7-3-9967bd15c7c5@gmail.com> References: <20241009-starqltechn_integration_upstream-v7-0-9967bd15c7c5@gmail.com> In-Reply-To: <20241009-starqltechn_integration_upstream-v7-0-9967bd15c7c5@gmail.com> To: Neil Armstrong , Jessica Zhang , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Dzmitry Sankouski X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1728486550; l=14601; i=dsankouski@gmail.com; s=20240619; h=from:subject:message-id; bh=pzDMf4OpE5Ssrnr/tT2AV3m8V/QhC8CvNbVtUskzjzc=; b=jSk/dl6eOBZg2h7dtxWB+rX1GxCOsAORZQKeZbCgw4IxctiqeQ9qJLcZo40N1TwcWh/Eqk+48 VyPicXCKC0sAGs2UHIGmtPhjYaFlpXa/DtvYP3khCc6F+rtDCd1ed9U X-Developer-Key: i=dsankouski@gmail.com; a=ed25519; pk=YJcXFcN1EWrzBYuiE2yi5Mn6WLn6L1H71J+f7X8fMag= Add support for MIPI-DSI based S6E3HA8 AMOLED panel driver. This panel has 1440x2960 resolution, 5.8-inch physical size, and can be found in starqltechn device. Brightness regulation is not yet supported. Reviewed-by: Neil Armstrong Signed-off-by: Dzmitry Sankouski --- Changes for v6: - return ctx.accum_err instead of 0 where possible - s6e3ha8_amb577px01_wqhd_on: arrange code blocks by key unlock / lock actions - more *_multi functions - switch to devm_regulator_bulk_get_const Changes for v5: - return ctx.accum_err instead of 0 where possible - switch mipi_dsi_picture_parameter_set to _multi - replace msleep with mipi_dsi_msleep Changes in v4: - inline power related functions - rework driver using new mipi_dsi_dcs_write_seq_multi macro - use drm_connector_helper_get_modes_fixed for modes - remove excessive compression setting --- MAINTAINERS | 1 + drivers/gpu/drm/panel/Kconfig | 7 +++ drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c | 342 ++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++++++++++++++ 4 files changed, 351 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index ccc3cf5114c6..0f3f767afa4c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7393,6 +7393,7 @@ DRM DRIVER FOR SAMSUNG S6E3HA8 PANELS M: Dzmitry Sankouski S: Maintained F: Documentation/devicetree/bindings/display/panel/samsung,s6e3ha8.yaml +F: drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c =20 DRM DRIVER FOR SITRONIX ST7586 PANELS M: David Lechner diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 1077fd2307d4..7d3c9cbfe835 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -689,6 +689,13 @@ config DRM_PANEL_SAMSUNG_S6E3HA2 depends on BACKLIGHT_CLASS_DEVICE select VIDEOMODE_HELPERS =20 +config DRM_PANEL_SAMSUNG_S6E3HA8 + tristate "Samsung S6E3HA8 DSI video mode panel" + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + select VIDEOMODE_HELPERS + config DRM_PANEL_SAMSUNG_S6E63J0X03 tristate "Samsung S6E63J0X03 DSI command mode panel" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 987a08702410..8ee28f5a2213 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -70,6 +70,7 @@ obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6D27A1) +=3D panel-samsun= g-s6d27a1.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6D7AA0) +=3D panel-samsung-s6d7aa0.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3FA7) +=3D panel-samsung-s6e3fa7.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HA2) +=3D panel-samsung-s6e3ha2.o +obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HA8) +=3D panel-samsung-s6e3ha8.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03) +=3D panel-samsung-s6e63j0x03.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0) +=3D panel-samsung-s6e63m0.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0_SPI) +=3D panel-samsung-s6e63m0-spi= .o diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c b/drivers/gpu/dr= m/panel/panel-samsung-s6e3ha8.c new file mode 100644 index 000000000000..76b5a6ea610d --- /dev/null +++ b/drivers/gpu/drm/panel/panel-samsung-s6e3ha8.c @@ -0,0 +1,342 @@ +// SPDX-License-Identifier: GPL-2.0-only +// +// Generated with linux-mdss-dsi-panel-driver-generator from vendor device= tree: +// Copyright (c) 2013, The Linux Foundation. All rights reserved. +// Copyright (c) 2024 Dzmitry Sankouski + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +struct s6e3ha8 { + struct drm_panel panel; + struct mipi_dsi_device *dsi; + struct drm_dsc_config dsc; + struct gpio_desc *reset_gpio; + struct regulator_bulk_data *supplies; +}; + +const struct regulator_bulk_data s6e3ha8_supplies[] =3D { + { .supply =3D "vdd3" }, + { .supply =3D "vci" }, + { .supply =3D "vddr" }, +}; + +static inline +struct s6e3ha8 *to_s6e3ha8_amb577px01_wqhd(struct drm_panel *panel) +{ + return container_of(panel, struct s6e3ha8, panel); +} + +#define s6e3ha8_test_key_on_lvl2(ctx) \ + mipi_dsi_dcs_write_seq_multi(ctx, 0xf0, 0x5a, 0x5a) +#define s6e3ha8_test_key_off_lvl2(ctx) \ + mipi_dsi_dcs_write_seq_multi(ctx, 0xf0, 0xa5, 0xa5) +#define s6e3ha8_test_key_on_lvl3(ctx) \ + mipi_dsi_dcs_write_seq_multi(ctx, 0xfc, 0x5a, 0x5a) +#define s6e3ha8_test_key_off_lvl3(ctx) \ + mipi_dsi_dcs_write_seq_multi(ctx, 0xfc, 0xa5, 0xa5) +#define s6e3ha8_test_key_on_lvl1(ctx) \ + mipi_dsi_dcs_write_seq_multi(ctx, 0x9f, 0xa5, 0xa5) +#define s6e3ha8_test_key_off_lvl1(ctx) \ + mipi_dsi_dcs_write_seq_multi(ctx, 0x9f, 0x5a, 0x5a) +#define s6e3ha8_afc_off(ctx) \ + mipi_dsi_dcs_write_seq_multi(ctx, 0xe2, 0x00, 0x00) + +static void s6e3ha8_amb577px01_wqhd_reset(struct s6e3ha8 *priv) +{ + gpiod_set_value_cansleep(priv->reset_gpio, 1); + usleep_range(5000, 6000); + gpiod_set_value_cansleep(priv->reset_gpio, 0); + usleep_range(5000, 6000); + gpiod_set_value_cansleep(priv->reset_gpio, 1); + usleep_range(5000, 6000); +} + +static int s6e3ha8_amb577px01_wqhd_on(struct s6e3ha8 *priv) +{ + struct mipi_dsi_device *dsi =3D priv->dsi; + struct mipi_dsi_multi_context ctx =3D { .dsi =3D dsi }; + + dsi->mode_flags |=3D MIPI_DSI_MODE_LPM; + + s6e3ha8_test_key_on_lvl1(&ctx); + + s6e3ha8_test_key_on_lvl2(&ctx); + mipi_dsi_compression_mode_multi(&ctx, true); + s6e3ha8_test_key_off_lvl2(&ctx); + + mipi_dsi_dcs_exit_sleep_mode_multi(&ctx); + usleep_range(5000, 6000); + + s6e3ha8_test_key_on_lvl2(&ctx); + mipi_dsi_dcs_write_seq_multi(&ctx, 0xf2, 0x13); + s6e3ha8_test_key_off_lvl2(&ctx); + usleep_range(10000, 11000); + + s6e3ha8_test_key_on_lvl2(&ctx); + mipi_dsi_dcs_write_seq_multi(&ctx, 0xf2, 0x13); + s6e3ha8_test_key_off_lvl2(&ctx); + + /* OMOK setting 1 (Initial setting) - Scaler Latch Setting Guide */ + s6e3ha8_test_key_on_lvl2(&ctx); + mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x07); + /* latch setting 1 : Scaler on/off & address setting & PPS setting -> Ima= ge update latch */ + mipi_dsi_dcs_write_seq_multi(&ctx, 0xf2, 0x3c, 0x10); + mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x0b); + /* latch setting 2 : Ratio change mode -> Image update latch */ + mipi_dsi_dcs_write_seq_multi(&ctx, 0xf2, 0x30); + /* OMOK setting 2 - Seamless setting guide : WQHD */ + mipi_dsi_dcs_write_seq_multi(&ctx, 0x2a, 0x00, 0x00, 0x05, 0x9f); /* CASE= T */ + mipi_dsi_dcs_write_seq_multi(&ctx, 0x2b, 0x00, 0x00, 0x0b, 0x8f); /* PASE= T */ + mipi_dsi_dcs_write_seq_multi(&ctx, 0xba, 0x01); /* scaler setup : scaler = off */ + s6e3ha8_test_key_off_lvl2(&ctx); + + mipi_dsi_dcs_write_seq_multi(&ctx, 0x35, 0x00); /* TE Vsync ON */ + + s6e3ha8_test_key_on_lvl2(&ctx); + mipi_dsi_dcs_write_seq_multi(&ctx, 0xed, 0x4c); /* ERR_FG */ + s6e3ha8_test_key_off_lvl2(&ctx); + + s6e3ha8_test_key_on_lvl3(&ctx); + /* FFC Setting 897.6Mbps */ + mipi_dsi_dcs_write_seq_multi(&ctx, 0xc5, 0x0d, 0x10, 0xb4, 0x3e, 0x01); + s6e3ha8_test_key_off_lvl3(&ctx); + + s6e3ha8_test_key_on_lvl2(&ctx); + mipi_dsi_dcs_write_seq_multi(&ctx, 0xb9, + 0x00, 0xb0, 0x81, 0x09, 0x00, 0x00, 0x00, + 0x11, 0x03); /* TSP HSYNC Setting */ + s6e3ha8_test_key_off_lvl2(&ctx); + + s6e3ha8_test_key_on_lvl2(&ctx); + mipi_dsi_dcs_write_seq_multi(&ctx, 0xb0, 0x03); + mipi_dsi_dcs_write_seq_multi(&ctx, 0xf6, 0x43); + s6e3ha8_test_key_off_lvl2(&ctx); + + s6e3ha8_test_key_on_lvl2(&ctx); + /* Brightness condition set */ + mipi_dsi_dcs_write_seq_multi(&ctx, 0xca, + 0x07, 0x00, 0x00, 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, + 0x80, 0x80, 0x80, 0x00, 0x00, 0x00); + mipi_dsi_dcs_write_seq_multi(&ctx, 0xb1, 0x00, 0x0c); /* AID Set : 0% */ + mipi_dsi_dcs_write_seq_multi(&ctx, 0xb5, + 0x19, 0xdc, 0x16, 0x01, 0x34, 0x67, 0x9a, + 0xcd, 0x01, 0x22, 0x33, 0x44, 0x00, 0x00, + 0x05, 0x55, 0xcc, 0x0c, 0x01, 0x11, 0x11, + 0x10); /* MPS/ELVSS Setting */ + mipi_dsi_dcs_write_seq_multi(&ctx, 0xf4, 0xeb, 0x28); /* VINT */ + mipi_dsi_dcs_write_seq_multi(&ctx, 0xf7, 0x03); /* Gamma, LTPS(AID) updat= e */ + s6e3ha8_test_key_off_lvl2(&ctx); + + s6e3ha8_test_key_off_lvl1(&ctx); + + return ctx.accum_err; +} + +static int s6e3ha8_enable(struct drm_panel *panel) +{ + struct s6e3ha8 *priv =3D to_s6e3ha8_amb577px01_wqhd(panel); + struct mipi_dsi_device *dsi =3D priv->dsi; + struct mipi_dsi_multi_context ctx =3D { .dsi =3D dsi }; + + s6e3ha8_test_key_on_lvl1(&ctx); + mipi_dsi_dcs_set_display_on_multi(&ctx); + s6e3ha8_test_key_off_lvl1(&ctx); + + return ctx.accum_err; +} + +static int s6e3ha8_disable(struct drm_panel *panel) +{ + struct s6e3ha8 *priv =3D to_s6e3ha8_amb577px01_wqhd(panel); + struct mipi_dsi_device *dsi =3D priv->dsi; + struct mipi_dsi_multi_context ctx =3D { .dsi =3D dsi }; + + s6e3ha8_test_key_on_lvl1(&ctx); + mipi_dsi_dcs_set_display_off_multi(&ctx); + s6e3ha8_test_key_off_lvl1(&ctx); + mipi_dsi_msleep(&ctx, 20); + + s6e3ha8_test_key_on_lvl2(&ctx); + s6e3ha8_afc_off(&ctx); + s6e3ha8_test_key_off_lvl2(&ctx); + + mipi_dsi_msleep(&ctx, 160); + + return ctx.accum_err; +} + +static int s6e3ha8_amb577px01_wqhd_prepare(struct drm_panel *panel) +{ + struct s6e3ha8 *priv =3D to_s6e3ha8_amb577px01_wqhd(panel); + struct mipi_dsi_device *dsi =3D priv->dsi; + struct mipi_dsi_multi_context ctx =3D { .dsi =3D dsi }; + struct drm_dsc_picture_parameter_set pps; + int ret; + + ret =3D regulator_bulk_enable(ARRAY_SIZE(s6e3ha8_supplies), priv->supplie= s); + if (ret < 0) + return ret; + mipi_dsi_msleep(&ctx, 120); + s6e3ha8_amb577px01_wqhd_reset(priv); + + ret =3D s6e3ha8_amb577px01_wqhd_on(priv); + if (ret < 0) { + gpiod_set_value_cansleep(priv->reset_gpio, 1); + goto err; + } + + drm_dsc_pps_payload_pack(&pps, &priv->dsc); + + s6e3ha8_test_key_on_lvl1(&ctx); + mipi_dsi_picture_parameter_set_multi(&ctx, &pps); + s6e3ha8_test_key_off_lvl1(&ctx); + + mipi_dsi_msleep(&ctx, 28); + + return ctx.accum_err; +err: + regulator_bulk_disable(ARRAY_SIZE(s6e3ha8_supplies), priv->supplies); + return ret; +} + +static int s6e3ha8_amb577px01_wqhd_unprepare(struct drm_panel *panel) +{ + struct s6e3ha8 *priv =3D to_s6e3ha8_amb577px01_wqhd(panel); + + return regulator_bulk_disable(ARRAY_SIZE(s6e3ha8_supplies), priv->supplie= s); +} + +static const struct drm_display_mode s6e3ha8_amb577px01_wqhd_mode =3D { + .clock =3D (1440 + 116 + 44 + 120) * (2960 + 120 + 80 + 124) * 60 / 1000, + .hdisplay =3D 1440, + .hsync_start =3D 1440 + 116, + .hsync_end =3D 1440 + 116 + 44, + .htotal =3D 1440 + 116 + 44 + 120, + .vdisplay =3D 2960, + .vsync_start =3D 2960 + 120, + .vsync_end =3D 2960 + 120 + 80, + .vtotal =3D 2960 + 120 + 80 + 124, + .width_mm =3D 64, + .height_mm =3D 132, +}; + +static int s6e3ha8_amb577px01_wqhd_get_modes(struct drm_panel *panel, + struct drm_connector *connector) +{ + return drm_connector_helper_get_modes_fixed(connector, &s6e3ha8_amb577px0= 1_wqhd_mode); +} + +static const struct drm_panel_funcs s6e3ha8_amb577px01_wqhd_panel_funcs = =3D { + .prepare =3D s6e3ha8_amb577px01_wqhd_prepare, + .unprepare =3D s6e3ha8_amb577px01_wqhd_unprepare, + .get_modes =3D s6e3ha8_amb577px01_wqhd_get_modes, + .enable =3D s6e3ha8_enable, + .disable =3D s6e3ha8_disable, +}; + +static int s6e3ha8_amb577px01_wqhd_probe(struct mipi_dsi_device *dsi) +{ + struct device *dev =3D &dsi->dev; + struct s6e3ha8 *priv; + int ret; + + priv =3D devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + ret =3D devm_regulator_bulk_get_const(dev, ARRAY_SIZE(s6e3ha8_supplies), + s6e3ha8_supplies, + &priv->supplies); + if (ret < 0) { + dev_err(dev, "failed to get regulators: %d\n", ret); + return ret; + } + + priv->reset_gpio =3D devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); + if (IS_ERR(priv->reset_gpio)) + return dev_err_probe(dev, PTR_ERR(priv->reset_gpio), + "Failed to get reset-gpios\n"); + + priv->dsi =3D dsi; + mipi_dsi_set_drvdata(dsi, priv); + + dsi->lanes =3D 4; + dsi->format =3D MIPI_DSI_FMT_RGB888; + dsi->mode_flags =3D MIPI_DSI_CLOCK_NON_CONTINUOUS | + MIPI_DSI_MODE_VIDEO_NO_HFP | MIPI_DSI_MODE_VIDEO_NO_HBP | + MIPI_DSI_MODE_VIDEO_NO_HSA | MIPI_DSI_MODE_NO_EOT_PACKET; + + drm_panel_init(&priv->panel, dev, &s6e3ha8_amb577px01_wqhd_panel_funcs, + DRM_MODE_CONNECTOR_DSI); + priv->panel.prepare_prev_first =3D true; + + drm_panel_add(&priv->panel); + + /* This panel only supports DSC; unconditionally enable it */ + dsi->dsc =3D &priv->dsc; + + priv->dsc.dsc_version_major =3D 1; + priv->dsc.dsc_version_minor =3D 1; + + priv->dsc.slice_height =3D 40; + priv->dsc.slice_width =3D 720; + WARN_ON(1440 % priv->dsc.slice_width); + priv->dsc.slice_count =3D 1440 / priv->dsc.slice_width; + priv->dsc.bits_per_component =3D 8; + priv->dsc.bits_per_pixel =3D 8 << 4; /* 4 fractional bits */ + priv->dsc.block_pred_enable =3D true; + + ret =3D mipi_dsi_attach(dsi); + if (ret < 0) { + dev_err(dev, "Failed to attach to DSI host: %d\n", ret); + drm_panel_remove(&priv->panel); + return ret; + } + + return 0; +} + +static void s6e3ha8_amb577px01_wqhd_remove(struct mipi_dsi_device *dsi) +{ + struct s6e3ha8 *priv =3D mipi_dsi_get_drvdata(dsi); + int ret; + + ret =3D mipi_dsi_detach(dsi); + if (ret < 0) + dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); + + drm_panel_remove(&priv->panel); +} + +static const struct of_device_id s6e3ha8_amb577px01_wqhd_of_match[] =3D { + { .compatible =3D "samsung,s6e3ha8" }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, s6e3ha8_amb577px01_wqhd_of_match); + +static struct mipi_dsi_driver s6e3ha8_amb577px01_wqhd_driver =3D { + .probe =3D s6e3ha8_amb577px01_wqhd_probe, + .remove =3D s6e3ha8_amb577px01_wqhd_remove, + .driver =3D { + .name =3D "panel-s6e3ha8", + .of_match_table =3D s6e3ha8_amb577px01_wqhd_of_match, + }, +}; +module_mipi_dsi_driver(s6e3ha8_amb577px01_wqhd_driver); + +MODULE_AUTHOR("Dzmitry Sankouski "); +MODULE_DESCRIPTION("DRM driver for S6E3HA8 panel"); +MODULE_LICENSE("GPL"); --=20 2.39.2