From patchwork Tue Oct 29 09:54:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 13854599 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 37FBFD2AB13 for ; Tue, 29 Oct 2024 09:58:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=zRN2Q2s1tXUlBpPwz2Gezq5YzOvyUe388g/hG6wINCo=; b=eavKJ4hVBHQfR5vT4i383rHREa IadqM48T+e4WRhX/fLuqJexNJcWx6p29BURHjrFBycPnLeRNF9UPY7lOpj1riPkcHdG4j+3ajSZWg joOmpXk6+BkkQQ57o1BDyrVlItHeEUajG/ZCtMMsf/tHv3Mh1YNBbcuoHxrO/w7xTfCGq/fnpb5BO 5cC3cXA2FOOTMyfclfN6RsphEqWX2LLUoCU6xY6KEOY8OwDl6BMV2Bi0+VQHxy/H5YM0FxYLm8bvi L97kg+Yc09m04tvVrYdDj4hgFYsg/YC+Tx+bEul1YhnP1YWCn9BDHnWNvV6S0uTtDvVZildRYQRMq 9J1WQ8Iw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t5izK-0000000Dx1u-3lyS; Tue, 29 Oct 2024 09:58:10 +0000 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t5ivb-0000000Dvs0-0yTC for linux-mediatek@lists.infradead.org; Tue, 29 Oct 2024 09:54:21 +0000 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-20e6981ca77so56079135ad.2 for ; Tue, 29 Oct 2024 02:54:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1730195658; x=1730800458; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=zRN2Q2s1tXUlBpPwz2Gezq5YzOvyUe388g/hG6wINCo=; b=NSIwfYSMdeHOtU1wU0QXHvu3gvojh6URbJlE15InZGHdBLzvJPxS+xL5d+TXlkmcrc a5k17L1y5LN8Fn9Ev8qhptPN3o5k0WYXuLdwWLMFF1mWRKzvX0U+beZm7LnE41v7/Uyq HUpivP3VAf/rxbFNm3AiSD7DFGWWBHE0GO3/U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730195658; x=1730800458; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zRN2Q2s1tXUlBpPwz2Gezq5YzOvyUe388g/hG6wINCo=; b=VM7tGfxz0rb985K9KTaiNukJhA1pq9dmDXY+YgspKctAeZpt4nXnawCKyO5Z9b5JDQ 3wEOIC4NyjG7lrMl4ul7zRFtZHdFnK8r3Z1uMQjgX8n9kRh4aLHNZuO6ztb9MU1WVs2K CxRgEddIofI2DtNMzQsuib7HpwyvwWwVbaCY23IhCjGthwxDThB2LgAzRkoC46lHlCdJ f2nPZVpbTB6EEcZKctYvyRVAX79tTlBSVNh7YNUIxuv3NyrQ/2rU4Hm3H+eOaDYI77A8 AaslpcLZNsdCPtiI4PVvwEy0aYz6OtJGoO7P+kcwGIwFpLU7/4Ordocm3SPqnJtJhhg4 C0JQ== X-Forwarded-Encrypted: i=1; AJvYcCWHxgBcxwvQDsYPTUOTgl7swMJ5d8sEsKr71x+b8GGLaB8EMQiNhn9LH5xK/0WjUHrMDldoEjYv6HuMfI3FVg==@lists.infradead.org X-Gm-Message-State: AOJu0YzahoKgnFQiRX7AGGhL01KaDLSvkeCF/ZrmfG+qooA9AVA7DNM4 k9+sxXIcQaxGYzRVo3SdEMkWMweE5RuiMhXLggaSOnMSPV9RVFB8wDSyw0y8Fw== X-Google-Smtp-Source: AGHT+IGJKLBeHml2mgw0fqam5oO7OYmdphXyqZ72BkhYs4KBfI3AcNJBCtRzWfdnOR4KM6obA5v1sA== X-Received: by 2002:a17:903:2289:b0:20b:7ec0:ee21 with SMTP id d9443c01a7336-210c68cf5a9mr165968125ad.19.1730195657831; Tue, 29 Oct 2024 02:54:17 -0700 (PDT) Received: from wenstp920.tpe.corp.google.com ([2401:fa00:1:10:1fef:f494:7cba:476]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-210bc02efb1sm62901235ad.221.2024.10.29.02.54.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2024 02:54:17 -0700 (PDT) From: Chen-Yu Tsai To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: Chen-Yu Tsai , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Matthias Brugger , AngeloGioacchino Del Regno , linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, stable@vger.kernel.org Subject: [PATCH] drm/bridge: it6505: Fix inverted reset polarity Date: Tue, 29 Oct 2024 17:54:10 +0800 Message-ID: <20241029095411.657616-1-wenst@chromium.org> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241029_025419_303663_8B01A5D0 X-CRM114-Status: GOOD ( 14.66 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The IT6505 bridge chip has a active low reset line. Since it is a "reset" and not an "enable" line, the GPIO should be asserted to put it in reset and deasserted to bring it out of reset during the power on sequence. The polarity was inverted when the driver was first introduced, likely because the device family that was targeted had an inverting level shifter on the reset line. The MT8186 Corsola devices already have the IT6505 in their device tree, but the whole display pipeline is actually disabled and won't be enabled until some remaining issues are sorted out. The other known user is the MT8183 Kukui / Jacuzzi family; their device trees currently do not have the IT6505 included. Fix the polarity in the driver while there are no actual users. Fixes: b5c84a9edcd4 ("drm/bridge: add it6505 driver") Cc: Signed-off-by: Chen-Yu Tsai Reviewed-by: Dmitry Baryshkov Reviewed-by: Neil Armstrong --- drivers/gpu/drm/bridge/ite-it6505.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge/ite-it6505.c index 7502a5f81557..df7ecdf0f422 100644 --- a/drivers/gpu/drm/bridge/ite-it6505.c +++ b/drivers/gpu/drm/bridge/ite-it6505.c @@ -2618,9 +2618,9 @@ static int it6505_poweron(struct it6505 *it6505) /* time interval between OVDD and SYSRSTN at least be 10ms */ if (pdata->gpiod_reset) { usleep_range(10000, 20000); - gpiod_set_value_cansleep(pdata->gpiod_reset, 0); - usleep_range(1000, 2000); gpiod_set_value_cansleep(pdata->gpiod_reset, 1); + usleep_range(1000, 2000); + gpiod_set_value_cansleep(pdata->gpiod_reset, 0); usleep_range(25000, 35000); } @@ -2651,7 +2651,7 @@ static int it6505_poweroff(struct it6505 *it6505) disable_irq_nosync(it6505->irq); if (pdata->gpiod_reset) - gpiod_set_value_cansleep(pdata->gpiod_reset, 0); + gpiod_set_value_cansleep(pdata->gpiod_reset, 1); if (pdata->pwr18) { err = regulator_disable(pdata->pwr18); @@ -3205,7 +3205,7 @@ static int it6505_init_pdata(struct it6505 *it6505) return PTR_ERR(pdata->ovdd); } - pdata->gpiod_reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); + pdata->gpiod_reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); if (IS_ERR(pdata->gpiod_reset)) { dev_err(dev, "gpiod_reset gpio not found"); return PTR_ERR(pdata->gpiod_reset);