From patchwork Sun Jun 30 18:36:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 808751 Received: from out-187.mta0.migadu.com (out-187.mta0.migadu.com [91.218.175.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7CC7D153BE2; Sun, 30 Jun 2024 18:36:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.187 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719772606; cv=none; b=jTvGsCMSk83m701F/zTlxgmiDFPkP7yy08XMNh/bPcIhzUWhlfc4hl2bpF5VNs6KCyO59ybehLxmSJRtA64td3kO8nAvrCs2HEHiqjvtc3IvhWDOiCUI8wb4+z4YATsLBpa5erZbq7IY2jlllcCnqUHghQw7lloAHAtXRUs+NyU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719772606; c=relaxed/simple; bh=XL5TcWDmclGnBkenp9Wm9HwFQWHhCM5cOKm1DOPdk6k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FU68IYcfVOuwueVE9KpT37Hes5OrFp/9YM+nvlaOqCmhTRer2sVqX9PewbN8tDBWuOorQAC+43GhCYgQmL7KaTZnUfffP3ZIdI6yOl1C1VR2LhcY8QwoLPcycymNso277LfnBzzshoVNPvbKKRwNYd/ZhH6X2eqp1NOVw87HOv0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=postmarketos.org; spf=pass smtp.mailfrom=postmarketos.org; dkim=pass (2048-bit key) header.d=postmarketos.org header.i=@postmarketos.org header.b=mOidTYR/; arc=none smtp.client-ip=91.218.175.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=postmarketos.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=postmarketos.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=postmarketos.org header.i=@postmarketos.org header.b="mOidTYR/" X-Envelope-To: robh@kernel.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=postmarketos.org; s=key1; t=1719772602; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZdEQ1EbZMn01XAPtZH6WuK788jpoWDyo/EngDbWuXh8=; b=mOidTYR/gxv822MQFeMCLNdEv4aKUAa5B6FIIk0HhymW6xlwW2VG1d74ZUBI7i9sTt4Cjz 3mhdwH7K96vbI4cHiVj8M0F5UdDozu88faIqZcvCwO25meHxt17l3KwZ9GFbBmLNtuTivr 8esnvnpcaa5YwKpVyO2mIwCImlIpAO5xLuWnMY1uY11glGPmjQbenDWLV7tdsa/IEILgRX cZUK8SGhwFmjyVQOhMdy5YgIi9voBgBUikkM4v3k+ILIvF0NBf+iiti37CZUfF+9pqFfA4 0kmetHzHuIIm0PRkZHVVRuvRRl6lep9OU41kxZHn9jwbKG587b73bdzvkq+9Xw== X-Envelope-To: conor+dt@kernel.org X-Envelope-To: neil.armstrong@linaro.org X-Envelope-To: daniel@ffwll.ch X-Envelope-To: ~postmarketos/upstreaming@lists.sr.ht X-Envelope-To: dmitry.torokhov@gmail.com X-Envelope-To: linux-input@vger.kernel.org X-Envelope-To: mripard@kernel.org X-Envelope-To: caleb@postmarketos.org X-Envelope-To: linux-arm-msm@vger.kernel.org X-Envelope-To: krzk+dt@kernel.org X-Envelope-To: dri-devel@lists.freedesktop.org X-Envelope-To: rydberg@bitmath.org X-Envelope-To: konrad.dybcio@linaro.org X-Envelope-To: maarten.lankhorst@linux.intel.com X-Envelope-To: devicetree@vger.kernel.org X-Envelope-To: dmitry.baryshkov@linaro.org X-Envelope-To: tzimmermann@suse.de X-Envelope-To: airlied@gmail.com X-Envelope-To: quic_jesszhan@quicinc.com X-Envelope-To: andersson@kernel.org X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Caleb Connolly Date: Sun, 30 Jun 2024 20:36:25 +0200 Subject: [PATCH v2 2/8] dt-bindings: input: touchscreen: document synaptics TCM oncell Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240630-oneplus8-v2-2-c4a1f8da74f1@postmarketos.org> References: <20240630-oneplus8-v2-0-c4a1f8da74f1@postmarketos.org> In-Reply-To: <20240630-oneplus8-v2-0-c4a1f8da74f1@postmarketos.org> To: Caleb Connolly , Neil Armstrong , Jessica Zhang , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Dmitry Torokhov , Bjorn Andersson , Konrad Dybcio , Henrik Rydberg Cc: Dmitry Baryshkov , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-input@vger.kernel.org, linux-arm-msm@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht X-Developer-Signature: v=1; a=openpgp-sha256; l=2098; i=caleb@postmarketos.org; h=from:subject:message-id; bh=XL5TcWDmclGnBkenp9Wm9HwFQWHhCM5cOKm1DOPdk6k=; b=owEBbQKS/ZANAwAIAQWDMSsZX2S2AcsmYgBmgaWzCd60t6AOzbkYJCsy1RmzqLlkpK03uXyb4 aFrFHSqZe6JAjMEAAEIAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZoGlswAKCRAFgzErGV9k tvqmD/4hxnXUzUEcQ6Wm8IIt1YhkO6B6Lsalzw1i2BTO7N5Z1gySLQod9ZBHJwIq2/McIzIC+01 KXLn2JU+C8Y4IFoPmBbAQygivnNDR0oXqYH6JW/D5jWIIuZqL3MDNpa4fdkZbh/FmOffZFzdXah 2gvZCLl0PAYXAAhD3J7P6ShhJbto56KA4ojs6rXz+/ZNg5B7LgQMUSutPjOuWnBIwVPExKD0jl5 RllLKPLUKoj1Pw/fIbMOBh1T14ovjOpX9+zX9c84PPEPjMjGxxAS4UrlEz3LEVgO+HHpUofNEGi rNjGLglowsCzcNIenPZogX9mLs3W17vcS4a8KNuy81SbKuUOEWSZjsWUr07iLNi/VakK1YwDJhN UZgiHzKiFphvNtgVOwn8TUMuwkiA++guKwjRs1iw/fIjR4tPqduJMbCVKYCpt4h1qF/6tSFK0jT P0BYax56LF53IGCgfq+Zl9dlplfgkhesWKapmGp5VXaKQIq+13L+2XvfT++HagEpoJYRbAD05Ty OfcBve782wlAmUK/6YfRyhG/h/Fy4LchCYc+/NdUmXk6KrQjwKbg5ld941/S7qWzysh64HAwmnz 3JZx8w1PJ54XA6RnxEQXZb2OI2/cXmmkIMiOc+sgV/8JRo891zxEEkNz47Rc7DBi1F4tihDaIh3 +yCMT61aD9u/4og== X-Developer-Key: i=caleb@postmarketos.org; a=openpgp; fpr=83B24DA7FE145076BC38BB250CD904EB673A7C47 X-Migadu-Flow: FLOW_OUT Document the Synaptics TCM oncell series of touchscreens, starting with the s3908. Signed-off-by: Caleb Connolly --- .../input/touchscreen/syna,tcm-oncell.yaml | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/Documentation/devicetree/bindings/input/touchscreen/syna,tcm-oncell.yaml b/Documentation/devicetree/bindings/input/touchscreen/syna,tcm-oncell.yaml new file mode 100644 index 000000000000..6e366c9446f8 --- /dev/null +++ b/Documentation/devicetree/bindings/input/touchscreen/syna,tcm-oncell.yaml @@ -0,0 +1,68 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/input/touchscreen/syna,tcm-oncell.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Synaptics TCM Oncell i2c touchscreen + +maintainers: + - Caleb Connolly + +allOf: + - $ref: touchscreen.yaml# + +properties: + compatible: + enum: + - syna,s3908 + + reg: + maxItems: 1 + + interrupts-extended: + maxItems: 1 + + reset-gpios: + maxItems: 1 + description: Reset GPIO the chip is connected to. + + vdd-supply: + description: a phandle for the regulator supplying 3V power. + + vcc-supply: + description: a phandle for the regulator supplying IO power. + +additionalProperties: false + +required: + - compatible + - reg + - interrupts-extended + - reset-gpios + - vdd-supply + - vcc-supply + +examples: + - | + #include + #include + + i2c { + #address-cells = <1>; + #size-cells = <0>; + clock-frequency = <400000>; + status = "okay"; + + touchscreen@4b { + compatible = "syna,s3908"; + reg = <0x4B>; + + interrupts-extended = <&tlmm 39 0x2008>; + + reset-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>; + + vdd-supply = <&vreg_l13a_ts_3p0>; + vcc-supply = <&vreg_l1c_1p8>; + }; + }; From patchwork Sun Jun 30 18:36:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 808750 Received: from out-178.mta0.migadu.com (out-178.mta0.migadu.com [91.218.175.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A014B15573C for ; Sun, 30 Jun 2024 18:36:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719772609; cv=none; b=KH9JykoEdqNglPbkUbDXF6X4O7Mnbv6Z9spsUlnK5DC0ck/nBH54YwyH7a+bRW+pQsfQYCrT3vSenJM8905e+jRXkXVfb/UmyaulyJcQe5ifXNQufOUdycSHyUNrlwSYLylEjB+90esd736DSCZDbjpJd2Si7+T5utLMBH1hK9s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719772609; c=relaxed/simple; bh=dxKUN9O3IfKfVKdznJW7pHdoyiaNKC3n5pN/k8clVHk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=M1mscvX8tDAPEkMgSuIy8Yg6inG5JzGvt1VN/7M1yV7zoto24A/EoMF2ZORx/m7ArnVhstdst7yl8bdeXfy3WRBv3apAqd/fgFFXQ7yv/+hHnk3LnvuBRXSLqcYuQP0045FJE0eLH2s0gRGOi3FlGSfZl+Y1oi2oOoL7MISgG0c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=postmarketos.org; spf=pass smtp.mailfrom=postmarketos.org; dkim=pass (2048-bit key) header.d=postmarketos.org header.i=@postmarketos.org header.b=oMd6pq90; arc=none smtp.client-ip=91.218.175.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=postmarketos.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=postmarketos.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=postmarketos.org header.i=@postmarketos.org header.b="oMd6pq90" X-Envelope-To: robh@kernel.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=postmarketos.org; s=key1; t=1719772605; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H7U98KFw2NBX8USOS8/v/gKpgMdmoWOHtCL2sTlkgOQ=; b=oMd6pq90R6z9R8S8wRou/U0vlye457KJuG6u8Okxu3tzpZPqHbx61UW906oOJSy3Af+k1F 9VDUMTPfir8LDjJH081jifohQVivb8WQ9NXgOdxwdmOooBhEAx/Lu8+8pnnvBn09fXkOZ1 vaKWM2KQy1di+XC4qujCHA697fi8AegHngIZ43zcc4B7gdSG+cmkDmQvRQ8D5kqs34HuqW r7OsmYy6aq24AwkvdI2fg8NLr5ed4SAENntzQEkvcU1u1poVXclIu6p6z9EHOSChy9zHG0 qfI28w0fzp95hs8Y5KJorSw1NezH+vYiC2scffD7dVX8Ui5pox2hYRexYA+uPg== X-Envelope-To: conor+dt@kernel.org X-Envelope-To: neil.armstrong@linaro.org X-Envelope-To: daniel@ffwll.ch X-Envelope-To: ~postmarketos/upstreaming@lists.sr.ht X-Envelope-To: dmitry.torokhov@gmail.com X-Envelope-To: linux-input@vger.kernel.org X-Envelope-To: mripard@kernel.org X-Envelope-To: caleb@postmarketos.org X-Envelope-To: linux-arm-msm@vger.kernel.org X-Envelope-To: krzk+dt@kernel.org X-Envelope-To: dri-devel@lists.freedesktop.org X-Envelope-To: rydberg@bitmath.org X-Envelope-To: konrad.dybcio@linaro.org X-Envelope-To: maarten.lankhorst@linux.intel.com X-Envelope-To: devicetree@vger.kernel.org X-Envelope-To: dmitry.baryshkov@linaro.org X-Envelope-To: tzimmermann@suse.de X-Envelope-To: airlied@gmail.com X-Envelope-To: quic_jesszhan@quicinc.com X-Envelope-To: andersson@kernel.org X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Caleb Connolly Date: Sun, 30 Jun 2024 20:36:27 +0200 Subject: [PATCH v2 4/8] drm: mipi: add mipi_dsi_generic_write_multi_type() Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240630-oneplus8-v2-4-c4a1f8da74f1@postmarketos.org> References: <20240630-oneplus8-v2-0-c4a1f8da74f1@postmarketos.org> In-Reply-To: <20240630-oneplus8-v2-0-c4a1f8da74f1@postmarketos.org> To: Caleb Connolly , Neil Armstrong , Jessica Zhang , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Dmitry Torokhov , Bjorn Andersson , Konrad Dybcio , Henrik Rydberg Cc: Dmitry Baryshkov , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-input@vger.kernel.org, linux-arm-msm@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht X-Developer-Signature: v=1; a=openpgp-sha256; l=3936; i=caleb@postmarketos.org; h=from:subject:message-id; bh=dxKUN9O3IfKfVKdznJW7pHdoyiaNKC3n5pN/k8clVHk=; b=owEBbQKS/ZANAwAIAQWDMSsZX2S2AcsmYgBmgaWzNRPFIJh0bhLcxkkzB3Hv+G99oFLCmk2QF ftsdylqLDaJAjMEAAEIAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZoGlswAKCRAFgzErGV9k tvJLD/41mBLa1W4xZy39T0eQ+94M6vb2BH9D9K78hE3xcpPHY6Y+IQi7LldueaOLFp+pIR59kO2 SgVhGEYWHGUTsut31X0mcGUAhrAFDxB3/FaJk17BJXXS4IGbLb98jhT0KZJpdl/YaLmX7GyEWpS 0H4yPzZxRokDuEUHlPMj6S+wJtViAkAtYzf7pTGXIvFFcl3Bh/OkHbwBjvuWc25Sh2ZJ5qB0KVh xB2jV1rycXZOZZW/fDpRf12CMkInjqXPrmwuvYEDUQnhEMkScJX100T4T7UfTQ9sPz/QUL/dUnY fA0SCfw3BkcwLIXIBpDLK59dlsq1M39ORX1R1sCci1sw3W0DXLtYmctzGUxLagMjrhjUDB3PREI +duFie3R4uf5bclPaoJM+1XV5FP9epdBMPHqL0/u/UR1bfmZPjgLsX0PV+XQeRt+Fsbe46ITidg wM8u4uCSf/lX5Bc7X7uxsQ1eG/ZEptRC5csSHcNTeDjLyamBYnxDscZ75DwPDcRUxO/vv6iCqhx CpwkKUAOTdf7UvdVvErSVAllDHYXSyFbefol/K4hbjirMmb93b96tt2lEAunf9hHYGYWsxp6Oto +P1nkdX92p9Il+KvaOs+lUHfECfTVgD9uj1uWskwcF1YHkeIr2+LNYRGDCHr7i70Jg1JIpNftiC QFNukbotVqG7eGw== X-Developer-Key: i=caleb@postmarketos.org; a=openpgp; fpr=83B24DA7FE145076BC38BB250CD904EB673A7C47 X-Migadu-Flow: FLOW_OUT Some panels like the Samsung AMB655X use long write commands for all non-standard messages and do not work when trying to use the appropriate command type. Support these panels by introducing a new helper to send commands of a specific type, overriding the normal rules. Signed-off-by: Caleb Connolly --- drivers/gpu/drm/drm_mipi_dsi.c | 40 ++++++++++++++++++++++++++++++++++++++++ include/drm/drm_mipi_dsi.h | 16 ++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index a471c46f5ca6..f2c7f3f23a6e 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -819,8 +819,48 @@ void mipi_dsi_generic_write_multi(struct mipi_dsi_multi_context *ctx, } } EXPORT_SYMBOL(mipi_dsi_generic_write_multi); +/** + * mipi_dsi_generic_write_raw_multi() - transmit data using a generic write packet of + * a specific type + * @ctx: Context for multiple DSI transactions + * @type: data type of the packet + * @payload: buffer containing the payload + * @size: size of payload buffer + * + * This function will automatically choose the right data type depending on + * the payload length. + * + * Return: The number of bytes transmitted on success or a negative error code + * on failure. + */ +ssize_t mipi_dsi_generic_write_raw_multi(struct mipi_dsi_multi_context *ctx, + u8 type, const void *payload, size_t size) +{ + struct mipi_dsi_device *dsi = ctx->dsi; + struct mipi_dsi_msg msg = { + .channel = dsi->channel, + .tx_buf = payload, + .tx_len = size, + .type = type, + }; + ssize_t ret; + + if (ctx->accum_err) + return 0; + + ret = mipi_dsi_device_transfer(dsi, &msg); + if (ret < 0) { + ctx->accum_err = ret; + dev_err(&dsi->dev, "sending generic data %*ph failed: %zd\n", + (int)size, payload, ret); + } + + return ret; +} +EXPORT_SYMBOL(mipi_dsi_generic_write_raw_multi); + /** * mipi_dsi_generic_read() - receive data using a generic read packet * @dsi: DSI peripheral device * @params: buffer containing the request parameters diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h index 71d121aeef24..fb23f4e3b94e 100644 --- a/include/drm/drm_mipi_dsi.h +++ b/include/drm/drm_mipi_dsi.h @@ -287,8 +287,10 @@ ssize_t mipi_dsi_generic_write(struct mipi_dsi_device *dsi, const void *payload, int mipi_dsi_generic_write_chatty(struct mipi_dsi_device *dsi, const void *payload, size_t size); void mipi_dsi_generic_write_multi(struct mipi_dsi_multi_context *ctx, const void *payload, size_t size); +ssize_t mipi_dsi_generic_write_raw_multi(struct mipi_dsi_multi_context *ctx, u8 type, + const void *payload, size_t size); ssize_t mipi_dsi_generic_read(struct mipi_dsi_device *dsi, const void *params, size_t num_params, void *data, size_t size); #define mipi_dsi_msleep(ctx, delay) \ @@ -432,8 +434,22 @@ void mipi_dsi_dcs_set_tear_on_multi(struct mipi_dsi_multi_context *ctx, static const u8 d[] = { cmd, seq }; \ mipi_dsi_dcs_write_buffer_multi(ctx, d, ARRAY_SIZE(d)); \ } while (0) +/** + * mipi_dsi_dcs_write_long_multi - transmit a DCS long command with payload + * @ctx: Context for multiple DSI transactions + * @cmd: Commands + * @seq: buffer containing data to be transmitted + */ +#define mipi_dsi_dcs_write_long_multi(ctx, cmd, seq...) \ + do { \ + static const u8 d[] = { cmd, seq }; \ + mipi_dsi_generic_write_raw_multi(ctx, \ + MIPI_DSI_DCS_LONG_WRITE, \ + d, ARRAY_SIZE(d)); \ + } while (0) + /** * struct mipi_dsi_driver - DSI driver * @driver: device driver model driver * @probe: callback for device binding From patchwork Sun Jun 30 18:36:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 808749 Received: from out-175.mta0.migadu.com (out-175.mta0.migadu.com [91.218.175.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E4A73156255 for ; Sun, 30 Jun 2024 18:36:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719772614; cv=none; b=OyjCK+CUvuJtZTFqDLO0NEwbeU98FFskDo9TDBj6+KRN5016X7BZh78P/Dx913lau0DqiJyazx1c9yuTUTn53558IiLDFnUKOUn6LfcUvoUuce3bgHeUeLQJ9H/rhNZU1bmqw+uVtujYgjURiblyfHOf7vI7T8bqpdwMSCgPynI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719772614; c=relaxed/simple; bh=EPwneTSUtmzFjis/lUpYnHTx38d8qVEWHysAJM4/3lo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=P2cTiB73NTzDarI/EET0MqAmbbyYVOFEXxa2WlrIuq0FrHiSk/R86FsEXb21vgqvVpqYDzs0wz7g/L6N3fo9OEk0cf9dowSGVeR8K76dmveH7tiQKbhsiDGgiF4cqPHa7PN9Cuu2kn8JgsiXwAIvsZRWa5mLAzJztxdYRvF66ic= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=postmarketos.org; spf=pass smtp.mailfrom=postmarketos.org; dkim=pass (2048-bit key) header.d=postmarketos.org header.i=@postmarketos.org header.b=WSj41HZM; arc=none smtp.client-ip=91.218.175.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=postmarketos.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=postmarketos.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=postmarketos.org header.i=@postmarketos.org header.b="WSj41HZM" X-Envelope-To: robh@kernel.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=postmarketos.org; s=key1; t=1719772610; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=P9ZFsw5xKwfg6vVcqc1X4au1s1qxxzW1yFV8kIX9ZSE=; b=WSj41HZMGv+5oU1m0ZUCu94priRa8IH+Xf+qpfZZXkMKcVQBHwQnOLpZUSlDoLnH7/DbLD vGpzC5/N21SSH/ixqqfq3tTutZkjzwIIiTHO5ZayFUU2BNC/2Wxi8f6+6EDUNhR2viYEz6 v5OkQG/f6CQGp7GYrO5C49twKxJdjTVmBNGE5ubWH8WYM/5PlGXLqYXn14/Npqn80eAsXi DPeM6HL89XghS3hklKVG0hdFPmGFK+9/CzjQxEL8vUzA00BnGvIVEoNZczgqScbOIkTLBS WXvyxtWlWBVwi+qWvPkjzArcx7BeFGnJIPVQUy9Eoah3OAF/CR0ytuSEyAX2Yw== X-Envelope-To: conor+dt@kernel.org X-Envelope-To: neil.armstrong@linaro.org X-Envelope-To: daniel@ffwll.ch X-Envelope-To: ~postmarketos/upstreaming@lists.sr.ht X-Envelope-To: dmitry.torokhov@gmail.com X-Envelope-To: linux-input@vger.kernel.org X-Envelope-To: mripard@kernel.org X-Envelope-To: caleb@postmarketos.org X-Envelope-To: linux-arm-msm@vger.kernel.org X-Envelope-To: krzk+dt@kernel.org X-Envelope-To: dri-devel@lists.freedesktop.org X-Envelope-To: rydberg@bitmath.org X-Envelope-To: konrad.dybcio@linaro.org X-Envelope-To: maarten.lankhorst@linux.intel.com X-Envelope-To: devicetree@vger.kernel.org X-Envelope-To: dmitry.baryshkov@linaro.org X-Envelope-To: tzimmermann@suse.de X-Envelope-To: airlied@gmail.com X-Envelope-To: quic_jesszhan@quicinc.com X-Envelope-To: andersson@kernel.org X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Caleb Connolly Date: Sun, 30 Jun 2024 20:36:29 +0200 Subject: [PATCH v2 6/8] drm/panel: add driver for samsung amb655x Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240630-oneplus8-v2-6-c4a1f8da74f1@postmarketos.org> References: <20240630-oneplus8-v2-0-c4a1f8da74f1@postmarketos.org> In-Reply-To: <20240630-oneplus8-v2-0-c4a1f8da74f1@postmarketos.org> To: Caleb Connolly , Neil Armstrong , Jessica Zhang , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Dmitry Torokhov , Bjorn Andersson , Konrad Dybcio , Henrik Rydberg Cc: Dmitry Baryshkov , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-input@vger.kernel.org, linux-arm-msm@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht X-Developer-Signature: v=1; a=openpgp-sha256; l=16049; i=caleb@postmarketos.org; h=from:subject:message-id; bh=EPwneTSUtmzFjis/lUpYnHTx38d8qVEWHysAJM4/3lo=; b=owEBbQKS/ZANAwAIAQWDMSsZX2S2AcsmYgBmgaWzuaPi7F90lxPkFwq9649JuWMaX2MePgXr1 GADhQASGl+JAjMEAAEIAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZoGlswAKCRAFgzErGV9k trKID/9DttHjwt+bJmb9SIFBqofaHu3tELGSP04/SURKKIAzjTUWMdcVjTbpCXOiZ04C9N4PVhB x1/UFpfNaPUvWNX21ymPjCw8nhLYL3eZRPSs6gsskbCy73UfMEY2uHzx/vxsqIYJdYyxOSMi46w HqHo/kt0HEXv+elYqv+L8OYeeQ2jPT9qnjTenfbSaaA3xx5lOVvG0l96gVetbp30RYUSyYxirt+ 41U7Yfvrrr2nt0gMUVAM4hxnUgAN2RrNBcDI+DLtfdM52hEExbD0AXYrKz3qvIEr6oGSKKyoxFj 0rrbP8n0eqi1C125OamKGZ7jMW2MC5RWXS/bRYAQzZw6meShgU21IPLYyOGfnsj6F725OtAFXTy pRRTLoRicuMyRqSW6R+De6xVt7/mq6UFPexQWmPg7Er0aWbF4ww1Iv8xRNtuju9hp1c4Q+iKyYp lvv1Cn/05l6JR6shMeW90qMVWCfquSQWJA7oiQ3yF8ZPnPC5BW0lJpA/te5y3NsE6ciB8zwGn2U 6F65ziTCjY+Sy391weuqghqPdqw1qUA7313/r1ZnQZMgB+4Fxj3zdkUQpSByUkeBimXlwWv0Bh2 2k+bxioFuiVYcateYk6Lmls2murBA/WJCnkbfQPXJPspdMD56Vmk5Aa3TV3PK45gRkcOGZuyCcr Kao3oOGwoIWGtVg== X-Developer-Key: i=caleb@postmarketos.org; a=openpgp; fpr=83B24DA7FE145076BC38BB250CD904EB673A7C47 X-Migadu-Flow: FLOW_OUT This is a 1080x2400 120hz panel used on the OnePlus 8T. It uses DSC but with many non-standard DCS commands. The only user of this panel (the OnePlus 8T) has a bug somewhere in the DSI stack whereby it isn't possible to properly initialize this panel after a reset. As a result, the reset GPIO is made optional so it can be left unused on that device. Signed-off-by: Caleb Connolly --- MAINTAINERS | 7 + drivers/gpu/drm/panel/Kconfig | 9 + drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-samsung-amb655x.c | 399 ++++++++++++++++++++++++++ 4 files changed, 416 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 807feae089c4..2b9cfbf92d7a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7142,8 +7142,15 @@ M: Robert Chiras S: Maintained F: Documentation/devicetree/bindings/display/panel/raydium,rm67191.yaml F: drivers/gpu/drm/panel/panel-raydium-rm67191.c +DRM DRIVER FOR SAMSUNG AMB655X PANEL +M: Caleb Connolly +S: Maintained +T: git https://gitlab.freedesktop.org/drm/misc/kernel.git +F: Documentation/devicetree/bindings/display/panel/samsung,amb655x.yaml +F: drivers/gpu/drm/panel/panel-samsung-amb655x.c + DRM DRIVER FOR SAMSUNG DB7430 PANELS M: Linus Walleij S: Maintained T: git https://gitlab.freedesktop.org/drm/misc/kernel.git diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index bf4eadfe21cb..7203d16ab20a 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -590,8 +590,17 @@ config DRM_PANEL_SAMSUNG_S6E88A0_AMS452EF01 depends on OF select DRM_MIPI_DSI select VIDEOMODE_HELPERS +config DRM_PANEL_SAMSUNG_AMB655X + tristate "Samsung AMB655X DSI panel" + depends on OF + depends on DRM_MIPI_DSI + depends on BACKLIGHT_CLASS_DEVICE + help + DRM panel driver for the Samsung AMB655X panel. + This panel has a resolution of 1080x2400 @ 60hz or 120Hz. + config DRM_PANEL_SAMSUNG_ATNA33XC20 tristate "Samsung ATNA33XC20 eDP panel" depends on OF depends on BACKLIGHT_CLASS_DEVICE diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index 051b75b3df7b..be6d500a56a4 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -58,8 +58,9 @@ obj-$(CONFIG_DRM_PANEL_RAYDIUM_RM67191) += panel-raydium-rm67191.o obj-$(CONFIG_DRM_PANEL_RAYDIUM_RM68200) += panel-raydium-rm68200.o obj-$(CONFIG_DRM_PANEL_RAYDIUM_RM692E5) += panel-raydium-rm692e5.o obj-$(CONFIG_DRM_PANEL_RAYDIUM_RM69380) += panel-raydium-rm69380.o obj-$(CONFIG_DRM_PANEL_RONBO_RB070D30) += panel-ronbo-rb070d30.o +obj-$(CONFIG_DRM_PANEL_SAMSUNG_AMB655X) += panel-samsung-amb655x.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_ATNA33XC20) += panel-samsung-atna33xc20.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_DB7430) += panel-samsung-db7430.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_LD9040) += panel-samsung-ld9040.o obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6D16D0) += panel-samsung-s6d16d0.o diff --git a/drivers/gpu/drm/panel/panel-samsung-amb655x.c b/drivers/gpu/drm/panel/panel-samsung-amb655x.c new file mode 100644 index 000000000000..945346e84f68 --- /dev/null +++ b/drivers/gpu/drm/panel/panel-samsung-amb655x.c @@ -0,0 +1,399 @@ +// SPDX-License-Identifier: GPL-2.0-only +// Generated with linux-mdss-dsi-panel-driver-generator from vendor device tree: +// Copyright (c) 2015-2017, The Linux Foundation. All rights reserved. +// Copyright (c) 2024 Caleb Connolly + + +#include +#include +#include +#include +#include + +#include