From patchwork Wed Aug 30 14:23:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13370294 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 C424CC83F15 for ; Wed, 30 Aug 2023 14:25:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F236E10E537; Wed, 30 Aug 2023 14:25:03 +0000 (UTC) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by gabe.freedesktop.org (Postfix) with ESMTP id 0480E10E537 for ; Wed, 30 Aug 2023 14:25:00 +0000 (UTC) X-IronPort-AV: E=Sophos;i="6.02,213,1688396400"; d="scan'208";a="178194122" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 30 Aug 2023 23:25:00 +0900 Received: from localhost.localdomain (unknown [10.226.92.150]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 83DBE42170F5; Wed, 30 Aug 2023 23:24:54 +0900 (JST) From: Biju Das To: Andrzej Hajda , Neil Armstrong , Robert Foss , David Airlie , Daniel Vetter Subject: [PATCH v2 8/8] drm: adv7511: Add hpd_override_enable variable to struct adv7511_chip_info Date: Wed, 30 Aug 2023 15:23:58 +0100 Message-Id: <20230830142358.275459-9-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230830142358.275459-1-biju.das.jz@bp.renesas.com> References: <20230830142358.275459-1-biju.das.jz@bp.renesas.com> 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: Ahmad Fatoum , Geert Uytterhoeven , Jonas Karlman , dri-devel@lists.freedesktop.org, Abhinav Kumar , Jernej Skrabec , Javier Martinez Canillas , linux-renesas-soc@vger.kernel.org, Andy Shevchenko , Laurent Pinchart , =?utf-8?q?Uwe_Kleine-?= =?utf-8?q?K=C3=B6nig?= , Biju Das , Adam Ford , Bogdan Togorean Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" As per spec, it is allowed to pulse the HPD signal to indicate that the EDID information has changed. Some monitors do this when they wake up from standby or are enabled. When the HPD goes low the adv7511 is reset and the outputs are disabled which might cause the monitor to go to standby again. To avoid this we ignore the HPD pin for the first few seconds after enabling the output. On the other hand, adv7535 require to enable HPD Override bit for proper HPD. Add hpd_override_enable variable to struct adv7511_chip_info to handle this scenario. Signed-off-by: Biju Das Reviewed-by: Robert Foss --- v1->v2: * Restored enum adv7511_type as there are users. * Replaced variable type from unsigned->bool. --- drivers/gpu/drm/bridge/adv7511/adv7511.h | 1 + drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511.h b/drivers/gpu/drm/bridge/adv7511/adv7511.h index 0d39e32b0793..39c9ece373b0 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7511.h +++ b/drivers/gpu/drm/bridge/adv7511/adv7511.h @@ -342,6 +342,7 @@ struct adv7511_chip_info { unsigned int reg_cec_offset; bool has_dsi; bool link_config; + bool hpd_override_enable; }; struct adv7511 { diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c index e0ec3c098225..83ff4206b3b7 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c @@ -354,7 +354,7 @@ static void __adv7511_power_on(struct adv7511 *adv7511) * first few seconds after enabling the output. On the other hand * adv7535 require to enable HPD Override bit for proper HPD. */ - if (adv7511->info->type == ADV7535) + if (adv7511->info->hpd_override_enable) regmap_update_bits(adv7511->regmap, ADV7511_REG_POWER2, ADV7535_REG_POWER2_HPD_OVERRIDE, ADV7535_REG_POWER2_HPD_OVERRIDE); @@ -381,7 +381,7 @@ static void adv7511_power_on(struct adv7511 *adv7511) static void __adv7511_power_off(struct adv7511 *adv7511) { /* TODO: setup additional power down modes */ - if (adv7511->info->type == ADV7535) + if (adv7511->info->hpd_override_enable) regmap_update_bits(adv7511->regmap, ADV7511_REG_POWER2, ADV7535_REG_POWER2_HPD_OVERRIDE, 0); @@ -682,7 +682,7 @@ adv7511_detect(struct adv7511 *adv7511, struct drm_connector *connector) status = connector_status_disconnected; } else { /* Renable HPD sensing */ - if (adv7511->info->type == ADV7535) + if (adv7511->info->hpd_override_enable) regmap_update_bits(adv7511->regmap, ADV7511_REG_POWER2, ADV7535_REG_POWER2_HPD_OVERRIDE, ADV7535_REG_POWER2_HPD_OVERRIDE); @@ -1379,6 +1379,7 @@ static const struct adv7511_chip_info adv7535_chip_info = { .num_supplies = ARRAY_SIZE(adv7533_supply_names), .reg_cec_offset = ADV7533_REG_CEC_OFFSET, .has_dsi = true, + .hpd_override_enable = true, }; static const struct i2c_device_id adv7511_i2c_ids[] = {