From patchwork Fri Nov 26 00:32:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 519674 Delivered-To: patch@linaro.org Received: by 2002:ac0:c605:0:0:0:0:0 with SMTP id p5csp1643641imj; Thu, 25 Nov 2021 16:32:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJx3qRxNjybKuARBXxb7xhVAGAcXLOe3uOcbMzg8xPCqAYdJsnyFkwosJFj5YoA/bgqkwia+ X-Received: by 2002:a17:90a:8043:: with SMTP id e3mr11805436pjw.130.1637886754908; Thu, 25 Nov 2021 16:32:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637886754; cv=none; d=google.com; s=arc-20160816; b=v0bOIthOvUprg1+ldYZRoOORBTdTyNUHA3k7/Xv2tO4xR4kfT5eC8I8697XnrnlXIa t1ZEkASIqqiYB4DjbEcYcCw0V8IZgfQJZd91cNeqvob5vy2YS8merKgWz1dVjSrESf6M BLcmU+1ic/3loRJ+wwJQDi+SKhSuuNbt9S7oYm3f8vXlaYhkBHFq5YwPHoK/rlvvqXqS JOETJsf8M3p2OqwQ0UhusL81TLrq+TCRZ84Zo3qAhisTxwJrtLCkGPIYhrC80e4ea+Yv OkDGhJKGZ/qnHvE30rKnbOZmkxjSlZcvySwCcKWC6hpSYjxNsjYZLOY5gwzf/kv0f/yC W6Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :delivered-to; bh=O1wJ1nsI24XrxYxVwGXZg9+kPz7FeJME7p8v2K+2gfg=; b=vV2wGOaBTdN1YqkRPOTDsQVuLja7UUDNW6N9sblhnLNi65C/sFIcZa9/CNLxLijGVo Tu5BWY3rM5r8sHMd9EFAiGxpyy6yHrmvFBrnJvsMrN8LSWavl+N8hKHDj3d1rlDNeAaq c7KPequnkXWsAsCf08V6ZjN+CdF+3relRYDhlGmE8lVOzImTfNbeU6H6PeBF15e1Lmlx 1ihd0BIsRpzt9OyZn/zC9dMhc3Z/uhga2VwZH7SplQhKH/wiTRHek1+09NXgMR/qmzE2 W2HJM+lLwwVlXDhZvo+G8+SNRZUMdU3PYWRqNrhKQ1kKIEU9lOJuUa3sV3Kdba1SEfJt pHCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=XHc0x7ce; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id p5si6252941plw.423.2021.11.25.16.32.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Nov 2021 16:32:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=XHc0x7ce; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7E13E6E19A; Fri, 26 Nov 2021 00:32:31 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by gabe.freedesktop.org (Postfix) with ESMTPS id B75DD6E19A for ; Fri, 26 Nov 2021 00:32:29 +0000 (UTC) Received: by mail-lf1-x12a.google.com with SMTP id bi37so19982728lfb.5 for ; Thu, 25 Nov 2021 16:32:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=O1wJ1nsI24XrxYxVwGXZg9+kPz7FeJME7p8v2K+2gfg=; b=XHc0x7ceky8JSlNWRv1dZqZ6c9SrjN3nFtQpgzZ6dXVUppQnrYuOHe3XKSvKdaC1wO mijzH3DZgFKwgtsEO4k7thYMpDoV357vO9NarJ/+cq3euJeixv2A7WEispaY2ThzEH1R HF99H03cci+3ZGfAIvMKtBlYj7axRpJXl9kn3qk+xys8HCVYVRQW43aPOJ+YjZ4viO1R DGIhT/o/AnLtJa2a2a88clApEi+ioL3m8Iwg7gNvyqIFpYnhECPe7Z7NHH1iGNtSC7SA THMK8enfz510+zOMjkB5o7wPfJe8lUIgROP+DqOi545cQJh1nh6VTwoxaWcXKVsgmBcq rrnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=O1wJ1nsI24XrxYxVwGXZg9+kPz7FeJME7p8v2K+2gfg=; b=2ILHpPAE/TD/dSnHhdVOPtSJe7Fbao0hciVfOlqpsKs+lEcWee5lYfvUA3xLHCNKox F0PaEzUwNdwSsNp7+clXhNkyvRCaIjVqZzZaAgOfHTFPNzk6KX8YWzVOSJoJswx7wYIy yHdyUKrqdkcT+2YjaU/i+0sNnLVB9CIcXfbsjNZn8xvrsZ4Uhc7g54Ez5zz2VaxHGPN3 HLyQTdx1E4OR5Tvl2Bbjt6n/31fwZvBSAVGT1Nrc788KgEdBn+M3qfmWThOoRuod3/JL YsvEB8Mh4Uv32TqoYPFIVcUy4aGteKDTDA/dZWXUX9nL/O5hWXZWH4r6VQi7mCi6Gk1I XAyA== X-Gm-Message-State: AOAM530eBO3jkBTEA9K448cmNS1YUhmvkl8XqWj65SmfPrnx5prz/Z38 c8bRDXHzpkKAMcvQkYKmkWtotA== X-Received: by 2002:a19:3844:: with SMTP id d4mr25546116lfj.64.1637886748118; Thu, 25 Nov 2021 16:32:28 -0800 (PST) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id k13sm417812lfo.300.2021.11.25.16.32.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Nov 2021 16:32:27 -0800 (PST) From: Dmitry Baryshkov To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec Subject: [PATCH 1/2] drm/ bridge: tc358762: move bridge init to enable callback Date: Fri, 26 Nov 2021 03:32:26 +0300 Message-Id: <20211126003227.1031347-1-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.33.0 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: , Cc: David Airlie , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" During the pre_enable time the previous bridge (e.g. DSI host) might be not initialized yet. Move the regulator enablement and bridge init to te enable callback (and consequently regulator disblement to disable). Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/bridge/tc358762.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358762.c b/drivers/gpu/drm/bridge/tc358762.c index 7104828024fd..ebdf771a1e49 100644 --- a/drivers/gpu/drm/bridge/tc358762.c +++ b/drivers/gpu/drm/bridge/tc358762.c @@ -64,7 +64,7 @@ struct tc358762 { struct drm_connector connector; struct regulator *regulator; struct drm_bridge *panel_bridge; - bool pre_enabled; + bool enabled; int error; }; @@ -125,26 +125,26 @@ static int tc358762_init(struct tc358762 *ctx) return tc358762_clear_error(ctx); } -static void tc358762_post_disable(struct drm_bridge *bridge) +static void tc358762_disable(struct drm_bridge *bridge) { struct tc358762 *ctx = bridge_to_tc358762(bridge); int ret; /* - * The post_disable hook might be called multiple times. + * The disable hook might be called multiple times. * We want to avoid regulator imbalance below. */ - if (!ctx->pre_enabled) + if (!ctx->enabled) return; - ctx->pre_enabled = false; + ctx->enabled = false; ret = regulator_disable(ctx->regulator); if (ret < 0) dev_err(ctx->dev, "error disabling regulators (%d)\n", ret); } -static void tc358762_pre_enable(struct drm_bridge *bridge) +static void tc358762_enable(struct drm_bridge *bridge) { struct tc358762 *ctx = bridge_to_tc358762(bridge); int ret; @@ -157,7 +157,7 @@ static void tc358762_pre_enable(struct drm_bridge *bridge) if (ret < 0) dev_err(ctx->dev, "error initializing bridge (%d)\n", ret); - ctx->pre_enabled = true; + ctx->enabled = true; } static int tc358762_attach(struct drm_bridge *bridge, @@ -170,8 +170,8 @@ static int tc358762_attach(struct drm_bridge *bridge, } static const struct drm_bridge_funcs tc358762_bridge_funcs = { - .post_disable = tc358762_post_disable, - .pre_enable = tc358762_pre_enable, + .disable = tc358762_disable, + .enable = tc358762_enable, .attach = tc358762_attach, }; @@ -218,7 +218,7 @@ static int tc358762_probe(struct mipi_dsi_device *dsi) mipi_dsi_set_drvdata(dsi, ctx); ctx->dev = dev; - ctx->pre_enabled = false; + ctx->enabled = false; /* TODO: Find out how to get dual-lane mode working */ dsi->lanes = 1; From patchwork Fri Nov 26 00:32:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 519675 Delivered-To: patch@linaro.org Received: by 2002:ac0:c605:0:0:0:0:0 with SMTP id p5csp1643676imj; Thu, 25 Nov 2021 16:32:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJzbfiibt011gbioYvyGQS78s9riEVmHWHUsvEzTfwgdfg08gK3GZW+XehDvq3yj4yAlihbN X-Received: by 2002:a17:90a:c287:: with SMTP id f7mr11948043pjt.114.1637886758634; Thu, 25 Nov 2021 16:32:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637886758; cv=none; d=google.com; s=arc-20160816; b=pmWSBTaftnFxGjvtbEIQzO9u0WUAaHi0DmPGFrhy00y7oxMLnTCUYHBv6NpI9hd2GJ QYVl0c63rg6nfrn1ROQ08C7P+R/V8Ml5M1x+hCCDVe3QBwc/LlILXRIwZP5XLv4qoapo 7nTKoXKgxkET3pd0wYWQU9XMReVDiakMunou8NNCpgEgOOd1AzrShcdfDJ5TTbe28eHK 6ZSuG+GX4Pfs4UYUGEFNJFIhHr8uwq+QPSubAJYmyqO+W/veMveZxrzm0Bhixj6ESPFX vONR5XfC2O/2VUhuwFcuzAeD1LTXQ7EF3TJ38ztRDT+tIyWcLuKzncTccQGzLZNQZVYS MCDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to; bh=9zxxPurAOayOI5k8xCP1c5Dwmp5PuzCyvgFFBlIyeu8=; b=cDLhhRGSY5rphTqfAHpNPiq2ILyco8PatYgllGKIh7DLLQ2G6CLs0rdToyedSoEFSU PMC6kdK8mS2F6O9zpOOE1Jyv6wV+EEs4bMumLVrgul9ALDtA3SxAdNHhoW0LDx0gMbkm wjPQuNL7HhJaTBMp5AoRKDOKwPXZCW4HboRW3ml2pAzJx/SRq6fYylIJimd5CG/TLzcA tE9bJLpKvdYBXXrs29HkllEN1srmtKjfjFoEAjFu00MY85CbWCBGzJ3zTNzzcgEIsOFR tAwyIO7YFuJy676CReOKGuKSw1h79mVzd4sa3Z/1nFEUvHxSKH4n23g8i7cuNZmfZii2 O3ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="B75/NmrM"; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id ng12si20756683pjb.158.2021.11.25.16.32.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Nov 2021 16:32:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="B75/NmrM"; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8B6506E200; Fri, 26 Nov 2021 00:32:34 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8D9576E19A for ; Fri, 26 Nov 2021 00:32:30 +0000 (UTC) Received: by mail-lj1-x22f.google.com with SMTP id 207so15363340ljf.10 for ; Thu, 25 Nov 2021 16:32:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9zxxPurAOayOI5k8xCP1c5Dwmp5PuzCyvgFFBlIyeu8=; b=B75/NmrMNxEa1jk+XqTYqmWFQwGwSRzSYogVYVlas6FZgcwF4ZmcgmMS581RJFUKdf PuNfI3MVlc5HeL+JiNRVuwHAxhHS/JVisWGKMNKKesZn5EWv9U73cdZRtmOZU4MFTvQo CG4EmkLn5Rl4n2Ce+xFBibNAYmNywCGTUfJEHcvNfVtqg0JN3mCiP5gxXOqDwxmkfyFf nrg4GCfesAiwVcEvuvqpD/jOskmaa0D/j177ZIiEXrEj5GwyXdyMKxKdU6GI/BUzcsu4 YWapH7nmcs4uhfLzG1Q+sbz2zD3Gffach5QwV0sziXBU7JueFZHx79Tr9rtc/eYBfU3j olGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9zxxPurAOayOI5k8xCP1c5Dwmp5PuzCyvgFFBlIyeu8=; b=0WYSXC9yGvePzwyElUAnauMZBa9NYgNSSx4OZQHgynJCAqnRmItcpXEjJJlTRr8rQ1 BOOf7jQAv0Nj9kgXH99XLCuuFLyVy+spsqtvC+GMLDGMA0yFMdPfC/7a2iEojjjMeghm ksAr6qXgv1foMl5/e6jt0qeiBnOyEBzBIGcFIseuhoE3pXPQC2yT3EGPvxPDRfo1Q8mB S1vkwD4P5txOMn3/pDkpZxo388ADugL2Zmfsnvdj8DVfEMcTocsC/dluFFPQUJhGw4xQ kSjsD0qOEiAmGcaLDmEh68zE9jSjjRuRETGOW+vnvax0ijVkEz+4f1TGl7kRcUDNRV0r F0/g== X-Gm-Message-State: AOAM533pNl7pjzvwyzGh1nkM/SDNUzGvNYOVklrFW4oLPUmWyzk7jNsX VEd+IPx/+lZtpgKeQwdcRLSiZXNL0ZJNYQ== X-Received: by 2002:a2e:984f:: with SMTP id e15mr27903691ljj.427.1637886748722; Thu, 25 Nov 2021 16:32:28 -0800 (PST) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id k13sm417812lfo.300.2021.11.25.16.32.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Nov 2021 16:32:28 -0800 (PST) From: Dmitry Baryshkov To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec Subject: [PATCH 2/2] drm/ bridge: tc358762: drop connector field Date: Fri, 26 Nov 2021 03:32:27 +0300 Message-Id: <20211126003227.1031347-2-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211126003227.1031347-1-dmitry.baryshkov@linaro.org> References: <20211126003227.1031347-1-dmitry.baryshkov@linaro.org> 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: , Cc: David Airlie , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The tc358762.connector field is unused. Remove it to save space. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/bridge/tc358762.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/tc358762.c b/drivers/gpu/drm/bridge/tc358762.c index ebdf771a1e49..930e19dfb329 100644 --- a/drivers/gpu/drm/bridge/tc358762.c +++ b/drivers/gpu/drm/bridge/tc358762.c @@ -61,7 +61,6 @@ struct tc358762 { struct device *dev; struct drm_bridge bridge; - struct drm_connector connector; struct regulator *regulator; struct drm_bridge *panel_bridge; bool enabled;