Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2670213ybk; Mon, 18 May 2020 05:13:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWdlsPGbytuvI2r4Y+wON+2QVJq8+FLq25XiF7zQ1wtl8d/If229oP6iQkp3PHI6ULszkh X-Received: by 2002:a17:907:43bf:: with SMTP id ok23mr14517418ejb.68.1589803989746; Mon, 18 May 2020 05:13:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589803989; cv=none; d=google.com; s=arc-20160816; b=T9ge3vPI0YAWKXI5/bbDBXnCWpXWjO/g3HITMu4QPDfQ0URpAxoBhkjZAT/gwKFfsp 6kXdrVKdk1E9g9Vsv7MkzxSga0qkWnfrYA4LiNuJfyvd6tFJHRhY3Yf4o8joxrpXVsrO 1QFsCcfI/SdIlXctayS4lRW0xV/BWugL1RWv4bO4B5PCmuo5CU/HRinsCv+2owfNJLxI 1wMFsdHqBb6C7ZMpzJFDrpzQVFO11FG+c8I7OoGfDk5MTbNZZZOa7Wq7wq6ltSwO8DWf Xzr1XC1czFkET8/LmkRvVLukdrBJ1NnWpkmpqbMsxyMoIYJDMpDj+tX0WC5JBTex+kaD LGxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=fMGTY5PIsiqvGaRm42OKgWyyYTbjkb2Wswgalvi1feg=; b=TkH8Dw9wYU7x8hS1uH9DPoXABf+Y0JwGKAsNBXsyBFY+4F3aQjk9+sYx4DnNxDlvkH ItB5CbErRzLeZLOOmGUfm36uqGgqEmYgMjScsalaPH2QBW3kgV7ewhGn6P221BcbMLys Fry2rmh5U58C2Jt5b3vEdiwZS3Z5jA4W+u3RCbiKRUxNhFyJa42XmQsBwCn1juLJYWHT jORCUNF59tmmU0UrjbcexphY76Cc6wWqUSolQFplvVKjqnsbp88dpDeNq2826bMprFIS zZouMm1j6xlPiY6NSE6PbCFfYhAVKGzjhBh/d3INudsbB1E3Ls0ZD/txZq1XtOF2QJ3L AdPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=WNl6T3Js; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f3si5496667edv.335.2020.05.18.05.12.45; Mon, 18 May 2020 05:13:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=WNl6T3Js; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726907AbgERMLO (ORCPT + 99 others); Mon, 18 May 2020 08:11:14 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:55586 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726557AbgERMLN (ORCPT ); Mon, 18 May 2020 08:11:13 -0400 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 04ICB5cP121874; Mon, 18 May 2020 07:11:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1589803865; bh=fMGTY5PIsiqvGaRm42OKgWyyYTbjkb2Wswgalvi1feg=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=WNl6T3JsFT9SLHE/DW4wnWph7f+dUaElb9ELROzbo+IjZAd5zfkAm7I1+f5GdlzXk seOicsbKY91/DOCNqJAF8cAM/sUg9ydLZdlPyBsETpadRpnQCw1mHtQo2hRCrmgiuo wR0Q5bZz29kpZzjs2itKJr7Jy++nD/x3/hemZ8Dg= Received: from DFLE102.ent.ti.com (dfle102.ent.ti.com [10.64.6.23]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 04ICB5kI111612 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 18 May 2020 07:11:05 -0500 Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Mon, 18 May 2020 07:11:04 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Mon, 18 May 2020 07:11:04 -0500 Received: from [10.250.233.85] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 04ICB04S085031; Mon, 18 May 2020 07:11:01 -0500 Subject: Re: [PATCH v1 2/2] phy: phy-cadence-torrent: Use PHY kernel APIs to set PHY attributes To: Swapnil Kashinath Jakhade , Tomi Valkeinen , Maxime Ripard CC: Yuti Suresh Amonkar , "linux-kernel@vger.kernel.org" , "mark.rutland@arm.com" , "jsarha@ti.com" , "praneeth@ti.com" , Milind Parab , Vinod Koul References: <1588057804-29161-1-git-send-email-yamonkar@cadence.com> <1588057804-29161-3-git-send-email-yamonkar@cadence.com> <20200429122750.hup7vbmz3xnpfwa5@gilmour.lan> <20200507171738.atzyfpueo6bjbwpb@gilmour.lan> From: Kishon Vijay Abraham I Message-ID: <39d5238c-0344-14ef-9e35-8ce4348ce9e4@ti.com> Date: Mon, 18 May 2020 17:41:00 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 5/18/2020 12:24 PM, Swapnil Kashinath Jakhade wrote: > Hi Kishon, > >> -----Original Message----- >> From: Kishon Vijay Abraham I >> Sent: Wednesday, May 13, 2020 8:08 AM >> To: Tomi Valkeinen ; Maxime Ripard >> ; Swapnil Kashinath Jakhade >> >> Cc: Yuti Suresh Amonkar ; linux- >> kernel@vger.kernel.org; mark.rutland@arm.com; jsarha@ti.com; >> praneeth@ti.com; Milind Parab ; Vinod Koul >> >> Subject: Re: [PATCH v1 2/2] phy: phy-cadence-torrent: Use PHY kernel APIs to >> set PHY attributes >> >> EXTERNAL MAIL >> >> >> Hi, >> >> On 5/8/2020 1:20 PM, Tomi Valkeinen wrote: >>> On 07/05/2020 20:17, Maxime Ripard wrote: >>> >>>>> Actually, for this particular case, consumer driver will be the >>>>> Cadence MHDP bridge driver for DisplayPort which is also under >>>>> review process for upstreaming [1]. So this DRM bridge driver will >>>>> make use of the PHY APIs >>>>> phy_get_bus_width() and phy_get_max_link_rate() during execution of >>>>> probe function to get the number of lanes and maximum link rate >>>>> supported by Cadence Torrent PHY. This information is required to >>>>> set the host capabilities in the DRM bridge driver, based on which >>>>> initial values for DisplayPort link training will be determined. >>>>> >>>>> The changes in this PHY patch series are based on suggestions in the >>>>> review comments in [1] which asks to use kernel PHY APIs to read >>>>> these properties instead of directly accessing PHY device node. The >>>>> complete driver and actual use of these APIs can be found in [2]. >>>>> This is how we are planning to use these APIs. >>>> >>>> I haven't really looked into the displayport spec, but I'd assume >>>> that there's a lot more parameters that would need to be negociated >>>> between the phy and the DP block? If so, then it would make more >>>> sense to follow the path we did for MIPI-DSI where the parameters can >>>> be negociated through the phy_configure / phy_validate interface. >>> >>> I don't think this is negotiation, but just exposing the (max) >>> capabilities of PHY, inside which the configure can work. Maybe all >>> the capabilities could handled with a struct (struct phy_attrs), >>> instead of adding separate functions for each, though. >> >> yeah, that makes sense. Just that users should take care not to over-write all >> the phy attributes with partial information. > > It would be really helpful if you could clarify a bit regarding how to handle this > exactly. What I could understand from Tomi' suggestion is that all PHY attributes > in struct phy_attrs should have single pair of functions to get and set all the PHY > attributes (e.g. phy_get_attrs / phy_set_attrs), instead of separate get/set pair of > functions for individual attribute (bus_width, mode, max_link_rate etc). Is this > understanding correct? If so, how should the existing functions for bus_width and > mode be used? Yes, your understanding is correct. There are already existing users of bus_width, mode, so let's not disturb that. That could maybe deprecated later. Thanks Kishon