From patchwork Thu Feb 15 08:53:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 20417 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp271956dyb; Thu, 15 Feb 2024 01:24:15 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVRquEYzIFxsmECM343V+jIEQhHn2aDnjFOpe7fuBoPwdiCRqq4dudvRjAnBx/LEBoW14nlyr8oUnqfK4bbDG7yXyXeDg== X-Google-Smtp-Source: AGHT+IEKi9UyDsYR8fLfm453MVhX8pX+7uV5yi0UootOQMMrxgkqyIOSvM3GlpWKofbls8XuAhVi X-Received: by 2002:a17:903:1107:b0:1d9:adc9:2962 with SMTP id n7-20020a170903110700b001d9adc92962mr1884058plh.20.1707989055763; Thu, 15 Feb 2024 01:24:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707989055; cv=pass; d=google.com; s=arc-20160816; b=ZFWXxiInnD30028B2qp3y3BbsOP0ps1Frl6nV0cjvVqE6sZl0U3DV5f33jgtbJ+MUZ G9dCeDyXE6SjfT0YGUcAc3Dalp5GnxUIMYowcdUp4W+cbjkGuWxZlouGS7hxkbSvkW12 Jsya7wiAz6OgV94/5CkL+BcZQsPJwl/TaMQxYGVVczo+hozKk9xOPfDR9zLPNQ4SxaM2 PzgHaEFdZg7Gzbvw44q4nRvD6X9oYB9npgZjKK+UFIwfbyvoAegZfbtK+c+ITSVC1x+z GHc5L6LihuPrITP/jIcPshCaR5oOcGgXRDmgS+b6yIX3kisbW4LPHrIUWoGa23HbQLij DfXw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=IdPIWcogsh+3Fehwh0frKh4JtxTJLm6iq34Rg70x/5g=; fh=vqwI+k2iC8QIi+oglWdIzX6WqNeozUvflOvzVQ5E5PM=; b=QExr62/N1TIQZWG7Pk5wTozqpZSLBz2Iko0ytKS9j5m3LaOlLC6/C3ZGTdnzeUe68X IxgM3lq2ePq9QeOdo7AAN4mw5mLjfXEUjoMGwEnRAN64a6dbJ8zOB+OW3IiVGN7cuqpE I4SVpZPKmbaAEn4Mi8m/Uj3ntZL0PIh0O9WVoZFi/pNhfTUbSwjFZeEYPFdLcHdPcAEz IE95op8/NkeyFvP4f3ul1W/bwi7Bgw9HOvQB7TOC1EEpXNZna6qW0jVrV+RG4G0kzR/L 07zNOq3J2KD1IXH+/0kedbJ6TRKgRfXZSo7VEKBAk6u+WCbvnGU0WgcRFHX+scadk1MF aOEg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=RyN4iV6k; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-66444-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66444-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id c8-20020a170902724800b001da2316af2fsi807657pll.7.2024.02.15.01.24.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 01:24:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66444-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=RyN4iV6k; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-66444-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66444-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 590E9B272B2 for ; Thu, 15 Feb 2024 08:53:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E4A2E17592; Thu, 15 Feb 2024 08:53:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="RyN4iV6k" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (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 B1B4D14012 for ; Thu, 15 Feb 2024 08:53:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707987203; cv=none; b=itXTXmXkGEfMmxiydDqTFA+uIYsk7vZocQm/OXea/cm8b8fIGLYtDI9T6SgEH8MyZgyeMX03YimCz22p74aaC5pmcbfMwCnpOoh5dTFGM2KRwlYu9waepYBkoSXt0xmULpmL/sLcFWr/NLNr84BBsNAfglKSxTtsZwJ3Kv169Zw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707987203; c=relaxed/simple; bh=gSl7FFAcyFkyZu86fmPgJX2VEBYzcNb/7gsEn+fDq54=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=E3i/2cMU8zTZkmrAKuSIDX724tindpcdxf832KDNzV9/X/sFF5yxJH0F2SpkF/BEbQ903EnaVngmFFzoCwPlnUGfu/4hsN47zqRKB8+mAf7cFPgHF3b96bfT3jnL0hOomisJgEyP62h9ve51uOr5JSv936rPGkbIWY+0RiUwEa0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=RyN4iV6k; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1707987199; bh=gSl7FFAcyFkyZu86fmPgJX2VEBYzcNb/7gsEn+fDq54=; h=From:To:Cc:Subject:Date:From; b=RyN4iV6kEyFZUZDDqUO4zfb0Xu1xdQ2OGWpN3LWM5Vhl1h/PF1pPWYFYYDxyyUMjr qZyqHYtqOmcQ9y+ZJ+DR9RgpArK1ZI4oXnCIQHBn5eTwYDXamGZn1sT5mtGdnbHvqc H2neXE64sulCGzppMw/hejt50qtRNSMAztVuG+640OyJgbF+sdvebK9IcLXRFZ2Mzx mT9A+HlxzyQcqktgAPoObRiQU0Msj40xW7qvqmKjdL3SZApQGJ0e4DqDSC7WD/377l iXGSqrGbHQdIcR6kqVjpzmXOcMdGBhqBpYkqsDJE1QLCPz0HT9n2S271+mSSuCHA7t vzggWxfanXisw== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id E41AB37813FD; Thu, 15 Feb 2024 08:53:18 +0000 (UTC) From: AngeloGioacchino Del Regno To: chunkuang.hu@kernel.org Cc: fshao@chromium.org, p.zabel@pengutronix.de, airlied@gmail.com, daniel@ffwll.ch, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@collabora.com Subject: [PATCH v6 0/9] MediaTek DRM - DSI driver cleanups Date: Thu, 15 Feb 2024 09:53:07 +0100 Message-ID: <20240215085316.56835-1-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790956331945245068 X-GMAIL-MSGID: 1790956331945245068 Changes in v6: - Moved default case from patch [4/9] to patch [3/9] Changes in v5: - Changed patch 1 to not fix the DSI_PS_SEL mask for newer SoCs Changes in v4: - Added a fix for RGB666 formats setting and for wrong register definitions for packed vs loosely packed formats - Added a commit to make use of mipi_dsi_pixel_format_to_bpp() helper instead of open coding the same Changes in v3: - Rebased over next-20240131 - Added bitfield.h inclusion in patch 3 - Added three more cleanup commits to the mix to simplify the probe function and remove gotos. Changes in v2: - Rebased over next-20231213 This series performs some cleanups for mtk_dsi, enhancing human readability, using kernel provided macros where possible and also reducing code size. Tested on MT8173 and MT8192 Chromebooks (using a DSI<->DP bridge) and on MT6795 Sony Xperia M5 (DSI video mode panel). AngeloGioacchino Del Regno (9): drm/mediatek: dsi: Use GENMASK() for register mask definitions drm/mediatek: dsi: Fix DSI RGB666 formats and definitions drm/mediatek: dsi: Cleanup functions mtk_dsi_ps_control{_vact}() drm/mediatek: dsi: Use bitfield macros where useful drm/mediatek: dsi: Replace open-coded instance of HZ_PER_MHZ drm/mediatek: dsi: Register DSI host after acquiring clocks and PHY drm/mediatek: dsi: Simplify with dev_err_probe and remove gotos drm/mediatek: dsi: Compress of_device_id entries and add sentinel drm/mediatek: dsi: Use mipi_dsi_pixel_format_to_bpp() helper function drivers/gpu/drm/mediatek/mtk_dsi.c | 310 ++++++++++++----------------- 1 file changed, 126 insertions(+), 184 deletions(-)