From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752195AbdK1JYE (ORCPT ); Tue, 28 Nov 2017 04:24:04 -0500 Received: from mail1.bemta5.messagelabs.com ([195.245.231.143]:14615 "EHLO mail1.bemta5.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751322AbdK1JX4 (ORCPT ); Tue, 28 Nov 2017 04:23:56 -0500 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOKsWRWlGSWpSXmKPExsUSt3Opsa6Gtmy UweSn5ha3p55ksnj9bzqLRfPi9WwWXat3slhc3jWHzWLRslZmiycLzzA5sHss2FTqMe9koMf+ uWvYPT4+vcXisfN7A7vH501yAWxRrJl5SfkVCawZD7qsChplK5pnKTUwXpDpYuTiEBJYxijRt mc5YxcjJwebgIXE5BMP2EBsEYFkicsfe5hAbGaBh0wSyy9rdzFycAgLOEsceqcEUeIiMX/7Ni YI20ni47bpYGNYBFQlNk7aC2bzCgRI9O19xwax6x2jRGtbIytIglMgUGL3899gzYwCshJfGlc zQ+wSl7j1ZD5YXEJAQGLJnvPMELaoxMvH/1ghbHmJ7d9+s0PY9hKv771jAblNQkBfoq+xGCJs KLFq2gEWCNtc4tDyfrASZgFNifW79CE2KUpM6X7IDnGmoMTJmU9YJjCKz0JyxCyEjllIOmYh6 VjAyLKKUaM4tagstUjX0EgvqSgzPaMkNzEzR9fQwFQvN7W4ODE9NScxqVgvOT93EyMwehmAYA dj3yznQ4ySHExKorwLsqWihPiS8lMqMxKLM+KLSnNSiw8xynBwKEnwntSUjRISLEpNT61Iy8w BphGYtAQHj5IIrwxImre4IDG3ODMdInWK0ZjjybV5f5k4ns183cAsxJKXn5cqJc77CKRUAKQ0 ozQPbhAsvV1ilJUS5mUEOk2IpyC1KDezBFX+FaM4B6OSMO91kCk8mXklcPteAZ3CBHTKzf3SI KeUJCKkpBoYWSZHMB1tUrOpKk/ZtkHisNimn1JH4p/L/K3c8P6g3AGrd6FHLYzvenw9zMJ386 7H5mKzQA3rc9sbf935eSjznxfnzPzNi1s3T3kmNqt0ezd34nRfb+ezr5g/rDLdOmOK87fadzb Rz7ZFsmlVKj3qa3Cu+s6bXNni9OZYUeA615VFFvOb4kwClFiKMxINtZiLihMB8EPadmoDAAA= X-Env-Sender: Adam.Thomson.Opensource@diasemi.com X-Msg-Ref: server-3.tower-178.messagelabs.com!1511861032!103210037!1 X-Originating-IP: [94.185.165.51] X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked From: Adam Thomson To: Badhri Jagan Sridharan , Adam Thomson CC: "heikki.krogerus@linux.intel.com" , "gregkh@linuxfoundation.org" , "dan.carpenter@oracle.com" , "linux@roeck-us.net" , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH 2/2 v7] typec: tcpm: Only request matching pdos Thread-Topic: [PATCH 2/2 v7] typec: tcpm: Only request matching pdos Thread-Index: AQHTXnaaVwiVwD1IZUORgIX229NkPaMh0z+QgAdC4gCAAIGA0A== Date: Tue, 28 Nov 2017 09:23:50 +0000 Message-ID: <2E89032DDAA8B9408CB92943514A0337014C1B1641@SW-EX-MBX01.diasemi.com> References: <20171116010156.25259-1-Badhri@google.com> <20171116010156.25259-2-Badhri@google.com> <2E89032DDAA8B9408CB92943514A0337014C1B0E02@SW-EX-MBX01.diasemi.com> In-Reply-To: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.20.24.43] x-kse-attachmentfiltering-interceptor-info: protection disabled x-kse-serverinfo: sw-ex-cashub01.diasemi.com, 9 x-kse-antivirus-interceptor-info: scan successful x-kse-antivirus-info: Clean, bases: 28/11/2017 07:45:00 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id vAS9O9XN007818 On 28 November 2017 01:38, Badhri Jagan Sridharan wrote: > > examples in the kernel where this happens. Where are these functions likely to > > be called from, as wherever that is it will need a reference to the port? > > Actually should we be adding DT bindings to set supported src/snk PDOs from FW, > > if you're taking this approach to PDO selection? > > > > This patch also seemingly leaves 'max_snk_mv', 'max_snk_ma' and 'max_snk_mv' > > redundant, although those values can be configured from a PD controller driver > > (e.g. fusb302 actually supports DT bindings which allow these to be set through > > FW). Now these DT bindings are basically made redundant by your change as they > > have no impact. Are we expecting these to be used again in the future, or should > > Yes, I think 'max_snk_mv', 'max_snk_ma' and 'max_snk_mw' etc should be > removed. > The problem here is that maintaining these values implies that tcpm is > not going to > request pdo based on the sink_caps that are published. All these > values can be derived from > the sink_pdo objects that were declared, hence, they are redundant, > I will update the patch to remove this. I have no problem really with this approach, other than right now with your patch there's no way to actually set the PDOs other than the 2 functions to update source and sink capabilities. Previously you had the option, at least through the fusb302 driver, to configure the max_snk_* values from DT, but your patch obviously changes this behaviour. I think we need a FW based method of configuring these at startup at least, as with your current patch the values being used are hard coded. As this is generic for TCPM I would guess DT bindings (and maybe equivalent ACPI properties as well I guess) would be a sensible approach. > > these be removed? FYI, as part of my PPS patch set I have been using them as > > part of the PPS APDO selection criteria, based on TCPM code prior to your > > modifications, as for PPS we're interested in a wide range of voltages and > > currents but want to stay within the platforms limits. > > Arent you defining a new PDO type similar to PDO_FIXED, PDO_VARIABLE etc ? > If so values such as " 'max_snk_mv', 'max_snk_ma' and > 'max_snk_mw' " should be part of the APDO object right ? So why would > you still need > 'max_snk_mv', 'max_snk_ma' and 'max_snk_mw' ? My initial implementation was based on the approach before your changes, and actually for PPS this to me made sense, at least from the sink side. We are dealing with a range of voltages and currents so the important points are the maximum values. However, if we're now making decisions based on sink PDOs then I can look at adapting.