devicetree-org / dt-schema

Devicetree schema tools
http://www.devicetree.org
BSD 2-Clause "Simplified" License
67 stars 67 forks source link

schemas: Add -kbps and -mbps standard unit suffixes #131

Open panikiel opened 8 months ago

panikiel commented 8 months ago

Some data rates might be too large to be represented as bits per second. Add kilobits per second (kbps) and megabits per second (mbps) to address that.

panikiel commented 8 months ago

Hey @krzk, this is the dtschema patch you mentioned on the kernel list.

robherring commented 8 months ago

Why do we need both? kbps seems unnecessary. The reason we don't just support all/any units is to discourage people from picking different units for the same thing.

What patch are you referring to?

panikiel commented 8 months ago

Link to discussion: https://lore.kernel.org/lkml/CAM5zL5rDKMbgN7P=KF2ZayN5ipUB7AYpVccZdLunSUNTR4_f1A@mail.gmail.com/

I want to represent a DisplayPort 'maximum link rate' value, which can be 8.1 Gbps, 5.4 Gbps, 2.7 Gbps, or 1.62 Gbps. I can't use bps, because that wouldn't fit into a uint32.

For this PR i added both kbps and mbps for completeness, but for my use case adding just one of them would be fine.