Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp221814rdb; Thu, 19 Oct 2023 02:27:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEct4G1o27pMqyQc/m3sjfOxCR66Q92+NcNZRo5d9c7daL/Ger9Zk3HAiSRu8Rr5Rn1VhXj X-Received: by 2002:a05:6358:cb14:b0:166:b17c:bbbd with SMTP id gr20-20020a056358cb1400b00166b17cbbbdmr1518505rwb.17.1697707626719; Thu, 19 Oct 2023 02:27:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697707626; cv=none; d=google.com; s=arc-20160816; b=KqFCEjyopqyTh1x6dkhPJO6G2j6vyn/mB5NH/qiKmvMBewoPpE1JQlUTzxHq6yYbjk zOCzne2hQV+xw6cTDyi1KLW5AhomCOAFrDkFiKtOEWeftuvJ758uP8WaeIqVlisZ3trY xNIGuu1rUSPhddV32Vmjr5yP22neAvv9kI5XyXQCa3r386or4xHPj5EliM4SQaaj6yT3 W3emNX1W5gclEAY2De95KqpOkJf6y+DvKUL8VFLMng5Qly/4KCLD/fRtCu63QojU9H2u jzopP0/1JytWIT3y3HcMpKM1h/+bZ7y10gruNsN4w/59noQ8G2VqXThRnzY9KJ25aOpo MiAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=0jCQeIIOH3UM0ijGfzKqh4MyCHfj3vLA9NmNrQBAfiU=; fh=UQMESVpC62xRFvSH1+uDf1FFPPoGfmiJd3O8oCYromw=; b=iWsMYPwvjDoMLVz45MXPf/VlLaHLPab8CUaqFwmFpHmpyIhT2BtSvLJZ+XRYqQhifP DLqAz98vjCivzM00JAPtC0+xfL928pcfZ0N31OmWNTPriTk54Ws3CJUdpgAM7jadeuix Xm40r4mT9VYFuIerTTk9oBgPSSJKo115+dG7PMofkHPH0G1sIiFLJ9j1spq2inDkHKMg 8f1W6qj2uRBBqY6di3y669UO1BA31rkB9lb+9S41YaT4jxKurB3TJCbjG9Av/iH0th10 SsDPWjZQwA3/Tdub9LLTJWV0/Zp7JCIU27oA4WoxIdApHnHn2+QPgangVcBFzZEWwkOW LgCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=q9FqAg7Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id k77-20020a628450000000b0068e380c3654si5719738pfd.395.2023.10.19.02.27.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 02:27:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=q9FqAg7Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id B42F9809B092; Thu, 19 Oct 2023 02:27:03 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345070AbjJSJ0b (ORCPT + 99 others); Thu, 19 Oct 2023 05:26:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345035AbjJSJ01 (ORCPT ); Thu, 19 Oct 2023 05:26:27 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8B67106; Thu, 19 Oct 2023 02:26:25 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B766EC433C7; Thu, 19 Oct 2023 09:26:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697707585; bh=OCDUlYLWKH4hPIGJgGmkgyAHhL7/848MWsrLLQz3nbQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=q9FqAg7Z6b7b6Q+l58S5MAWVseQF0hpk4HZJmu/Hy2hgyt/hquWS//yFAFbJPXpcG X4hOWD8y7KfJVGQ/eQL4O5JNMKRj8HKmPlKLZX5i8buLhzX+9g7jHDRGrLj9JjUTPX DQrBMOOppV2i/G26YN4EKlDl3ibLcvVPJrTOGb4tYc3VFUZMCRBRlVqkw99uabprEt SY0NBKCLqyNNgfC5G2jzbL1q7AYVrU6c8WN/+g30iejbiE4ZvhdsbR67AfG22oI3Ym h0G4t60zOQjJPH4PS9JSY8nlfZC889dgSie0TKOnqdIF9FI+Fla58dEyHFqqmZUjZv r/6eOlbpmKpvg== Date: Thu, 19 Oct 2023 11:26:16 +0200 From: Maxime Ripard To: Dmitry Baryshkov Cc: Dave Stevenson , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Douglas Anderson , Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , Konrad Dybcio , Jessica Zhang , Marek Vasut , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org Subject: Re: [RFC PATCH 03/10] drm/mipi-dsi: add API for manual control over the DSI link power state Message-ID: <7e4ak4e77fp5dat2aopyq3g4wnqu3tt7di7ytdr3dvgjviyhrd@vqiqx6iso6vg> References: <20231016165355.1327217-1-dmitry.baryshkov@linaro.org> <20231016165355.1327217-4-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20231016165355.1327217-4-dmitry.baryshkov@linaro.org> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 19 Oct 2023 02:27:04 -0700 (PDT) On Mon, Oct 16, 2023 at 07:53:48PM +0300, Dmitry Baryshkov wrote: > The MIPI DSI links do not fully fall into the DRM callbacks model. Explaining why would help > The drm_bridge_funcs abstraction. Is there a typo or missing words? > Instead of having just two states (off and on) the DSI hosts have > separate LP-11 state. In this state the host is on, but the video > stream is not yet enabled. >=20 > Introduce API that allows DSI bridges / panels to control the DSI host > power up state. >=20 > Signed-off-by: Dmitry Baryshkov > --- > drivers/gpu/drm/drm_mipi_dsi.c | 31 +++++++++++++++++++++++++++++++ > include/drm/drm_mipi_dsi.h | 29 +++++++++++++++++++++++++---- > 2 files changed, 56 insertions(+), 4 deletions(-) >=20 > diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_ds= i.c > index 14201f73aab1..c467162cb7d8 100644 > --- a/drivers/gpu/drm/drm_mipi_dsi.c > +++ b/drivers/gpu/drm/drm_mipi_dsi.c > @@ -428,6 +428,37 @@ int devm_mipi_dsi_attach(struct device *dev, > } > EXPORT_SYMBOL_GPL(devm_mipi_dsi_attach); > =20 > +bool mipi_dsi_host_power_control_available(struct mipi_dsi_host *host) > +{ > + const struct mipi_dsi_host_ops *ops =3D host->ops; > + > + return ops && ops->power_up; > +} > +EXPORT_SYMBOL_GPL(mipi_dsi_host_power_control_available); > + > +int mipi_dsi_host_power_up(struct mipi_dsi_host *host) > +{ > + const struct mipi_dsi_host_ops *ops =3D host->ops; > + > + if (!mipi_dsi_host_power_control_available(host)) > + return -EOPNOTSUPP; > + > + return ops->power_up ? ops->power_up(host) : 0; > +} > +EXPORT_SYMBOL_GPL(mipi_dsi_host_power_up); > + > +void mipi_dsi_host_power_down(struct mipi_dsi_host *host) > +{ > + const struct mipi_dsi_host_ops *ops =3D host->ops; > + > + if (!mipi_dsi_host_power_control_available(host)) > + return; > + > + if (ops->power_down) > + ops->power_down(host); > +} > +EXPORT_SYMBOL_GPL(mipi_dsi_host_power_down); > + If this API is supposed to be used by DSI devices, it should probably take a mipi_dsi_device pointer as a parameter? We should probably make sure it hasn't been powered on already too? Maxime