# Re: \[PATCH 1/2\] dt-binding: can: mcp2517fd: document device tree bindings

- From: Patrick Menschel \<hidden\>
- Date: 2017-11-30 16:44:19 
- List: linux-devicetree
- Page: https://ratatoskr.run/linux-devicetree/2017/11/8147402
- Thread: https://ratatoskr.run/linux-can/2017/11/8147402/t.md

```text
Am 30.11.2017 um 08:24 schrieb kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org:
> I understand, but the question still is: how to
> present the information in a valid way.
>
> To use gpio propperly it would require that the driver
> implements a “sub-driver” pinctrl with all the extra
> (boilerplate) code overhead.
>
> Also this would mean mixing different types of
> logical drivers into a single source - I doubt that
> would be easy to get accepted...
>
> Here again a summary of all the GPIOs that the mcp2517fd has:
> * TXCAN: dedicated GPIO with single function, 
>          individually conigurable as push/pull or open drain
> * INT: main interrupt line - configurable as push/pull or 
>          individually conigurable as push/pull or open drain
> * GPIO0: general GPIO with in/out option, but 2 special “cases”:
>          tx-irq and TX-disable
>          group configurable as push/pull or open drain
> * GPIO1: general GPIO with in/out potion, but 1 special “cases”:
>          rx-irq
>          group configurable as push/pull or open drain
> * CLKO/SOF: clock output at (1/10th, 1/5th, 1/2, 1 of the 
>             core frequency) or start of frame output
>             possibly group configurable as push/pull or open drain
> 	    (not explicitly specified in datasheet)
>
> How would you try to present that HW-configuration in the 
> device tree instead?
> How would it impact the driver design?
>
Hi,
I'm afraid I don't know what is best practice but you may want to look
at the max310x driver which declares it's GPIOs and GPIO based
interrupts in the regular driver.

drivers/tty/serial/max310x.c
Documentation/devicetree/bindings/serial/maxim,max310x.txt
Look for "#ifdef CONFIG_GPIOLIB".

My first try would be a single dt node like the max310x uses in the dt
example.
Imho it is better to make things useful before making them complicated.

Regards,
Patrick

```

## Attachments

- [smime.p7s](https://ratatoskr.run/linux-devicetree/2017/11/8147402/attachment/0) (application/pkcs7-signature, 3992 bytes)
