mbox series

[RFC,v3,0/2] Add support for time DT property in TCPM

Message ID 20240923224059.3674414-1-amitsd@google.com
Headers show
Series Add support for time DT property in TCPM | expand

Message

Amit Sunil Dhamne Sept. 23, 2024, 10:40 p.m. UTC
USB PD specification defines a bunch of timers that can have a range of
acceptable values instead of specific values. These values have to be
tuned based on the platform. However, TCPM currently sets them to a
default value without providing a mechanism to set platform specific
values.

This patchset adds new DT properties per timer to allow users to define
platform specific values.

Changes compare to v2:
  - Added min, max & default values to DT property in Documentation.
  - Changed return type of tcpm_fw_get_timings to void instead of int.

Changes compared to v1:
  - Defined new properties per timer that we are interested in rather
    than defining a single pd-timers u32 array property.
  - Better description of the timer properties.
  - Since subject has changed, adding link for previous patchset for
    posterity:
    https://lore.kernel.org/all/20240911000715.554184-1-amitsd@google.com/

Amit Sunil Dhamne (2):
  dt-bindings: connector: Add properties to define time values
  usb: typec: tcpm: Add support for parsing time dt properties

 .../bindings/connector/usb-connector.yaml     | 35 ++++++++-
 drivers/usb/typec/tcpm/tcpm.c                 | 74 +++++++++++++++----
 2 files changed, 92 insertions(+), 17 deletions(-)


base-commit: 68d4209158f43a558c5553ea95ab0c8975eab18c

Comments

Heikki Krogerus Sept. 24, 2024, 12:55 p.m. UTC | #1
Hi,

> @@ -7611,10 +7650,13 @@ struct tcpm_port *tcpm_register_port(struct device *dev, struct tcpc_dev *tcpc)
>  	err = tcpm_fw_get_caps(port, tcpc->fwnode);
>  	if (err < 0)
>  		goto out_destroy_wq;
> +


This extra newline is not relevant or necessary. Otherwise this LGTM:

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

>  	err = tcpm_fw_get_snk_vdos(port, tcpc->fwnode);
>  	if (err < 0)
>  		goto out_destroy_wq;
>  
> +	tcpm_fw_get_timings(port, tcpc->fwnode);
> +
>  	port->try_role = port->typec_caps.prefer_role;
>  
>  	port->typec_caps.revision = 0x0120;	/* Type-C spec release 1.2 */

thanks,
Amit Sunil Dhamne Sept. 25, 2024, 2:44 a.m. UTC | #2
Hi Heikki,

On 9/24/24 5:55 AM, Heikki Krogerus wrote:
> Hi,
>
>> @@ -7611,10 +7650,13 @@ struct tcpm_port *tcpm_register_port(struct device *dev, struct tcpc_dev *tcpc)
>>   	err = tcpm_fw_get_caps(port, tcpc->fwnode);
>>   	if (err < 0)
>>   		goto out_destroy_wq;
>> +
>
> This extra newline is not relevant or necessary. Otherwise this LGTM:

Thanks for reviewing! Please let me know if I should upload a new set or 
this is alright at this time?

--

Amit

>
> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
>
>>   	err = tcpm_fw_get_snk_vdos(port, tcpc->fwnode);
>>   	if (err < 0)
>>   		goto out_destroy_wq;
>>   
>> +	tcpm_fw_get_timings(port, tcpc->fwnode);
>> +
>>   	port->try_role = port->typec_caps.prefer_role;
>>   
>>   	port->typec_caps.revision = 0x0120;	/* Type-C spec release 1.2 */
> thanks,
>
Amit Sunil Dhamne Sept. 25, 2024, 3:16 a.m. UTC | #3
Hi,

On 9/24/24 7:44 PM, Amit Sunil Dhamne wrote:
> Hi Heikki,
>
> On 9/24/24 5:55 AM, Heikki Krogerus wrote:
>> Hi,
>>
>>> @@ -7611,10 +7650,13 @@ struct tcpm_port *tcpm_register_port(struct 
>>> device *dev, struct tcpc_dev *tcpc)
>>>       err = tcpm_fw_get_caps(port, tcpc->fwnode);
>>>       if (err < 0)
>>>           goto out_destroy_wq;
>>> +
>>
>> This extra newline is not relevant or necessary. Otherwise this LGTM:
>
> Thanks for reviewing! Please let me know if I should upload a new set 
> or this is alright at this time?


Uploaded a new patchset anyway: 
https://lore.kernel.org/all/20240925031135.1101048-3-amitsd@google.com/


Thanks!

>
> -- 
>
> Amit
>
>>
>> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
>>
>>>       err = tcpm_fw_get_snk_vdos(port, tcpc->fwnode);
>>>       if (err < 0)
>>>           goto out_destroy_wq;
>>>   +    tcpm_fw_get_timings(port, tcpc->fwnode);
>>> +
>>>       port->try_role = port->typec_caps.prefer_role;
>>>         port->typec_caps.revision = 0x0120;    /* Type-C spec 
>>> release 1.2 */
>> thanks,
>>