Skip to contentSkip to conversation

Need some advices on Yaml conversion

DISCUSSION Jérôme Pouiller 2 participants 2 messages Oct 6, 2020

lore
Share & tools
lore
#0 lore raw

Hello,

In order to get the wfx driver out of the staging area, I try to convert the following DT bindings to YAML:

drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/siliabs,wfx.txt

Unfortunately, the conversion is not straight forward. The WFx device can be connected on SPI or on SDIO. The requirement for the two interfaces are different. For exemple:
- <reg> should be set to 1 in SDIO, while it corresponds to the Chip Select in SPI
- The attribute reset-gpios is not available in SDIO
- The "interrupt" does not have the same exact meaning in SPI and SDIO (it is required in SPI, but not in SDIO)

I have considered to declare two different devices, but I am not sure the dtbs_checker will appreciate to have two definitions of the same device. In add, some attribute descriptions would be redundant.

I also considered to use conditional statements, but I didn't find how to check the bus that the device currently use.

Does anyone has some advice about the way to achieve that?

Thank you,

Signature · 1 line
Jérôme Pouiller
#1 lore raw
Quoted 6 lines · Jérôme Pouiller

Hello,

In order to get the wfx driver out of the staging area, I try to convert the following DT bindings to YAML:

Quoted 7 lines

drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/siliabs,wfx.txt

Unfortunately, the conversion is not straight forward. The WFx device can be connected on SPI or on SDIO. The requirement for the two interfaces are different. For exemple:
- <reg> should be set to 1 in SDIO, while it corresponds to the Chip Select in SPI

What's important for 'reg' is how many entries. The bus defines that in both cases here IIRC, so just 'reg: true' is sufficient.

Quoted 3 lines

- The attribute reset-gpios is not available in SDIO
- The "interrupt" does not have the same exact meaning in SPI and SDIO (it is required in SPI, but not in SDIO)

Just list them both and note the constraints. That's no worse than what we had before.

Quoted 6 lines

I have considered to declare two different devices, but I am not sure the dtbs_checker will appreciate to have two definitions of the same device. In add, some attribute descriptions would be redundant.

I also considered to use conditional statements, but I didn't find how to check the bus that the device currently use.

I've thought about adding a pseudo '$bus' property for this purpose, but no, there's not currently a way to do that.

Quoted 9 lines

Does anyone has some advice about the way to achieve that?

Thank you,

--
Jérôme Pouiller