mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
Merge tag 'i3c/for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux
Pull i3c update from Boris Brezillon: "Fix GETMRL's logic" * tag 'i3c/for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux: i3c master: GETMRL's 3rd byte is optional even with BCR_IBI_PAYLOAD
This commit is contained in:
@@ -1008,7 +1008,6 @@ static int i3c_master_getmrl_locked(struct i3c_master_controller *master,
|
|||||||
struct i3c_device_info *info)
|
struct i3c_device_info *info)
|
||||||
{
|
{
|
||||||
struct i3c_ccc_cmd_dest dest;
|
struct i3c_ccc_cmd_dest dest;
|
||||||
unsigned int expected_len;
|
|
||||||
struct i3c_ccc_mrl *mrl;
|
struct i3c_ccc_mrl *mrl;
|
||||||
struct i3c_ccc_cmd cmd;
|
struct i3c_ccc_cmd cmd;
|
||||||
int ret;
|
int ret;
|
||||||
@@ -1024,22 +1023,23 @@ static int i3c_master_getmrl_locked(struct i3c_master_controller *master,
|
|||||||
if (!(info->bcr & I3C_BCR_IBI_PAYLOAD))
|
if (!(info->bcr & I3C_BCR_IBI_PAYLOAD))
|
||||||
dest.payload.len -= 1;
|
dest.payload.len -= 1;
|
||||||
|
|
||||||
expected_len = dest.payload.len;
|
|
||||||
i3c_ccc_cmd_init(&cmd, true, I3C_CCC_GETMRL, &dest, 1);
|
i3c_ccc_cmd_init(&cmd, true, I3C_CCC_GETMRL, &dest, 1);
|
||||||
ret = i3c_master_send_ccc_cmd_locked(master, &cmd);
|
ret = i3c_master_send_ccc_cmd_locked(master, &cmd);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (dest.payload.len != expected_len) {
|
switch (dest.payload.len) {
|
||||||
|
case 3:
|
||||||
|
info->max_ibi_len = mrl->ibi_len;
|
||||||
|
fallthrough;
|
||||||
|
case 2:
|
||||||
|
info->max_read_len = be16_to_cpu(mrl->read_len);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
ret = -EIO;
|
ret = -EIO;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
info->max_read_len = be16_to_cpu(mrl->read_len);
|
|
||||||
|
|
||||||
if (info->bcr & I3C_BCR_IBI_PAYLOAD)
|
|
||||||
info->max_ibi_len = mrl->ibi_len;
|
|
||||||
|
|
||||||
out:
|
out:
|
||||||
i3c_ccc_cmd_dest_cleanup(&dest);
|
i3c_ccc_cmd_dest_cleanup(&dest);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user