All of lore.kernel.org
 help / color / mirror / Atom feed
* new alsa driver for ti omap chip
@ 2004-02-12  7:26 Gupta, Kshitij
  2004-02-12 10:58 ` Takashi Iwai
  0 siblings, 1 reply; 6+ messages in thread
From: Gupta, Kshitij @ 2004-02-12  7:26 UTC (permalink / raw)
  To: 'alsa-devel@lists.sourceforge.net'

hi,

	I am trying to write an alsa driver for a tsc2101 codec on a arm
based SOC.  The control interface between the SOC and the tsc2101 codec is
via SPI. 
And the data interface is a I2S interface.  Can some one suggest a good
starting point to start such a driver.  
does sound/drivers/dummy.c makes sense for such a driver ???
warm regards
-kshitij


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click

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

* Re: new alsa driver for ti omap chip
  2004-02-12  7:26 new alsa driver for ti omap chip Gupta, Kshitij
@ 2004-02-12 10:58 ` Takashi Iwai
  2004-02-12 11:22   ` Jaroslav Kysela
  0 siblings, 1 reply; 6+ messages in thread
From: Takashi Iwai @ 2004-02-12 10:58 UTC (permalink / raw)
  To: Gupta, Kshitij; +Cc: 'alsa-devel@lists.sourceforge.net'

At Thu, 12 Feb 2004 12:56:04 +0530,
Gupta, Kshitij wrote:
> 
> hi,
> 
> 	I am trying to write an alsa driver for a tsc2101 codec on a arm
> based SOC.  The control interface between the SOC and the tsc2101 codec is
> via SPI. 
> And the data interface is a I2S interface.  Can some one suggest a good
> starting point to start such a driver.  

some ALSA drivers use their own i2c functions, although there is a
generic i2c layer on linux kernel.  for example, delta.c or ews.c of
ice1712 driver use i2c (SPI) transfer (which calls ak4xxx-adda.c).
but it's rather complex to refer...

the i2c transfer is really easy to implement.  do just like the spec
says.  a pseudo code is like below.

	chip_select_low();
	udelay(1);

	for (i = 15; i >= 0; i--) {
		set_bit_clock(0);
		udelay(1);
		if (value_to_send & (1 << i))
			set_bit_data(1);
		else
			set_bit_data(0);
		udelay(1);
		set_bit_clock(0);
		udelay(1);
	}

	chip_select_high();


> does sound/drivers/dummy.c makes sense for such a driver ???

the dummy driver is irrelevant to the BUS type, so it makes some sense
to read the code :)


Takashi


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click

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

* Re: new alsa driver for ti omap chip
  2004-02-12 10:58 ` Takashi Iwai
@ 2004-02-12 11:22   ` Jaroslav Kysela
  2004-02-12 11:31     ` Takashi Iwai
  0 siblings, 1 reply; 6+ messages in thread
From: Jaroslav Kysela @ 2004-02-12 11:22 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Gupta, Kshitij, 'alsa-devel@lists.sourceforge.net'

On Thu, 12 Feb 2004, Takashi Iwai wrote:

> At Thu, 12 Feb 2004 12:56:04 +0530,
> Gupta, Kshitij wrote:
> > 
> > hi,
> > 
> > 	I am trying to write an alsa driver for a tsc2101 codec on a arm
> > based SOC.  The control interface between the SOC and the tsc2101 codec is
> > via SPI. 
> > And the data interface is a I2S interface.  Can some one suggest a good
> > starting point to start such a driver.  
> 
> some ALSA drivers use their own i2c functions, although there is a
> generic i2c layer on linux kernel.  for example, delta.c or ews.c of
> ice1712 driver use i2c (SPI) transfer (which calls ak4xxx-adda.c).
> but it's rather complex to refer...
> 
> the i2c transfer is really easy to implement.  do just like the spec
> says.  a pseudo code is like below.
> 
> 	chip_select_low();
> 	udelay(1);
> 
> 	for (i = 15; i >= 0; i--) {
> 		set_bit_clock(0);
> 		udelay(1);
> 		if (value_to_send & (1 << i))
> 			set_bit_data(1);
> 		else
> 			set_bit_data(0);
> 		udelay(1);
> 		set_bit_clock(0);
> 		udelay(1);
> 	}
> 
> 	chip_select_high();

Note that I2S is not I2C. I2S is used to connect A/D and D/A converters 
(three wires - clock, l/r word and sample bit). We don't talk directly 
with any device over this serial bus.

I think that the driver must be written for a sound bridge between host
and the converters. In case of ARM platform, it's usually an integrated
serial controller which can do DMA transfers.

So, this I2S question is a bit irrelevant (it's for hardware designers, 
but not for driver developers).

Because I don't know the behaviour of the sound / serial bridge, I cannot 
suggest a driver, but if it's similar as ARM1100 architecture, then we 
have already a driver for it.

						Jaroslav

-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click

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

* Re: new alsa driver for ti omap chip
  2004-02-12 11:22   ` Jaroslav Kysela
@ 2004-02-12 11:31     ` Takashi Iwai
  0 siblings, 0 replies; 6+ messages in thread
From: Takashi Iwai @ 2004-02-12 11:31 UTC (permalink / raw)
  To: Jaroslav Kysela
  Cc: Gupta, Kshitij, 'alsa-devel@lists.sourceforge.net'

At Thu, 12 Feb 2004 12:22:31 +0100 (CET),
Jaroslav wrote:
> 
> On Thu, 12 Feb 2004, Takashi Iwai wrote:
> 
> > At Thu, 12 Feb 2004 12:56:04 +0530,
> > Gupta, Kshitij wrote:
> > > 
> > > hi,
> > > 
> > > 	I am trying to write an alsa driver for a tsc2101 codec on a arm
> > > based SOC.  The control interface between the SOC and the tsc2101 codec is
> > > via SPI. 
> > > And the data interface is a I2S interface.  Can some one suggest a good
> > > starting point to start such a driver.  
> > 
> > some ALSA drivers use their own i2c functions, although there is a
> > generic i2c layer on linux kernel.  for example, delta.c or ews.c of
> > ice1712 driver use i2c (SPI) transfer (which calls ak4xxx-adda.c).
> > but it's rather complex to refer...
> > 
> > the i2c transfer is really easy to implement.  do just like the spec
> > says.  a pseudo code is like below.
> > 
> > 	chip_select_low();
> > 	udelay(1);
> > 
> > 	for (i = 15; i >= 0; i--) {
> > 		set_bit_clock(0);
> > 		udelay(1);
> > 		if (value_to_send & (1 << i))
> > 			set_bit_data(1);
> > 		else
> > 			set_bit_data(0);
> > 		udelay(1);
> > 		set_bit_clock(0);
> > 		udelay(1);
> > 	}
> > 
> > 	chip_select_high();
> 
> Note that I2S is not I2C. I2S is used to connect A/D and D/A converters 
> (three wires - clock, l/r word and sample bit). We don't talk directly 
> with any device over this serial bus.
> 
> I think that the driver must be written for a sound bridge between host
> and the converters. In case of ARM platform, it's usually an integrated
> serial controller which can do DMA transfers.
> 
> So, this I2S question is a bit irrelevant (it's for hardware designers, 
> but not for driver developers).

oh yes, it has nothing to do with I2S, of course.  sorry for
confusion.

but, about the SPI mode to control the chip (not DMA transfer), you
can still check the files above.


Takashi


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click

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

* RE: new alsa driver for ti omap chip
@ 2004-02-12 11:54 Gupta, Kshitij
  2004-02-12 12:00 ` Jaroslav Kysela
  0 siblings, 1 reply; 6+ messages in thread
From: Gupta, Kshitij @ 2004-02-12 11:54 UTC (permalink / raw)
  To: 'Jaroslav Kysela', Takashi Iwai
  Cc: 'alsa-devel@lists.sourceforge.net'

hi,

	yeah that's true I2S has not much to with the driver.  So there is
one more component on the chip called McBSP(Multichannel Buffered serial
port) which will actually communicate to the codec chip over I2S protocol.
And the DMA can read data from the McBSP recieve and transmit buffers. But
still the driver has to do the McBSP configuration. 
The kind of functionality the driver should provide is 

- Codec Control
	xxx_codec_write
	xxx_codec_read
for reading and writing to the codec control bits.  This will be done via
SPI interface.

- Dma Control functions
	start_dma
	queue_dma
	stop_dma ...

And all the ALSA based functions for init, read , write etc.....

regards
-kshitij

-----Original Message-----
From: Jaroslav Kysela [mailto:perex@suse.cz]
Sent: Thursday, February 12, 2004 4:53 PM
To: Takashi Iwai
Cc: Gupta, Kshitij; 'alsa-devel@lists.sourceforge.net'
Subject: Re: [Alsa-devel] new alsa driver for ti omap chip


On Thu, 12 Feb 2004, Takashi Iwai wrote:

> At Thu, 12 Feb 2004 12:56:04 +0530,
> Gupta, Kshitij wrote:
> > 
> > hi,
> > 
> > 	I am trying to write an alsa driver for a tsc2101 codec on a arm
> > based SOC.  The control interface between the SOC and the tsc2101 codec
is
> > via SPI. 
> > And the data interface is a I2S interface.  Can some one suggest a good
> > starting point to start such a driver.  
> 
> some ALSA drivers use their own i2c functions, although there is a
> generic i2c layer on linux kernel.  for example, delta.c or ews.c of
> ice1712 driver use i2c (SPI) transfer (which calls ak4xxx-adda.c).
> but it's rather complex to refer...
> 
> the i2c transfer is really easy to implement.  do just like the spec
> says.  a pseudo code is like below.
> 
> 	chip_select_low();
> 	udelay(1);
> 
> 	for (i = 15; i >= 0; i--) {
> 		set_bit_clock(0);
> 		udelay(1);
> 		if (value_to_send & (1 << i))
> 			set_bit_data(1);
> 		else
> 			set_bit_data(0);
> 		udelay(1);
> 		set_bit_clock(0);
> 		udelay(1);
> 	}
> 
> 	chip_select_high();

Note that I2S is not I2C. I2S is used to connect A/D and D/A converters 
(three wires - clock, l/r word and sample bit). We don't talk directly 
with any device over this serial bus.

I think that the driver must be written for a sound bridge between host
and the converters. In case of ARM platform, it's usually an integrated
serial controller which can do DMA transfers.

So, this I2S question is a bit irrelevant (it's for hardware designers, 
but not for driver developers).

Because I don't know the behaviour of the sound / serial bridge, I cannot 
suggest a driver, but if it's similar as ARM1100 architecture, then we 
have already a driver for it.

						Jaroslav

-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click

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

* RE: new alsa driver for ti omap chip
  2004-02-12 11:54 Gupta, Kshitij
@ 2004-02-12 12:00 ` Jaroslav Kysela
  0 siblings, 0 replies; 6+ messages in thread
From: Jaroslav Kysela @ 2004-02-12 12:00 UTC (permalink / raw)
  To: Gupta, Kshitij; +Cc: Takashi Iwai, 'alsa-devel@lists.sourceforge.net'

On Thu, 12 Feb 2004, Gupta, Kshitij wrote:

> hi,
> 
> 	yeah that's true I2S has not much to with the driver.  So there is
> one more component on the chip called McBSP(Multichannel Buffered serial
> port) which will actually communicate to the codec chip over I2S protocol.
> And the DMA can read data from the McBSP recieve and transmit buffers. But
> still the driver has to do the McBSP configuration. 
> The kind of functionality the driver should provide is 
> 
> - Codec Control
> 	xxx_codec_write
> 	xxx_codec_read
> for reading and writing to the codec control bits.  This will be done via
> SPI interface.

So, look to alsa-kernel/i2c directory for examples, how to write a library 
for such codecs. We prefer to create a library than controlling codecs in
the toplevel driver, because we can reuse code later.

> - Dma Control functions
> 	start_dma
> 	queue_dma
> 	stop_dma ...

Exactly. In this case, you may look to any ISA/PCI drivers what the 
callbacks from midlevel do.

If you have a specific question, we are here ;-)

						Jaroslav

-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click

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

end of thread, other threads:[~2004-02-12 12:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-12  7:26 new alsa driver for ti omap chip Gupta, Kshitij
2004-02-12 10:58 ` Takashi Iwai
2004-02-12 11:22   ` Jaroslav Kysela
2004-02-12 11:31     ` Takashi Iwai
  -- strict thread matches above, loose matches on Subject: below --
2004-02-12 11:54 Gupta, Kshitij
2004-02-12 12:00 ` Jaroslav Kysela

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.