diff options
author | Haotien Hsu <haotienh@nvidia.com> | 2024-01-26 04:01:15 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-01-28 01:53:42 +0100 |
commit | 05d039e176cccc4c435c36ccd39170d218563a94 (patch) | |
tree | 1d1324f85c1eb401b901c8f908d5dfd71ba35053 /Documentation/devicetree/bindings | |
parent | usb: audio-v2: Correct comments for struct uac_clock_selector_descriptor (diff) | |
download | linux-05d039e176cccc4c435c36ccd39170d218563a94.tar.xz linux-05d039e176cccc4c435c36ccd39170d218563a94.zip |
ucsi_ccg: Refine the UCSI Interrupt handling
With the Cypress CCGx Type-C controller the following error is
sometimes observed on boot:
[ 16.087147] ucsi_ccg 1-0008: failed to reset PPM!
[ 16.087319] ucsi_ccg 1-0008: PPM init failed (-110)
When the above timeout occurs the following happens:
1. The function ucsi_reset_ppm() is called to reset UCSI controller.
This function performs an async write to start reset and then
polls for completion.
2. An interrupt occurs when the reset completes. In the interrupt
handler, the OPM field in the INTR_REG is cleared and this clears
the CCI data in the PPM. Hence, the reset completion status is
cleared.
3. The function ucsi_reset_ppm() continues to poll for the reset
completion, but has missed the reset completion event and
eventually timeouts.
In this patch, we store CCI when handling the interrupt and make
reading after async write gets the correct value.
To align with the CCGx UCSI interface guide, this patch updates the
driver to copy CCI and MESSAGE_IN before they are reset when UCSI
interrupt acknowledged.
When a new command is sent, the driver will clear the old CCI to avoid
ucsi_ccg_read() getting wrong CCI after ucsi_ccg_async_write() when
the UCSI interrupt is not handled.
Finally, acking the UCSI_READ_INT interrupt before calling complete()
in ISR to ensure that the ucsi_ccg_sync_write() would wait for the
interrupt handling to complete.
Signed-off-by: Sing-Han Chen <singhanc@nvidia.com>
Signed-off-by: Haotien Hsu <haotienh@nvidia.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20240126030115.3791554-1-haotienh@nvidia.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Documentation/devicetree/bindings')
0 files changed, 0 insertions, 0 deletions