summaryrefslogtreecommitdiff
path: root/drivers/i2c/busses/i2c-rpmsg-imx.c
AgeCommit message (Collapse)Author
2022-08-04LF-6750-1 i2c: rpmsg-imx: Add dynamic i2c buffer size supportClark Wang
Since the Mcore images of 8qxp/8qm/8dxl platforms are not maintained and cannot support a maximum buffer size of 478bytes of i2c buffer, these platforms are using origin compatible string. The v1 version only supports I2C buffer with a fixed length of 16 bytes. For the two platforms of 8mp/8ulp, the mcore image supports a maximum i2c buffer size of 478bytes. Therefore, use v2 compatible string to add support for dynamic i2c buffer sizes. Signed-off-by: Clark Wang <xiaoning.wang@nxp.com> Reviewed-by: Haibo Chen <haibo.chen@nxp.com>
2022-08-03LF-6710 i2c: rpmsg-imx: expand i2c transfer buffer to 478 bytesClark Wang
Expand the transfer buffer of I2C over rpmsg bus to 478 bytes. Correct and update the protocol in comment. Signed-off-by: Clark Wang <xiaoning.wang@nxp.com> Acked-by: Haibo Chen <haibo.chen@nxp.com>
2021-11-02i2c: rpmsg-imx: add defer probe for rpbusClark Wang
Add defer probe when rpbus probe, so if the rpmsg channel is not created, the rpbus will try to probe later. Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
2021-11-02MLK-21140 i2c: rpmsg: ensure received bus_id and addr is same as sentClark Wang
For some chips may need long time to get the response from M4 sometimes, enlarge timeout to 500ms. Add a judgement to check if the received data is the current transfer wanted. Signed-off-by: Clark Wang <xiaoning.wang@nxp.com> (cherry picked from commit 222e201b520cbd01b611fc45ae2f6b2f0b9d73a1) (cherry picked from commit 6cfc8578ccce0e664b5428738090a51322773366)
2021-11-02MLK-21023 i2c: rpmsg-imx: add mutex lock when transfer i2c messagesClark Wang
I2c_lock_bus function in i2c-core-base will not stop the transfer to different devices on different buses at the same time. Since the multiple rpmsg i2c buses share one rpmsg channel, so it has to add mutex to protect rpmsg resource accessing. Signed-off-by: Clark Wang <xiaoning.wang@nxp.com> (cherry picked from commit d592afe9018e193f675b8c710fb1e66e44851ec8) (cherry picked from commit 44622ff8c847031d65fd75a03459061faf07d0f2)
2021-11-02MLK-20993 i2c: rpmsg: add a BUG_ON to catch alias id issuePeng Fan
The alias ID must be defined in device tree, because that will be used as BUS ID to Cortex M4. If the alias ID not defined, linux kernel will automatically allocate one ID which might not be the same number used in Cortex M4 and Cortex M4 will not send msg to I2C controller. So let's add BUG_ON to catch issue as earlier as possible to avoid wasting efforts. Signed-off-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Clark Wang <xiaoning.wang@nxp.com> (cherry picked from commit b9ff20355040d4bece8357a0af31bc5fca191cee) (cherry picked from commit 8e509705ddd1658ceaea05a65dc6b58d448d2037)
2021-11-02MLK-20940-1 i2c: busses: Add virtual i2c driver based on rpmsgClark Wang
Add virtual i2c driver to send SRTM i2c messages to M4. Each virtual I2C bus has a specal bus id, which is abstracted by M4. Each SRTM message include a bus id for the bus which the device is on. Virtual i2c rpmsg bus will bind rpbus nodes with compatible string "fsl,i2c-rpbus". And "rpmsg-i2c-channel" will probe only one rpmsg channel for all rpbuses. This virtual i2c driver depends on CONFIG_I2C and CONFIG_RPMSG. Signed-off-by: Clark Wang <xiaoning.wang@nxp.com> (cherry picked from commit 9feeac93a7d91ce67537a8a6c67e624eb7986a01) (cherry picked from commit 379ab8392ef404dc7eea9a7492231a9d9d250ed5)