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=-11.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_SANE_1 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 976F1C388F9 for ; Fri, 30 Oct 2020 22:45:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5808920796 for ; Fri, 30 Oct 2020 22:44:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725971AbgJ3Wo4 (ORCPT ); Fri, 30 Oct 2020 18:44:56 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:37096 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725780AbgJ3Woz (ORCPT ); Fri, 30 Oct 2020 18:44:55 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: koike) with ESMTPSA id 5B3261F46249 Subject: Re: [PATCH 01/14] phy: Distinguish between Rx and Tx for MIPI D-PHY with submodes To: Paul Kocialkowski , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, linux-sunxi@googlegroups.com Cc: Mauro Carvalho Chehab , Rob Herring , Maxime Ripard , Chen-Yu Tsai , Yong Deng , Kishon Vijay Abraham I , Vinod Koul , Greg Kroah-Hartman , Philipp Zabel , Hans Verkuil , Sakari Ailus , Thomas Petazzoni , Hans Verkuil , kevin.lhopital@hotmail.com References: <20201023174546.504028-1-paul.kocialkowski@bootlin.com> <20201023174546.504028-2-paul.kocialkowski@bootlin.com> From: Helen Koike Message-ID: <01d93f3a-bf97-7689-b6ac-a3cb4295195a@collabora.com> Date: Fri, 30 Oct 2020 19:44:45 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.2 MIME-Version: 1.0 In-Reply-To: <20201023174546.504028-2-paul.kocialkowski@bootlin.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Hi Paul, On 10/23/20 2:45 PM, Paul Kocialkowski wrote: > As some D-PHY controllers support both Rx and Tx mode, we need a way for > users to explicitly request one or the other. For instance, Rx mode can > be used along with MIPI CSI-2 while Tx mode can be used with MIPI DSI. > > Introduce new MIPI D-PHY PHY submodes to use with PHY_MODE_MIPI_DPHY. > The default (zero value) is kept to Tx so only the rkisp1 driver, which > uses D-PHY in Rx mode, needs to be adapted. > > Signed-off-by: Paul Kocialkowski > --- > drivers/staging/media/rkisp1/rkisp1-isp.c | 3 ++- > include/linux/phy/phy-mipi-dphy.h | 13 +++++++++++++ > 2 files changed, 15 insertions(+), 1 deletion(-) > > diff --git a/drivers/staging/media/rkisp1/rkisp1-isp.c b/drivers/staging/media/rkisp1/rkisp1-isp.c > index 6ec1e9816e9f..0afbce00121e 100644 > --- a/drivers/staging/media/rkisp1/rkisp1-isp.c > +++ b/drivers/staging/media/rkisp1/rkisp1-isp.c > @@ -902,7 +902,8 @@ static int rkisp1_mipi_csi2_start(struct rkisp1_isp *isp, > > phy_mipi_dphy_get_default_config(pixel_clock, isp->sink_fmt->bus_width, > sensor->lanes, cfg); > - phy_set_mode(sensor->dphy, PHY_MODE_MIPI_DPHY); > + phy_set_mode_ext(cdev->dphy, PHY_MODE_MIPI_DPHY, > + PHY_MIPI_DPHY_SUBMODE_RX); >From rkisp1 pov, looks good to me Acked-by: Helen Koike Regards, Helen > phy_configure(sensor->dphy, &opts); > phy_power_on(sensor->dphy); > > diff --git a/include/linux/phy/phy-mipi-dphy.h b/include/linux/phy/phy-mipi-dphy.h > index a877ffee845d..0f57ef46a8b5 100644 > --- a/include/linux/phy/phy-mipi-dphy.h > +++ b/include/linux/phy/phy-mipi-dphy.h > @@ -6,6 +6,19 @@ > #ifndef __PHY_MIPI_DPHY_H_ > #define __PHY_MIPI_DPHY_H_ > > +/** > + * enum phy_mipi_dphy_submode - MIPI D-PHY sub-mode > + * > + * A MIPI D-PHY can be used to transmit or receive data. > + * Since some controllers can support both, the direction to enable is specified > + * with the PHY sub-mode. Transmit is assumed by default with phy_set_mode. > + */ > + > +enum phy_mipi_dphy_submode { > + PHY_MIPI_DPHY_SUBMODE_TX = 0, > + PHY_MIPI_DPHY_SUBMODE_RX, > +}; > + > /** > * struct phy_configure_opts_mipi_dphy - MIPI D-PHY configuration set > * >