b1dad2f0 | 24-Jul-2024 |
Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> |
usb: typec: tipd: Delete extra semi-colon
There shouldn't be a ; at the end of the function, delete it.
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> Reviewed-by: Javier Car
usb: typec: tipd: Delete extra semi-colon
There shouldn't be a ; at the end of the function, delete it.
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> Reviewed-by: Javier Carrasco <javier.carrasco@wolfvision.net> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20240724162356.992763-2-harshit.m.mogalapalli@oracle.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
2bc0bea1 | 06-Jun-2024 |
Javier Carrasco <javier.carrasco@wolfvision.net> |
usb: typec: tipd: use min() to set tps6598x firmware packet size
Simplify the current firmware packet size check in the tps6598x implementation by means of a single call to min(), which is what the
usb: typec: tipd: use min() to set tps6598x firmware packet size
Simplify the current firmware packet size check in the tps6598x implementation by means of a single call to min(), which is what the current code does in a more verbose, less elegant way.
This patch fixes a cocci warning ("WARNING opportunity for min()").
Suggested-by: Julia Lawall <julia.lawall@inria.fr> Signed-off-by: Javier Carrasco <javier.carrasco@wolfvision.net> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20240606-tps6598x_fw_update_log-v1-3-2b5b8369a0ba@wolfvision.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
916b8e5f | 06-Jun-2024 |
Javier Carrasco <javier.carrasco@wolfvision.net> |
usb: typec: tipd: add error log to provide firmware name and size
The current error logs do not show the firmware name and size for the tps6598x. On the other hand, this information is provided for
usb: typec: tipd: add error log to provide firmware name and size
The current error logs do not show the firmware name and size for the tps6598x. On the other hand, this information is provided for the tps25750. Both implementations have access to that information, and the existing message for the tps25750 can be used for the tps6598x without extra modifications.
Signed-off-by: Javier Carrasco <javier.carrasco@wolfvision.net> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20240606-tps6598x_fw_update_log-v1-2-2b5b8369a0ba@wolfvision.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
344f74cf | 29-Apr-2024 |
Javier Carrasco <javier.carrasco@wolfvision.net> |
usb: typec: tipd: rely on i2c_get_match_data()
The first thing i2c_get_match_data() does is calling device_get_match_data(), which already checks if there is a fwnode.
Remove explicit usage of devi
usb: typec: tipd: rely on i2c_get_match_data()
The first thing i2c_get_match_data() does is calling device_get_match_data(), which already checks if there is a fwnode.
Remove explicit usage of device_get_match_data() as it is already included in i2c_get_match_data().
Signed-off-by: Javier Carrasco <javier.carrasco@wolfvision.net> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20240429-tps6598x_fix_event_handling-v3-3-4e8e58dce489@wolfvision.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
409c1cfb | 29-Apr-2024 |
Javier Carrasco <javier.carrasco@wolfvision.net> |
usb: typec: tipd: fix event checking for tps6598x
The current interrupt service routine of the tps6598x only reads the first 64 bits of the INT_EVENT1 and INT_EVENT2 registers, which means that any
usb: typec: tipd: fix event checking for tps6598x
The current interrupt service routine of the tps6598x only reads the first 64 bits of the INT_EVENT1 and INT_EVENT2 registers, which means that any event above that range will be ignored, leaving interrupts unattended. Moreover, those events will not be cleared, and the device will keep the interrupt enabled.
This issue has been observed while attempting to load patches, and the 'ReadyForPatch' field (bit 81) of INT_EVENT1 was set.
Given that older versions of the tps6598x (1, 2 and 6) provide 8-byte registers, a mechanism based on the upper byte of the version register (0x0F) has been included. The manufacturer has confirmed [1] that this byte is always 0 for older versions, and either 0xF7 (DH parts) or 0xF9 (DK parts) is returned in newer versions (7 and 8).
Read the complete INT_EVENT registers to handle all interrupts generated by the device and account for the hardware version to select the register size.
Link: https://e2e.ti.com/support/power-management-group/power-management/f/power-management-forum/1346521/tps65987d-register-command-to-distinguish-between-tps6591-2-6-and-tps65987-8 [1] Fixes: 0a4c005bd171 ("usb: typec: driver for TI TPS6598x USB Power Delivery controllers") Cc: stable@vger.kernel.org Signed-off-by: Javier Carrasco <javier.carrasco@wolfvision.net> Link: https://lore.kernel.org/r/20240429-tps6598x_fix_event_handling-v3-2-4e8e58dce489@wolfvision.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
933bb7b8 | 04-Jan-2024 |
Javier Carrasco <javier.carrasco.cruz@gmail.com> |
usb: typec: tipd: fix use of device-specific init function
The current implementation supports device-pecific callbacks for the init function with a function pointer. The patch that introduced this
usb: typec: tipd: fix use of device-specific init function
The current implementation supports device-pecific callbacks for the init function with a function pointer. The patch that introduced this feature did not update one call to the tps25750 init function to turn it into a call with the new pointer in the resume function.
Fixes: d49f90822015 ("usb: typec: tipd: add init and reset functions to tipd_data") Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Suggested-by: Roger Quadros <rogerq@kernel.org> Link: https://lore.kernel.org/r/20240104-dev_spec_init-v1-1-1a57e7fd8cc8@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
4c3ea81a | 14-Dec-2023 |
Javier Carrasco <javier.carrasco@wolfvision.net> |
usb: typec: tipd: add patch update support for tps6598x
The TPS6598x PD controller supports firmware updates that can be loaded either from an external flash memory or a host using the device's I2C
usb: typec: tipd: add patch update support for tps6598x
The TPS6598x PD controller supports firmware updates that can be loaded either from an external flash memory or a host using the device's I2C host interface. This patch implements the second approach, which is especially relevant if no flash memory is available.
In order to make patch bundle updates, a series of tasks (special commands) must be sent to the device as it is documented in the TPS65987DDH and TPS65988DH Host Interface Technical Reference Manual[1], section 4.11 (Patch Bundle Update Tasks).
The update sequence is as follows: 1. PTCs - Start Patch Load Sequence: the proposed approach includes device and application configuration data. 2. PTCd - Patch Download: 64-byte data chunks must be sent until the end of the firmware file is reached (the last chunk may be shorter). 3. PTCc - Patch Data Transfer Complete: ends the patch loading sequence.
After this sequence and if no errors occurred, the device will change its mode to 'APP' after SETUP_MS milliseconds, and then it will be ready for normal operation.
[1] https://www.ti.com/lit/ug/slvubh2b/slvubh2b.pdf?ts=1697623299919&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FTPS65987D
Signed-off-by: Javier Carrasco <javier.carrasco@wolfvision.net> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20231207-tps6598x_update-v2-4-f3cfcde6d890@wolfvision.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
e79ead88 | 14-Dec-2023 |
Javier Carrasco <javier.carrasco@wolfvision.net> |
usb: typec: tipd: declare in_data in as const in exec_cmd functions
The input data passed to execute commands with tps6598x_exec_cmd() is not supposed to be modified by the function. Moreover, this
usb: typec: tipd: declare in_data in as const in exec_cmd functions
The input data passed to execute commands with tps6598x_exec_cmd() is not supposed to be modified by the function. Moreover, this data is passed to tps6598x_exec_cmd_tmo() and finally to tps6598x_block_write(), which expects a const pointer.
The current implementation does not produce any bugs, but it discards const qualifiers from the pointers passed as arguments. This leads to compile issues if 'discarded-qualifiers' is active and a const pointer is passed to the function, which is the case if data from a firmware structure is passed to execute update commands. Adding the const modifier to in_data prevents such issues and provides code consistency.
Signed-off-by: Javier Carrasco <javier.carrasco@wolfvision.net> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20231207-tps6598x_update-v2-3-f3cfcde6d890@wolfvision.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
798531b8 | 14-Dec-2023 |
Javier Carrasco <javier.carrasco@wolfvision.net> |
usb: typec: tipd: add function to request firmware
The firmware request process is device agnostic and can be used for other parts.
Signed-off-by: Javier Carrasco <javier.carrasco@wolfvision.net> R
usb: typec: tipd: add function to request firmware
The firmware request process is device agnostic and can be used for other parts.
Signed-off-by: Javier Carrasco <javier.carrasco@wolfvision.net> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20231207-tps6598x_update-v2-2-f3cfcde6d890@wolfvision.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
4b435764 | 21-Nov-2023 |
Heikki Krogerus <heikki.krogerus@linux.intel.com> |
usb: typec: tipd: Supply also I2C driver data
If there is no fwnode, device_get_match_data() does not return anything making the probe to always fail. Using i2c_get_match_data() when there is no fwn
usb: typec: tipd: Supply also I2C driver data
If there is no fwnode, device_get_match_data() does not return anything making the probe to always fail. Using i2c_get_match_data() when there is no fwnode to fix that.
Fixes: 5bd4853da049 ("USB: typec: tps6598x: Add device data to of_device_id") Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20231121114647.2005011-1-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
efa33cd8 | 03-Oct-2023 |
Abdel Alkuor <abdelalkuor@geotab.com> |
USB: typec: tps6598x: Add status trace for tps25750
tps25750 status register is a subset of tps6598x status register, hence a trace for tps25750 status register is added.
Signed-off-by: Abdel Alkuo
USB: typec: tps6598x: Add status trace for tps25750
tps25750 status register is a subset of tps6598x status register, hence a trace for tps25750 status register is added.
Signed-off-by: Abdel Alkuor <abdelalkuor@geotab.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20231003155842.57313-10-alkuor@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|
e5d4a413 | 03-Oct-2023 |
Abdel Alkuor <abdelalkuor@geotab.com> |
USB: typec: tps6598x: Add power status trace for tps25750
tps25750 power status register is a subset of tps6598x power status register.
Signed-off-by: Abdel Alkuor <abdelalkuor@geotab.com> Reviewed
USB: typec: tps6598x: Add power status trace for tps25750
tps25750 power status register is a subset of tps6598x power status register.
Signed-off-by: Abdel Alkuor <abdelalkuor@geotab.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20231003155842.57313-9-alkuor@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
show more ...
|