Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp4009169rwj; Tue, 20 Dec 2022 05:05:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf412uswGXD5b49iVh7jWUFnsqep3T3Sqkua5wsYE4h5PUtxHiIqRIKj9HTl+XLyLPH+3UGl X-Received: by 2002:a62:1685:0:b0:574:3b4e:1cbf with SMTP id 127-20020a621685000000b005743b4e1cbfmr43177201pfw.6.1671541508558; Tue, 20 Dec 2022 05:05:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671541508; cv=none; d=google.com; s=arc-20160816; b=1CEAoC2H/DpNzOcSzqPLEiQBcN2rOSr6tzN99+vIoFDeUHLLbaC4yDEx6Ad0mNUaAP WAqfZ+9AZEG0NsdL8k6bfI3vGe/45PGjHMUB5eIDaie3s1vTWG5MbIhuM2JeRGxH+lav cPTeMNhxPKTiM27NyV7PYbKHQMVun/wf35UvfljcToalg7wsetB4zA8ajRr4kDam1V38 Obd9YweC4hSftFSwlbxsZFXy8QbemZadN59Pc29xljvr4PKHkuTxx8xbsUQscLPzLI+b JK3tn+yE7NNGnsxD0La9vXwGcfUrQ4jO+aGLo1wQDjmywWLOWGUGU6UpIY5R12w8VD6y bCTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=u2QWCDgyAA7Tn1Rh7jbuiVrfCmkujLzANkjdKaok7YQ=; b=1ETaAFm6nrIVGXVu3r3k5pkshWsCkv9KXjzipERiDInalGLVtFRfq8QNSdvRkGg22a VqFrWJsB2ZJBR8gFxKd1T3KXUoMWSA5MllapP2Vin0JTBM5wNbfFF1CHAOWNpd3yvytZ enN6Iw7Uo5LMSeOkSzzIqVk/YP4foS/fPspPfoik44rOYMpcQk2PxFgQ2dGKZjHUibb+ 8JvgCBtjW5cxmGSCe0Ej8MLb3xgH3iAxUv72+i5lEiW8OUv0kzOtQ9wExhbeVDv9e50q 6ZYbdiJzv2jq70YWwu7Bbol7kQymvG8GMNNtBU642Of3CAl2vnCBl/gD76emTpbhtyjB emOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=KnN0Qq3h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j125-20020a625583000000b005763f53b50asi13075452pfb.165.2022.12.20.05.04.58; Tue, 20 Dec 2022 05:05:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=KnN0Qq3h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233727AbiLTNCg (ORCPT + 70 others); Tue, 20 Dec 2022 08:02:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233772AbiLTNCX (ORCPT ); Tue, 20 Dec 2022 08:02:23 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52E9C164BA; Tue, 20 Dec 2022 05:02:13 -0800 (PST) Received: from [192.168.1.15] (91-154-32-225.elisa-laajakaista.fi [91.154.32.225]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B6CE456D; Tue, 20 Dec 2022 14:02:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1671541331; bh=lNwpBXMbmhBLeOzbMEaPW9nHJmZ7obkuA7HfGtvKB5k=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=KnN0Qq3h6/7NCd4ZEtfGAuj7BYpCsqPwRLFQaXqPD2L8fDIk9bpuLDrdVr9PNWpOP QKL+fjTm7D26zqJd7EnfQvbhVKeowGTJNSpzxVFqQqAUb+jVhm2A6HRVRnGPhyveo+ yLus0JXYHAfhhkmI4f0cI7piV65lWgAHs44EWxn8= Message-ID: <0cde4a68-220a-915b-c8df-6f3b8f23d486@ideasonboard.com> Date: Tue, 20 Dec 2022 15:02:08 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v6 4/5] drm/tidss: Add IO CTRL and Power support for OLDI TX in am625 Content-Language: en-US To: Aradhya Bhatia , Jyri Sarha , Rob Herring , David Airlie , Daniel Vetter , Krzysztof Kozlowski Cc: DRI Development List , Devicetree List , Linux Kernel List , Nishanth Menon , Vignesh Raghavendra , Rahul T R , Devarsh Thakkar , Jayesh Choudhary References: <20221119173019.15643-1-a-bhatia1@ti.com> <20221119173019.15643-5-a-bhatia1@ti.com> From: Tomi Valkeinen In-Reply-To: <20221119173019.15643-5-a-bhatia1@ti.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 19/11/2022 19:30, Aradhya Bhatia wrote: > The ctrl mmr module of the AM625 is different from the AM65X SoC. Thus > the ctrl mmr registers that supported the OLDI TX power have become > different in AM625 SoC. > > Add IO CTRL support and control the OLDI TX power for AM625. > > Signed-off-by: Aradhya Bhatia > --- > drivers/gpu/drm/tidss/tidss_dispc.c | 55 ++++++++++++++++++------ > drivers/gpu/drm/tidss/tidss_dispc_regs.h | 37 +++++++++++----- > 2 files changed, 70 insertions(+), 22 deletions(-) > > diff --git a/drivers/gpu/drm/tidss/tidss_dispc.c b/drivers/gpu/drm/tidss/tidss_dispc.c > index 472226a83251..f26129fb1d8f 100644 > --- a/drivers/gpu/drm/tidss/tidss_dispc.c > +++ b/drivers/gpu/drm/tidss/tidss_dispc.c > @@ -930,21 +930,52 @@ int dispc_vp_bus_check(struct dispc_device *dispc, u32 hw_videoport, > > static void dispc_oldi_tx_power(struct dispc_device *dispc, bool power) > { > - u32 val = power ? 0 : OLDI_PWRDN_TX; > + u32 val; > > if (WARN_ON(!dispc->oldi_io_ctrl)) > return; > > - regmap_update_bits(dispc->oldi_io_ctrl, OLDI_DAT0_IO_CTRL, > - OLDI_PWRDN_TX, val); > - regmap_update_bits(dispc->oldi_io_ctrl, OLDI_DAT1_IO_CTRL, > - OLDI_PWRDN_TX, val); > - regmap_update_bits(dispc->oldi_io_ctrl, OLDI_DAT2_IO_CTRL, > - OLDI_PWRDN_TX, val); > - regmap_update_bits(dispc->oldi_io_ctrl, OLDI_DAT3_IO_CTRL, > - OLDI_PWRDN_TX, val); > - regmap_update_bits(dispc->oldi_io_ctrl, OLDI_CLK_IO_CTRL, > - OLDI_PWRDN_TX, val); > + if (dispc->feat->subrev == DISPC_AM65X) { > + val = power ? 0 : AM65X_OLDI_PWRDN_TX; > + > + regmap_update_bits(dispc->oldi_io_ctrl, AM65X_OLDI_DAT0_IO_CTRL, > + AM65X_OLDI_PWRDN_TX, val); > + regmap_update_bits(dispc->oldi_io_ctrl, AM65X_OLDI_DAT1_IO_CTRL, > + AM65X_OLDI_PWRDN_TX, val); > + regmap_update_bits(dispc->oldi_io_ctrl, AM65X_OLDI_DAT2_IO_CTRL, > + AM65X_OLDI_PWRDN_TX, val); > + regmap_update_bits(dispc->oldi_io_ctrl, AM65X_OLDI_DAT3_IO_CTRL, > + AM65X_OLDI_PWRDN_TX, val); > + regmap_update_bits(dispc->oldi_io_ctrl, AM65X_OLDI_CLK_IO_CTRL, > + AM65X_OLDI_PWRDN_TX, val); > + > + } else if (dispc->feat->subrev == DISPC_AM625) { > + if (power) { > + switch (dispc->oldi_mode) { > + case OLDI_SINGLE_LINK_SINGLE_MODE: > + /* Power down OLDI TX 1 */ > + val = AM625_OLDI1_PWRDN_TX; > + break; > + > + case OLDI_SINGLE_LINK_CLONE_MODE: > + case OLDI_DUAL_LINK_MODE: > + /* No Power down */ > + val = 0; > + break; > + > + default: > + /* Power down both the OLDI TXes */ > + val = AM625_OLDI0_PWRDN_TX | AM625_OLDI1_PWRDN_TX; > + break; > + } > + } else { > + /* Power down both the OLDI TXes */ > + val = AM625_OLDI0_PWRDN_TX | AM625_OLDI1_PWRDN_TX; > + } > + > + regmap_update_bits(dispc->oldi_io_ctrl, AM625_OLDI_PD_CTRL, > + AM625_OLDI0_PWRDN_TX | AM625_OLDI1_PWRDN_TX, val); > + } > } > > static void dispc_set_num_datalines(struct dispc_device *dispc, > @@ -2841,7 +2872,7 @@ int dispc_init(struct tidss_device *tidss) > dispc->vp_data[i].gamma_table = gamma_table; > } > > - if (feat->subrev == DISPC_AM65X) { > + if (feat->oldi_supported) { > r = dispc_init_am65x_oldi_io_ctrl(dev, dispc); > if (r) > return r; I think it makes more sense to test the SoC version here, rather than the generic "oldi_supported". And if the same function is used for am625, maybe rename the func to "_am6xx_". Other than that: Reviewed-by: Tomi Valkeinen Tomi