Received: by 10.223.176.5 with SMTP id f5csp3465007wra; Mon, 29 Jan 2018 13:36:42 -0800 (PST) X-Google-Smtp-Source: AH8x2257qZ0tfSVBeF2QegCw6itEUZ/QBAWifKZazJAMqp5QkVtRQQRY2Awsla8pzj8cu67RXofU X-Received: by 2002:a17:902:b492:: with SMTP id y18-v6mr13750595plr.437.1517261802808; Mon, 29 Jan 2018 13:36:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517261802; cv=none; d=google.com; s=arc-20160816; b=aFY3EvlrdHf/rjyhFXR9aS1iK5zLXgD0V7qjtTbzmvKRQ5ZnDLadwuki3/l+e17rOW E1UdsyNPA6BWao5xH5A05Ro4Rnxf7BSbQ5atqKRCragH0K33NxwE/ZiTX6BqBYOdyZZi EF9uT0Lrw417H4RW+OzvverhLIOlq5b4mVgZXgj5viFRHzj5OA4ZW5AEZE+LvmIjB7ZW UT+p/Je4vmAA7jrsrQ5u3/mfiqp9HNbiry0mq3cpYahNvbs2OGbjesLfXk2gmsqAwKxt cNP8ZGkQ+gDCdDcN1jMCu61vP40yGLcM8V3dZVl19e1bjz76ikHLG4AeYPRXsrysrabD G4cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=LZH2FUYTBHLxcf1oRBO33GfCopCRoIkX932AANSXudI=; b=yw1Opt2LrhHXVvqje0NXydOu9NPDPabbVDb0hKymTkyyXPwV4NwhmBgvS76WWwiQrK 4I5K9YgCA0j6RXKYUmDTOXqYowJmMGXrPNzhx27ypyrUFhBrfYNEgeFdpcxQvWQCT/Pt 9AQPyBQ9RfaXOzyx/BdpxUJSZwfx2KzHHXnKLBxfO2rft42Dh8BiGsS2Tf7MvH0w0iZL GVZONv1IgQ8bMyL7JH2MLO4zOaONKEv9QcV16EqS7C+x65e/Yyxz1ST/6aJvJdpNqUiO M0rGkPp2Qz6r9Tv/mgtTIrJZT6Z5CR2NaMRlE/N98G4L0+J14+Ct/9RP7rxTlVOsddhH L6Fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=I7IV0s5s; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o2-v6si2236753pli.507.2018.01.29.13.36.28; Mon, 29 Jan 2018 13:36:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=I7IV0s5s; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751729AbeA2VgD (ORCPT + 99 others); Mon, 29 Jan 2018 16:36:03 -0500 Received: from mail-yw0-f194.google.com ([209.85.161.194]:43728 "EHLO mail-yw0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751644AbeA2VgB (ORCPT ); Mon, 29 Jan 2018 16:36:01 -0500 Received: by mail-yw0-f194.google.com with SMTP id x190so3256950ywd.10 for ; Mon, 29 Jan 2018 13:36:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=LZH2FUYTBHLxcf1oRBO33GfCopCRoIkX932AANSXudI=; b=I7IV0s5s0FhO5DFT7EV/6P7bxknY7akOsGwWnErAhq0vn7P1Y/WYOOFsdZP+H7/4H+ SgZeOAu6eEUa6q5UN4zm7z47L6FNrVZMrXiDONzI0KpIMcvWptxvHUhTlQuUDNkLQgVt YC1/xxGe0uGhNaKxY5oFW7HhGMWlM95tMkRDg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=LZH2FUYTBHLxcf1oRBO33GfCopCRoIkX932AANSXudI=; b=tFxRdFoxtKvcT30wnRfOzDx+f44w8zvLg1+r9YL71SLn8bmpiQsBlRkrOjt0Rv/HN+ DCf6ywgPe5g04rt5WcZ3KwOLUZ6BAKrounXO44+uU+subRvGRGx3trXKTvKIl6IlfemA ioBM73tn7KI43G53x9yWorRP23Dk6Is9gj09wNUQZEu4ItO3fNcaeyeqsbRGo4TNApRr bdvdmjbwzNzfsNxXSq3lrzBIzW3fqGhirqFyUwLGOMuLx6O+USu8WxweIPBkxiHjlUfL djNAjn0N2vfg+0lEpi/+XqVO9/+1hMCi1ePGsMrku89OcMUDNIYQpChgNZWRhV62oxxe rpdA== X-Gm-Message-State: AKwxytf5tDrKmGBlwxdIVGkiLfYLy21Bf3YrvujiwyFaOUTslKYiD5AL FGG1Sq5A7LkhtMLEDKjSIQ6lLQ== X-Received: by 10.129.165.11 with SMTP id c11mr18170909ywh.311.1517261760531; Mon, 29 Jan 2018 13:36:00 -0800 (PST) Received: from localhost ([2620:0:1013:11:d3af:69ac:1964:28e8]) by smtp.gmail.com with ESMTPSA id f4sm4712124ywa.99.2018.01.29.13.35.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Jan 2018 13:36:00 -0800 (PST) Date: Mon, 29 Jan 2018 16:35:59 -0500 From: Sean Paul To: Thierry Escande Cc: Archit Taneja , Inki Dae , Thierry Reding , Sandy Huang , Sean Paul , David Airlie , Tomasz Figa , Haixia Shi , =?iso-8859-1?Q?=D8rjan?= Eide , Zain Wang , Yakir Yang , Lin Huang , Douglas Anderson , Mark Yao , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH v2 28/43] drm/bridge: analogix_dp: Fix incorrect operations with register ANALOGIX_DP_FUNC_EN_1 Message-ID: <20180129213559.dwcwup35whqzklfc@art_vandelay> References: <20180126131710.7622-1-thierry.escande@collabora.com> <20180126131710.7622-29-thierry.escande@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180126131710.7622-29-thierry.escande@collabora.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 26, 2018 at 02:16:55PM +0100, Thierry Escande wrote: > From: zain wang > > Register ANALOGIX_DP_FUNC_EN_1(offset 0x18), Rockchip is different to > Exynos: > > on Exynos edp phy, > BIT 7 MASTER_VID_FUNC_EN_N > BIT 6 reserved > BIT 5 SLAVE_VID_FUNC_EN_N > > on Rockchip edp phy, > BIT 7 reserved > BIT 6 RK_VID_CAP_FUNC_EN_N > BIT 5 RK_VID_FIFO_FUNC_EN_N > > So, we should do some private operations to Rockchip. > > Cc: Tomasz Figa > Signed-off-by: zain wang > Signed-off-by: Sean Paul > Signed-off-by: Thierry Escande > Reviewed-by: Andrzej Hajda > --- > drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c | 19 ++++++++++++++----- > drivers/gpu/drm/bridge/analogix/analogix_dp_reg.h | 2 ++ > 2 files changed, 16 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c > index 02ab1aaa9993..4eae206ec31b 100644 > --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c > +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c > @@ -126,9 +126,14 @@ void analogix_dp_reset(struct analogix_dp_device *dp) > analogix_dp_stop_video(dp); > analogix_dp_enable_video_mute(dp, 0); > > - reg = MASTER_VID_FUNC_EN_N | SLAVE_VID_FUNC_EN_N | > - AUD_FIFO_FUNC_EN_N | AUD_FUNC_EN_N | > - HDCP_FUNC_EN_N | SW_FUNC_EN_N; > + if (dp->plat_data && is_rockchip(dp->plat_data->dev_type)) > + reg = RK_VID_CAP_FUNC_EN_N | RK_VID_FIFO_FUNC_EN_N | > + SW_FUNC_EN_N; > + else > + reg = MASTER_VID_FUNC_EN_N | SLAVE_VID_FUNC_EN_N | > + AUD_FIFO_FUNC_EN_N | AUD_FUNC_EN_N | > + HDCP_FUNC_EN_N | SW_FUNC_EN_N; The patch doesn't mention whether the other flags (AUD/HDCP) are relevant to rockchip. Even in the CrOS tree we don't see these flags set for RK, so I guess they're not. Would have been nice to know for certain. ¯\_(ツ)_/¯ Sean > + > writel(reg, dp->reg_base + ANALOGIX_DP_FUNC_EN_1); > > reg = SSC_FUNC_EN_N | AUX_FUNC_EN_N | > @@ -971,8 +976,12 @@ void analogix_dp_config_video_slave_mode(struct analogix_dp_device *dp) > u32 reg; > > reg = readl(dp->reg_base + ANALOGIX_DP_FUNC_EN_1); > - reg &= ~(MASTER_VID_FUNC_EN_N | SLAVE_VID_FUNC_EN_N); > - reg |= MASTER_VID_FUNC_EN_N; > + if (dp->plat_data && is_rockchip(dp->plat_data->dev_type)) { > + reg &= ~(RK_VID_CAP_FUNC_EN_N | RK_VID_FIFO_FUNC_EN_N); > + } else { > + reg &= ~(MASTER_VID_FUNC_EN_N | SLAVE_VID_FUNC_EN_N); > + reg |= MASTER_VID_FUNC_EN_N; > + } > writel(reg, dp->reg_base + ANALOGIX_DP_FUNC_EN_1); > > reg = readl(dp->reg_base + ANALOGIX_DP_VIDEO_CTL_10); > diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.h b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.h > index b633a4a5082a..0cf27c731727 100644 > --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.h > +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.h > @@ -127,7 +127,9 @@ > > /* ANALOGIX_DP_FUNC_EN_1 */ > #define MASTER_VID_FUNC_EN_N (0x1 << 7) > +#define RK_VID_CAP_FUNC_EN_N (0x1 << 6) > #define SLAVE_VID_FUNC_EN_N (0x1 << 5) > +#define RK_VID_FIFO_FUNC_EN_N (0x1 << 5) > #define AUD_FIFO_FUNC_EN_N (0x1 << 4) > #define AUD_FUNC_EN_N (0x1 << 3) > #define HDCP_FUNC_EN_N (0x1 << 2) > -- > 2.14.1 > -- Sean Paul, Software Engineer, Google / Chromium OS