From patchwork Tue Aug 27 16:12:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13779781 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3954EC54731 for ; Tue, 27 Aug 2024 16:12:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E069D10E372; Tue, 27 Aug 2024 16:12:47 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; secure) header.d=tuxon.dev header.i=@tuxon.dev header.b="BviZhr6r"; dkim-atps=neutral Received: from mail-ej1-f54.google.com (mail-ej1-f54.google.com [209.85.218.54]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3852110E36F for ; Tue, 27 Aug 2024 16:12:47 +0000 (UTC) Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a86933829dcso647138166b.3 for ; Tue, 27 Aug 2024 09:12:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1724775165; x=1725379965; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=41QfeVXp3bRAaO6YVHwo1Hn8U4dlul/y2Bh2kt4jOQ0=; b=BviZhr6rgQEZjzmRYvyBphU1JQHCtl5dam9FEFvcvrf6DCNImdTP+atoKvJuyZDq8f qSkHLtDZZzdKyBe/oDpLZ3I60rqW4yXiLL77ruGTmSFSP6YoqRvIwXqIuDiMFEEHVFy9 oxPZvcsnAJTUcPJsbKwf0VjkzfVEE7HjtgYDPP5b+STfBt4kwN0YesGBvkOnmkDYAg/q 9AUgaPnOJxYrwNqb9Jn+01BPeaU+7yd3XXiIRqVyiF8JqeEwdU0UP0buj+YRn1EBKBIL 5UaQ7LjyyR/xVexohnQLqBZmbTXzI3/qtfj1wWuozrYXbS09cFcASrvozdeSwJPIzTM3 v4EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724775165; x=1725379965; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=41QfeVXp3bRAaO6YVHwo1Hn8U4dlul/y2Bh2kt4jOQ0=; b=bv9cCFE+/+HpG59q1kwRiyxsow7eEN2okCiq5WCfo4fPT6RwNbqQqPlUIFQkjcbK9q x7Ivq4e5g8hdWPOxUeoGQfeWk7oMQfxOGZzm8AyuYrLsR/LlUVvZOXHj3Or/hgHe4c9F sNaxE5VncgIQxhyXTamrgAOlicADuKDrBwCcyJvdjzc75bfDKr0zdAD6gmMJBgBDKBq8 t1oyNSEtweKSohJMA4bCuivZPNGw3o10EpZeqxms5wd228vhd9s8bsKAs5Sj1aY0z/e+ KD2FG/JAkxIOljsv2LcevU1AlopYStCICsWborRu3d4B+/lr8mB4QZICgt210TOaAGTU 2hiQ== X-Gm-Message-State: AOJu0YwYPiBOVYgFIDGOFy1J1vpsxygNIfEv4dIfz2PGkYyBMQ8q1Rvz ZbTbOaizzIrsi1IPIRlEK7QCwpNTDB/7zoez+PpiZdb5BcyKuMC9Jz/jXv3IvoM= X-Google-Smtp-Source: AGHT+IF7Sm59AQfRh7cKuFyeiTLq5Ik6e0LG6qqZKMbHSfWuyELRqfPU3FbNqtC11ZbZBKOAMALa8w== X-Received: by 2002:a17:907:971d:b0:a77:eb34:3b4e with SMTP id a640c23a62f3a-a86a518b26amr1091013566b.7.1724775165553; Tue, 27 Aug 2024 09:12:45 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.144]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a86e54b50dbsm127893966b.93.2024.08.27.09.12.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Aug 2024 09:12:45 -0700 (PDT) From: Claudiu Beznea To: manikandan.m@microchip.com, dharma.b@microchip.com, andrzej.hajda@intel.com, neil.armstrong@linaro.org, rfoss@kernel.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, hari.prasathge@microchip.com Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, claudiu.beznea@tuxon.dev Subject: [PATCH 1/3] drm/bridge: microchip-lvds: Revert clk_prepare_enable() in case of failure Date: Tue, 27 Aug 2024 19:12:21 +0300 Message-Id: <20240827161223.4152195-2-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240827161223.4152195-1-claudiu.beznea@tuxon.dev> References: <20240827161223.4152195-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" In case pm_runtime_get_sync() fails the clock remains enabled. Disable it to save power on this failure scenario. Fixes: 179b0769fc5f ("drm/bridge: add lvds controller support for sam9x7") Signed-off-by: Claudiu Beznea Reviewed-by: Dharma Balasubiramani Tested-by: Dharma Balasubiramani --- drivers/gpu/drm/bridge/microchip-lvds.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/bridge/microchip-lvds.c b/drivers/gpu/drm/bridge/microchip-lvds.c index b8313dad6072..027292ab0197 100644 --- a/drivers/gpu/drm/bridge/microchip-lvds.c +++ b/drivers/gpu/drm/bridge/microchip-lvds.c @@ -125,6 +125,7 @@ static void mchp_lvds_enable(struct drm_bridge *bridge) ret = pm_runtime_get_sync(lvds->dev); if (ret < 0) { + clk_disable_unprepare(lvds->pclk); dev_err(lvds->dev, "failed to get pm runtime: %d\n", ret); return; } From patchwork Tue Aug 27 16:12:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13779782 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CFC9EC54731 for ; Tue, 27 Aug 2024 16:12:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4BF9210E374; Tue, 27 Aug 2024 16:12:52 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; secure) header.d=tuxon.dev header.i=@tuxon.dev header.b="iPV7CVAL"; dkim-atps=neutral Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id B48A710E374 for ; Tue, 27 Aug 2024 16:12:49 +0000 (UTC) Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-534366c1aa2so4849550e87.1 for ; Tue, 27 Aug 2024 09:12:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1724775168; x=1725379968; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9b40ZG6wtpXNDRIbJ+N027Dbp0WF4n42iEPhKoROnQ8=; b=iPV7CVAL9dFGzhidDQi2w+9gbvZusqCyWX/rEgLesw19eo7hpzqO4BAk4JAWprFyvj 5cGpIR3Frn18MjFJMaAkppKrOlOIwY1abvzWUpVLj33Vufx2DOOidD8PXUCFtZIK3mLe GH+uLvbhdpsvrfJixcXkGZbhljVWDEbc2X98XzS9ej58XBAjA2EGGF7CqUKkTgLEZnzV pIOqKwOLnX0a/7F65turZZyweQhQdzv2mnmu7C1osuEiYjCJIsp2FDSsRJh2BIBK21IG zk/1Mxos6hz02ihj7zRlpweEHqAzhkj28yeaf/wqcqaSB5trFEbLKDX0mA6F/73Y2MlF uLZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724775168; x=1725379968; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9b40ZG6wtpXNDRIbJ+N027Dbp0WF4n42iEPhKoROnQ8=; b=vm/GQ6FM+JuPID/SrlGi3RSTuP0+q1IsZVBP5twN5qE5qSIu21iQIvjTFh4pkYFQIv sASCk9vla5z/W2euY42X+gsoCCiIjKUghaW41INt0TD8lZNXiM2X+RZjEt9FHGJK2qQh pL/UvWd/yZ8Ci77gJMUW9Q9t15/+iABLFTmDCe1MAA/06pV7A5vOTceQBFD/hz+58kLJ 6zk8c2DtM3Quqn2vLDPfagtBWeBMM+7AhPDz0Igo9BuDWIo28zNceOGBKGd9EvzLNAH/ arRyY/Y02syOK5YsbGWhxvA7xbeNmw1g77Fw04v3Xi8BMnctVtSZCIGppY4SbKNYfzHY wamg== X-Gm-Message-State: AOJu0Ywfo0EFJwd1C7e+UuJ+jJcKJygEIYl48ECS0i3DUqQjHuKdo1Mu KzTocjA/fcN+Lfi3EdqzRxeTIJk/HvdJBqxnN5Mc8Cn5wHhDc+csfSINPCUUe2Q= X-Google-Smtp-Source: AGHT+IGztyO/vXFJhZ5is4NuBcc0I5gssmVDfjip0FHP6sjWxirKEM36B5impi0ie7i98OY5jl3r6g== X-Received: by 2002:a05:6512:e89:b0:52e:767a:ada7 with SMTP id 2adb3069b0e04-53438868d57mr9236836e87.50.1724775167458; Tue, 27 Aug 2024 09:12:47 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.144]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a86e54b50dbsm127893966b.93.2024.08.27.09.12.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Aug 2024 09:12:47 -0700 (PDT) From: Claudiu Beznea To: manikandan.m@microchip.com, dharma.b@microchip.com, andrzej.hajda@intel.com, neil.armstrong@linaro.org, rfoss@kernel.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, hari.prasathge@microchip.com Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, claudiu.beznea@tuxon.dev Subject: [PATCH 2/3] drm/bridge: microchip-lvds: Drop unused headers Date: Tue, 27 Aug 2024 19:12:22 +0300 Message-Id: <20240827161223.4152195-3-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240827161223.4152195-1-claudiu.beznea@tuxon.dev> References: <20240827161223.4152195-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Drop unused headers. With this code becomes simpler. Signed-off-by: Claudiu Beznea --- drivers/gpu/drm/bridge/microchip-lvds.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/gpu/drm/bridge/microchip-lvds.c b/drivers/gpu/drm/bridge/microchip-lvds.c index 027292ab0197..f04831106eea 100644 --- a/drivers/gpu/drm/bridge/microchip-lvds.c +++ b/drivers/gpu/drm/bridge/microchip-lvds.c @@ -8,25 +8,16 @@ */ #include -#include #include #include -#include +#include #include -#include -#include #include #include -#include -#include -#include #include #include #include -#include -#include -#include #define LVDS_POLL_TIMEOUT_MS 1000 From patchwork Tue Aug 27 16:12:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13779783 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2674FC5472F for ; Tue, 27 Aug 2024 16:12:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4E23210E375; Tue, 27 Aug 2024 16:12:52 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; secure) header.d=tuxon.dev header.i=@tuxon.dev header.b="hAqdx2mz"; dkim-atps=neutral Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) by gabe.freedesktop.org (Postfix) with ESMTPS id C076210E374 for ; Tue, 27 Aug 2024 16:12:51 +0000 (UTC) Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-5334a8a1b07so7051477e87.1 for ; Tue, 27 Aug 2024 09:12:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1724775170; x=1725379970; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/VeZJltoLAKxh7d3cB6a8DRSH0vtTp7P9mPnF3uj0f8=; b=hAqdx2mzJBrnkG54BXIMG2oj7TJjordUYiriDP3maJkgbsEQ/LxglPKB0D+dDsLA0E z22zqHc5hU0nSmRF1gaK+gxeqqe+XmvlTXQ7cYw5G4DOOln0flyVNMgf/sQ6DaJzh+oy xglPrZz2F5ttChWXj7Ly75TUgsmZPHXoGkQGDj2ycYP35iGWcD/ea4CnwAJt/MW0KVLg j0Dp9O+ve/iQdr7o2eyep20TyQnkNjNrZpwrvIzKgY4VYgszPDnju8VkGAn/sAGFHsXH wvo6YE7+64khqDFxnph+AjYCQCWgFKMBHpOFRuRDKD9qOqT1AMTFtusOp7F8OBSXJkQq dTOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724775170; x=1725379970; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/VeZJltoLAKxh7d3cB6a8DRSH0vtTp7P9mPnF3uj0f8=; b=QgYHD2V/PFSCf4SmTW24jXv5SaSZYvbRujGV+9evAr/H/12ZVPu/j5YMDTZ74Zk5TY U1IWEXdhNQ64hQ3ynU08j2IlkuFR0+/avBcK6a+bN5Rxys5q9CeppXXTaxj+EBSm4m+t VEVYICY/yA1UnDGGl+p9ApaI7zcGFe23MpEFcSPEi1MPlp+RhlFx+aVUbWWMJE2N0Phn dCuzaVQD9B3sGxblsb4Sn0a3A2Elic7ds3geI03SUFyhsepcGaNLOXtDEp1ut4yl6U8U ZHgFMpvbPZKnIuXN0N0Q1ZOGudxj+wQr0KOe7K9gbgE4gp3P8O9xnxVhbKqvMiE0HCS/ oSTA== X-Gm-Message-State: AOJu0YzIs9hEhlM2Tz8dKS/2au3oy3cCSVz5Uy2vrIe2hkE1YOg9gCP4 ca0okVCTrlB3Kaect4yb7cSCw3dUkSgqGbTLWU9ns8tXvpUP+yqRrOEFo+s0WbQ= X-Google-Smtp-Source: AGHT+IEn6EiOoC6u9T3Qh/ZYHO31b5oMxMsAnawAD7VSKPISxZfLW3mQWnzXyfQVhrfz81mditnTcg== X-Received: by 2002:a05:6512:4004:b0:530:aa09:b6bf with SMTP id 2adb3069b0e04-534388330bcmr10078492e87.24.1724775169565; Tue, 27 Aug 2024 09:12:49 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.144]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a86e54b50dbsm127893966b.93.2024.08.27.09.12.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Aug 2024 09:12:49 -0700 (PDT) From: Claudiu Beznea To: manikandan.m@microchip.com, dharma.b@microchip.com, andrzej.hajda@intel.com, neil.armstrong@linaro.org, rfoss@kernel.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, hari.prasathge@microchip.com Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, claudiu.beznea@tuxon.dev Subject: [PATCH 3/3] drm/bridge: microchip-lvds: Use devm_platform_ioremap_resource() Date: Tue, 27 Aug 2024 19:12:23 +0300 Message-Id: <20240827161223.4152195-4-claudiu.beznea@tuxon.dev> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240827161223.4152195-1-claudiu.beznea@tuxon.dev> References: <20240827161223.4152195-1-claudiu.beznea@tuxon.dev> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The devm_platform_ioremap_resouce() does exactly what devm_ioremap_resource() combined with platform_get_resouce() does. Thus use it. Signed-off-by: Claudiu Beznea Reviewed-by: Dharma Balasubiramani Tested-by: Dharma Balasubiramani --- drivers/gpu/drm/bridge/microchip-lvds.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/microchip-lvds.c b/drivers/gpu/drm/bridge/microchip-lvds.c index f04831106eea..85aff8c5aaf4 100644 --- a/drivers/gpu/drm/bridge/microchip-lvds.c +++ b/drivers/gpu/drm/bridge/microchip-lvds.c @@ -154,8 +154,7 @@ static int mchp_lvds_probe(struct platform_device *pdev) lvds->dev = dev; - lvds->regs = devm_ioremap_resource(lvds->dev, - platform_get_resource(pdev, IORESOURCE_MEM, 0)); + lvds->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(lvds->regs)) return PTR_ERR(lvds->regs);