Il 14/06/24 09:27, Alexandre Mergnat ha scritto:
> - Add specific config to enable:
> - MT8365 sound support
> - MT6357 audio codec support
> - Add the mt8365 directory and all drivers under it.
>
> Signed-off-by: Alexandre Mergnat <amergnat(a)baylibre.com>
> ---
> sound/soc/mediatek/Kconfig | 20 ++++++++++++++++++++
> sound/soc/mediatek/Makefile | 1 +
> sound/soc/mediatek/mt8365/Makefile | 15 +++++++++++++++
> 3 files changed, 36 insertions(+)
>
> diff --git a/sound/soc/mediatek/Kconfig b/sound/soc/mediatek/Kconfig
> index 5a8476e1ecca..c1c86ecc0601 100644
> --- a/sound/soc/mediatek/Kconfig
> +++ b/sound/soc/mediatek/Kconfig
> @@ -298,3 +298,23 @@ config SND_SOC_MT8195_MT6359
> boards with the MT6359 and other I2S audio codecs.
> Select Y if you have such device.
> If unsure select "N".
> +
> +config SND_SOC_MT8365
> + tristate "ASoC support for Mediatek MT8365 chip"
> + depends on ARCH_MEDIATEK
> + select SND_SOC_MEDIATEK
> + help
> + This adds ASoC platform driver support for Mediatek MT8365 chip
> + that can be used with other codecs.
> + Select Y if you have such device.
> + If unsure select "N".
> +
> +config SND_SOC_MT8365_MT6357
> + tristate "ASoC Audio driver for MT8365 with MT6357 codec"
> + depends on SND_SOC_MT8365 && MTK_PMIC_WRAP
> + select SND_SOC_MT6357
> + help
> + This adds support for ASoC machine driver for Mediatek MT8365
s/Mediatek/MediaTek/g (here and everywhere else in other commits as well)
> + boards with the MT6357 codec.
MT6357 PMIC codec
after which
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno(a)collabora.com>
Il 14/06/24 09:27, Alexandre Mergnat ha scritto:
> Add soundcard bindings for the MT8365 SoC with the MT6357 audio codec.
>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski(a)linaro.org>
> Signed-off-by: Alexandre Mergnat <amergnat(a)baylibre.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno(a)collabora.com>
Il 14/06/24 09:27, Alexandre Mergnat ha scritto:
> Add I2S Device Audio Interface support for MT8365 SoC.
>
> Signed-off-by: Alexandre Mergnat <amergnat(a)baylibre.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno(a)collabora.com>
Il 14/06/24 09:27, Alexandre Mergnat ha scritto:
> Add Digital Micro Device Audio Interface support for MT8365 SoC.
>
> Signed-off-by: Alexandre Mergnat <amergnat(a)baylibre.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno(a)collabora.com>
Il 14/06/24 09:27, Alexandre Mergnat ha scritto:
> Add ADDA Device Audio Interface support for MT8365 SoC.
>
> Signed-off-by: Alexandre Mergnat <amergnat(a)baylibre.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno(a)collabora.com>
Hi TaoJiang,
On Tue, Jun 18, 2024 at 4:30 PM TaoJiang <tao.jiang_2(a)nxp.com> wrote:
>
> From: Ming Qian <ming.qian(a)nxp.com>
>
> When the memory type is VB2_MEMORY_DMABUF, the v4l2 device can't know
> whether the dma buffer is coherent or synchronized.
>
> The videobuf2-core will skip cache syncs as it think the DMA exporter
> should take care of cache syncs
>
> But in fact it's likely that the client doesn't
> synchronize the dma buf before qbuf() or after dqbuf(). and it's
> difficult to find this type of error directly.
>
> I think it's helpful that videobuf2-core can call
> dma_buf_end_cpu_access() and dma_buf_begin_cpu_access() to handle the
> cache syncs.
>
> Signed-off-by: Ming Qian <ming.qian(a)nxp.com>
> Signed-off-by: TaoJiang <tao.jiang_2(a)nxp.com>
> ---
> .../media/common/videobuf2/videobuf2-core.c | 22 +++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
Sorry, that patch is incorrect. I believe you're misunderstanding the
way DMA-buf buffers should be managed in the userspace. It's the
userspace responsibility to call the DMA_BUF_IOCTL_SYNC ioctl [1] to
signal start and end of CPU access to the kernel and imply necessary
cache synchronization.
[1] https://docs.kernel.org/driver-api/dma-buf.html#dma-buffer-ioctls
So, really sorry, but it's a NAK.
Best regards,
Tomasz
> diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c
> index 358f1fe42975..4734ff9cf3ce 100644
> --- a/drivers/media/common/videobuf2/videobuf2-core.c
> +++ b/drivers/media/common/videobuf2/videobuf2-core.c
> @@ -340,6 +340,17 @@ static void __vb2_buf_mem_prepare(struct vb2_buffer *vb)
> vb->synced = 1;
> for (plane = 0; plane < vb->num_planes; ++plane)
> call_void_memop(vb, prepare, vb->planes[plane].mem_priv);
> +
> + if (vb->memory != VB2_MEMORY_DMABUF)
> + return;
> + for (plane = 0; plane < vb->num_planes; ++plane) {
> + struct dma_buf *dbuf = vb->planes[plane].dbuf;
> +
> + if (!dbuf)
> + continue;
> +
> + dma_buf_end_cpu_access(dbuf, vb->vb2_queue->dma_dir);
> + }
> }
>
> /*
> @@ -356,6 +367,17 @@ static void __vb2_buf_mem_finish(struct vb2_buffer *vb)
> vb->synced = 0;
> for (plane = 0; plane < vb->num_planes; ++plane)
> call_void_memop(vb, finish, vb->planes[plane].mem_priv);
> +
> + if (vb->memory != VB2_MEMORY_DMABUF)
> + return;
> + for (plane = 0; plane < vb->num_planes; ++plane) {
> + struct dma_buf *dbuf = vb->planes[plane].dbuf;
> +
> + if (!dbuf)
> + continue;
> +
> + dma_buf_begin_cpu_access(dbuf, vb->vb2_queue->dma_dir);
> + }
> }
>
> /*
> --
> 2.43.0-rc1
>
Il 17/06/24 10:05, Alexandre Mergnat ha scritto:
>
>
> On 14/06/2024 11:31, Mark Brown wrote:
>> On Fri, Jun 14, 2024 at 09:27:43AM +0200, Alexandre Mergnat wrote:
>>> This serie aim to add the following audio support for the Genio 350-evk:
>>> - Playback
>>> - 2ch Headset Jack (Earphone)
>>> - 1ch Line-out Jack (Speaker)
>>> - 8ch HDMI Tx
>>
>> I seem to remember you had review comments that needed addressing from
>> AngeloGioacchino, why resend without addressing those?
>
> I don't see any comment:
> https://lore.kernel.org/lkml/20240226-audio-i350-v5-0-e7e2569df481@baylibre…
>
Mark, the review comments were on the v4 of this series :-)
I'll review this version probably tomorrow, or anyway this week.
Cheers,
Angelo