From: mishal@softerra.com (Mykhail Lodygin)
To: linux-arm-kernel@lists.infradead.org
Subject: Using SPI in a kernel module
Date: Mon, 28 Jun 2010 01:30:24 +0300 [thread overview]
Message-ID: <4C27D100.2030405@softerra.com> (raw)
In-Reply-To: <385275.91392.qm@web33802.mail.mud.yahoo.com>
On 06/28/2010 12:47 AM, Alfredo Quesada S?nchez wrote:
> I expected to receive a call to probe as soon as i register an
> spi_driver, which doesn't
> seem to happen.
>
of course , you havn't fullfill the appropriate structure fields.
> If my driver must be already registered before the machine init then it
> can't be a module, it must be inside the kernel,
>
Why do you think so? spi works for many years - your driver is not the
first and definitely not the last, please exame other drivers - you will
see how to register.
>
> What I don't understand is where the spi_device instance is created,
> and where. Looks like
> it's appearing from nowhere.
>
come on! drivers/spi/spi.c spi_alloc_device
<http://lxr.linux.no/linux+*/+code=spi_alloc_device>
> But even more strange is the fact that spidev only registers
> its own spi_driver and according to other people it works, so the only
> explanation for me
> is that it can only be done as long as it's part of the kernel. But
> even being part of the
> kernel spi_driver's register should be done before the machine init,
> which makes no sense
> imho.
>
Sorry but again - why do you think so? please look at several drivers
which utilize spi_driver structure carefully - and you'll see how to do
it yourself.
> Regards
>
>
> --- El *dom, 27/6/10, Mykhail Lodygin /<mishal@softerra.com>/* escribi?:
>
>
> De: Mykhail Lodygin <mishal@softerra.com>
> Asunto: Re: Using SPI in a kernel module
> Para: "Alfredo Quesada S?nchez" <freddy2_es@yahoo.com>
> CC: linux-arm-kernel at lists.infradead.org
> Fecha: domingo, 27 de junio, 2010 23:26
>
> Invocation sequence is the same as described in ek_spi_devices. So since there is no YOUR driver in ek_spi_devices - i can't say when it would be called - for now - never.
> which device? - you define it by setting .chip_select, i believe.
>
>
> You could see all calls - just set verbosity to debug function in
> the configuration.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100628/da8f9102/attachment-0001.html>
prev parent reply other threads:[~2010-06-27 22:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-27 18:25 Using SPI in a kernel module Alfredo Quesada Sánchez
2010-06-27 20:09 ` Mykhail Lodygin
2010-06-27 20:55 ` Alfredo Quesada Sánchez
2010-06-27 21:26 ` Mykhail Lodygin
2010-06-27 21:47 ` Alfredo Quesada Sánchez
2010-06-27 22:30 ` Mykhail Lodygin [this message]
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=4C27D100.2030405@softerra.com \
--to=mishal@softerra.com \
--cc=linux-arm-kernel@lists.infradead.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