linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: linux-can@vger.kernel.org, dev.kurt@vandijck-laurijssen.be,
	Oleksij Rempel <o.rempel@pengutronix.de>
Subject: Re: [PATCH v41 2/3] dt-binding: can: mcp25xxfd: document device tree bindings
Date: Tue, 23 Jun 2020 08:56:35 +0530	[thread overview]
Message-ID: <20200623032635.GG11093@Mani-XPS-13-9360> (raw)
In-Reply-To: <89ebabc5-dd88-32ed-65b3-911d3d80237b@pengutronix.de>

On Mon, Jun 22, 2020 at 08:12:58PM +0200, Marc Kleine-Budde wrote:
> On 6/22/20 6:53 PM, Manivannan Sadhasivam wrote:
> > Hi,
> > 
> > On Mon, Jun 22, 2020 at 01:46:02PM +0200, Marc Kleine-Budde wrote:
> >> From: Oleksij Rempel <o.rempel@pengutronix.de>
> >>
> >> This patch adds the device-tree binding documentation for the Microchip
> >> MCP25xxFD SPI CAN controller family.
> >>
> >> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> >> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> > 
> > You need to CC Rob and devicetree list to get a review for this patch.
> 
> Will do for next round.
> 
> > 
> >> ---
> >>  .../bindings/net/can/microchip,mcp25xxfd.yaml | 77 +++++++++++++++++++
> >>  1 file changed, 77 insertions(+)
> >>  create mode 100644 Documentation/devicetree/bindings/net/can/microchip,mcp25xxfd.yaml
> >>
> >> diff --git a/Documentation/devicetree/bindings/net/can/microchip,mcp25xxfd.yaml b/Documentation/devicetree/bindings/net/can/microchip,mcp25xxfd.yaml
> >> new file mode 100644
> >> index 000000000000..4993dd49181c
> >> --- /dev/null
> >> +++ b/Documentation/devicetree/bindings/net/can/microchip,mcp25xxfd.yaml
> >> @@ -0,0 +1,77 @@
> >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> >> +%YAML 1.2
> >> +---
> >> +$id: http://devicetree.org/schemas/net/can/microchip,mcp25xxfd.yaml#
> >> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> >> +
> >> +title: Microchip MCP2517/18FD stand-alone CAN controller device tree bindings
> >> +
> > 
> > MCP251{7/8}FD?
> 
> Which expansion rules should be use for the title? In sh-like shells it would be
> MCP251{7,8}FD.
> 

Either one. I was just concerned about the original one which might create
ambiguity.

> > 
> >> +maintainers:
> >> +  - Marc Kleine-Budde <mkl@pengutronix.de>
> >> +
> >> +properties:
> >> +  compatible:
> >> +    oneOf:
> >> +      - const: microchip,mcp2517fd
> >> +        description: for MCP2517FD
> >> +      - const: microchip,mcp2518fd
> >> +        description: for MCP2518FD
> >> +      - const: microchip,mcp25xxfd
> >> +        description: to autodetect chip variant
> >> +
> > 
> > Actually what benefit this generic compatible provides? User who is integrating
> > this driver should know the exact controller instance he is playing with, isn't
> > it?
> 
> As the chip variant can be autodetected why not do it? It makes device tree
> overlays (e.g. for the rpi much simpler), as you don't have to specify the exact
> chip variant.
> 
> Testing is much easier, as I don't have to change the overlays if swapping the
> CAN hat.
> 

Okay.

> > 
> >> +  reg:
> >> +    maxItems: 1
> >> +
> >> +  interrupts-extended:
> >> +    maxItems: 1
> >> +
> > 
> > Document this just above 'interrupts' property.
> 
> Do you mean I should change the order?
> - reg:
> - clocks:
> - interrupts-extended:
> 

Sorry, please ignore this comment. You can keep the order as it is.

> > 
> >> +  clocks:
> >> +    maxItems: 1
> >> +
> >> +  vdd-supply:
> >> +    description: Regulator that powers the CAN controller.
> >> +    maxItems: 1
> >> +
> >> +  xceiver-supply:
> >> +    description: Regulator that powers the CAN transceiver.
> >> +    maxItems: 1
> >> +
> >> +  rx-int-gpios:

This doesn't look like a standard property. So I think you need to add
'microchip' prefix to make it as vendor specific.

> >> +    description:
> >> +      GPIO phandle of GPIO connected to to INT1 pin of the MCP25XXFD, which
> >> +      signals a pending RX interrupt.
> >> +    maxItems: 1
> >> +
> >> +  spi-max-frequency:
> >> +    description:
> >> +      Must be half or less of "clocks" frequency.
> >> +    maximum: 20000000
> >> +
> >> +required:
> >> +  - compatible
> >> +  - reg
> >> +  - interrupts-extended
> >> +  - clocks
> >> +
> > 
> > The controller is capable of generating clocks and also able to control few
> > GPIOs. So eventually you need to document those properties in bindings even
> > your driver is not supporting all of them atm.
> 
> I'd like to add support for clocks and GPIOs as soon as someone needs them. DT
> bindings will go along with that. So far I have no customer that needs support
> for that, do you?
> 

DT binding should describe what the controller is capable of and not the
capability of the driver. You can always add functionality to driver but binding
should stay as it is (although there are exceptions...).

Thanks,
Mani

> > If you want you can take a look at the bindings patch I posted earlier:
> > 
> > dt-bindings: can: Document devicetree bindings for MCP25XXFD
> 
> regards,
> Marc
> 
> -- 
> Pengutronix e.K.                 | Marc Kleine-Budde           |
> Embedded Linux                   | https://www.pengutronix.de  |
> Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
> Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

  reply	other threads:[~2020-06-23  3:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-22 11:46 [PATCH v41 0/3] can: add mcp25xxfd support Marc Kleine-Budde
2020-06-22 11:46 ` [PATCH v41 1/3] can: rx-offload: can_rx_offload_add_manual(): add new initialization function Marc Kleine-Budde
2020-06-22 11:46 ` [PATCH v41 2/3] dt-binding: can: mcp25xxfd: document device tree bindings Marc Kleine-Budde
2020-06-22 16:53   ` Manivannan Sadhasivam
2020-06-22 18:12     ` Marc Kleine-Budde
2020-06-23  3:26       ` Manivannan Sadhasivam [this message]
2020-06-23  6:02         ` Oleksij Rempel
2020-06-23  6:12           ` Manivannan Sadhasivam
2020-06-23  7:27         ` Marc Kleine-Budde
2020-06-23 12:46 ` [PATCH v41 0/3] can: add mcp25xxfd support Manivannan Sadhasivam
2020-06-23 12:49   ` Marc Kleine-Budde
     [not found] ` <20200622114603.965371-4-mkl@pengutronix.de>
     [not found]   ` <20200626133243.GA8333@Mani-XPS-13-9360>
2020-06-26 14:41     ` [PATCH v41 3/3] can: mcp25xxfd: initial commit Marc Kleine-Budde
2020-07-16 13:28       ` Manivannan Sadhasivam
2020-08-17 15:51         ` Manivannan Sadhasivam
2020-06-27 19:56     ` Kurt Van Dijck
2020-06-28  6:48       ` Manivannan Sadhasivam
2020-08-31 10:10 ` [PATCH v41 0/3] can: add mcp25xxfd support Manivannan Sadhasivam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200623032635.GG11093@Mani-XPS-13-9360 \
    --to=manivannan.sadhasivam@linaro.org \
    --cc=dev.kurt@vandijck-laurijssen.be \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=o.rempel@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).