linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard@bootlin.com>
To: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Boris Brezillon <boris.brezillon@bootlin.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	linux-media@vger.kernel.org,
	Archit Taneja <architt@codeaurora.org>,
	Andrzej Hajda <a.hajda@samsung.com>, Chen-Yu Tsai <wens@csie.org>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	Krzysztof Witos <kwitos@cadence.com>,
	Rafal Ciepiela <rafalc@cadence.com>
Subject: Re: [PATCH v2 8/9] phy: Add Cadence D-PHY support
Date: Wed, 21 Nov 2018 14:47:56 +0100	[thread overview]
Message-ID: <20181121134756.aoj6otdcl4stpd6p@flea> (raw)
In-Reply-To: <20c0fd85-95f6-9849-c10b-998a1e0f527d@ti.com>

[-- Attachment #1: Type: text/plain, Size: 2689 bytes --]

Hi Kishon,

On Wed, Nov 21, 2018 at 03:59:43PM +0530, Kishon Vijay Abraham I wrote:
> On 21/11/18 3:41 PM, Maxime Ripard wrote:
> > Hi Kishon,
> > 
> > On Tue, Nov 20, 2018 at 11:02:34AM +0530, Kishon Vijay Abraham I wrote:
> >>>> +static int cdns_dphy_config_from_opts(struct phy *phy,
> >>>> +				      struct phy_configure_opts_mipi_dphy *opts,
> >>>> +				      struct cdns_dphy_cfg *cfg)
> >>>> +{
> >>>> +	struct cdns_dphy *dphy = phy_get_drvdata(phy);
> >>>> +	unsigned int dsi_hfp_ext = 0;
> >>>> +	int ret;
> >>>> +
> >>>> +	ret = phy_mipi_dphy_config_validate(opts);
> >>>> +	if (ret)
> >>>> +		return ret;
> >>>> +
> >>>> +	ret = cdns_dsi_get_dphy_pll_cfg(dphy, cfg,
> >>>> +					opts, &dsi_hfp_ext);
> >>>> +	if (ret)
> >>>> +		return ret;
> >>>> +
> >>>> +	opts->wakeup = cdns_dphy_get_wakeup_time_ns(dphy);
> >>
> >> Is the wakeup populated here used by the consumer driver?
> > 
> > It's supposed to, if it can yes.
> 
> But I guess right now it's not using. I'm thinking the usefulness of validate
> callback (only from this series point of view). Why should a consumer driver
> invoke validate if it doesn't intend to configure the PHY?
> 
> The 3 steps required are
> 	* The consumer driver gets the default config
> 	* The consumer driver changes some of the configuration and
> 	* The consumer driver invokes phy configure callback.
> 
> phy_configure anyways can validate the config before actually configuring the phy.

If you only want to configure the PHY, then yes, sure.

However, the point here is that validate helps negotiating what the
source device (DSI controller for example) and what the sink device
(say a panel) are capable of.

A panel for example might very well have multiple resolutions that it
supports, and the DSI controller will have some as well. And the PHY
will only be able to operate within certain boundaries too. However,
they don't necessarily match, since there's so many panels, and so
many SoCs.

Let's say our (very weird) panel is able to do 640x480, 1024x768 and
1280x800. Our DSI driver can only operate with 1024 pixels in both
dimensions, and the PHY can only reach the bus frequency needed for
around 800x600.

We'll want to filter out 1280x800 (because the DSI controller can't
provide that) and 1024x768 (because the PHY can go fast enough), to
only provide the 640x480 option to the user.

That's what validate bring you. The option to test whether a given
configuration *would* work, without actually wanting to apply it right
now.

Does that make sense?

Maxime

-- 
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2018-11-21 13:48 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-06 14:54 [PATCH v2 0/9] phy: Add configuration interface for MIPI D-PHY devices Maxime Ripard
2018-11-06 14:54 ` [PATCH v2 1/9] phy: Add MIPI D-PHY mode Maxime Ripard
2018-11-07 13:29   ` Sakari Ailus
2018-11-06 14:54 ` [PATCH v2 2/9] phy: Add configuration interface Maxime Ripard
2018-11-12 10:02   ` Kishon Vijay Abraham I
2018-11-14 10:51     ` Maxime Ripard
2018-11-06 14:54 ` [PATCH v2 3/9] phy: Add MIPI D-PHY configuration options Maxime Ripard
2018-11-19 13:58   ` Sakari Ailus
2018-11-21  9:52     ` Maxime Ripard
2018-11-06 14:54 ` [PATCH v2 4/9] phy: dphy: Add configuration helpers Maxime Ripard
2018-11-19 13:43   ` Sakari Ailus
2018-11-21  9:33     ` Maxime Ripard
2018-12-04  5:58       ` Kishon Vijay Abraham I
2018-12-04 15:48         ` Maxime Ripard
2018-11-06 14:54 ` [PATCH v2 5/9] sun6i: dsi: Convert to generic phy handling Maxime Ripard
2018-11-06 14:54 ` [PATCH v2 6/9] phy: Move Allwinner A31 D-PHY driver to drivers/phy/ Maxime Ripard
2018-11-19 17:05   ` Sakari Ailus
2018-11-06 14:54 ` [PATCH v2 7/9] drm/bridge: cdns: Separate DSI and D-PHY configuration Maxime Ripard
2018-11-06 14:54 ` [PATCH v2 8/9] phy: Add Cadence D-PHY support Maxime Ripard
2018-11-12  9:51   ` Kishon Vijay Abraham I
2018-11-16  9:17     ` Maxime Ripard
2018-11-20  5:32     ` Kishon Vijay Abraham I
2018-11-21 10:11       ` Maxime Ripard
2018-11-21 10:29         ` Kishon Vijay Abraham I
2018-11-21 13:47           ` Maxime Ripard [this message]
2018-11-22  8:46             ` Kishon Vijay Abraham I
2018-11-19 21:24   ` Sakari Ailus
2018-11-21 13:21     ` Maxime Ripard
2018-11-06 14:54 ` [PATCH v2 9/9] drm/bridge: cdns: Convert to phy framework Maxime Ripard
2018-12-07  5:00 ` [PATCH v2 0/9] phy: Add configuration interface for MIPI D-PHY devices Kishon Vijay Abraham I
2018-12-07  9:09   ` Maxime Ripard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181121134756.aoj6otdcl4stpd6p@flea \
    --to=maxime.ripard@bootlin.com \
    --cc=a.hajda@samsung.com \
    --cc=architt@codeaurora.org \
    --cc=boris.brezillon@bootlin.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kishon@ti.com \
    --cc=kwitos@cadence.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=rafalc@cadence.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=wens@csie.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).