lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a13e829e-f238-41e8-1877-50c8cf009547@linaro.org>
Date:   Sun, 20 Aug 2023 08:24:18 +0200
From:   Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To:     Abdel Alkuor <alkuor@...il.com>, heikki.krogerus@...ux.intel.com,
        devicetree@...r.kernel.org
Cc:     gregkh@...uxfoundation.org, robh+dt@...nel.org,
        krzysztof.kozlowski+dt@...aro.org, conor+dt@...nel.org,
        abdelalkuor@...tab.com, linux-usb@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 2/2] USB: typec: Add TI TPS25750 USB Type-C controller

On 20/08/2023 07:23, Abdel Alkuor wrote:
> From: Abdel Alkuor <abdelalkuor@...tab.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ