media: allegro: add explicit mail encoding and decoding
authorMichael Tretter <m.tretter@pengutronix.de>
Mon, 13 Jul 2020 14:42:20 +0000 (16:42 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Sun, 19 Jul 2020 12:00:31 +0000 (14:00 +0200)
commit3de16839669f60b6049734e3a9f553a2a958c4b5
tree08e23e0e798acc0fb0fdf04849c8eef46ea49f5b
parente561f8e24c5ade18f97970c3034ac0f965370c3f
media: allegro: add explicit mail encoding and decoding

The message format in the mailboxes differ between firmware versions.
Therefore, it is necessary to decouple the mailbox format of the driver
from the message format of the firmware. This allows to keep a
consistent message format in the driver while still supporting various
firmware versions.

Add an intermediate step to encode and decode message before writing the
mails to the mailboxes.

On the other hand, this allows to handle optional fields in the
messages, which is required for advanced features of the encoder and was
not possible until now.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/staging/media/allegro-dvt/allegro-core.c
drivers/staging/media/allegro-dvt/allegro-mail.c
drivers/staging/media/allegro-dvt/allegro-mail.h