summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-bq4802.c
diff options
context:
space:
mode:
authorHamish Martin <hamish.martin@alliedtelesis.co.nz>2023-10-25 06:55:14 +0300
committerJiri Kosina <jkosina@suse.cz>2023-11-21 11:30:22 +0300
commit2682468671aa0b4d52ae09779b48212a80d71b91 (patch)
tree498e7477aeb804eb146e448dece9987f82e38c99 /drivers/rtc/rtc-bq4802.c
parent02a46753601a24e1673d9c28173121055e8e6cc9 (diff)
downloadlinux-2682468671aa0b4d52ae09779b48212a80d71b91.tar.xz
HID: mcp2221: Handle reads greater than 60 bytes
When a user requests more than 60 bytes of data the MCP2221 must chunk the data in chunks up to 60 bytes long (see command/response code 0x40 in the datasheet). In order to signal that the device has more data the (undocumented) byte at byte index 2 of the Get I2C Data response uses the value 0x54. This contrasts with the case for the final data chunk where the value returned is 0x55 (MCP2221_I2C_READ_COMPL). The fact that 0x55 was not returned in the response was interpreted by the driver as a failure meaning that all reads of more than 60 bytes would fail. Add support for reads that are split over multiple chunks by looking for the response code indicating that more data is expected and continuing the read as the code intended. Some timing delays are required to ensure the chip has time to refill its FIFO as data is read in from the I2C bus. This timing has been tested in my system when configured for bus speeds of 50KHz, 100KHz, and 400KHz and operates well. Signed-off-by: Hamish Martin <hamish.martin@alliedtelesis.co.nz> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/rtc/rtc-bq4802.c')
0 files changed, 0 insertions, 0 deletions