From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6988DC2BB84 for ; Mon, 7 Sep 2020 08:44:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 29C7121481 for ; Mon, 7 Sep 2020 08:44:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="Sekv5nMW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728252AbgIGIob (ORCPT ); Mon, 7 Sep 2020 04:44:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726978AbgIGIo1 (ORCPT ); Mon, 7 Sep 2020 04:44:27 -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 DD8BCC061573 for ; Mon, 7 Sep 2020 01:44:26 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id o5so14835233wrn.13 for ; Mon, 07 Sep 2020 01:44:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=vCnAWdnxSr/38fyjTvOTRJxFVAmm6+c6MV2keTsd7MA=; b=Sekv5nMWTfXrdvtBSBt4tq0Y2AbxKBQri2AcmRiNB1b/6QkAYONgRhWwL6adv1U9Oy OX2jj3wgvrHe6JSVMMdbyFzCJHoLonklvzeVS7ggDhRinAxScsdt2RO/p8UzCg+atNG2 DdmRTImKPguTHk+r/2WmdHazQCI/qe2UrdAT8= 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:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to; bh=vCnAWdnxSr/38fyjTvOTRJxFVAmm6+c6MV2keTsd7MA=; b=b9+V8d7/WQ7FusUw6YSsKwz2L3i2OaaD+fpvwweM33ivAwx60KJc4LNoZXBdhUyHj3 20j6nKX4du6/fGODxE3mCLwv+CIy6hY6E1zEi0bMVCNWV8JRX4B3gPaphgR3ae+eQNJu cVzs3sRTqVTR7C3PpKqRES5NiDI8hQpyod54S7C8Chc/DNAP51a95EcRmr+JA9+Y2ueD EOVyr4miRsWV7pJ+2NiM7ODn+F+T/9FDwenk+AVpTO+ZTjajdY/71gTI9tX+QKZlPI8s B1IJNBIvi/ByJuReY/WyHtuXtGPT0G199fxHug0ULTWdTjXaUAetzjcQz8Avo/0tC6gh P7Lg== X-Gm-Message-State: AOAM531Puwfx9gpkU6hbXMxYFVnuNvFroYOa3BCQQM8YIucYn+6jOz5m XS+sVWKO1GrbvWMQinS0sUbJ2w== X-Google-Smtp-Source: ABdhPJxo0b2BioN6yS6K8NDFZRYtT7Z/wlisahbg3vMF0PpzK5nxYaIuo/QXZEQcvDOG3slBf4Dj+A== X-Received: by 2002:a5d:660f:: with SMTP id n15mr15531018wru.103.1599468265492; Mon, 07 Sep 2020 01:44:25 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id z19sm6776901wmi.3.2020.09.07.01.44.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Sep 2020 01:44:24 -0700 (PDT) Date: Mon, 7 Sep 2020 10:44:23 +0200 From: Daniel Vetter To: Neil Armstrong , dri-devel@lists.freedesktop.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 6/6] drm/meson: add support for MIPI-DSI transceiver Message-ID: <20200907084423.GW2352366@phenom.ffwll.local> Mail-Followup-To: Neil Armstrong , dri-devel@lists.freedesktop.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org References: <20200907081825.1654-1-narmstrong@baylibre.com> <20200907081825.1654-7-narmstrong@baylibre.com> <20200907084351.GV2352366@phenom.ffwll.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200907084351.GV2352366@phenom.ffwll.local> X-Operating-System: Linux phenom 5.7.0-1-amd64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 07, 2020 at 10:43:51AM +0200, Daniel Vetter wrote: > On Mon, Sep 07, 2020 at 10:18:25AM +0200, Neil Armstrong wrote: > > The Amlogic AXg SoCs embeds a Synopsys DW-MIPI-DSI transceiver (ver 1.21a), with a custom > > glue managing the IP resets, clock and data input similar to the DW-HDMI Glue on other > > Amlogic SoCs. > > > > This adds support for the Glue managing the transceiver, mimicing the init flow provided > > by Amlogic to setup the ENCl encoder, the glue, the transceiver, the digital D-PHY and the > > Analog PHY in the proper way. > > > > The DW-MIPI-DSI transceiver + D-PHY are directly clocked by the VCLK2 clock, which pixel clock > > is derived and feeds the ENCL encoder and the VIU pixel reader. > > > > An optional "MEAS" clock can be enabled to measure the delay between each vsync feeding the > > DW-MIPI-DSI transceiver. > > > > Signed-off-by: Neil Armstrong > > More dw-hdmi drivers which aren't bridges but components, and the thing is > still midlayer-y as heck :-/ *dw-dsi, but really they both work the same way and should both be fixed ... > > Can we try to fix this? There's a ton of this going on, and the more we > add the old fashioned way the harder this gets to fix up for real. > -Daniel > > > --- > > drivers/gpu/drm/meson/Kconfig | 7 + > > drivers/gpu/drm/meson/Makefile | 1 + > > drivers/gpu/drm/meson/meson_dw_mipi_dsi.c | 562 ++++++++++++++++++++++ > > 3 files changed, 570 insertions(+) > > create mode 100644 drivers/gpu/drm/meson/meson_dw_mipi_dsi.c > > > > diff --git a/drivers/gpu/drm/meson/Kconfig b/drivers/gpu/drm/meson/Kconfig > > index 9f9281dd49f8..385f6f23839b 100644 > > --- a/drivers/gpu/drm/meson/Kconfig > > +++ b/drivers/gpu/drm/meson/Kconfig > > @@ -16,3 +16,10 @@ config DRM_MESON_DW_HDMI > > default y if DRM_MESON > > select DRM_DW_HDMI > > imply DRM_DW_HDMI_I2S_AUDIO > > + > > +config DRM_MESON_DW_MIPI_DSI > > + tristate "MIPI DSI Synopsys Controller support for Amlogic Meson Display" > > + depends on DRM_MESON > > + default y if DRM_MESON > > + select DRM_DW_MIPI_DSI > > + select GENERIC_PHY_MIPI_DPHY > > diff --git a/drivers/gpu/drm/meson/Makefile b/drivers/gpu/drm/meson/Makefile > > index 28a519cdf66b..2cc870e91182 100644 > > --- a/drivers/gpu/drm/meson/Makefile > > +++ b/drivers/gpu/drm/meson/Makefile > > @@ -5,3 +5,4 @@ meson-drm-y += meson_rdma.o meson_osd_afbcd.o > > > > obj-$(CONFIG_DRM_MESON) += meson-drm.o > > obj-$(CONFIG_DRM_MESON_DW_HDMI) += meson_dw_hdmi.o > > +obj-$(CONFIG_DRM_MESON_DW_MIPI_DSI) += meson_dw_mipi_dsi.o > > diff --git a/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c b/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c > > new file mode 100644 > > index 000000000000..bbe1294fce7c > > --- /dev/null > > +++ b/drivers/gpu/drm/meson/meson_dw_mipi_dsi.c > > @@ -0,0 +1,562 @@ > > +// SPDX-License-Identifier: GPL-2.0-or-later > > +/* > > + * Copyright (C) 2016 BayLibre, SAS > > + * Author: Neil Armstrong > > + * Copyright (C) 2015 Amlogic, Inc. All rights reserved. > > + */ > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#include