Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2349129ybv; Fri, 14 Feb 2020 16:58:54 -0800 (PST) X-Google-Smtp-Source: APXvYqwPdxx4vICXhBD6pPiXOXol3MC/ZCxRtrRFoYy80U+IQrjsq9NG5qd2fouRSXZhPH563zhE X-Received: by 2002:a05:6808:30d:: with SMTP id i13mr3573582oie.144.1581728334096; Fri, 14 Feb 2020 16:58:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581728334; cv=none; d=google.com; s=arc-20160816; b=lZXssxWI6nPYku6tIlTeMZbsn6UPP7/R4yAPrXGy/pli3FRudFqgYfmYZ2oDYMG/JV nQXeZ8+6fmEODwhzPUPJFPHGw349lcgz0wfjWneOl1moOfSyMkvULQHPIIyiO1ZLBjlc yvV2cK1Qy72H1UeBgckjUyWRPfPINVvGWyzu2N7NHsbo4TbSQytSLYWE15KyDlSq+Zim ofTHIUNxwZjIBa8spItnsT2Hs0SO0VVNJF5bGmMc9TcqAGRph/kYOzWaA5Kjt48lAN9g JvgyOK7IJQjcBKGetZDYhGRM/0aHOWl2H3SVBob+ooeb/I+MHaEP8DlF//WsDz/Iq6yh iw8g== 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=1cKFrJvxjBZmwV8fx4PYPqMr+d+UV5RB12ZA7bxHkY0=; b=kZtpP261W/ZcjOZxeQuFIEjwwDJ0MilXZXYfdVx2BfefJK/QlzB9HxVNCeUIvhUueC Tr+ehobGChmFdUz5YUe/FOxB4xTLod/dt3fuRle1uvz9vw5qUj0ps/npBhxoAYCNzj0o PDn7YkyHvz1e8MfkYVqzAPxuYPU5stg/8WYRwH60HiRSMah4jcVOSNAaSDF2BpqFOEMz aiSgyZvN6Nm96U+Xkm2+Oef23nPuCl/181pbhbq7ThJb0D6V+RiE3WXV3Y3c10c9IFn+ Mn3LlexQf30m/LNeoqhczz0y8NG3IdjTg8GxmjJ42MdGfFayeE4Yx8rHIV2dUCgn3fLr 5XEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=TeSq9Nlz; 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 e7si4025386oti.301.2020.02.14.16.58.42; Fri, 14 Feb 2020 16:58:54 -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=TeSq9Nlz; 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 S1727888AbgBOA6G (ORCPT + 99 others); Fri, 14 Feb 2020 19:58:06 -0500 Received: from mail-qv1-f65.google.com ([209.85.219.65]:37408 "EHLO mail-qv1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727567AbgBOA6F (ORCPT ); Fri, 14 Feb 2020 19:58:05 -0500 Received: by mail-qv1-f65.google.com with SMTP id m5so5152822qvv.4 for ; Fri, 14 Feb 2020 16:58:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1cKFrJvxjBZmwV8fx4PYPqMr+d+UV5RB12ZA7bxHkY0=; b=TeSq9Nlzf7M/ZtJ8VOaje5NhgoW8Yeqrn8llHTbkbSXb5O/a1WCI5M5AZcp131CFwf 13Arnsb5ipnKvw44LV/bDy99jaw3XQ6+lrSgP3r47jcFBAANti4hct/FKSVSzETMGn1s g5c5h0yzaGpiilE+3o2Xg2CjsUeE+cvpiSA/k= 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=1cKFrJvxjBZmwV8fx4PYPqMr+d+UV5RB12ZA7bxHkY0=; b=mA8ylPqx5qKsbHoMlSDVAh9Aa8+uM7hLELj7V0y3Rb+pv8+cTiiGWRq46GelbKvu2g 6CQ5sI0jbkxi48hUzll+elt4Ua+UxCX7Wl93oUarTlnyf3dQIPP2jHHfyJObjGehHov0 fn9vI8p8lGNv00X/9iFI45nysNSQ/WsI7eCWjatse4ZcRz2uvb/WaR7R2qSIpP3ZP3N4 yFb96Tq4iIThAbHfl0mg6IJI05CH9yB8u7g4P7IMF3LDZF8ZmriXX1nSqzuG/RUcYaHA L/Ba0qD/43xegkED5IW89TPWUBNqCYd9iQK/WojS4KBM+Svyk8Paqhj4kLkrf/ViXUdb W91w== X-Gm-Message-State: APjAAAVaXMuwONsbJ5gF/rmWsH5pLiw41gyunHGGoAqB7K25Nd/W7ERj JIwhCvGJYEvpEUa54wiL9LMScjjbjsDwyCz9zHbYNjBoeXU= X-Received: by 2002:a05:6214:531:: with SMTP id x17mr4638090qvw.156.1581728284775; Fri, 14 Feb 2020 16:58:04 -0800 (PST) MIME-Version: 1.0 References: <20200213145416.890080-1-enric.balletbo@collabora.com> <20200213145416.890080-2-enric.balletbo@collabora.com> In-Reply-To: From: Nicolas Boichat Date: Sat, 15 Feb 2020 08:57:53 +0800 Message-ID: Subject: Re: [PATCH v2 2/2] drm/bridge: anx7688: Add anx7688 bridge driver support To: Vasily Khoruzhick Cc: Enric Balletbo i Serra , linux-kernel , Collabora Kernel ML , Andrzej Hajda , Matthias Brugger , Hsin-Yi Wang , Neil Armstrong , David Airlie , Jonas Karlman , dri-devel , Maxime Ripard , Thomas Gleixner , Icenowy Zheng , Jernej Skrabec , Torsten Duwe , Laurent Pinchart , Daniel Vetter 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 On Sat, Feb 15, 2020 at 5:36 AM Vasily Khoruzhick wrote: > > On Thu, Feb 13, 2020 at 6:54 AM Enric Balletbo i Serra > wrote: > > > > From: Nicolas Boichat > > > > ANX7688 is a HDMI to DP converter (as well as USB-C port controller), > > that has an internal microcontroller. > > > > The only reason a Linux kernel driver is necessary is to reject > > resolutions that require more bandwidth than what is available on > > the DP side. DP bandwidth and lane count are reported by the bridge > > via 2 registers on I2C. > > It is true only for your particular platform where usb-c part is > managed by firmware. Pinephone has the same anx7688 but linux will > need a driver that manages usb-c in addition to DP. > > I'd suggest making it MFD driver from the beginning, or at least make > proper bindings so we don't have to rework it and introduce binding > incompatibilities in future. If that helps for the binding, ANX7688 is indeed a MFD (TCPC, HDMI to DP converter, USB-C mux between USB 3.0 lanes and the DP output of the embedded converter), with 2 I2C addresses: - 0x2c is the TCPC/mux, used by the Embedded Controller [1] on Chrome OS, and the code in this patch (my understanding is that lane count/BW registers in the kernel driver below may only be available to FW on Chromebooks). - 0x28: - Used to update the embedded FW in the anx7688 (on Chrome OS we do this in depthcharge [2]). This is a EEPROM-based FW (so even without implementing this, it'll usually "just work"). - Used to workaround some TCPC issues (see [1] again). [1] EC driver: https://chromium.googlesource.com/chromiumos/platform/ec/+/refs/heads/master/driver/tcpm/anx7688.c [2] depthcharge driver to update ANX7688 FW: https://chromium.googlesource.com/chromiumos/platform/depthcharge/+/master/src/drivers/ec/anx7688/anx7688.c