All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org
To: Patrick Menschel <menschel.p-1KBjaw7Xf1+zQB+pC5nmwQ@public.gmane.org>
Cc: linux-can-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree <devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 1/2] dt-binding: can: mcp2517fd: document device tree bindings
Date: Thu, 30 Nov 2017 17:58:57 +0100	[thread overview]
Message-ID: <F6036A58-9E98-4A62-950E-3396C9EE636E@martin.sperl.org> (raw)
In-Reply-To: <6aea8071-dc21-4ba7-2b2f-5af41b5755a5-1KBjaw7Xf1+zQB+pC5nmwQ@public.gmane.org>

Hi Patrick!

> On 30.11.2017, at 17:44, Patrick Menschel <menschel.p-1KBjaw7Xf1+zQB+pC5nmwQ@public.gmane.org> wrote:
>> 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”.

This is a gpio-controller, for which this is what I would implement.

The problem comes more from the fact that the mcp2517fd is
primarily a CAN controller, which has a few GPIO pins.

So implementing a gpio-controller for those (rarely used) GPIOs
in the same driver seems a bit of an overkill.

The mcp2515 chip also supports 5 GPIO pins, but the driver
does not really make use of them, so they are left out.

The problem here is more the fact that the mcp2517fd supports
also push-pull/open-drain on some of those gpios.

And at least openDrain may be required on TXCan if used on a network
without a transceiver…

> 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.

The settings as they are now are the “simple” version.
implementing a separate GPIO-controller driver just to implement the same
logic we have now would make it a much bigger driver without lots of extra
benefits.

So I hope the current proposal is ok...

Martin--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-11-30 16:58 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-24 18:35 [PATCH 0/2] Microchip mcp2517fd can controller driver kernel-TqfNSX0MhmxHKSADF0wUEw
     [not found] ` <20171124183509.12810-1-kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2017-11-24 18:35   ` [PATCH 1/2] dt-binding: can: mcp2517fd: document device tree bindings kernel-TqfNSX0MhmxHKSADF0wUEw
     [not found]     ` <20171124183509.12810-2-kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2017-11-26 22:28       ` Rob Herring
2017-11-29 11:55         ` kernel
     [not found]           ` <6EBDD798-8632-4F42-A138-369BCD36DF68-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2017-11-29 20:35             ` Patrick Menschel
2017-11-30  7:24               ` kernel
     [not found]                 ` <612BB6CD-5330-40B8-A854-FD065E0A3331-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2017-11-30 16:44                   ` Patrick Menschel
     [not found]                     ` <6aea8071-dc21-4ba7-2b2f-5af41b5755a5-1KBjaw7Xf1+zQB+pC5nmwQ@public.gmane.org>
2017-11-30 16:58                       ` kernel-TqfNSX0MhmxHKSADF0wUEw [this message]
2017-11-30 17:49                         ` Patrick Menschel
     [not found]                           ` <1ac487f7-17e3-c8a0-0f99-8138fe867373-1KBjaw7Xf1+zQB+pC5nmwQ@public.gmane.org>
2017-12-05 10:26                             ` Martin Sperl
     [not found]                               ` <d79ee9eb-8b36-0086-8d76-ec6bca224fe5@posteo.de>
     [not found]                                 ` <d79ee9eb-8b36-0086-8d76-ec6bca224fe5-1KBjaw7Xf1+zQB+pC5nmwQ@public.gmane.org>
2017-12-17 14:34                                   ` kernel-TqfNSX0MhmxHKSADF0wUEw
     [not found]                                     ` <4E2DB518-A148-46CE-8267-73D292991BD2-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2017-12-22 15:50                                       ` Patrick Menschel
2017-11-24 18:35   ` [PATCH 2/2] can: mcp2517fd: Add Microchip mcp2517fd CAN FD driver kernel-TqfNSX0MhmxHKSADF0wUEw
     [not found]     ` <20171124183509.12810-3-kernel-TqfNSX0MhmxHKSADF0wUEw@public.gmane.org>
2017-11-30 13:04       ` Marc Kleine-Budde
     [not found]         ` <ff920dd7-4535-dcaa-27f9-57844ce66c7b-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2017-12-03 18:34           ` kernel-TqfNSX0MhmxHKSADF0wUEw
2017-11-25 12:03 ` [PATCH 0/2] Microchip mcp2517fd can controller driver Oliver Hartkopp
2017-11-25 14:47   ` kernel
2017-11-26 12:38     ` Oliver Hartkopp
2017-11-26 15:43       ` kernel
2017-11-26 16:18     ` Wolfgang Grandegger
2017-11-26 18:29       ` kernel
2017-11-26 19:05         ` Wolfgang Grandegger
2017-11-26 19:53           ` kernel

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=F6036A58-9E98-4A62-950E-3396C9EE636E@martin.sperl.org \
    --to=kernel-tqfnsx0mhmxhksadf0wuew@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-can-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=menschel.p-1KBjaw7Xf1+zQB+pC5nmwQ@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.