From: Amit Sunil Dhamne <amitsd@google.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: gregkh@linuxfoundation.org, robh@kernel.org,
heikki.krogerus@linux.intel.com, badhri@google.com,
kyletso@google.com, rdbabiera@google.com,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
devicetree@vger.kernel.org
Subject: Re: [RFC v2 2/2] usb: typec: tcpm: Add support for parsing time dt properties
Date: Thu, 19 Sep 2024 15:08:58 -0700 [thread overview]
Message-ID: <f025bb6b-b9b2-41eb-bd09-13a2538751af@google.com> (raw)
In-Reply-To: <kjscycfgp7kxlrrdvfszzmhvxxql7y6gs6jpfcgebvtj5qwhxp@zayctjtma2cx>
Hi Dmitry,
Thanks for the review!
On 9/19/24 1:56 AM, Dmitry Baryshkov wrote:
> On Thu, Sep 19, 2024 at 12:51:14AM GMT, Amit Sunil Dhamne wrote:
>> Add support for DT time properties to allow users to define platform
>> specific timing deadlines of certain timers rather than using hardcoded
>> ones. For values that have not been explicitly defined in DT using this
>> property, default values will be set therefore, making this change
>> backward compatible.
>>
>> Signed-off-by: Amit Sunil Dhamne <amitsd@google.com>
>> ---
>> drivers/usb/typec/tcpm/tcpm.c | 81 ++++++++++++++++++++++++++++-------
>> 1 file changed, 65 insertions(+), 16 deletions(-)
>> @@ -7053,6 +7068,35 @@ static int tcpm_port_register_pd(struct tcpm_port *port)
>> return ret;
>> }
>>
>> +static int tcpm_fw_get_timings(struct tcpm_port *port, struct fwnode_handle *fwnode)
>> +{
>> + int ret;
>> + u32 val;
>> +
>> + if (!fwnode)
>> + return -EINVAL;
> I think this check isn't really necessary here. Other than that:
>
> Acked-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>
Will remove this check in next rev as suggested in
https://lore.kernel.org/all/Zuwn1Fn1DrLGvPK9@kuha.fi.intel.com/ .
Regards,
Amit
>> +
>> + ret = fwnode_property_read_u32(fwnode, "sink-wait-cap-time-ms", &val);
>> + if (!ret)
>> + port->timings.sink_wait_cap_time = val;
>> + else
>> + port->timings.sink_wait_cap_time = PD_T_SINK_WAIT_CAP;
>> +
>> + ret = fwnode_property_read_u32(fwnode, "ps-source-off-time-ms", &val);
>> + if (!ret)
>> + port->timings.ps_src_off_time = val;
>> + else
>> + port->timings.ps_src_off_time = PD_T_PS_SOURCE_OFF;
>> +
>> + ret = fwnode_property_read_u32(fwnode, "cc-debounce-time-ms", &val);
>> + if (!ret)
>> + port->timings.cc_debounce_time = val;
>> + else
>> + port->timings.cc_debounce_time = PD_T_CC_DEBOUNCE;
>> +
>> + return 0;
>> +}
>> +
>> static int tcpm_fw_get_caps(struct tcpm_port *port, struct fwnode_handle *fwnode)
>> {
>> struct fwnode_handle *capabilities, *child, *caps = NULL;
>> @@ -7608,9 +7652,14 @@ struct tcpm_port *tcpm_register_port(struct device *dev, struct tcpc_dev *tcpc)
>> init_completion(&port->pps_complete);
>> tcpm_debugfs_init(port);
>>
>> + err = tcpm_fw_get_timings(port, tcpc->fwnode);
>> + if (err < 0)
>> + goto out_destroy_wq;
>> +
>> err = tcpm_fw_get_caps(port, tcpc->fwnode);
>> if (err < 0)
>> goto out_destroy_wq;
>> +
>> err = tcpm_fw_get_snk_vdos(port, tcpc->fwnode);
>> if (err < 0)
>> goto out_destroy_wq;
>> --
>> 2.46.0.792.g87dc391469-goog
>>
next prev parent reply other threads:[~2024-09-19 22:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-19 7:51 [RFC v2 0/2] Add support for time DT property in TCPM Amit Sunil Dhamne
2024-09-19 7:51 ` [RFC v2 1/2] dt-bindings: connector: Add properties to define time values Amit Sunil Dhamne
2024-09-21 0:56 ` Rob Herring
2024-09-19 7:51 ` [RFC v2 2/2] usb: typec: tcpm: Add support for parsing time dt properties Amit Sunil Dhamne
2024-09-19 8:56 ` Dmitry Baryshkov
2024-09-19 22:08 ` Amit Sunil Dhamne [this message]
2024-09-19 13:32 ` Heikki Krogerus
2024-09-19 22:15 ` Amit Sunil Dhamne
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=f025bb6b-b9b2-41eb-bd09-13a2538751af@google.com \
--to=amitsd@google.com \
--cc=badhri@google.com \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=kyletso@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=rdbabiera@google.com \
--cc=robh@kernel.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).