All of lore.kernel.org
 help / color / mirror / Atom feed
* General SPI question
@ 2009-04-24  6:28 ` Arnav Das
  0 siblings, 0 replies; 6+ messages in thread
From: Arnav Das @ 2009-04-24  6:28 UTC (permalink / raw)
  To: David Brownell
  Cc: linuxppc-dev-mnsaURCQ41sdnm+yROfE0A, Stefan Roese,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f


[-- Attachment #1.1: Type: text/plain, Size: 1578 bytes --]

Hi,

Thanks a lot and sorry for the mistakes. I have gone through the trm of the
adc as well as the omap driver. my question is that i want to interact the
adc to the board. now should i directly use the omap driver or should i mak
one of my own. if i make one of my own then i would like to know how would
the spi registers be changed by driver. should it include the omap2 driver
or is the fuctionality provided directly when i include spi.h.

another doubt: when and why is the spidev.c/h used?

i am deeply grateful towards you for helping me out
thanks
Arnav

On Fri, Apr 24, 2009 at 11:50 AM, David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>wrote:

> On Thursday 23 April 2009, Arnav Das wrote:
> > i am a newbie
>
> Lesson #1:  make sure your Subject: lines match the message
> topic (I did a partial repair) and don't post to the wrong
> list (e.g. PPC lists for OMAP questions).
>
>
> > and am doing a project on beagle board(running
> > omap3530). i am interfacing an adc(ads7886) to the beagleboard via
> > spi. need to know how the spi works
>
> Read the ads7886 data sheet, in this case.  It uses
> a subset of SPI ... no input commands, just a 12-bit
> sample returned each time chipselect pulses.
>
>
> > and how a module can access the
> > spi registers of the omap. if someones already made an adc driver can
> > they mail me?
>
> Use drivers/spi/omap2_mcspi.c on OMAP3 boards, at
> least to start with.  If you want streaming conversions
> you may want to use different modes than are currently
> supported by that driver.
>
> - Dave
>
>
>
>
>

[-- Attachment #1.2: Type: text/html, Size: 2011 bytes --]

[-- Attachment #2: Type: text/plain, Size: 340 bytes --]

------------------------------------------------------------------------------
Crystal Reports &#45; New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty&#45;free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects

[-- Attachment #3: Type: text/plain, Size: 210 bytes --]

_______________________________________________
spi-devel-general mailing list
spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

^ permalink raw reply	[flat|nested] 6+ messages in thread

* General SPI question
@ 2009-04-24  6:28 ` Arnav Das
  0 siblings, 0 replies; 6+ messages in thread
From: Arnav Das @ 2009-04-24  6:28 UTC (permalink / raw)
  To: David Brownell; +Cc: linuxppc-dev, Stefan Roese, spi-devel-general

[-- Attachment #1: Type: text/plain, Size: 1550 bytes --]

Hi,

Thanks a lot and sorry for the mistakes. I have gone through the trm of the
adc as well as the omap driver. my question is that i want to interact the
adc to the board. now should i directly use the omap driver or should i mak
one of my own. if i make one of my own then i would like to know how would
the spi registers be changed by driver. should it include the omap2 driver
or is the fuctionality provided directly when i include spi.h.

another doubt: when and why is the spidev.c/h used?

i am deeply grateful towards you for helping me out
thanks
Arnav

On Fri, Apr 24, 2009 at 11:50 AM, David Brownell <david-b@pacbell.net>wrote:

> On Thursday 23 April 2009, Arnav Das wrote:
> > i am a newbie
>
> Lesson #1:  make sure your Subject: lines match the message
> topic (I did a partial repair) and don't post to the wrong
> list (e.g. PPC lists for OMAP questions).
>
>
> > and am doing a project on beagle board(running
> > omap3530). i am interfacing an adc(ads7886) to the beagleboard via
> > spi. need to know how the spi works
>
> Read the ads7886 data sheet, in this case.  It uses
> a subset of SPI ... no input commands, just a 12-bit
> sample returned each time chipselect pulses.
>
>
> > and how a module can access the
> > spi registers of the omap. if someones already made an adc driver can
> > they mail me?
>
> Use drivers/spi/omap2_mcspi.c on OMAP3 boards, at
> least to start with.  If you want streaming conversions
> you may want to use different modes than are currently
> supported by that driver.
>
> - Dave
>
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 1983 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: General SPI question
       [not found] ` <8ee9e87c0904232328j7f912eb6v3d0b9cb0321793a9-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2009-04-24  7:31   ` David Brownell
       [not found]     ` <200904240031.53343.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: David Brownell @ 2009-04-24  7:31 UTC (permalink / raw)
  To: Arnav Das; +Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

[ I dropped the PPC folk from the cc list.. ]

On Thursday 23 April 2009, Arnav Das wrote:
> Hi,
> 
> Thanks a lot and sorry for the mistakes. I have gone through the trm of the
> adc as well as the omap driver. my question is that i want to interact the
> adc to the board. now should i directly use the omap driver or should i mak
> one of my own.

Unless you have a compelling reason, use the OMAP controller driver.

You'd write a spi_driver -- a *REALLY* simple one -- using interfaces
described in Documentation/spi/spi-summary for the lower level.  Almost
all the work involved would be in the upper level interface:  presenting
the data to whatever needs it.  Maybe sysfs, maybe not; you've not said
anything about how you need to use this data.  That would usually be
the first thing to figure out...


> if i make one of my own then i would like to know how would 
> the spi registers be changed by driver. should it include the omap2 driver
> or is the fuctionality provided directly when i include spi.h.

You should end up with a simple ADC driver that can hook up to
any platform's SPI controller.  Your driver will talk to a
"struct spi_device" and will be usable on non-OMAP boards.

 
> another doubt: when and why is the spidev.c/h used?

When you want a "userspace driver" instead of a kernel driver.

- Dave


> i am deeply grateful towards you for helping me out
> thanks
> Arnav
> 
> On Fri, Apr 24, 2009 at 11:50 AM, David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>wrote:
> 
> > On Thursday 23 April 2009, Arnav Das wrote:
> > > i am a newbie
> >
> > Lesson #1:  make sure your Subject: lines match the message
> > topic (I did a partial repair) and don't post to the wrong
> > list (e.g. PPC lists for OMAP questions).
> >
> >
> > > and am doing a project on beagle board(running
> > > omap3530). i am interfacing an adc(ads7886) to the beagleboard via
> > > spi. need to know how the spi works
> >
> > Read the ads7886 data sheet, in this case.  It uses
> > a subset of SPI ... no input commands, just a 12-bit
> > sample returned each time chipselect pulses.
> >
> >
> > > and how a module can access the
> > > spi registers of the omap. if someones already made an adc driver can
> > > they mail me?
> >
> > Use drivers/spi/omap2_mcspi.c on OMAP3 boards, at
> > least to start with.  If you want streaming conversions
> > you may want to use different modes than are currently
> > supported by that driver.
> >
> > - Dave
> >
> >
> >
> >
> >
> 



------------------------------------------------------------------------------
Crystal Reports &#45; New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty&#45;free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: General SPI question
       [not found]     ` <200904240031.53343.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
@ 2009-04-24  8:28       ` Arnav Das
       [not found]         ` <8ee9e87c0904240128y1615625aiae9468de0a02643-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Arnav Das @ 2009-04-24  8:28 UTC (permalink / raw)
  To: David Brownell; +Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f


[-- Attachment #1.1: Type: text/plain, Size: 3419 bytes --]

thanks for the quick reply.

i basically want to make a cro out of the adc and the beaglebard. so
whatever input i get, i need to show it in a graphical manner on a real time
basis. this probably can be forthur utilised in as a ecg in medical
applications and further improvements can be made.

could you please guide me to a knowledgebase from where i can learn all
about spi, drivers and spi drivers(platform independant, if possible) as my
main focus of the project is the graphical part wherein i will use the data
collected to output on the screen with proper gui.

i got this adc driver from blackfin/uclinux resources please see whether it
is ok?

Thanks a lot,
Arnav

On Fri, Apr 24, 2009 at 1:01 PM, David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org> wrote:

> [ I dropped the PPC folk from the cc list.. ]
>
> On Thursday 23 April 2009, Arnav Das wrote:
> > Hi,
> >
> > Thanks a lot and sorry for the mistakes. I have gone through the trm of
> the
> > adc as well as the omap driver. my question is that i want to interact
> the
> > adc to the board. now should i directly use the omap driver or should i
> mak
> > one of my own.
>
> Unless you have a compelling reason, use the OMAP controller driver.
>
> You'd write a spi_driver -- a *REALLY* simple one -- using interfaces
> described in Documentation/spi/spi-summary for the lower level.  Almost
> all the work involved would be in the upper level interface:  presenting
> the data to whatever needs it.  Maybe sysfs, maybe not; you've not said
> anything about how you need to use this data.  That would usually be
> the first thing to figure out...
>
>
> > if i make one of my own then i would like to know how would
> > the spi registers be changed by driver. should it include the omap2
> driver
> > or is the fuctionality provided directly when i include spi.h.
>
> You should end up with a simple ADC driver that can hook up to
> any platform's SPI controller.  Your driver will talk to a
> "struct spi_device" and will be usable on non-OMAP boards.
>
>
> > another doubt: when and why is the spidev.c/h used?
>
> When you want a "userspace driver" instead of a kernel driver.
>
> - Dave
>
>
> > i am deeply grateful towards you for helping me out
> > thanks
> > Arnav
> >
> > On Fri, Apr 24, 2009 at 11:50 AM, David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org
> >wrote:
> >
> > > On Thursday 23 April 2009, Arnav Das wrote:
> > > > i am a newbie
> > >
> > > Lesson #1:  make sure your Subject: lines match the message
> > > topic (I did a partial repair) and don't post to the wrong
> > > list (e.g. PPC lists for OMAP questions).
> > >
> > >
> > > > and am doing a project on beagle board(running
> > > > omap3530). i am interfacing an adc(ads7886) to the beagleboard via
> > > > spi. need to know how the spi works
> > >
> > > Read the ads7886 data sheet, in this case.  It uses
> > > a subset of SPI ... no input commands, just a 12-bit
> > > sample returned each time chipselect pulses.
> > >
> > >
> > > > and how a module can access the
> > > > spi registers of the omap. if someones already made an adc driver can
> > > > they mail me?
> > >
> > > Use drivers/spi/omap2_mcspi.c on OMAP3 boards, at
> > > least to start with.  If you want streaming conversions
> > > you may want to use different modes than are currently
> > > supported by that driver.
> > >
> > > - Dave
> > >
> > >
> > >
> > >
> > >
> >
>
>
>

[-- Attachment #1.2: Type: text/html, Size: 4384 bytes --]

[-- Attachment #2: bfin_spi_adc.c --]
[-- Type: application/octet-stream, Size: 5202 bytes --]

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/wait.h>
#include <linux/poll.h>
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/string.h>
#include <linux/interrupt.h>
#include <linux/device.h>
#include <linux/miscdevice.h>
#include <linux/spi/spi.h>
#include <linux/spinlock.h>
#include <linux/dma-mapping.h>

#include <asm/dma-mapping.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/cacheflush.h>
#include <asm/dma.h>

#include "beagle_spi.h"

#define SPI0_ADC_MINOR         251

struct beagle_spi_adc {
	int             opened;
	unsigned short  *buffer;
	int             hz;
	int 		cont;
	struct spi_device *spidev;
	dma_addr_t dma_handle;
};

struct beagle_spi_adc spi_adc;
static DEFINE_SPINLOCK(spiadc_lock);

static int adc_spi_ioctl(struct inode *inode, struct file *filp, uint cmd, unsigned long arg)
{
unsigned long value;
struct beagle_spi_adc *beagle_spi_adc = filp->private_data;

switch (cmd) {
case CMD_SPI_GET_SYSTEMCLOCK:
{
value = get_sclk();
copy_to_user((unsigned long *)arg, &value, sizeof(unsigned long));
break;
}
case CMD_SPI_SET_BAUDRATE:
{
if (arg > (133000000 / 4))
return -EINVAL;
beagle_spi_adc->hz = arg;
break;
}
case CMD_SPI_SET_WRITECONTINUOUS:
{
beagle_spi_adc->cont = (unsigned char)arg;
break;
}
default:
return -EINVAL;
}
return 0;
}

static ssize_t adc_spi_read (struct file *filp, char *buf, size_t count, loff_t *pos)
{
int stat;
struct beagle_spi_adc *beagle_spi_adc = filp->private_data;
u8 *buffer;

struct spi_transfer	t = {
.len		= count,
.speed_hz	= beagle_spi_adc->hz,
};
struct spi_message	m;

if (count <= 0)
return -EINVAL;

buffer = dma_alloc_coherent(NULL, count, &beagle_spi_adc->dma_handle, GFP_KERNEL);

if (buffer == NULL)
return -ENOMEM;

t.rx_buf = buffer;

spi_message_init(&m);
spi_message_add_tail(&t, &m);

stat = spi_sync(beagle_spi_adc->spidev, &m);

if (stat == 0) {
unsigned long	missing;

missing = copy_to_user(buf, buffer, count);
if (count && missing == count)
stat = -EFAULT;
else
stat = count - missing;
}

dma_free_coherent(NULL, count, buffer, beagle_spi_adc->dma_handle);

return stat;
}

static ssize_t adc_spi_write (struct file *filp, const char *buf, size_t count, loff_t *f_pos)
{
int stat;
unsigned long missing;
struct beagle_spi_adc *beagle_spi_adc = filp->private_data;
u8 *buffer;

struct spi_transfer	t = {
.len		= count,
.speed_hz	= beagle_spi_adc->hz,
};
struct spi_message	m;

if (count <= 0)
return -EINVAL;

buffer = dma_alloc_coherent(NULL, count, &beagle_spi_adc->dma_handle, GFP_KERNEL);

if (buffer == NULL)
return -ENOMEM;

t.tx_buf = buffer;

if (beagle_spi_adc->cont)
t.tx_dma = 0xFFFF;

spi_message_init(&m);
spi_message_add_tail(&t, &m);

missing = copy_from_user(buffer, buf, count);

if (missing == 0) {
stat = spi_sync(beagle_spi_adc->spidev, &m);
if (stat == 0)
stat = count;
} 
else
stat = -EFAULT;

dma_free_coherent(NULL, count, buffer, beagle_spi_adc->dma_handle);

return stat;
}

static int adc_spi_open(struct inode *inode, struct file *filp)
{
unsigned long flags;
int minor = MINOR (inode->i_rdev);


if (minor != SPI0_ADC_MINOR)
return -ENXIO;

spin_lock_irqsave(&spiadc_lock, flags);
if (spi_adc.opened){
spin_unlock_irqrestore(&spiadc_lock, flags);
return -EMFILE;
}

spi_adc.opened = 1;

filp->private_data = &spi_adc;
spin_unlock_irqrestore(&spiadc_lock, flags);

return 0;
}

static int adc_spi_release (struct inode *inode, struct file *filp)
{
unsigned long flags;
struct beagle_spi_adc *beagle_spi_adc = filp->private_data;

spin_lock_irqsave(&spiadc_lock, flags);
beagle_spi_adc->opened = 0;
beagle_spi_adc->hz = 0;
beagle_spi_adc->cont = 0;
spin_unlock_irqrestore(&spiadc_lock, flags);

return 0;
}

static struct file_operations beagle_spi_adc_fops = {
.owner = THIS_MODULE,
.read = adc_spi_read,
.write = adc_spi_write,
.ioctl = adc_spi_ioctl,
.open = adc_spi_open,
.release = adc_spi_release,
};

static int __devinit beagle_spi_adc_probe(struct spi_device *spi)
{
spi_adc.spidev = spi;

return 0;
}

static int __devexit beagle_spi_adc_remove(struct spi_device *spi)
{
printk(KERN_INFO "Goodbye SPI\n");
return 0;
}

static struct spi_driver beagle_spi_adc_driver = {
.driver = {
.name	= "beagle_spi_adc",
.bus	= &spi_bus_type,
.owner	= THIS_MODULE,
},
.probe	= beagle_spi_adc_probe,
.remove	= __devexit_p(beagle_spi_adc_remove),
};

/*static struct miscdevice beagle_adc_dev = {
SPI0_ADC_MINOR,
"spi",
&beagle_spi_adc_fops
};*/

static int __init beagle_spi_adc_init(void)
{
int result;
result = misc_register(&beagle_adc_dev);
if (result < 0) {
printk(KERN_WARNING "SPI: Failed to register\n");
return result;
}

return spi_register_driver(&beagle_spi_adc_driver);
}

static void __exit beagle_spi_adc_exit(void)
{
spi_unregister_driver(&beagle_spi_adc_driver);
misc_deregister(&beagle_adc_dev);
}

module_init(beagle_spi_adc_init);
module_exit(beagle_spi_adc_exit);

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("SPI-ADC Driver");

[-- Attachment #3: bfin5xx_spi.h --]
[-- Type: application/octet-stream, Size: 2835 bytes --]

#ifndef _SPI_CHANNEL_H_
#define _SPI_CHANNEL_H_

#define SPI_READ              0
#define SPI_WRITE             1

#define SPI_CTRL_OFF            0x0
#define SPI_FLAG_OFF            0x4
#define SPI_STAT_OFF            0x8
#define SPI_TXBUFF_OFF          0xc
#define SPI_RXBUFF_OFF          0x10
#define SPI_BAUD_OFF            0x14
#define SPI_SHAW_OFF            0x18


#define BIT_CTL_ENABLE      0x4000
#define BIT_CTL_OPENDRAIN   0x2000
#define BIT_CTL_MASTER      0x1000
#define BIT_CTL_POLAR       0x0800
#define BIT_CTL_PHASE       0x0400
#define BIT_CTL_BITORDER    0x0200
#define BIT_CTL_WORDSIZE    0x0100
#define BIT_CTL_MISOENABLE  0x0020
#define BIT_CTL_RXMOD       0x0000
#define BIT_CTL_TXMOD       0x0001
#define BIT_CTL_TIMOD_DMA_TX 0x0003
#define BIT_CTL_TIMOD_DMA_RX 0x0002
#define BIT_CTL_SENDOPT     0x0004
#define BIT_CTL_TIMOD       0x0003

#define BIT_STAT_SPIF       0x0001
#define BIT_STAT_MODF       0x0002
#define BIT_STAT_TXE        0x0004
#define BIT_STAT_TXS        0x0008
#define BIT_STAT_RBSY       0x0010
#define BIT_STAT_RXS        0x0020
#define BIT_STAT_TXCOL      0x0040
#define BIT_STAT_CLR        0xFFFF

#define BIT_STU_SENDOVER    0x0001
#define BIT_STU_RECVFULL    0x0020

#define CFG_SPI_ENABLE      1
#define CFG_SPI_DISABLE     0

#define CFG_SPI_OUTENABLE   1
#define CFG_SPI_OUTDISABLE  0

#define CFG_SPI_ACTLOW      1
#define CFG_SPI_ACTHIGH     0

#define CFG_SPI_PHASESTART  1
#define CFG_SPI_PHASEMID    0

#define CFG_SPI_MASTER      1
#define CFG_SPI_SLAVE       0

#define CFG_SPI_SENELAST    0
#define CFG_SPI_SENDZERO    1

#define CFG_SPI_RCVFLUSH    1
#define CFG_SPI_RCVDISCARD  0

#define CFG_SPI_LSBFIRST    1
#define CFG_SPI_MSBFIRST    0

#define CFG_SPI_WORDSIZE16  1
#define CFG_SPI_WORDSIZE8   0

#define CFG_SPI_MISOENABLE   1
#define CFG_SPI_MISODISABLE  0

#define CFG_SPI_READ      0x00
#define CFG_SPI_WRITE     0x01
#define CFG_SPI_DMAREAD   0x02
#define CFG_SPI_DMAWRITE  0x03

#define CFG_SPI_CSCLEARALL  0
#define CFG_SPI_CHIPSEL1    1
#define CFG_SPI_CHIPSEL2    2
#define CFG_SPI_CHIPSEL3    3
#define CFG_SPI_CHIPSEL4    4
#define CFG_SPI_CHIPSEL5    5
#define CFG_SPI_CHIPSEL6    6
#define CFG_SPI_CHIPSEL7    7

#define CFG_SPI_CS1VALUE    1
#define CFG_SPI_CS2VALUE    2
#define CFG_SPI_CS3VALUE    3
#define CFG_SPI_CS4VALUE    4
#define CFG_SPI_CS5VALUE    5
#define CFG_SPI_CS6VALUE    6
#define CFG_SPI_CS7VALUE    7

#define CMD_SPI_SET_BAUDRATE  2
#define CMD_SPI_GET_SYSTEMCLOCK   25
#define CMD_SPI_SET_WRITECONTINUOUS     26

struct beagle_spi_master {
u16 num_chipselect;
u8 enable_dma;
u16 pin_req[4];
};

struct beagle_spi_chip {
u16 ctl_reg;
u8 enable_dma;
u8 bits_per_word;
u8 cs_change_per_word;
u16 cs_chg_udelay;
};

#endif

[-- Attachment #4: Type: text/plain, Size: 340 bytes --]

------------------------------------------------------------------------------
Crystal Reports &#45; New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty&#45;free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects

[-- Attachment #5: Type: text/plain, Size: 210 bytes --]

_______________________________________________
spi-devel-general mailing list
spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: General SPI question
       [not found]         ` <8ee9e87c0904240128y1615625aiae9468de0a02643-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2009-04-25  4:57           ` Bryan Wu
       [not found]             ` <386072610904242157h6c7dc7e8qf6e66ec4e0057423-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Bryan Wu @ 2009-04-25  4:57 UTC (permalink / raw)
  To: Arnav Das
  Cc: David Brownell, spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Fri, Apr 24, 2009 at 4:28 PM, Arnav Das <arnavdas29-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> thanks for the quick reply.
>
> i basically want to make a cro out of the adc and the beaglebard. so
> whatever input i get, i need to show it in a graphical manner on a real time
> basis. this probably can be forthur utilised in as a ecg in medical
> applications and further improvements can be made.
>
> could you please guide me to a knowledgebase from where i can learn all
> about spi, drivers and spi drivers(platform independant, if possible) as my
> main focus of the project is the graphical part wherein i will use the data
> collected to output on the screen with proper gui.
>
> i got this adc driver from blackfin/uclinux resources please see whether it
> is ok?
>

This blackfin spi adc driver will never go to upstream mainline,
because it is a old implementation for some legacy customer product.
Please follow Dave's suggestion.

Thanks
-Bryan

> Thanks a lot,
> Arnav
>
> On Fri, Apr 24, 2009 at 1:01 PM, David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org> wrote:
>>
>> [ I dropped the PPC folk from the cc list.. ]
>>
>> On Thursday 23 April 2009, Arnav Das wrote:
>> > Hi,
>> >
>> > Thanks a lot and sorry for the mistakes. I have gone through the trm of
>> > the
>> > adc as well as the omap driver. my question is that i want to interact
>> > the
>> > adc to the board. now should i directly use the omap driver or should i
>> > mak
>> > one of my own.
>>
>> Unless you have a compelling reason, use the OMAP controller driver.
>>
>> You'd write a spi_driver -- a *REALLY* simple one -- using interfaces
>> described in Documentation/spi/spi-summary for the lower level.  Almost
>> all the work involved would be in the upper level interface:  presenting
>> the data to whatever needs it.  Maybe sysfs, maybe not; you've not said
>> anything about how you need to use this data.  That would usually be
>> the first thing to figure out...
>>
>>
>> > if i make one of my own then i would like to know how would
>> > the spi registers be changed by driver. should it include the omap2
>> > driver
>> > or is the fuctionality provided directly when i include spi.h.
>>
>> You should end up with a simple ADC driver that can hook up to
>> any platform's SPI controller.  Your driver will talk to a
>> "struct spi_device" and will be usable on non-OMAP boards.
>>
>>
>> > another doubt: when and why is the spidev.c/h used?
>>
>> When you want a "userspace driver" instead of a kernel driver.
>>
>> - Dave
>>
>>
>> > i am deeply grateful towards you for helping me out
>> > thanks
>> > Arnav
>> >
>> > On Fri, Apr 24, 2009 at 11:50 AM, David Brownell
>> > <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>wrote:
>> >
>> > > On Thursday 23 April 2009, Arnav Das wrote:
>> > > > i am a newbie
>> > >
>> > > Lesson #1:  make sure your Subject: lines match the message
>> > > topic (I did a partial repair) and don't post to the wrong
>> > > list (e.g. PPC lists for OMAP questions).
>> > >
>> > >
>> > > > and am doing a project on beagle board(running
>> > > > omap3530). i am interfacing an adc(ads7886) to the beagleboard via
>> > > > spi. need to know how the spi works
>> > >
>> > > Read the ads7886 data sheet, in this case.  It uses
>> > > a subset of SPI ... no input commands, just a 12-bit
>> > > sample returned each time chipselect pulses.
>> > >
>> > >
>> > > > and how a module can access the
>> > > > spi registers of the omap. if someones already made an adc driver
>> > > > can
>> > > > they mail me?
>> > >
>> > > Use drivers/spi/omap2_mcspi.c on OMAP3 boards, at
>> > > least to start with.  If you want streaming conversions
>> > > you may want to use different modes than are currently
>> > > supported by that driver.
>> > >
>> > > - Dave
>> > >
>> > >
>> > >
>> > >
>> > >
>> >
>>
>>
>
>
> ------------------------------------------------------------------------------
> Crystal Reports &#45; New Free Runtime and 30 Day Trial
> Check out the new simplified licensign option that enables unlimited
> royalty&#45;free distribution of the report engine for externally facing
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> spi-devel-general mailing list
> spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/spi-devel-general
>
>

------------------------------------------------------------------------------
Crystal Reports &#45; New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty&#45;free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: General SPI question
       [not found]             ` <386072610904242157h6c7dc7e8qf6e66ec4e0057423-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2009-04-27  6:50               ` Arnav Das
  0 siblings, 0 replies; 6+ messages in thread
From: Arnav Das @ 2009-04-27  6:50 UTC (permalink / raw)
  To: Bryan Wu
  Cc: David Brownell, spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f


[-- Attachment #1.1: Type: text/plain, Size: 5184 bytes --]

Hi,

Thanks for looking at the blackfin driver. But i dont wanna use the driver
as it is. since my major work is in making the user level application rather
than the driver i was asking whether this driver could be modified for the
omap330-ads7886 combo. also if you could help me writing the driver fully
that would be a very helpful and would be highly grateful for it. please
help

thanks
Arnav
On Sat, Apr 25, 2009 at 10:27 AM, Bryan Wu <cooloney-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:

> On Fri, Apr 24, 2009 at 4:28 PM, Arnav Das <arnavdas29-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > thanks for the quick reply.
> >
> > i basically want to make a cro out of the adc and the beaglebard. so
> > whatever input i get, i need to show it in a graphical manner on a real
> time
> > basis. this probably can be forthur utilised in as a ecg in medical
> > applications and further improvements can be made.
> >
> > could you please guide me to a knowledgebase from where i can learn all
> > about spi, drivers and spi drivers(platform independant, if possible) as
> my
> > main focus of the project is the graphical part wherein i will use the
> data
> > collected to output on the screen with proper gui.
> >
> > i got this adc driver from blackfin/uclinux resources please see whether
> it
> > is ok?
> >
>
> This blackfin spi adc driver will never go to upstream mainline,
> because it is a old implementation for some legacy customer product.
> Please follow Dave's suggestion.
>
> Thanks
> -Bryan
>
> > Thanks a lot,
> > Arnav
> >
> > On Fri, Apr 24, 2009 at 1:01 PM, David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
> wrote:
> >>
> >> [ I dropped the PPC folk from the cc list.. ]
> >>
> >> On Thursday 23 April 2009, Arnav Das wrote:
> >> > Hi,
> >> >
> >> > Thanks a lot and sorry for the mistakes. I have gone through the trm
> of
> >> > the
> >> > adc as well as the omap driver. my question is that i want to interact
> >> > the
> >> > adc to the board. now should i directly use the omap driver or should
> i
> >> > mak
> >> > one of my own.
> >>
> >> Unless you have a compelling reason, use the OMAP controller driver.
> >>
> >> You'd write a spi_driver -- a *REALLY* simple one -- using interfaces
> >> described in Documentation/spi/spi-summary for the lower level.  Almost
> >> all the work involved would be in the upper level interface:  presenting
> >> the data to whatever needs it.  Maybe sysfs, maybe not; you've not said
> >> anything about how you need to use this data.  That would usually be
> >> the first thing to figure out...
> >>
> >>
> >> > if i make one of my own then i would like to know how would
> >> > the spi registers be changed by driver. should it include the omap2
> >> > driver
> >> > or is the fuctionality provided directly when i include spi.h.
> >>
> >> You should end up with a simple ADC driver that can hook up to
> >> any platform's SPI controller.  Your driver will talk to a
> >> "struct spi_device" and will be usable on non-OMAP boards.
> >>
> >>
> >> > another doubt: when and why is the spidev.c/h used?
> >>
> >> When you want a "userspace driver" instead of a kernel driver.
> >>
> >> - Dave
> >>
> >>
> >> > i am deeply grateful towards you for helping me out
> >> > thanks
> >> > Arnav
> >> >
> >> > On Fri, Apr 24, 2009 at 11:50 AM, David Brownell
> >> > <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>wrote:
> >> >
> >> > > On Thursday 23 April 2009, Arnav Das wrote:
> >> > > > i am a newbie
> >> > >
> >> > > Lesson #1:  make sure your Subject: lines match the message
> >> > > topic (I did a partial repair) and don't post to the wrong
> >> > > list (e.g. PPC lists for OMAP questions).
> >> > >
> >> > >
> >> > > > and am doing a project on beagle board(running
> >> > > > omap3530). i am interfacing an adc(ads7886) to the beagleboard via
> >> > > > spi. need to know how the spi works
> >> > >
> >> > > Read the ads7886 data sheet, in this case.  It uses
> >> > > a subset of SPI ... no input commands, just a 12-bit
> >> > > sample returned each time chipselect pulses.
> >> > >
> >> > >
> >> > > > and how a module can access the
> >> > > > spi registers of the omap. if someones already made an adc driver
> >> > > > can
> >> > > > they mail me?
> >> > >
> >> > > Use drivers/spi/omap2_mcspi.c on OMAP3 boards, at
> >> > > least to start with.  If you want streaming conversions
> >> > > you may want to use different modes than are currently
> >> > > supported by that driver.
> >> > >
> >> > > - Dave
> >> > >
> >> > >
> >> > >
> >> > >
> >> > >
> >> >
> >>
> >>
> >
> >
> >
> ------------------------------------------------------------------------------
> > Crystal Reports &#45; New Free Runtime and 30 Day Trial
> > Check out the new simplified licensign option that enables unlimited
> > royalty&#45;free distribution of the report engine for externally facing
> > server and web deployment.
> > http://p.sf.net/sfu/businessobjects
> > _______________________________________________
> > spi-devel-general mailing list
> > spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> > https://lists.sourceforge.net/lists/listinfo/spi-devel-general
> >
> >
>

[-- Attachment #1.2: Type: text/html, Size: 7147 bytes --]

[-- Attachment #2: Type: text/plain, Size: 340 bytes --]

------------------------------------------------------------------------------
Crystal Reports &#45; New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty&#45;free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects

[-- Attachment #3: Type: text/plain, Size: 210 bytes --]

_______________________________________________
spi-devel-general mailing list
spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-04-27  6:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-24  6:28 General SPI question Arnav Das
2009-04-24  6:28 ` Arnav Das
     [not found] ` <8ee9e87c0904232328j7f912eb6v3d0b9cb0321793a9-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-04-24  7:31   ` David Brownell
     [not found]     ` <200904240031.53343.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2009-04-24  8:28       ` Arnav Das
     [not found]         ` <8ee9e87c0904240128y1615625aiae9468de0a02643-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-04-25  4:57           ` Bryan Wu
     [not found]             ` <386072610904242157h6c7dc7e8qf6e66ec4e0057423-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-04-27  6:50               ` Arnav Das

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.