[Linux-stm32] [PATCH RFC 3/6] dmaengine: qcom: gpi: Accept protocol ID hints
Konrad Dybcio
konrad.dybcio at oss.qualcomm.com
Sat Aug 2 12:39:48 UTC 2025
On 7/30/25 1:32 PM, Geert Uytterhoeven wrote:
> 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]
Good point, not compiling for 32-bit always ends up biting.. thanks
Konrad
More information about the Linux-stm32
mailing list