From: Daniel Santos <danielfsantos@att.net>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
linux-gpio <linux-gpio@vger.kernel.org>,
linux-usb <linux-usb@vger.kernel.org>,
linux-spi <linux-spi@vger.kernel.org>
Subject: Re: RESEND: Generating interrupts from a USB device driver?
Date: Tue, 03 Sep 2013 14:10:38 -0500 [thread overview]
Message-ID: <5226342E.70804@att.net> (raw)
In-Reply-To: <20130903175933.GA8463@kroah.com>
On 09/03/2013 12:59 PM, Greg KH wrote:
> Hm, I thought we used to have some of them, I guess people have been
> saying they would write a driver for this type of hardware for a long
> time now :(
Well, on the bright side, we have one now, albeit in a "this is my first
driver that nobody has reviewed yet" state. :) It works (even on RPi --
well, mostly). As-is, it has a fair TODO & fix list, which I'm sure
will grow rapidly with some review. I hope that as I learn the kernel
better, I can generalize parts of this into some re-usable lib for other
USB-to-SPI/I2C/GPIO drivers.
https://github.com/daniel-santos/mcp2210-linux/
> Anyway, look at the spi core, I think you want to tie into the
> spi_new_device() call in your usb driver, and start sending/receiving
> data through the SPI interfaces the spi core provides.
I'm actually using the alternative to that call, which is the
spi_alloc_device() / spi_add_device() pair as I'm not using struct
spi_board_info at all since it doesn't (currently) have even half of the
fields I need for each device. However, struct spi_device does have the
two void * fields controller_data and controller_state -- I suppose I
can use those to pass a pointer to a add_notify() type of function. I
was just trying to seek a more generic, re-usable mechanism, but this
should at least work for now.
> The Linux SPI mailing list should be able to help you out a lot more
> here than I can.
>
> greg k-h
Thanks again for your help!
next prev parent reply other threads:[~2013-09-03 19:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-02 22:46 RESEND: Generating interrupts from a USB device driver? Daniel Santos
2013-09-02 23:07 ` Greg KH
[not found] ` <20130902230738.GA22494-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2013-09-03 1:40 ` Daniel Santos
2013-09-03 17:59 ` Greg KH
2013-09-03 19:10 ` Daniel Santos [this message]
2013-09-03 20:00 ` RESEND: Generating interrupts from a USB device driver? (USB to SPI/GPIO bridge) Daniel Santos
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=5226342E.70804@att.net \
--to=danielfsantos@att.net \
--cc=daniel.santos@pobox.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=linux-usb@vger.kernel.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).