[Linux-stm32] [PATCH RFC 3/6] dmaengine: qcom: gpi: Accept protocol ID hints

Geert Uytterhoeven geert at linux-m68k.org
Wed Jul 30 11:32:58 UTC 2025


Hi Konrad,

On Wed, 30 Jul 2025 at 11:35, Konrad Dybcio <konradybcio at kernel.org> wrote:
> From: Konrad Dybcio <konrad.dybcio at oss.qualcomm.com>
>
> Client drivers may now pass hints to dmaengine drivers. GPI DMA's only
> consumers (GENI SEs) need to pass a protocol (I2C, I3C, SPI, etc.) ID
> to the DMA engine driver, for it to take different actions.
>
> Currently, that's done through passing that ID through device tree,
> with each Serial Engine expressed NUM_PROTOCOL times, resulting in
> terrible dt-bindings that are full of useless copypasta.
>
> To help get rid of that, accept the driver cookie instead, while
> keeping backwards compatibility.
>
> Signed-off-by: Konrad Dybcio <konrad.dybcio at oss.qualcomm.com>

Thanks for your patch!

> --- a/drivers/dma/qcom/gpi.c
> +++ b/drivers/dma/qcom/gpi.c
> @@ -2145,7 +2151,8 @@ static struct dma_chan *gpi_of_dma_xlate(struct of_phandle_args *args,
>         }
>
>         gchan->seid = seid;
> -       gchan->protocol = args->args[2];
> +       /* The protocol ID is in the teens range, simply ignore the higher bits */
> +       gchan->protocol = (u32)((u64)proto);

A single cast "(uintptr_t)" should be sufficient.
Casing the pointer to u64 on 32-bit may trigger:

    warning: cast from pointer to integer of different size
[-Wpointer-to-int-cast]

>
>         return dma_get_slave_channel(&gchan->vc.chan);
>  }

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



More information about the Linux-stm32 mailing list