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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 711E7C3DA6E for ; Mon, 8 Jan 2024 10:52:36 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0127687A99; Mon, 8 Jan 2024 11:51:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Oq5eiVnD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8927287A81; Mon, 8 Jan 2024 11:51:05 +0100 (CET) Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 60F0A87A80 for ; Mon, 8 Jan 2024 11:51:02 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=clamor95@gmail.com Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-50eac018059so1897937e87.0 for ; Mon, 08 Jan 2024 02:51:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704711061; x=1705315861; darn=lists.denx.de; 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=ywT7RtroBGQBoOgjaad2C3kGUJ/r/zdruIhtLtkR65U=; b=Oq5eiVnD03AvEOlsoz3vV/nEyC38hU4dqFhbUndu1T0X41QS3wq1WW+khRAfYTvjFy UAWvVuzbe8HbFnD7osTqTBK9ii1WwN6A4QY1WA/RW7PqojY/q2/qrkKFSzzU0N+fcCBl ZfmNv1vb4A/QnHlzcefb1sktVoWpElMeVl/B25a0HycU+ohwxowj5KnuTGO2GCa3g6ye hFN2gbo8adKLss7ofUo1AcvBm4G3XqQmJJRHmNYT4bBvTrB5E5+O+gvJ/cmJgc789Jop 4hYJNcGUDYJIDRHjt5eBMdDCbzrKFeL0JCgFZxA4mCU5iTPGHgWj8sDbS05MnUumYxXd OJGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704711061; x=1705315861; 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=ywT7RtroBGQBoOgjaad2C3kGUJ/r/zdruIhtLtkR65U=; b=mx1+mbAi1H+hh+DIgue6WYq2B9ne/tEX9XO9t3mrcqFdDUasgkStKQWlJYEpmHVOD9 vTrXjMATp5IervwR7uryeVSMKo/5PBcsuGMql55ETh9KM5JVr4IpwItIXDDTUpCWNCRk 7ztOLHQ+MrOqbm8nlzqucQiH+1U8UTiG/Zpj3mC/76mF3oJYI2o+0rue5nluSFRkt9Bx MZjVAxRuahNzK5DcM5jO2/jDTFEs1DIFnNzqIcFZuYagTO6nQp3uOn9JPXhmFKwvLxPz cbVBfu9SwTc1hoJnq/NyxAsbfGlqhAWvW9eUwbqDmvgO7PpmT80YRud4ynVwZ/c1ii/6 K6zA== X-Gm-Message-State: AOJu0YzjyZmw8zcq9RRQWDh4xujupFcX2HUPEXYH4XfAyh3966uYd5MF IOlL+poNsv4YV6fZsyfo3ZA= X-Google-Smtp-Source: AGHT+IH8c4mRS7WtoehQbnTwvZb2Q3L0VDMGNX4ggfumR+MnT3Jzyt3vFY+1qK8fgjqBWInKmkWfOg== X-Received: by 2002:a05:6512:a8d:b0:50e:a959:f23 with SMTP id m13-20020a0565120a8d00b0050ea9590f23mr1725620lfu.9.1704711061606; Mon, 08 Jan 2024 02:51:01 -0800 (PST) Received: from xeon.. ([188.163.112.49]) by smtp.gmail.com with ESMTPSA id 26-20020a170906309a00b00a26ae4fb50asm3821141ejv.89.2024.01.08.02.51.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 02:51:01 -0800 (PST) From: Svyatoslav Ryhel To: Thierry Reding , Anatolij Gustschin , Svyatoslav Ryhel , Simon Glass Cc: u-boot@lists.denx.de Subject: [PATCH v2 9/9] video: tegra20: dsi: add reset support Date: Mon, 8 Jan 2024 12:50:02 +0200 Message-Id: <20240108105002.243149-10-clamor95@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240108105002.243149-1-clamor95@gmail.com> References: <20240108105002.243149-1-clamor95@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Implement reset use to discard any changes which could have been applied to DSI before and can interfere with current configuration. Tested-by: Ion Agorria # HTC One X Tested-by: Svyatoslav Ryhel # Nvidia Tegratab T114 Signed-off-by: Svyatoslav Ryhel --- drivers/video/tegra20/tegra-dsi.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/video/tegra20/tegra-dsi.c b/drivers/video/tegra20/tegra-dsi.c index f4743e8458..6408026808 100644 --- a/drivers/video/tegra20/tegra-dsi.c +++ b/drivers/video/tegra20/tegra-dsi.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -849,6 +850,7 @@ static int tegra_dsi_bridge_probe(struct udevice *dev) struct tegra_dsi_priv *priv = dev_get_priv(dev); struct mipi_dsi_device *device = &priv->device; struct mipi_dsi_panel_plat *mipi_plat; + struct reset_ctl reset_ctl; int ret; priv->version = dev_get_driver_data(dev); @@ -862,6 +864,13 @@ static int tegra_dsi_bridge_probe(struct udevice *dev) priv->video_fifo_depth = 480; priv->host_fifo_depth = 64; + ret = reset_get_by_name(dev, "dsi", &reset_ctl); + if (ret) { + log_debug("%s: reset_get_by_name() failed: %d\n", + __func__, ret); + return ret; + } + ret = uclass_get_device_by_phandle(UCLASS_REGULATOR, dev, "avdd-dsi-csi-supply", &priv->avdd); if (ret) @@ -900,12 +909,17 @@ static int tegra_dsi_bridge_probe(struct udevice *dev) tegra_dsi_get_format(device->format, &priv->format); + reset_assert(&reset_ctl); + ret = regulator_set_enable_if_allowed(priv->avdd, true); if (ret && ret != -ENOSYS) return ret; tegra_dsi_init_clocks(dev); + mdelay(2); + reset_deassert(&reset_ctl); + return 0; } -- 2.40.1