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=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS 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 9B5A6C433E0 for ; Thu, 28 May 2020 19:57:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6B8D32088E for ; Thu, 28 May 2020 19:57:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590695849; bh=WdjZb2iePlc27XuysorsJpBilXlRt3WRFcZxlXNQpY0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=e8VZ4hgHPjsvBi0RjXWEgGzb9wYlS/Qr594A4cqRBE8UjjlA4QFVxiuMb3/sZKpaV 5VyKfXR3pMpEycXKnHsPcEHt0gW9U6GXLNFM7l8zQwi9ip4acvKRIvCaWxROmQE1fk d2DTvcHIRwXR67hAH7QH3t0Cg+6fYzS0TfjbD408= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406808AbgE1T5Z (ORCPT ); Thu, 28 May 2020 15:57:25 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:41138 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406687AbgE1T5V (ORCPT ); Thu, 28 May 2020 15:57:21 -0400 Received: by mail-io1-f67.google.com with SMTP id o5so31455633iow.8; Thu, 28 May 2020 12:57:20 -0700 (PDT) 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; bh=C1yxG+5EPv3E4hC3r9qMne3qQ1WLqR3rVkfPRz5Lf7A=; b=KESz+RH2pOl6VIua9FOmCwgjXTqa/IlGXvkhr/5sIjnxjGZcajx8n/DdcRahir1pNZ QGWRHNy9T56tdSGNG9vqBBWa7f3YMi2Yv2wGwaF5L6wc26mvbACoDFpzU4CDYDCoYqx0 6TeQaEPqSBV180LS97zQwM5e8rLihY3M49B25xR7geoWFLHleqYepOUDxDOw62vsxGzH uNqnLbNJ9p7Ca+5NuF1y+V0MisGajxt9gNYIJlOr0nKHZr4PvmigIuNr7bvGTvFHazQQ BiNOUN8i3vlq/6jWSI++U+FSkLMsUpfAM1QcFgbhjgQaRWAxLvbSEaeUljwG7uAjWGWp MvAw== X-Gm-Message-State: AOAM531NRScDwHC6KOcBYPgIWDpiKv4pzpSYLo1oFi59pUYlbRL3xgPK qu2E/vj1NMw2ctDLj5fqjA== X-Google-Smtp-Source: ABdhPJwSH+qxIcWv8h/fKAo6SOTAQdcOfw2m0OYWjSIpa6W5m47BsalTXqPIM9X9CbE4u2CeC3MeOw== X-Received: by 2002:a02:95a6:: with SMTP id b35mr4047016jai.40.1590695839998; Thu, 28 May 2020 12:57:19 -0700 (PDT) Received: from xps15 ([64.188.179.252]) by smtp.gmail.com with ESMTPSA id b18sm3627485ilh.77.2020.05.28.12.57.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 May 2020 12:57:19 -0700 (PDT) Received: (nullmailer pid 580805 invoked by uid 1000); Thu, 28 May 2020 19:57:17 -0000 Date: Thu, 28 May 2020 13:57:17 -0600 From: Rob Herring To: Guido =?iso-8859-1?Q?G=FCnther?= Cc: Laurent Pinchart , David Airlie , Daniel Vetter , Shawn Guo , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Andrzej Hajda , Sam Ravnborg , Anson Huang , Leonard Crestez , Lucas Stach , Peng Fan , Robert Chiras , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [RFC PATCH 4/6] drm/bridge/nwl-dsi: Drop mux handling Message-ID: <20200528195717.GA568887@bogus> References: <951688795f969ebcbf9fb3c38065ccce6f488235.1589548223.git.agx@sigxcpu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <951688795f969ebcbf9fb3c38065ccce6f488235.1589548223.git.agx@sigxcpu.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 15, 2020 at 03:12:13PM +0200, Guido Günther wrote: > This will be handled via the mux-input-bridge. You can't do this. What happens booting a kernel with this change and an un-modified dtb? You just broke it. > > Signed-off-by: Guido Günther > --- > drivers/gpu/drm/bridge/Kconfig | 1 - > drivers/gpu/drm/bridge/nwl-dsi.c | 61 -------------------------------- > 2 files changed, 62 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig > index 3886c0f41bdd..11444f841e35 100644 > --- a/drivers/gpu/drm/bridge/Kconfig > +++ b/drivers/gpu/drm/bridge/Kconfig > @@ -78,7 +78,6 @@ config DRM_NWL_MIPI_DSI > select DRM_PANEL_BRIDGE > select GENERIC_PHY_MIPI_DPHY > select MFD_SYSCON > - select MULTIPLEXER > select REGMAP_MMIO > help > This enables the Northwest Logic MIPI DSI Host controller as > diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nwl-dsi.c > index b14d725bf609..8839f333f39c 100644 > --- a/drivers/gpu/drm/bridge/nwl-dsi.c > +++ b/drivers/gpu/drm/bridge/nwl-dsi.c > @@ -12,7 +12,6 @@ > #include > #include > #include > -#include > #include > #include > #include > @@ -44,9 +43,6 @@ enum transfer_direction { > DSI_PACKET_RECEIVE, > }; > > -#define NWL_DSI_ENDPOINT_LCDIF 0 > -#define NWL_DSI_ENDPOINT_DCSS 1 > - > struct nwl_dsi_plat_clk_config { > const char *id; > struct clk *clk; > @@ -94,7 +90,6 @@ struct nwl_dsi { > struct reset_control *rst_esc; > struct reset_control *rst_dpi; > struct reset_control *rst_pclk; > - struct mux_control *mux; > > /* DSI clocks */ > struct clk *phy_ref_clk; > @@ -1018,14 +1013,6 @@ static int nwl_dsi_parse_dt(struct nwl_dsi *dsi) > } > dsi->tx_esc_clk = clk; > > - dsi->mux = devm_mux_control_get(dsi->dev, NULL); > - if (IS_ERR(dsi->mux)) { > - ret = PTR_ERR(dsi->mux); > - if (ret != -EPROBE_DEFER) > - DRM_DEV_ERROR(dsi->dev, "Failed to get mux: %d\n", ret); > - return ret; > - } > - > base = devm_platform_ioremap_resource(pdev, 0); > if (IS_ERR(base)) > return PTR_ERR(base); > @@ -1073,47 +1060,6 @@ static int nwl_dsi_parse_dt(struct nwl_dsi *dsi) > return 0; > } > > -static int nwl_dsi_select_input(struct nwl_dsi *dsi) > -{ > - struct device_node *remote; > - u32 use_dcss = 1; > - int ret; > - > - remote = of_graph_get_remote_node(dsi->dev->of_node, 0, > - NWL_DSI_ENDPOINT_LCDIF); > - if (remote) { > - use_dcss = 0; > - } else { > - remote = of_graph_get_remote_node(dsi->dev->of_node, 0, > - NWL_DSI_ENDPOINT_DCSS); > - if (!remote) { > - DRM_DEV_ERROR(dsi->dev, > - "No valid input endpoint found\n"); > - return -EINVAL; > - } > - } > - > - DRM_DEV_INFO(dsi->dev, "Using %s as input source\n", > - (use_dcss) ? "DCSS" : "LCDIF"); > - ret = mux_control_try_select(dsi->mux, use_dcss); > - if (ret < 0) > - DRM_DEV_ERROR(dsi->dev, "Failed to select input: %d\n", ret); > - > - of_node_put(remote); > - return ret; > -} You could however make these functions generic for any bridge to use. Define a function that checks for mux-control property and if found sets up the mux (IIRC, there's already a concept of a default state). That should be callable from somewhere generic too. Rob 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=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,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 024F8C433DF for ; Thu, 28 May 2020 19:57:35 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C8D1E206C3 for ; Thu, 28 May 2020 19:57:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="VLOzTLRM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C8D1E206C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0V87jU2+zZ7YGCKFsWyCJL0yOH4T68bfnEI/bEbuaic=; b=VLOzTLRMPJoTKO gJXaonXdfHfAfLRk/sB8cmesPlQD3k0coHaOAnM+GRLj/HW/c+z3uxtZCNJYpWUn7BbR8pm5etp5p hznz6DjphHmPuAhrpTIqh1amLb7oFPKzitz3BPbaUvrcG7hRhR5xxU0RYLpvXT4ccv6LM+F7gFXuV kWHz7eFQI/IO9h6BrPq9AiLtNPASwFi5wOtNd+zzQYd1S2UY9MVokR4s6uoK93vzEYpDac+KucNvM 5XzPeoYtwb0Iu2T2Jt3zMyfmTY4OQef2sr5EfTSEUPyB8YBEiYW6j6MkyjjvC7AI2Lx6+k5kEfXmV 0bWC6w+GrwySs/LV7evQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jeOec-0003vX-66; Thu, 28 May 2020 19:57:26 +0000 Received: from mail-io1-f68.google.com ([209.85.166.68]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jeOeY-0003um-HR for linux-arm-kernel@lists.infradead.org; Thu, 28 May 2020 19:57:23 +0000 Received: by mail-io1-f68.google.com with SMTP id q8so30098097iow.7 for ; Thu, 28 May 2020 12:57:20 -0700 (PDT) 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; bh=C1yxG+5EPv3E4hC3r9qMne3qQ1WLqR3rVkfPRz5Lf7A=; b=l1xBETaNToj+5fDpl135iwmJVUFdKrwDX1fb8Ik35/N2z2KsCAhqzvvNNhpLI6Ibq9 jt+pg6c9HPK1lki0nS64Ha3kvBAfxIjsTjZYyFh2x16acOCgxD6wiafetfrKxi+Jy0bH F4AUfudrtbncPSe9x8idZr/SKqGW4FuHEWXB/VDo52PF/HIdmGMzF44bgRA2JhbGkgHg mL/tfGlVoXwpppMQUWk2S5S1RUE0Etrbd/NT3uoL2TFKxYw9C+3Z8pQ1SLZzZ14tEFZg 0VXM8/0S4LMMEqd1XOy/MGiQ6sERLfRDF8vNnzG8zp0k+qEFiMnWZ0EwwsR2Ls4TrriD fkKw== X-Gm-Message-State: AOAM532kpGy58RMlzVRDlCsWZxPyz+5UGKIyqvocAR1vh5WC+oYS+yjt ARjdyTJFF5F7BRZ/fBXQyA== X-Google-Smtp-Source: ABdhPJwSH+qxIcWv8h/fKAo6SOTAQdcOfw2m0OYWjSIpa6W5m47BsalTXqPIM9X9CbE4u2CeC3MeOw== X-Received: by 2002:a02:95a6:: with SMTP id b35mr4047016jai.40.1590695839998; Thu, 28 May 2020 12:57:19 -0700 (PDT) Received: from xps15 ([64.188.179.252]) by smtp.gmail.com with ESMTPSA id b18sm3627485ilh.77.2020.05.28.12.57.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 May 2020 12:57:19 -0700 (PDT) Received: (nullmailer pid 580805 invoked by uid 1000); Thu, 28 May 2020 19:57:17 -0000 Date: Thu, 28 May 2020 13:57:17 -0600 From: Rob Herring To: Guido =?iso-8859-1?Q?G=FCnther?= Subject: Re: [RFC PATCH 4/6] drm/bridge/nwl-dsi: Drop mux handling Message-ID: <20200528195717.GA568887@bogus> References: <951688795f969ebcbf9fb3c38065ccce6f488235.1589548223.git.agx@sigxcpu.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <951688795f969ebcbf9fb3c38065ccce6f488235.1589548223.git.agx@sigxcpu.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200528_125722_577675_25741BF7 X-CRM114-Status: GOOD ( 17.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Peng Fan , Pengutronix Kernel Team , Sam Ravnborg , Anson Huang , David Airlie , Shawn Guo , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Andrzej Hajda , Laurent Pinchart , Daniel Vetter , Lucas Stach , Robert Chiras , Leonard Crestez , Fabio Estevam , linux-arm-kernel@lists.infradead.org, NXP Linux Team Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, May 15, 2020 at 03:12:13PM +0200, Guido G=FCnther wrote: > This will be handled via the mux-input-bridge. You can't do this. What happens booting a kernel with this change and an = un-modified dtb? You just broke it. > = > Signed-off-by: Guido G=FCnther > --- > drivers/gpu/drm/bridge/Kconfig | 1 - > drivers/gpu/drm/bridge/nwl-dsi.c | 61 -------------------------------- > 2 files changed, 62 deletions(-) > = > diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kcon= fig > index 3886c0f41bdd..11444f841e35 100644 > --- a/drivers/gpu/drm/bridge/Kconfig > +++ b/drivers/gpu/drm/bridge/Kconfig > @@ -78,7 +78,6 @@ config DRM_NWL_MIPI_DSI > select DRM_PANEL_BRIDGE > select GENERIC_PHY_MIPI_DPHY > select MFD_SYSCON > - select MULTIPLEXER > select REGMAP_MMIO > help > This enables the Northwest Logic MIPI DSI Host controller as > diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nw= l-dsi.c > index b14d725bf609..8839f333f39c 100644 > --- a/drivers/gpu/drm/bridge/nwl-dsi.c > +++ b/drivers/gpu/drm/bridge/nwl-dsi.c > @@ -12,7 +12,6 @@ > #include > #include > #include > -#include > #include > #include > #include > @@ -44,9 +43,6 @@ enum transfer_direction { > DSI_PACKET_RECEIVE, > }; > = > -#define NWL_DSI_ENDPOINT_LCDIF 0 > -#define NWL_DSI_ENDPOINT_DCSS 1 > - > struct nwl_dsi_plat_clk_config { > const char *id; > struct clk *clk; > @@ -94,7 +90,6 @@ struct nwl_dsi { > struct reset_control *rst_esc; > struct reset_control *rst_dpi; > struct reset_control *rst_pclk; > - struct mux_control *mux; > = > /* DSI clocks */ > struct clk *phy_ref_clk; > @@ -1018,14 +1013,6 @@ static int nwl_dsi_parse_dt(struct nwl_dsi *dsi) > } > dsi->tx_esc_clk =3D clk; > = > - dsi->mux =3D devm_mux_control_get(dsi->dev, NULL); > - if (IS_ERR(dsi->mux)) { > - ret =3D PTR_ERR(dsi->mux); > - if (ret !=3D -EPROBE_DEFER) > - DRM_DEV_ERROR(dsi->dev, "Failed to get mux: %d\n", ret); > - return ret; > - } > - > base =3D devm_platform_ioremap_resource(pdev, 0); > if (IS_ERR(base)) > return PTR_ERR(base); > @@ -1073,47 +1060,6 @@ static int nwl_dsi_parse_dt(struct nwl_dsi *dsi) > return 0; > } > = > -static int nwl_dsi_select_input(struct nwl_dsi *dsi) > -{ > - struct device_node *remote; > - u32 use_dcss =3D 1; > - int ret; > - > - remote =3D of_graph_get_remote_node(dsi->dev->of_node, 0, > - NWL_DSI_ENDPOINT_LCDIF); > - if (remote) { > - use_dcss =3D 0; > - } else { > - remote =3D of_graph_get_remote_node(dsi->dev->of_node, 0, > - NWL_DSI_ENDPOINT_DCSS); > - if (!remote) { > - DRM_DEV_ERROR(dsi->dev, > - "No valid input endpoint found\n"); > - return -EINVAL; > - } > - } > - > - DRM_DEV_INFO(dsi->dev, "Using %s as input source\n", > - (use_dcss) ? "DCSS" : "LCDIF"); > - ret =3D mux_control_try_select(dsi->mux, use_dcss); > - if (ret < 0) > - DRM_DEV_ERROR(dsi->dev, "Failed to select input: %d\n", ret); > - > - of_node_put(remote); > - return ret; > -} You could however make these functions generic for any bridge to use. = Define a function that checks for mux-control property and if found sets = up the mux (IIRC, there's already a concept of a default state). That = should be callable from somewhere generic too. Rob _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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=-7.0 required=3.0 tests=INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 0B9D9C433DF for ; Thu, 28 May 2020 19:57:23 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D8179206C3 for ; Thu, 28 May 2020 19:57:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D8179206C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5F3BC6E201; Thu, 28 May 2020 19:57:22 +0000 (UTC) Received: from mail-io1-f66.google.com (mail-io1-f66.google.com [209.85.166.66]) by gabe.freedesktop.org (Postfix) with ESMTPS id AB22E6E201 for ; Thu, 28 May 2020 19:57:20 +0000 (UTC) Received: by mail-io1-f66.google.com with SMTP id j8so31468301iog.13 for ; Thu, 28 May 2020 12:57:20 -0700 (PDT) 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; bh=C1yxG+5EPv3E4hC3r9qMne3qQ1WLqR3rVkfPRz5Lf7A=; b=ljx9dXRHcgrzCWkmHPi9SlbQ5EfIDq8/LRBgoDXHY9QktpvUIpw+yGeqA/QeV4/QWl wc7Wf2KLZIKPRra4TTpRX5PFWlUyCQ0+SitniDqWo1+1WDy6ejrHoaKOwTo888PwLvkB TBpWrcOUXd+DvAZ2//f4CgvraUaPCounvJG/1fV/yo0JOYybPrMleqXJXFCSSDuZ7ONy /ohk7Y8z3Q7JlH/Kbms/ZDgLYwlG386YvpbFvbQy1zfODm2xZdEKAaFo889yNsdN62Nl bckxtL02xnV5NXPWt4tKnbD1QoBVRr2+NGRjmrIryxZepsOdTHVqO8xR1sxvKymI7saD k0Ew== X-Gm-Message-State: AOAM5331vg4AyyjfroiqGH5KHT1n4ka6gujjAkUYnosoSZOVDPQ59bhy nTs5m8Fg32nlL18qKtGavg== X-Google-Smtp-Source: ABdhPJwSH+qxIcWv8h/fKAo6SOTAQdcOfw2m0OYWjSIpa6W5m47BsalTXqPIM9X9CbE4u2CeC3MeOw== X-Received: by 2002:a02:95a6:: with SMTP id b35mr4047016jai.40.1590695839998; Thu, 28 May 2020 12:57:19 -0700 (PDT) Received: from xps15 ([64.188.179.252]) by smtp.gmail.com with ESMTPSA id b18sm3627485ilh.77.2020.05.28.12.57.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 May 2020 12:57:19 -0700 (PDT) Received: (nullmailer pid 580805 invoked by uid 1000); Thu, 28 May 2020 19:57:17 -0000 Date: Thu, 28 May 2020 13:57:17 -0600 From: Rob Herring To: Guido =?iso-8859-1?Q?G=FCnther?= Subject: Re: [RFC PATCH 4/6] drm/bridge/nwl-dsi: Drop mux handling Message-ID: <20200528195717.GA568887@bogus> References: <951688795f969ebcbf9fb3c38065ccce6f488235.1589548223.git.agx@sigxcpu.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <951688795f969ebcbf9fb3c38065ccce6f488235.1589548223.git.agx@sigxcpu.org> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Peng Fan , Sam Ravnborg , Anson Huang , David Airlie , Shawn Guo , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Andrzej Hajda , Laurent Pinchart , Pengutronix Kernel Team , Robert Chiras , Leonard Crestez , linux-arm-kernel@lists.infradead.org, NXP Linux Team Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Fri, May 15, 2020 at 03:12:13PM +0200, Guido G=FCnther wrote: > This will be handled via the mux-input-bridge. You can't do this. What happens booting a kernel with this change and an = un-modified dtb? You just broke it. > = > Signed-off-by: Guido G=FCnther > --- > drivers/gpu/drm/bridge/Kconfig | 1 - > drivers/gpu/drm/bridge/nwl-dsi.c | 61 -------------------------------- > 2 files changed, 62 deletions(-) > = > diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kcon= fig > index 3886c0f41bdd..11444f841e35 100644 > --- a/drivers/gpu/drm/bridge/Kconfig > +++ b/drivers/gpu/drm/bridge/Kconfig > @@ -78,7 +78,6 @@ config DRM_NWL_MIPI_DSI > select DRM_PANEL_BRIDGE > select GENERIC_PHY_MIPI_DPHY > select MFD_SYSCON > - select MULTIPLEXER > select REGMAP_MMIO > help > This enables the Northwest Logic MIPI DSI Host controller as > diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c b/drivers/gpu/drm/bridge/nw= l-dsi.c > index b14d725bf609..8839f333f39c 100644 > --- a/drivers/gpu/drm/bridge/nwl-dsi.c > +++ b/drivers/gpu/drm/bridge/nwl-dsi.c > @@ -12,7 +12,6 @@ > #include > #include > #include > -#include > #include > #include > #include > @@ -44,9 +43,6 @@ enum transfer_direction { > DSI_PACKET_RECEIVE, > }; > = > -#define NWL_DSI_ENDPOINT_LCDIF 0 > -#define NWL_DSI_ENDPOINT_DCSS 1 > - > struct nwl_dsi_plat_clk_config { > const char *id; > struct clk *clk; > @@ -94,7 +90,6 @@ struct nwl_dsi { > struct reset_control *rst_esc; > struct reset_control *rst_dpi; > struct reset_control *rst_pclk; > - struct mux_control *mux; > = > /* DSI clocks */ > struct clk *phy_ref_clk; > @@ -1018,14 +1013,6 @@ static int nwl_dsi_parse_dt(struct nwl_dsi *dsi) > } > dsi->tx_esc_clk =3D clk; > = > - dsi->mux =3D devm_mux_control_get(dsi->dev, NULL); > - if (IS_ERR(dsi->mux)) { > - ret =3D PTR_ERR(dsi->mux); > - if (ret !=3D -EPROBE_DEFER) > - DRM_DEV_ERROR(dsi->dev, "Failed to get mux: %d\n", ret); > - return ret; > - } > - > base =3D devm_platform_ioremap_resource(pdev, 0); > if (IS_ERR(base)) > return PTR_ERR(base); > @@ -1073,47 +1060,6 @@ static int nwl_dsi_parse_dt(struct nwl_dsi *dsi) > return 0; > } > = > -static int nwl_dsi_select_input(struct nwl_dsi *dsi) > -{ > - struct device_node *remote; > - u32 use_dcss =3D 1; > - int ret; > - > - remote =3D of_graph_get_remote_node(dsi->dev->of_node, 0, > - NWL_DSI_ENDPOINT_LCDIF); > - if (remote) { > - use_dcss =3D 0; > - } else { > - remote =3D of_graph_get_remote_node(dsi->dev->of_node, 0, > - NWL_DSI_ENDPOINT_DCSS); > - if (!remote) { > - DRM_DEV_ERROR(dsi->dev, > - "No valid input endpoint found\n"); > - return -EINVAL; > - } > - } > - > - DRM_DEV_INFO(dsi->dev, "Using %s as input source\n", > - (use_dcss) ? "DCSS" : "LCDIF"); > - ret =3D mux_control_try_select(dsi->mux, use_dcss); > - if (ret < 0) > - DRM_DEV_ERROR(dsi->dev, "Failed to select input: %d\n", ret); > - > - of_node_put(remote); > - return ret; > -} You could however make these functions generic for any bridge to use. = Define a function that checks for mux-control property and if found sets = up the mux (IIRC, there's already a concept of a default state). That = should be callable from somewhere generic too. Rob _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel