Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp282278ybg; Tue, 28 Jul 2020 06:05:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwo69HftmNIQw3g6RmWcBn61qChzBxBxewMMGpPtgY9tklmxfFPpdFBK/TLl2yvQnBc3mYD X-Received: by 2002:a17:906:6bc9:: with SMTP id t9mr22587864ejs.372.1595941548171; Tue, 28 Jul 2020 06:05:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595941548; cv=none; d=google.com; s=arc-20160816; b=ZnKpgPkRIfXT/ur05mcgVDX7yXrqCJTpdH6Kmr4yJU2eNyZSnd4A/vmQxX8HfxkD8M pOWpomhipD6mRiMBR6032m0JHNFsmzSNyYstQoXE6YL6Ic3QPn2DeWt5mTMa4jP870q3 yPQ6l12S075yNcaHFMd+DEUUoKqVfQdhXsN4+t7VZ/qhoVEy1g9s6t1ThfJKntByIpv8 GyMmJUuiCUXTu33o+I8tlY+4PptwYHtpGXoOOXfjCk0b517yVndwKrQbWF61jFTBUmct 5eswVnuk2u16dCwp2bdHzXDq9LyLnABMv5YyrfWh9i9PPZsbvpb0JIWzlpJ4ffHlC2Ev LkhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=gcofQuTne2V4gIOdfNwCH+OZQw5KXbzKYJj8xweScI4=; b=uXJmfnFF9nchOSinV2z6QhMsZxYMLWSRptiwjsOMHMrNw0zeGKPnwv0VmtpYrAPsez RewmMFNgsooNGhlMGoeATLD97qw25tOvUwqldcMuoVTZRjCBFTyQZy1rOnj2YdsaitTG kQ2ILXFpLqtYSLNt2zDQENm2naXpQi/Z/ZuZgGxfqanJuPw5NzrJ07GUGsPPEbuZIfag cIHpY0aPNr8dlt3ISQGpMhBJnYpgqM0lTCXwuZqe3iAGSaL6NoQTO7k3eplcj5uOQHeQ qUtZdiwQ6IkIzeejDEoZ6AVrIGboiQ9JXoWecPnZ2uaa+k0J6V1mh25oNNoATwH+wxqh 4dgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@raspberrypi.com header.s=google header.b=Wk8DgYFC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=raspberrypi.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k3si7475267ejk.32.2020.07.28.06.05.25; Tue, 28 Jul 2020 06:05:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@raspberrypi.com header.s=google header.b=Wk8DgYFC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=raspberrypi.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729862AbgG1NEh (ORCPT + 99 others); Tue, 28 Jul 2020 09:04:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729607AbgG1NEh (ORCPT ); Tue, 28 Jul 2020 09:04:37 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8C8AC061794 for ; Tue, 28 Jul 2020 06:04:36 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id r2so13137324wrs.8 for ; Tue, 28 Jul 2020 06:04:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gcofQuTne2V4gIOdfNwCH+OZQw5KXbzKYJj8xweScI4=; b=Wk8DgYFCnFIRsz2cW/r3mBspcHpJv3myWr993HibCeQqllBImb1GEcO+fyimpiIr5w 7PTKyEnW8WoREJvkcnCvBLhEe/b2AYgmGBg+hDG7uRv3RiPKed/1m+fZvGMrg1gayGWK AFyVkhHrIr6plLwk6Ra9T2C/i6e+GwgslmPo6LkAuUUaSjQQxUlzNFGD4K5Fs8XLyBm/ WYKHxqOG+IimIaQW/a8+cdOdxV5cwEiSLqh64frjVKJSZNdsQJBvNAjdKtN2KPJEyT1u LzTqFcQ8B58tNeZOZwtP2g6/Gu1R/CWcoBt/XKUu4dmLtkrQaKc4RegQ3+jHyVhi/dcO S+AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gcofQuTne2V4gIOdfNwCH+OZQw5KXbzKYJj8xweScI4=; b=gHz1fBUL92T0Y5j/vsHPGN+zBWV9XQVnIwNZVHbDjJNcEXsr5y2+3Wnprdz6dotAR5 sjC6ekqT4/3YJvjTQLIhwBVa/H9k3Tn+GTeumBEEkwGOFkHV1unphM8dwBEYgxSISKPc cYuLhI+QFa13pblPCvabDT/oNXAf76u+mA3zAjvjl1xEqYixJFyeJmr9rnHXxum8VuQv GN7LjwsYWMAWy1EKh/RDPgp6hKGQyCGySWs1TLRv/k52Uz040IzXZLb91Fmvvv3OgMcI vUxiEAzmF7oMH75A8GLlquXWGV/7HJ5Yj1bZP0vQgmF2Ldz0RGPTlIcxQgGnS9LGzmtj 92rw== X-Gm-Message-State: AOAM530alQ4lO0Z61LodQEXjAHeRTHMGhz3I3xoGPnsoaGFiLuzo2vA7 kb2HivCmvsDcUk5ZsKUxcz2x6abfw+/5SqtW8qUuTQ== X-Received: by 2002:adf:fdce:: with SMTP id i14mr19598316wrs.273.1595941475627; Tue, 28 Jul 2020 06:04:35 -0700 (PDT) MIME-Version: 1.0 References: <6289e210ab50767f32951c1e9b80d420dc879447.1594230107.git-series.maxime@cerno.tech> In-Reply-To: <6289e210ab50767f32951c1e9b80d420dc879447.1594230107.git-series.maxime@cerno.tech> From: Dave Stevenson Date: Tue, 28 Jul 2020 14:04:18 +0100 Message-ID: Subject: Re: [PATCH v4 54/78] drm/vc4: hdmi: Add PHY RNG enable / disable function To: Maxime Ripard Cc: Nicolas Saenz Julienne , Eric Anholt , DRI Development , linux-rpi-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, LKML , Tim Gover , Phil Elwell Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Maxime On Wed, 8 Jul 2020 at 18:43, Maxime Ripard wrote: > > Let's continue the implementation of hooks for the parts that change in the > BCM2711 SoC with the PHY RNG setup. > > Signed-off-by: Maxime Ripard Reviewed-by: Dave Stevenson > --- > drivers/gpu/drm/vc4/vc4_hdmi.c | 15 +++++++++------ > drivers/gpu/drm/vc4/vc4_hdmi.h | 8 ++++++++ > drivers/gpu/drm/vc4/vc4_hdmi_phy.c | 15 +++++++++++++++ > 3 files changed, 32 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c > index 068041145d1c..19897d6525ac 100644 > --- a/drivers/gpu/drm/vc4/vc4_hdmi.c > +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c > @@ -762,9 +762,9 @@ static int vc4_hdmi_audio_trigger(struct snd_pcm_substream *substream, int cmd, > switch (cmd) { > case SNDRV_PCM_TRIGGER_START: > vc4_hdmi_set_audio_infoframe(encoder); > - HDMI_WRITE(HDMI_TX_PHY_CTL_0, > - HDMI_READ(HDMI_TX_PHY_CTL_0) & > - ~VC4_HDMI_TX_PHY_RNG_PWRDN); > + > + if (vc4_hdmi->variant->phy_rng_enable) > + vc4_hdmi->variant->phy_rng_enable(vc4_hdmi); > > HDMI_WRITE(HDMI_MAI_CTL, > VC4_SET_FIELD(vc4_hdmi->audio.channels, > @@ -776,9 +776,10 @@ static int vc4_hdmi_audio_trigger(struct snd_pcm_substream *substream, int cmd, > VC4_HD_MAI_CTL_DLATE | > VC4_HD_MAI_CTL_ERRORE | > VC4_HD_MAI_CTL_ERRORF); > - HDMI_WRITE(HDMI_TX_PHY_CTL_0, > - HDMI_READ(HDMI_TX_PHY_CTL_0) | > - VC4_HDMI_TX_PHY_RNG_PWRDN); > + > + if (vc4_hdmi->variant->phy_rng_disable) > + vc4_hdmi->variant->phy_rng_disable(vc4_hdmi); > + > break; > default: > break; > @@ -1433,6 +1434,8 @@ static const struct vc4_hdmi_variant bcm2835_variant = { > .reset = vc4_hdmi_reset, > .phy_init = vc4_hdmi_phy_init, > .phy_disable = vc4_hdmi_phy_disable, > + .phy_rng_enable = vc4_hdmi_phy_rng_enable, > + .phy_rng_disable = vc4_hdmi_phy_rng_disable, > }; > > static const struct of_device_id vc4_hdmi_dt_match[] = { > diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.h b/drivers/gpu/drm/vc4/vc4_hdmi.h > index 32c80161c786..950accbc44e4 100644 > --- a/drivers/gpu/drm/vc4/vc4_hdmi.h > +++ b/drivers/gpu/drm/vc4/vc4_hdmi.h > @@ -47,6 +47,12 @@ struct vc4_hdmi_variant { > > /* Callback to disable the PHY */ > void (*phy_disable)(struct vc4_hdmi *vc4_hdmi); > + > + /* Callback to enable the RNG in the PHY */ > + void (*phy_rng_enable)(struct vc4_hdmi *vc4_hdmi); > + > + /* Callback to disable the RNG in the PHY */ > + void (*phy_rng_disable)(struct vc4_hdmi *vc4_hdmi); > }; > > /* HDMI audio information */ > @@ -107,5 +113,7 @@ encoder_to_vc4_hdmi(struct drm_encoder *encoder) > void vc4_hdmi_phy_init(struct vc4_hdmi *vc4_hdmi, > struct drm_display_mode *mode); > void vc4_hdmi_phy_disable(struct vc4_hdmi *vc4_hdmi); > +void vc4_hdmi_phy_rng_enable(struct vc4_hdmi *vc4_hdmi); > +void vc4_hdmi_phy_rng_disable(struct vc4_hdmi *vc4_hdmi); > > #endif /* _VC4_HDMI_H_ */ > diff --git a/drivers/gpu/drm/vc4/vc4_hdmi_phy.c b/drivers/gpu/drm/vc4/vc4_hdmi_phy.c > index 5a1746877bb5..93287e24d7d1 100644 > --- a/drivers/gpu/drm/vc4/vc4_hdmi_phy.c > +++ b/drivers/gpu/drm/vc4/vc4_hdmi_phy.c > @@ -7,6 +7,7 @@ > */ > > #include "vc4_hdmi.h" > +#include "vc4_regs.h" > #include "vc4_hdmi_regs.h" > > void vc4_hdmi_phy_init(struct vc4_hdmi *vc4_hdmi, struct drm_display_mode *mode) > @@ -23,3 +24,17 @@ void vc4_hdmi_phy_disable(struct vc4_hdmi *vc4_hdmi) > { > HDMI_WRITE(HDMI_TX_PHY_RESET_CTL, 0xf << 16); > } > + > +void vc4_hdmi_phy_rng_enable(struct vc4_hdmi *vc4_hdmi) > +{ > + HDMI_WRITE(HDMI_TX_PHY_CTL_0, > + HDMI_READ(HDMI_TX_PHY_CTL_0) & > + ~VC4_HDMI_TX_PHY_RNG_PWRDN); > +} > + > +void vc4_hdmi_phy_rng_disable(struct vc4_hdmi *vc4_hdmi) > +{ > + HDMI_WRITE(HDMI_TX_PHY_CTL_0, > + HDMI_READ(HDMI_TX_PHY_CTL_0) | > + VC4_HDMI_TX_PHY_RNG_PWRDN); > +} > -- > git-series 0.9.1