Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1406948lqh; Mon, 6 May 2024 07:00:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX/RoDFjhdG4nID7Uv/xj/YVT0OY9aP4JomDawVYGAeADVFDa4BEYMqbG3BDwZZaBYFreanrIlCYYQrAiKlj/Kc3aewWbq0iWSDEU0qpg== X-Google-Smtp-Source: AGHT+IFz8T/OEQQIfPdP7Y8IUF4+6kCuKLwpQ63u93zuBPYyL22ljIlIsa4cIRS4aDEWAuRSSrfE X-Received: by 2002:a17:90a:8d03:b0:2a2:981b:2c9e with SMTP id c3-20020a17090a8d0300b002a2981b2c9emr9092355pjo.36.1715004056824; Mon, 06 May 2024 07:00:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715004056; cv=pass; d=google.com; s=arc-20160816; b=jo3qtGyvylEC0P3AxOpjrcuioMPhhHNVCYhroy2+YYUt37Cnda5gWCf4zOnUfY26Re f+0EGblnYnDlA/WBRur2Ne3IfpzF6z+vxMWbeKHGwLS8YHpVWX4+7zQKFail9TEmKqlU oYWXSHHWmhs4zsJ6SaEHaKjLEJ63OuaDMkmxSy54YWeRnXNWXSdWRqLfuDqdkxmnY02B NRv0BgCZDolfOLdNga9ccr9gC3GLXwPpUDRf5wTS4J8X8cftYmzmqLzmRmM80Aq3mLro TbXDw74tb966hl47j4PuQMjz5yYfByTUR1RYP4HdiKQzHAD+caQncfmU2syWmtwHYQTn Y/og== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=4BQmtEZV/yonZCDjMvNhltvj6dDRsNeCnO0rfrstorw=; fh=SuRMajwH7N2ZLVBLirbkCwTFKIhKCObxyHKAw4nU6hQ=; b=rf2f/hLN4jMejZmcW88Jf8EBb7L6JoYZjnTlphTyvSW24L1RRg9qN0uR0XbAS6SX0Z tCpNmzVwxS1SKhzQSVLQP7DX4P7fZyYv4NEL692cWNeHnYOYv/IxZBwOFwUmjm77eEGF t6Bwy2N+cnY0gRtz9E56onp9EfKqczTYGvDVGcpVrK1k2ATrig7RBucmBDSrDp3uSzKs s9vdCDE0Zb3RZBfZkXflVc4XH528Tp9RtvU8LKBttFrGmY3ZM/Vw/oltiUvjsevTl9yb YS0MvYFYZWPjnS5zk2aCzQkR8LdFmP5eBlvsXTCFxyJHIap9e6ZALpPPM1UbiP8oNuNx DgEw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fkIFGsQv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-169906-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169906-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id t4-20020a17090aba8400b002aeb2b7da89si10836802pjr.23.2024.05.06.07.00.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 07:00:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-169906-linux.lists.archive=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=@kernel.org header.s=k20201202 header.b=fkIFGsQv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-169906-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169906-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 D075EB27A8C for ; Mon, 6 May 2024 13:38:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 125E87A13A; Mon, 6 May 2024 13:35:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fkIFGsQv" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 4024C79B9D for ; Mon, 6 May 2024 13:35:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715002552; cv=none; b=UEaMLwBiUgr4MWeI2qQogJ0Jn7Ma7HtTMnua5kxRxJf+7kaT27XHhvj7xRWutf4+PMgMHYNkUsieHYYTI/u28JpigXoJOIyG9V45pkemTtV1egwIgeH8JzQOxCEdCGpIWnymsuoSgnWugc/oio23Id3HnXUlsmy+QllSOKfpMSE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715002552; c=relaxed/simple; bh=WxRrG6WTFlRQfn6WWcefR6HHCbkvvHD6Cc1lLV/qbGE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=b9QkpXlpJAI5GN/pm3/gz/hn/rBmrYZriCpnBqm3jZBocuoeJDQ1ZRTXi4037riUbBU01NhTxlGKN0ZZa5dj4y562VDKyE3BRx8Erhas9lXcgyHbiEpaX7rN/pXW4f23lKuk61cVdB0wo6HW28ZBCxQ5dapkGl1fCRfojnkDfEY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fkIFGsQv; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC6E7C4DDE0; Mon, 6 May 2024 13:35:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715002552; bh=WxRrG6WTFlRQfn6WWcefR6HHCbkvvHD6Cc1lLV/qbGE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=fkIFGsQvkv1zts7XnHArWvq5f6naVeYQf+gyv4hIjws7yh55elTEiD8E/gZClAhKt 2Nm8vAV4FymXXd+glXnlSr9Wi4znWxmiXt0ju4tdA60Zf/sl9QcxuMD6XMzogZ0i+f XZekXyKMV8g+eGYA8o2AxeORRn1LY73iuelV5XTvS8qB9VhsOyNcdYRR1VI7F31Bqy 61wBlpLyw6poCnKygq72ifnnqGRa2Y9LtUlhMr6OB6IDF7522UfUhiu07Dc907F4GA LrfmNplDZxSkhYiQGJjHvN4Rf3vmZd1re2RAEgCYpFFCwgSkRTME6JNwvTXNNQaen+ +vPi2Xo0NRgZQ== From: Michael Walle Date: Mon, 06 May 2024 15:34:39 +0200 Subject: [PATCH 10/20] drm/bridge: tc358775: simplify lvds_link property 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: 7bit Message-Id: <20240506-tc358775-fix-powerup-v1-10-545dcf00b8dd@kernel.org> References: <20240506-tc358775-fix-powerup-v1-0-545dcf00b8dd@kernel.org> In-Reply-To: <20240506-tc358775-fix-powerup-v1-0-545dcf00b8dd@kernel.org> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Sam Ravnborg , Vinay Simha BN , Tony Lindgren Cc: Daniel Semkowicz , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Michael Walle X-Mailer: b4 0.12.4 The LVDS link can either be a single link or a dual link. No need for a u8. Replace it with a bool "lvds_dual_link". Signed-off-by: Michael Walle --- drivers/gpu/drm/bridge/tc358775.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358775.c b/drivers/gpu/drm/bridge/tc358775.c index a9d731e87970..be2175571b99 100644 --- a/drivers/gpu/drm/bridge/tc358775.c +++ b/drivers/gpu/drm/bridge/tc358775.c @@ -231,7 +231,7 @@ struct tc_data { struct regulator *vddio; struct gpio_desc *reset_gpio; struct gpio_desc *stby_gpio; - u8 lvds_link; /* single-link or dual-link */ + bool lvds_dual_link; u8 bpc; enum tc3587x5_type type; @@ -409,7 +409,7 @@ static void tc_bridge_enable(struct drm_bridge *bridge) regmap_write(tc->regmap, VFUEN, VFUEN_EN); val = LVCFG_LVEN_BIT; - if (tc->lvds_link == DUAL_LINK) { + if (tc->lvds_dual_link) { val |= TC358775_LVCFG_LVDLINK(1); val |= TC358775_LVCFG_PCLKDIV(DIVIDE_BY_6); } else { @@ -460,8 +460,8 @@ tc_mode_valid(struct drm_bridge *bridge, * Maximum pixel clock speed 135MHz for single-link * 270MHz for dual-link */ - if ((mode->clock > 135000 && tc->lvds_link == SINGLE_LINK) || - (mode->clock > 270000 && tc->lvds_link == DUAL_LINK)) + if ((mode->clock > 135000 && !tc->lvds_dual_link) || + (mode->clock > 270000 && tc->lvds_dual_link)) return MODE_CLOCK_HIGH; switch (info->bus_formats[0]) { @@ -516,7 +516,6 @@ static int tc358775_parse_dt(struct device_node *np, struct tc_data *tc) of_node_put(tc->host_node); - tc->lvds_link = SINGLE_LINK; endpoint = of_graph_get_endpoint_by_regs(tc->dev->of_node, TC358775_LVDS_OUT1, -1); if (endpoint) { @@ -525,13 +524,14 @@ static int tc358775_parse_dt(struct device_node *np, struct tc_data *tc) if (remote) { if (of_device_is_available(remote)) - tc->lvds_link = DUAL_LINK; + tc->lvds_dual_link = true; of_node_put(remote); } } dev_dbg(tc->dev, "no.of dsi lanes: %d\n", tc->num_dsi_lanes); - dev_dbg(tc->dev, "operating in %d-link mode\n", tc->lvds_link); + dev_dbg(tc->dev, "operating in %s-link mode\n", + tc->lvds_dual_link ? "dual" : "single"); return 0; } -- 2.39.2