devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Abdel Alkuor <alkuor@gmail.com>,
	heikki.krogerus@linux.intel.com, devicetree@vger.kernel.org
Cc: gregkh@linuxfoundation.org, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org,
	abdelalkuor@geotab.com, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/2] USB: typec: Add TI TPS25750 USB Type-C controller
Date: Sun, 20 Aug 2023 08:24:18 +0200	[thread overview]
Message-ID: <a13e829e-f238-41e8-1877-50c8cf009547@linaro.org> (raw)
In-Reply-To: <9ad92e760e67dfdc740f5b0a32a9c1dbb2342fed.1692507038.git.abdelalkuor@geotab.com>

On 20/08/2023 07:23, Abdel Alkuor wrote:
> From: Abdel Alkuor <abdelalkuor@geotab.com>
> 
> TPS25750 is USB Type-C controller and Power Delivery controller.
> 
> TPS25750 needs to be configured after a cold reset. The configuration
> can be applied either from an external EEPROM connected to the
> controller or by a host using I2C. TI provides an online GUI that
> can be used to generate the configuration binary.
> Tool link: https://tinyurl.com/2s3watcm
> P.S. It requires a TI account to be able to use the tool.
> 
...


> +
> +static void tps25750_remove(struct i2c_client *client)
> +{
> +	struct tps25750 *tps = i2c_get_clientdata(client);
> +
> +	tps25750_disconnect(tps, 0);
> +	typec_unregister_port(tps->port);
> +	usb_role_switch_put(tps->role_sw);
> +
> +	/* clear the patch by a hard reset */
> +	tps25750_exec_normal_cmd(tps, TPS_4CC_GAID);
> +}
> +
> +static int __maybe_unused tps25750_suspend(struct device *dev)
> +{
> +	/* TODO: should we remove the patch? */
> +	return 0;
> +}
> +
> +static int __maybe_unused tps25750_resume(struct device *dev)
> +{
> +	struct i2c_client *client = to_i2c_client(dev);
> +	struct tps25750 *tps = i2c_get_clientdata(client);
> +
> +	/* The controller needs to be reinitialized again

Format is:

/*
 * The....

> +	 * if it is powered off as config is not persisted
> +	 */
> +	return tps25750_init(tps);
> +}
> +
> +static const struct dev_pm_ops tps25750_pm_ops = {
> +	SET_SYSTEM_SLEEP_PM_OPS(tps25750_suspend, tps25750_resume)
> +};
> +
> +static const struct of_device_id tps25750_of_match[] = {
> +	{ .compatible = "ti,tps25750", },
> +	{}
> +};
> +MODULE_DEVICE_TABLE(of, tps25750_of_match);
> +
> +static const struct i2c_device_id tps25750_id[] = {
> +	{ "tps25750" },
> +	{ }
> +};
> +MODULE_DEVICE_TABLE(i2c, tps25750_id);
> +
> +static struct i2c_driver tps25750_i2c_driver = {
> +	.driver = {
> +		.name = "tps25750",
> +		.pm = pm_ptr(&tps25750_pm_ops),
> +		.of_match_table = of_match_ptr(tps25750_of_match),

Drop of_match_ptr(). It will cause warnings.

> +	},
> +	.probe_new = tps25750_probe,
> +	.remove = tps25750_remove,
> +	.id_table = tps25750_id,
> +};
> +module_i2c_driver(tps25750_i2c_driver);


Best regards,
Krzysztof


  reply	other threads:[~2023-08-20  6:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-20  5:23 [PATCH v3 0/2] Add support for TPS25750 Abdel Alkuor
2023-08-20  5:23 ` [PATCH v3 1/2] dt-bindings: usb: Add ti,tps25750 Abdel Alkuor
2023-08-20  6:17   ` Krzysztof Kozlowski
2023-08-20  5:23 ` [PATCH v3 2/2] USB: typec: Add TI TPS25750 USB Type-C controller Abdel Alkuor
2023-08-20  6:24   ` Krzysztof Kozlowski [this message]
2023-08-20 19:55     ` Abdel Alkuor

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=a13e829e-f238-41e8-1877-50c8cf009547@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=abdelalkuor@geotab.com \
    --cc=alkuor@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=robh+dt@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).