<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
On 06/28/2010 12:47 AM, Alfredo Quesada Sánchez wrote:
<blockquote cite="mid:385275.91392.qm@web33802.mail.mud.yahoo.com"
type="cite">
<meta http-equiv="Context-Type"
content="text/html; charset=iso-8859-1">
<table>
<tbody>
<tr>
<td valign="top">I expected to receive a call to probe as soon
as i register an spi_driver, which doesn't<br>
seem to happen.</td>
</tr>
</tbody>
</table>
</blockquote>
of course , you havn't fullfill the appropriate structure fields.<br>
<blockquote cite="mid:385275.91392.qm@web33802.mail.mud.yahoo.com"
type="cite">
<table>
<tbody>
<tr>
<td valign="top"> If my driver must be already registered
before the machine init then it<br>
can't be a module, it must be inside the kernel,</td>
</tr>
</tbody>
</table>
</blockquote>
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.<br>
<blockquote cite="mid:385275.91392.qm@web33802.mail.mud.yahoo.com"
type="cite">
<table>
<tbody>
<tr>
<td valign="top"> <br>
</td>
</tr>
</tbody>
</table>
</blockquote>
<br>
<blockquote cite="mid:385275.91392.qm@web33802.mail.mud.yahoo.com"
type="cite">
<table>
<tbody>
<tr>
<td valign="top">What I don't understand is where the
spi_device instance is created, and where. Looks like<br>
it's appearing from nowhere.</td>
</tr>
</tbody>
</table>
</blockquote>
come on! drivers/spi/spi.c spi_alloc_device<a
href="http://lxr.linux.no/linux+*/+code=spi_alloc_device" class="sref"></a>
<blockquote cite="mid:385275.91392.qm@web33802.mail.mud.yahoo.com"
type="cite">
<table>
<tbody>
<tr>
<td valign="top"> But even more strange is the fact that spidev
only registers<br>
its own spi_driver and according to other people it works, so the only
explanation for me<br>
is that it can only be done as long as it's part of the kernel. But
even being part of the<br>
kernel spi_driver's register should be done before the machine init,
which makes no sense<br>
imho.<br>
<br>
</td>
</tr>
</tbody>
</table>
</blockquote>
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.<br>
<blockquote cite="mid:385275.91392.qm@web33802.mail.mud.yahoo.com"
type="cite">
<table>
<tbody>
<tr>
<td valign="top">Regards<br>
<br>
<br>
--- El <b>dom, 27/6/10, Mykhail Lodygin <i><a class="moz-txt-link-rfc2396E" href="mailto:mishal@softerra.com"><mishal@softerra.com></a></i></b>
escribió:<br>
<blockquote><br>
De: Mykhail Lodygin <a class="moz-txt-link-rfc2396E" href="mailto:mishal@softerra.com"><mishal@softerra.com></a><br>
Asunto: Re: Using SPI in a kernel module<br>
Para: "Alfredo Quesada Sánchez" <a class="moz-txt-link-rfc2396E" href="mailto:freddy2_es@yahoo.com"><freddy2_es@yahoo.com></a><br>
CC: <a class="moz-txt-link-abbreviated" href="mailto:linux-arm-kernel@lists.infradead.org">linux-arm-kernel@lists.infradead.org</a><br>
Fecha: domingo, 27 de junio, 2010 23:26<br>
<br>
<div>
<pre> 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.
</pre>
You could see all calls - just set verbosity to debug function in the
configuration.<br>
<br>
</div>
</blockquote>
</td>
</tr>
</tbody>
</table>
<br>
</blockquote>
<br>
</body>
</html>