* general question: spi framework
@ 2010-05-28 10:40 Dimitar Penev
[not found] ` <875452.33839.qm-cP32haYabaOvuULXzWHTWIglqE1Y4D90QQ4Iyu8u01E@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Dimitar Penev @ 2010-05-28 10:40 UTC (permalink / raw)
To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Hi Guys,
I have a pretty general question about the spi framework.
I hope this is not off topic for this list.
So it is about uclinux kernel 2.6.28 for blackfin cpu.
1. I undestand how to define my spi data in the board file.
2. I have kernel device driver for my spi chip.
3. I have read about linux/spi/spi.h and the spi protocol driver API which
is exported.
spi_read(struct spi_device *spi, u8 *buf, size_t len)
spi_write(struct spi_device *spi, const u8 *buf, size_t len)
etc ...
I would like to use this API from another kernel module (so kernel space)
For me it is unclear however how to get pointer to spi_device from my kernel module. In general is there somewhere an example for using of the spi framework from the kernel space.
I don't want to write spi device drivers. It is already written in the linux tree. I would like to use it from the kernel space.
Thank you for all pointers you provide!
Dimitar
------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: general question: spi framework
[not found] ` <875452.33839.qm-cP32haYabaOvuULXzWHTWIglqE1Y4D90QQ4Iyu8u01E@public.gmane.org>
@ 2010-05-28 10:45 ` Baruch Siach
0 siblings, 0 replies; 2+ messages in thread
From: Baruch Siach @ 2010-05-28 10:45 UTC (permalink / raw)
To: Dimitar Penev; +Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Hi Dimitar,
On Fri, May 28, 2010 at 03:40:18AM -0700, Dimitar Penev wrote:
> I would like to use this API from another kernel module (so kernel space)
> For me it is unclear however how to get pointer to spi_device from my kernel
> module. In general is there somewhere an example for using of the spi
> framework from the kernel space. I don't want to write spi device drivers.
> It is already written in the linux tree. I would like to use it from the
> kernel space.
See drivers/net/enc28j60.c (Ethernet driver), and drivers/mtd/devices/m25p80.c
(Flash driver).
baruch
--
~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org - tel: +972.2.679.5364, http://www.tkos.co.il -
------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-05-28 10:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-28 10:40 general question: spi framework Dimitar Penev
[not found] ` <875452.33839.qm-cP32haYabaOvuULXzWHTWIglqE1Y4D90QQ4Iyu8u01E@public.gmane.org>
2010-05-28 10:45 ` Baruch Siach
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).