Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1920590ioo; Mon, 23 May 2022 06:20:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4Schw5thuhmVUdT10/pO1a9FL+fPbc2rMIzAP7TjzO4tODCJPtm+0oP3HHqbc2Pkrggem X-Received: by 2002:a65:690a:0:b0:3f6:1815:f542 with SMTP id s10-20020a65690a000000b003f61815f542mr20483781pgq.275.1653312045660; Mon, 23 May 2022 06:20:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653312045; cv=none; d=google.com; s=arc-20160816; b=G7W9Nx30gy9TWtWR3WxqyX6x4G2CCqppSmMsimFMuBpqFAdC1ap9RXOb/72CvAa3Hl CNwbcTG6olMzwoalJf36wCvXzuNthDB3mInjChj4vwCMx9wQ98o8gcrfHJDxaSc+ej9U mpqXEEmK+SDwTm1XIMRLHoWacxNlekfKA38FrxLPEmkxDmuxh0Qx+xlA2xfhqrECQWCx XKjgBi/RwqWG9Pb4UmO+qDCwj24CZjnW3jzg9et18vzgdUPvLJ5ygJ1Xw8u5KcK3OHGC zsyv6ywG4bODTUaZlif0rFNES3kBR0w2v3ja85/EuIhSmpefZPF3pphmGyc/rmOr87Wu wFlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=IEQmaNNUUGULv1/BZVbeKyFXlK9ef3Jq4e2jfX8ne/8=; b=qdBTk0LT1okZQF13mMARyONWBcex/9CroOzQ+qiCsnLyYDk5tdw499wWoqSFleIq+I IOkgo01OgTXoBWnimohzHb4+bFBkBpsxnTmMh0b7B8WANFyUVX42GujT95IRAQPg/VjG bk4uyYOSa8zqFsI28v51t1RB6Hn1pLnUyp67pRYnN0MoU7lpOX0J5PLOCMEPilr6tJV1 TB4oVyStpVl/vwp5qiUsK/EGJQLDXQV9XjPcOPZycHxZZXgKj/rHdYqpJ3o4i8JI0jml 1HrCyFEqzbPr6YZqhoNbGRYp3oP+nGsQmBve6JFuA/DhXxYmv0asFXYiK3BQ77JrOy4g 7IzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ITSEKXkN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id gf17-20020a17090ac7d100b001df4ea7a026si12936370pjb.34.2022.05.23.06.20.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 06:20:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ITSEKXkN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CFE4B326D0; Mon, 23 May 2022 06:20:39 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236066AbiEWNUd (ORCPT + 99 others); Mon, 23 May 2022 09:20:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236015AbiEWNU3 (ORCPT ); Mon, 23 May 2022 09:20:29 -0400 Received: from mail-yw1-x1134.google.com (mail-yw1-x1134.google.com [IPv6:2607:f8b0:4864:20::1134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73FF12CE3B for ; Mon, 23 May 2022 06:20:27 -0700 (PDT) Received: by mail-yw1-x1134.google.com with SMTP id 00721157ae682-2fee9fe48c2so147901407b3.3 for ; Mon, 23 May 2022 06:20:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IEQmaNNUUGULv1/BZVbeKyFXlK9ef3Jq4e2jfX8ne/8=; b=ITSEKXkNy+WkGjl07bzn1gW5tL8hFVuZo8CtHyHMxj15PrnXlzwJblUdMJq6Kw2A7I dWxzl45wH+L3Yc+lAztbclYUd1sx65t9cGSABKZ224wmI+GWKh1WBmD2h23j+jr9lwNW FreG9cvmggglYolcLKnAUHGgdx1VRBaoHb6g9WHO+X4ql5N7l380/Zt5bwHK4T/mhGNT i4WXXUQlxOMDSanxAjHHeBJxssoK3aCEYx0BniRLdps+Xbi1h/3KjXUEBjBCfuRIJx3H MwPbhYulG2vMVrmUKPD/U/uXHK/B00Aau3v6V6FkteTXR4pT94cVc1dvUqFYUC7YqN7j yIIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IEQmaNNUUGULv1/BZVbeKyFXlK9ef3Jq4e2jfX8ne/8=; b=NM4EJMzGc5zpeqJyq7qeandQIe3X/bh/cNlD/me7Wsvkc1jBo73Kpp9Uh28zHOKri8 WQzuoHzjZtdk/McAGgKhw916PrP1I6zjFhTx13pD46T/JA83GgNabyCaINbRmv/wGaAW UCjKmP+Kl/ayI5KhH8aSpR3nU2//yRiUmptqMDdwZUEYKjACJn/J0TPkyXANU61JhWDx cwTs1caBi/jv9v/14RGvUE+Or0YMQBwzIDTrSI/CNhho88rw6Nlkq0lpaw6ZyELV4akR ypN4w/aPiLJ0G6zVfwAsK9n0o7GsD7xGnrSVKnNmB+CYB3u4UqX9IHCV9ygquyXMlDpy fDGw== X-Gm-Message-State: AOAM531Y+bRs5BeYZ+b7a4rjGBPVRS6OWGPBflbWrzPDCt5sYhd5BpEw TGTRqKM1xWv08jWOtp7uGCoGcBLV1phZZjdE2L4= X-Received: by 2002:a81:d4a:0:b0:2ff:1edb:7492 with SMTP id 71-20020a810d4a000000b002ff1edb7492mr22660737ywn.58.1653312026778; Mon, 23 May 2022 06:20:26 -0700 (PDT) MIME-Version: 1.0 References: <20220523130144.444225-1-net147@gmail.com> <868d010c-9fca-3fac-7657-faaa2f271c14@denx.de> In-Reply-To: <868d010c-9fca-3fac-7657-faaa2f271c14@denx.de> From: Jonathan Liu Date: Mon, 23 May 2022 23:20:15 +1000 Message-ID: Subject: Re: [PATCH v2] drm: bridge: icn6211: Adjust clock phase using SYS_CTRL_1 To: Marek Vasut Cc: dri-devel , Maxime Ripard , Jagan Teki , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , linux-kernel Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Marek, On Mon, 23 May 2022 at 23:15, Marek Vasut wrote: > > On 5/23/22 15:01, Jonathan Liu wrote: > > The code from [1] sets SYS_CTRL_1 to different values depending on the > > desired clock phase (0, 1/4, 1/2 or 3/4). A clock phase of 0 aligns the > > positive edge of the clock with the pixel data while other values delay > > the clock by a fraction of the clock period. A clock phase of 1/2 aligns > > the negative edge of the clock with the pixel data. > > > > The driver currently hard codes SYS_CTRL_1 to 0x88 which corresponds to > > aligning the positive edge of the clock with the pixel data. This won't > > work correctly for panels that require aligning the negative edge of the > > clock with the pixel data. > > > > Adjust the clock phase to 0 if DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE is > > present in bus_flags, otherwise adjust the clock phase to 1/2 as > > appropriate for DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE. > > > > [1] https://github.com/tdjastrzebski/ICN6211-Configurator > > > > Signed-off-by: Jonathan Liu > > --- > > V2: Use GENMASK and FIELD_PREP macros > > --- > > drivers/gpu/drm/bridge/chipone-icn6211.c | 18 ++++++++++++++++-- > > 1 file changed, 16 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/gpu/drm/bridge/chipone-icn6211.c b/drivers/gpu/drm/bridge/chipone-icn6211.c > > index 47dea657a752..f1538fb5f8a9 100644 > > --- a/drivers/gpu/drm/bridge/chipone-icn6211.c > > +++ b/drivers/gpu/drm/bridge/chipone-icn6211.c > > @@ -9,6 +9,8 @@ > > #include > > #include > > > > +#include > > +#include > > #include > > #include > > #include > > @@ -26,6 +28,11 @@ > > #define PD_CTRL(n) (0x0a + ((n) & 0x3)) /* 0..3 */ > > #define RST_CTRL(n) (0x0e + ((n) & 0x1)) /* 0..1 */ > > #define SYS_CTRL(n) (0x10 + ((n) & 0x7)) /* 0..4 */ > > +#define SYS_CTRL_1_CLK_PHASE_MSK GENMASK(5, 4) > > This should be GENMASK(7, 6) , no ? Clock phase 0 = 0b_1000_1000 = 0x88 Clock phase 1/4 = 0b_1001_1000 = 0x98 Clock phase 1/2 = 0b_1010_1000 = 0xA8 Clock phase 3/4 = 0b_1011_1000 = 0xB8 The clock phase bits are 5:4 not 7:6. The upper 2 bits and lower 4 bits are unknown. Regards, Jonathan