From: Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Octavian Purdila
<octavian.purdila-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: Greg Kroah-Hartman
<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
Linus Walleij
<linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Alexandre Courbot
<gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org,
Samuel Ortiz <sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
Johan Hovold <johan-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
lkml <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Daniel Baluta
<daniel.baluta-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Laurentiu Palcu
<laurentiu.palcu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH v2 1/3] mfd: add support for Diolan DLN-2 devices
Date: Mon, 1 Sep 2014 12:39:49 +0100 [thread overview]
Message-ID: <20140901113949.GP7374@lee--X1> (raw)
In-Reply-To: <CAE1zot+T6eq0jrL6_Qh=5nihNOgGEaWe5RCDk7_1XS8ZWaWKqA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Mon, 01 Sep 2014, Octavian Purdila wrote:
> On Mon, Sep 1, 2014 at 12:51 PM, Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
> > On Mon, 01 Sep 2014, Octavian Purdila wrote:
> >
> >> On Mon, Sep 1, 2014 at 11:37 AM, Lee Jones <lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
> >> > On Sat, 30 Aug 2014, Octavian Purdila wrote:
> >> >
> >> >> This patch implements the USB part of the Diolan USB-I2C/SPI/GPIO
> >> >> Master Adapter DLN-2. Details about the device can be found here:
> >> >>
> >> >> https://www.diolan.com/i2c/i2c_interface.html.
> >> >>
> >> >> Information about the USB protocol can be found in the Programmer's
> >> >> Reference Manual [1], see section 1.7.
> >> >>
> >> >> Because the hardware has a single transmit endpoint and a single
> >> >> receive endpoint the communication between the various DLN2 drivers
> >> >> and the hardware will be muxed/demuxed by this driver.
> >> >>
> >> >> Each DLN2 module will be identified by the handle field within the DLN2
> >> >> message header. If a DLN2 module issues multiple commands in parallel
> >> >> they will be identified by the echo counter field in the message header.
> >> >>
> >> >> The DLN2 modules can use the dln2_transfer() function to issue a
> >> >> command and wait for its response. They can also register a callback
> >> >> that is going to be called when a specific event id is generated by
> >> >> the device (e.g. GPIO interrupts). The device uses handle 0 for
> >> >> sending events.
> >> >>
> >> >> [1] https://www.diolan.com/downloads/dln-api-manual.pdf
> >> >
> >> > MFD is not a dumping ground for misfit h/w. Almost all of this code
> >> > looks like it belongs in drivers/usb. Please move it there.
> >> >
> >>
> >> We initially submitted this driver as a pure USB driver, with our own
> >> module registration mechanism, but during the first round of reviews
> >> people pointed out that a MFD driver is the better approach, and I
> >> agree. I also see that there are already a couple of USB drivers
> >> implemented as MFD drivers.
> >
> > Can you link me to your previous submission please?
>
> Sure, here it is:
>
> https://lkml.org/lkml/2014/8/20/228
>
> >
> >> Do you see a better approach?
> >
> > You should have a small MFD driver which controls resources and
> > registers children. All other functionality should live in their
> > respective drivers/X locations i.e. USB functionallity should normally
> > live in drivers/usb.
> >
>
> OK, that sounds better. I am not sure how to handle the registration
> part though, since in this case we need to create the children at
> runtime, from the usb probe routine.
>
> The only solution I see is to move the driver completely to
> usb/drivers and continue to use the MFD infrastructure. Does that
> sound OK to you?
I have no problem with that. If this is an MFD driver, it _should_
live in drivers/mfd. However, all of that USB specific stuff
defiantly should not.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
next prev parent reply other threads:[~2014-09-01 11:39 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-29 22:00 [PATCH v2 0/3] mfd: add support for Diolan DLN-2 Octavian Purdila
[not found] ` <1409349654-24841-1-git-send-email-octavian.purdila-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-08-29 22:00 ` [PATCH v2 1/3] mfd: add support for Diolan DLN-2 devices Octavian Purdila
2014-09-01 8:37 ` Lee Jones
2014-09-01 9:05 ` Octavian Purdila
[not found] ` <CAE1zotK0cddns4f4ay-GJie8O2pjb72+-yYndZvW0hbF0D83HA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-09-01 9:51 ` Lee Jones
2014-09-01 10:22 ` Octavian Purdila
[not found] ` <CAE1zot+T6eq0jrL6_Qh=5nihNOgGEaWe5RCDk7_1XS8ZWaWKqA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-09-01 11:39 ` Lee Jones [this message]
2014-09-01 14:55 ` Octavian Purdila
[not found] ` <CAE1zotKNBTEMX8DDYwdwOcq0qZgqxZWazE60TUQeiOmD0a4xbA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-09-01 15:46 ` Lee Jones
2014-09-01 16:22 ` Octavian Purdila
[not found] ` <CAE1zotL-cjHqrdymzYhZq24zx+0qGY8-4JnrVZf-TGXDf5Sm3w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-09-01 17:54 ` Johan Hovold
2014-09-02 8:00 ` Lee Jones
2014-09-02 8:45 ` Octavian Purdila
[not found] ` <CAE1zotJzFL0bZvNo4mHK3+EhURarhTPDE5n+SdNzof8Nc-CFew-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-09-02 15:23 ` Johan Hovold
2014-09-03 13:39 ` Octavian Purdila
[not found] ` <CAE1zotLnBZ83O23kaDz_xVhhSpPW6YyOQmkaTfZaicmf6MfOdQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-09-03 15:37 ` Johan Hovold
2014-09-02 15:07 ` Johan Hovold
2014-08-29 22:00 ` [PATCH v2 2/3] i2c: add support for Diolan DLN-2 USB-I2C adapter Octavian Purdila
2014-08-29 22:00 ` [PATCH v2 3/3] gpio: add support for the Diolan DLN-2 USB GPIO driver Octavian Purdila
[not found] ` <1409349654-24841-4-git-send-email-octavian.purdila-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-09-04 16:32 ` Linus Walleij
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=20140901113949.GP7374@lee--X1 \
--to=lee.jones-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=daniel.baluta-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=johan-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=laurentiu.palcu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=octavian.purdila-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=wsa-z923LK4zBo2bacvFa/9K2g@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 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).