Thread (19 messages) 19 messages, 3 authors, 2021-08-19

Re: [PATCH v10 1/2] dt-bindings: pinctrl: mt8195: add rsel define

From: Linus Walleij <hidden>
Date: 2021-08-17 20:09:37
Also in: linux-arm-kernel, linux-devicetree, linux-gpio, lkml

On Tue, Aug 17, 2021 at 9:51 AM zhiyong.tao [off-list ref] wrote:
In one chip, If GPIO is different, the MTXXXX_PULL_UP_RSEL_001 may
means different actual bias resistance setting.

For example,

KPROW IO
Paramters       Descriptions                   Min      Typ     Max
 UNIT
Rpd     Input pull-down resistance      40      75      190     Kohm
Rpu     Input pull-up resistance        40      75      190     Kohm
Rpd     Input pull-down resistance      0.8     1.6     2       Kohm
Rpu     Input pull-up resistance        0.8     1.6     2       Kohm
This is exactly why we should try to use SI units in the device tree.
I assume that the software can eventually configure which resistance
it gets?

The electronics people will say make sure it is pulled down by around
80 kOhm, they can put that on the device tree and your code can
say, "hm 40 < 80 < 190 this is OK" and let the value pass.

We do not define these exact semantics, it is up to the driver code
to decide what to do with the Ohm value 80000 in this case, but
it makes perfect sent for me to let it pass and fail if someone
for example requests 20 kOhm, or at least print a helpful warning:

dev_warn(dev, "the requested resistance %d is out of range, supported
range %d to %d kOhm\n",
                 val, low, high);

This is what makes the SI units really helpful for people writing device
trees: solve real integration tasks and make it easy to do the right thing.

Yours,
Linus Walleij

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help