Skip to contentSkip to conversation

Alsa modularisations and support for tsc2101 1/7

PATCH In review Daniel Petrini 3 participants 7 messages Feb 20, 2006 – Feb 26, 2006 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Alsa modularisations and support for tsc2101 1/7

ALSA Omap Modularisation

This series of patches adds modularisation in alsa files for omap so that makes possible to use the same alsa omap core files for different boards. Regarding the original omap alsa support, the codec specific functions were removed from file omap-aic23.c (which now is called omap-alsa.c) and inserted in a specific file for this codec. Similar action was made for tsc2101 codec, based in oss former drivers.
With this series of patches omap now have support for osk and H2 boards. Besides codec files, the mixer file has its support added for H2.

Summary:

-New architecture: extraction of codec dependent code from main alsa file -Support for board H2
-Creation of codec alsa file for codec aic23 (from existing alsa work) -Creation of codec alsa file for codec tsc2101 from oss -Migration of specific codec configuration to platform_data -Improvement of function probe in omap-alsa driver
-Creation of the mixer for tsc2101

This first patch creates the new files omap-alsa.[c,h] based in the former omap-aic23.[c,h] and put the .h file in include/asm/arch/.

signed-off by Daniel Petrini <[email protected]> signed-off by Mika Laitio <[email protected]>

------------------------
Daniel Petrini
--
INdT - Manaus - Brazil

ALSA Omap Modularisation

This series of patches adds modularisation in alsa files for omap so that makes possible to use the same alsa omap core files for different boards. Regarding the original omap alsa support, the codec specific functions were removed from file omap-aic23.c (which now is called omap-alsa.c) and inserted in a specific file for this codec. Similar action was made for tsc2101 codec, based in oss former drivers.
With this series of patches omap now have support for osk and H2 boards. Besides codec files, the mixer file has its support added for H2.

Summary:

-New architecture: extraction of codec dependent code from main alsa file -Support for board H2
-Creation of codec alsa file for codec aic23 (from existing alsa work) -Creation of codec alsa file for codec tsc2101 from oss -Migration of specific codec configuration to platform_data -Improvement of function probe in omap-alsa driver
-Creation of the mixer for tsc2101

This first patch creates the new files omap-alsa.[c,h] based in the former omap-aic23.[c,h] and put the .h file in include/asm/arch/.

signed-off by Daniel Petrini <[email protected]> signed-off by Mika Laitio <[email protected]>

sound/arm/Makefile +6 -2
Index: linux-omap-2.6.git-q/sound/arm/Makefile
===================================================================
@@ -14,5 +14,9 @@ snd-pxa2xx-pcm-objs		:= pxa2xx-pcm.o
 obj-$(CONFIG_SND_PXA2XX_AC97)	+= snd-pxa2xx-ac97.o
 snd-pxa2xx-ac97-objs		:= pxa2xx-ac97.o
 
-obj-$(CONFIG_SND_OMAP_AIC23) += snd-omap-aic23.o
-snd-omap-aic23-objs := omap-aic23.o omap-alsa-dma.o omap-alsa-mixer.o
+obj-$(CONFIG_SND_OMAP_AIC23) += snd-omap-alsa-aic23.o
+snd-omap-alsa-aic23-objs := omap-alsa.o omap-alsa-dma.o omap-alsa-mixer.o 
+
+obj-$(CONFIG_SND_OMAP_TSC2101) += snd-omap-alsa-tsc2101.o
+snd-omap-alsa-tsc2101-objs := omap-alsa.o omap-alsa-dma.o omap-alsa-tsc2101-mixer.o 
+
sound/arm/omap-alsa.c new file +714 -0

714 lines not on this page · raw message

include/asm-arm/arch-omap/omap-alsa.h new file +150 -0

150 lines not on this page · raw message

sound/arm/omap-aic23.h deleted +0 -130

130 lines not on this page · raw message

sound/arm/omap-aic23.c deleted +0 -929

929 lines not on this page · raw message

#1 lore raw

Daniel,

sound/arm/omap-alsa.c line 4

Quoted 5 lines
sound/arm/omap-alsa.c new file +4 -0
@@ -0,0 +1,714 @@
+/*
+ * sound/arm/omap-alsa.c
+ * 
+ * Alsa Driver for AIC23 codec on OSK5912 platform board

Now *not* just for AIC23. Time to update this line.

Quoted 9 lines
sound/arm/omap-alsa.c new file +4 -0
+ *
+ * History:
+ *
+ * 2005-07-29   INdT Kernel Team - Alsa driver for omap osk.

Creation of new
+ * file omap-aic23.c
+ *
+ * 2005-12-18 Dirk Behme - Added L/R Channel Interchange fix
as proposed by Ajaya Babu

Quoted 8 lines

+ *
+ * 2006-02-07 Daniel Petrini - Codec specific function separated.
File renamed to
+ * omap-alsa.c
+ * 2006-02-10 Mika Laitio - Codec specific function pointers are set
in the codec.
+ * Default samplerate queried from the codec.
+ */

I am happy to see this big development and cleaned up driver interface, but I think we can trim down this History as I believe GIT is being really used for this purpose. Only thing we need to take care is give better comment at patch submit time :)

Quoted 1 line

+MODULE_ALIAS("omap_alsa_mcbsp.1");

Do we really need to add "_mcbsp" in that string? It looks confusing while reading.

Review

Quoted 2 lines
(quoted diff) +2 -0
+#define DMA_BUF_SIZE	1024 * 8
+

Brackets around 1024 * 8 would be better.

sound/arm/omap-alsa.c line 136

Quoted 10 lines
sound/arm/omap-alsa.c new file +10 -0
+static int audio_dma_request(struct audio_stream *s,
+			     void (*callback) (void *))
+{
+	int err;
+	ADEBUG();
+
+	err = omap_request_sound_dma(s->dma_dev, s->id, s, &s->lch);
+	if (err < 0)
+		printk(KERN_ERR "unable to grab audio dma 0x%x\n",
+		       s->dma_dev);

s/unable/Unable will look good :)

Quoted 29 lines
sound/arm/omap-alsa.c new file +3 -0
+
+/*
+ *  This function should calculate the current position of the dma

in the
+ * buffer. It will help alsa middle layer to continue update the buffer.
+ * Its correctness is crucial for good functioning.
+ */

sound/arm/omap-alsa.c new file +10 -0
+static u_int audio_get_dma_pos(struct audio_stream *s)
+{
+	snd_pcm_substream_t *substream = s->stream;
+	snd_pcm_runtime_t *runtime = substream->runtime;
+	unsigned int offset;
+	unsigned long flags;
+	dma_addr_t count;
+	ADEBUG();
+
+	/* this must be called w/ interrupts locked as requested in dma.c

*/

sound/arm/omap-alsa.c new file +9 -0
+	spin_lock_irqsave(&s->dma_lock, flags);
+
+	/* For the current period let's see where we are */
+	count = omap_get_dma_src_addr_counter(s->lch[s->dma_q_head]);
+
+	spin_unlock_irqrestore(&s->dma_lock, flags);
+
+	/* Now, the position related to the end of that period */
+	offset = bytes_to_frames(runtime, s->offset) -

bytes_to_frames(runtime, count);

sound/arm/omap-alsa.c line 177

Quoted 3 lines
sound/arm/omap-alsa.c new file +3 -0
+
+	if (offset >= runtime->buffer_size || offset < 0)
+		offset = 0;

I am not sure but will this "unsigned int offset" will be ever become < 0 here ?

Quoted 11 lines
sound/arm/omap-alsa.c new file +3 -0
+
+/* 
+ *  This is called when dma IRQ occurs at the end of each transmited

block
+ */

sound/arm/omap-alsa.c new file +6 -0
+void audio_dma_callback(void *data)
+{
+	struct audio_stream *s = data;
+	ADEBUG();
+
+	/* 

sound/arm/omap-alsa.c line 263

Quoted 10 lines
sound/arm/omap-alsa.c new file +10 -0
+	 * If we are getting a callback for an active stream then we inform
+	 * the PCM middle layer we've finished a period
+	 */
+	if (s->active)
+		snd_pcm_period_elapsed(s->stream);
+
+	spin_lock(&s->dma_lock);
+	if (s->periods > 0) {
+		s->periods--;
+	}

{} not need around if.

Quoted 8 lines
sound/arm/omap-alsa.c new file +7 -0
+
+/* 
+ * Alsa section
+ * PCM settings and callbacks
+ */
+
+static int snd_omap_alsa_trigger(snd_pcm_substream_t * substream,

int cmd)

Extra empty line after function comments. Same review comment applies to all other places in the file. You may like to remove that.

Quoted 5 lines
sound/arm/omap-alsa.c new file +5 -0
+
+static int snd_card_omap_alsa_open(snd_pcm_substream_t * substream)
+{
+	struct snd_card_omap_codec *chip =
+	    snd_pcm_substream_chip(substream);

sound/arm/omap-alsa.c line 385

Quoted 10 lines
sound/arm/omap-alsa.c new file +10 -0
+	snd_pcm_runtime_t *runtime = substream->runtime;
+	int stream_id = substream->pstr->stream;
+	int err;
+	
+	ADEBUG();
+	chip->s[stream_id].stream = substream;
+	alsa_codec_config->codec_clock_on();
+	if (stream_id == SNDRV_PCM_STREAM_PLAYBACK) {
+		runtime->hw = snd_omap_alsa_playback;
+	}

{} not needed after if and else below.

sound/arm/omap-alsa.c line 397

Quoted 12 lines
sound/arm/omap-alsa.c new file +12 -0
+	else {
+		runtime->hw = snd_omap_alsa_capture;
+	}
+	if ((err = snd_pcm_hw_constraint_integer(runtime,
+					   SNDRV_PCM_HW_PARAM_PERIODS)) < 0) {
+		return err;
+	}
+	if ((err = snd_pcm_hw_constraint_list(runtime, 0,
+					SNDRV_PCM_HW_PARAM_RATE,
+					&hw_constraints_rates)) < 0) {
+		return err;
+	}

Ditto. Also adding one empty line between ifs will look better.

sound/arm/omap-alsa.c line 472

Quoted 7 lines
sound/arm/omap-alsa.c new file +7 -0
+
+	/* sets up initial buffer with continuous allocation */
+	snd_pcm_lib_preallocate_pages_for_all(pcm,
+					      SNDRV_DMA_TYPE_CONTINUOUS,
+					      snd_dma_continuous_data
+					      (GFP_KERNEL),
+					      128 * 1024, 128 * 1024);

Brackets around GFP_KERNEL may not be needed.

sound/arm/omap-alsa.c line 480

Quoted 8 lines
sound/arm/omap-alsa.c new file +8 -0
+
+	snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK,
+			&snd_card_omap_alsa_playback_ops);
+	snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE,
+			&snd_card_omap_alsa_capture_ops);
+	pcm->private_data = omap_alsa;
+	pcm->info_flags = 0;
+	strcpy(pcm->name, "omap aic23 pcm");

aic23?

Quoted 6 lines
sound/arm/omap-alsa.c new file +5 -0
+
+
+#ifdef CONFIG_PM
+
+static int snd_omap_alsa_suspend(snd_card_t * card, pm_message_t

state)

Empty line after CONFIG_PM may not be needed.

sound/arm/omap-alsa.c line 558

Quoted 8 lines
sound/arm/omap-alsa.c new file +8 -0
+
+#else
+#define snd_omap_alsa_suspend	NULL
+#define snd_omap_alsa_resume	NULL
+#define omap_alsa_suspend	NULL
+#define omap_alsa_resume	NULL
+
+#endif	/* CONFIG_PM */

May be snd_omap_alsa_suspend(x) do {} while(0) style would be better.

Quoted 5 lines
sound/arm/omap-alsa.c new file +5 -0
+
+/* 
+ */
+void snd_omap_alsa_free(snd_card_t * card)
+{

sound/arm/omap-alsa.c line 573

Quoted 10 lines
sound/arm/omap-alsa.c new file +10 -0
+	struct snd_card_omap_codec *chip = card->private_data;
+	ADEBUG();
+	
+	/*
+	 * Turn off codec after it is done.
+	 * Can't do it immediately, since it may still have
+	 * buffered data.
+	 */
+	set_current_state(TASK_INTERRUPTIBLE);
+	schedule_timeout(2);

We have now API to combine this two functions. There one long name if I remember.

sound/arm/omap-alsa.c line 610

Quoted 4 lines
sound/arm/omap-alsa.c new file +4 -0
+	
+	if (alsa_codec_config && alsa_codec_config->codec_configure_dev) {
+		alsa_codec_config->codec_configure_dev();
+	}

As mentioned earlier...{} not needed, also few more in code below.

Quoted 7 lines
sound/arm/omap-alsa.c new file +7 -0
+
+static int snd_omap_alsa_remove(struct platform_device *pdev)
+{
+	snd_card_t *card = platform_get_drvdata(pdev);
+	struct snd_card_omap_codec *chip = card->private_data;
+	
+	snd_card_free(card);

sound/arm/omap-alsa.c line 684

Quoted 10 lines
sound/arm/omap-alsa.c new file +10 -0
+
+	alsa_codec = NULL;
+	card->private_data = NULL;
+	kfree(chip);
+	
+	platform_set_drvdata(pdev, NULL);
+	
+	return 0;
+	
+}

Extra empty lines after return 0.

sound/arm/omap-alsa.c line 690

Quoted 6 lines
sound/arm/omap-alsa.c new file +6 -0
+
+static struct platform_driver omap_alsa_driver = {
+	.probe =	snd_omap_alsa_probe,
+	.remove =	snd_omap_alsa_remove,
+	.suspend =	omap_alsa_suspend, 
+	.resume =	omap_alsa_resume, 

May be keeping consistent naming will be good for suspend and resume.

include/asm-arm/arch-omap/omap-alsa.h line 97

Quoted 4 lines
include/asm-arm/arch-omap/omap-alsa.h new file +4 -0
+
+/*
+ * Alsa card structure for aic23
+ */

aic23?

Quoted 12 lines
sound/arm/omap-alsa.c new file +3 -0
+
+/*
+ * Defines codec specific functions pointers that can be used from

the
+ * common omap-alse base driver for all omap codecs. (tsc2101 and aic23)
+ */
+void define_codec_functions(struct omap_alsa_codec_config *codec_config);

include/asm-arm/arch-omap/omap-alsa.h new file +3 -0
+inline void aic23_configure(void);
+void aic23_set_samplerate(long rate);
+void aic23_clock_setup(void);

include/asm-arm/arch-omap/omap-alsa.h line 145

Quoted 10 lines
include/asm-arm/arch-omap/omap-alsa.h new file +10 -0
+int aic23_clock_on(void);
+int aic23_clock_off(void);
+int aic23_get_default_samplerate(void);
+
+inline void tsc2101_configure(void);
+void tsc2101_set_samplerate(long rate);
+void tsc2101_clock_setup(void);
+int tsc2101_clock_on(void);
+int tsc2101_clock_off(void);
+int tsc2101_get_default_samplerate(void);

I think above functions should not be mentioned in omap-alsa.h, as it meant to be independant of any codec information. You may want to put them in specific codec header files, anyway they are going to called through function pointers I believe.

---Komal Shah
http://komalshah.blogspot.com/

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#2 lore raw

Komal,

Thanks for the comments,

Quoted 9 lines · Komal Shah

Daniel,

sound/arm/omap-alsa.c line 4

Quoted 5 lines
sound/arm/omap-alsa.c new file +4 -0
@@ -0,0 +1,714 @@
+/*
+ * sound/arm/omap-alsa.c
+ *
+ * Alsa Driver for AIC23 codec on OSK5912 platform board

Now *not* just for AIC23. Time to update this line.

Sure

Quoted 18 lines
Quoted 9 lines
sound/arm/omap-alsa.c new file +4 -0
+ *
+ * History:
+ *
+ * 2005-07-29   INdT Kernel Team - Alsa driver for omap osk.

Creation of new
+ * file omap-aic23.c
+ *
+ * 2005-12-18 Dirk Behme - Added L/R Channel Interchange fix
as proposed by Ajaya Babu

Quoted 8 lines

+ *
+ * 2006-02-07 Daniel Petrini - Codec specific function separated.
File renamed to
+ * omap-alsa.c
+ * 2006-02-10 Mika Laitio - Codec specific function pointers are set
in the codec.
+ * Default samplerate queried from the codec.
+ */

Quoted 4 lines

I am happy to see this big development and cleaned up driver interface, but I think we can trim down this History as I believe GIT is being really used for this purpose. Only thing we need to take care is give better comment at patch submit time :)

Very good suggestion. We will keep in mind to do it from now on.

Quoted 4 lines
Quoted 1 line

+MODULE_ALIAS("omap_alsa_mcbsp.1");

Do we really need to add "_mcbsp" in that string? It looks confusing while reading.

Matter of taste? Isn't better to have all this information?

Quoted 4 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+#define DMA_BUF_SIZE 1024 * 8
+

Brackets around 1024 * 8 would be better.

ok.

Quoted 4 lines
Quoted 4 lines
sound/arm/omap-alsa.c new file +4 -0
+static int audio_dma_request(struct audio_stream *s,
+                          void (*callback) (void *))
+{
+     int err;
Quoted 8 lines

sound/arm/omap-alsa.c line 136

Quoted 6 lines
sound/arm/omap-alsa.c new file +6 -0
+     ADEBUG();
+
+     err = omap_request_sound_dma(s->dma_dev, s->id, s, &s->lch);
+     if (err < 0)
+             printk(KERN_ERR "unable to grab audio dma 0x%x\n",
+                    s->dma_dev);

s/unable/Unable will look good :)

ok

Quoted 27 lines
Quoted 27 lines
sound/arm/omap-alsa.c new file +3 -0
+
+/*
+ *  This function should calculate the current position of the dma

in the
+ * buffer. It will help alsa middle layer to continue update the buffer.
+ * Its correctness is crucial for good functioning.
+ */

sound/arm/omap-alsa.c new file +10 -0
+static u_int audio_get_dma_pos(struct audio_stream *s)
+{
+     snd_pcm_substream_t *substream = s->stream;
+     snd_pcm_runtime_t *runtime = substream->runtime;
+     unsigned int offset;
+     unsigned long flags;
+     dma_addr_t count;
+     ADEBUG();
+
+     /* this must be called w/ interrupts locked as requested in dma.c

*/

sound/arm/omap-alsa.c new file +8 -0
+     spin_lock_irqsave(&s->dma_lock, flags);
+
+     /* For the current period let's see where we are */
+     count = omap_get_dma_src_addr_counter(s->lch[s->dma_q_head]);
+
+     spin_unlock_irqrestore(&s->dma_lock, flags);
+
+     /* Now, the position related to the end of that period */
Quoted 8 lines

sound/arm/omap-alsa.c line 177

Quoted 5 lines

+ offset = bytes_to_frames(runtime, s->offset) -
bytes_to_frames(runtime, count);

sound/arm/omap-alsa.c new file +3 -0
+
+     if (offset >= runtime->buffer_size || offset < 0)
+             offset = 0;

I am not sure but will this "unsigned int offset" will be ever become < 0 here ?

Indeed, offset should not go to below zero but just for the sake that strange things can happen, we should change its type to int to make this test properly.

Quoted 15 lines
Quoted 15 lines
sound/arm/omap-alsa.c new file +3 -0
+
+/*
+ *  This is called when dma IRQ occurs at the end of each transmited

block
+ */

sound/arm/omap-alsa.c new file +10 -0
+void audio_dma_callback(void *data)
+{
+     struct audio_stream *s = data;
+     ADEBUG();
+
+     /*
+      * If we are getting a callback for an active stream then we inform
+      * the PCM middle layer we've finished a period
+      */
+     if (s->active)
Quoted 8 lines

sound/arm/omap-alsa.c line 263

Quoted 6 lines
sound/arm/omap-alsa.c new file +6 -0
+             snd_pcm_period_elapsed(s->stream);
+
+     spin_lock(&s->dma_lock);
+     if (s->periods > 0) {
+             s->periods--;
+     }

{} not need around if.

ok, and for the next space, brackets ones too.

Quoted 65 lines
Quoted 9 lines
sound/arm/omap-alsa.c new file +7 -0
+
+/*
+ * Alsa section
+ * PCM settings and callbacks
+ */
+
+static int snd_omap_alsa_trigger(snd_pcm_substream_t * substream,

int cmd)

Extra empty line after function comments. Same review comment applies to all other places in the file. You may like to remove that.

Quoted 5 lines
sound/arm/omap-alsa.c new file +5 -0
+
+static int snd_card_omap_alsa_open(snd_pcm_substream_t * substream)
+{
+     struct snd_card_omap_codec *chip =
+         snd_pcm_substream_chip(substream);

sound/arm/omap-alsa.c line 385

Quoted 10 lines
sound/arm/omap-alsa.c new file +10 -0
+     snd_pcm_runtime_t *runtime = substream->runtime;
+     int stream_id = substream->pstr->stream;
+     int err;
+
+     ADEBUG();
+     chip->s[stream_id].stream = substream;
+     alsa_codec_config->codec_clock_on();
+     if (stream_id == SNDRV_PCM_STREAM_PLAYBACK) {
+             runtime->hw = snd_omap_alsa_playback;
+     }

{} not needed after if and else below.

sound/arm/omap-alsa.c line 397

Quoted 12 lines
sound/arm/omap-alsa.c new file +12 -0
+     else {
+             runtime->hw = snd_omap_alsa_capture;
+     }
+     if ((err = snd_pcm_hw_constraint_integer(runtime,
+                                        SNDRV_PCM_HW_PARAM_PERIODS)) < 0) {
+             return err;
+     }
+     if ((err = snd_pcm_hw_constraint_list(runtime, 0,
+                                     SNDRV_PCM_HW_PARAM_RATE,
+                                     &hw_constraints_rates)) < 0) {
+             return err;
+     }

Ditto. Also adding one empty line between ifs will look better.

sound/arm/omap-alsa.c line 472

Quoted 7 lines
sound/arm/omap-alsa.c new file +7 -0
+
+     /* sets up initial buffer with continuous allocation */
+     snd_pcm_lib_preallocate_pages_for_all(pcm,
+                                           SNDRV_DMA_TYPE_CONTINUOUS,
+                                           snd_dma_continuous_data
+                                           (GFP_KERNEL),
+                                           128 * 1024, 128 * 1024);

Brackets around GFP_KERNEL may not be needed.

sound/arm/omap-alsa.c line 480

Quoted 8 lines
sound/arm/omap-alsa.c new file +8 -0
+
+     snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK,
+                     &snd_card_omap_alsa_playback_ops);
+     snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE,
+                     &snd_card_omap_alsa_capture_ops);
+     pcm->private_data = omap_alsa;
+     pcm->info_flags = 0;
+     strcpy(pcm->name, "omap aic23 pcm");
Quoted 1 line

aic23?

ok

Quoted 9 lines
Quoted 6 lines
sound/arm/omap-alsa.c new file +5 -0
+
+
+#ifdef CONFIG_PM
+
+static int snd_omap_alsa_suspend(snd_card_t * card, pm_message_t

state)

Empty line after CONFIG_PM may not be needed.

Quoted 10 lines

sound/arm/omap-alsa.c line 558

Quoted 8 lines
sound/arm/omap-alsa.c new file +8 -0
+
+#else
+#define snd_omap_alsa_suspend        NULL
+#define snd_omap_alsa_resume NULL
+#define omap_alsa_suspend    NULL
+#define omap_alsa_resume     NULL
+
+#endif       /* CONFIG_PM */

May be snd_omap_alsa_suspend(x) do {} while(0) style would be better.

Some files looked as models has used this manner. Mainly the PXA ones..

Quoted 10 lines
Quoted 10 lines
sound/arm/omap-alsa.c new file +10 -0
+
+/*
+ */
+void snd_omap_alsa_free(snd_card_t * card)
+{
+     struct snd_card_omap_codec *chip = card->private_data;
+     ADEBUG();
+
+     /*
+      * Turn off codec after it is done.
Quoted 8 lines

sound/arm/omap-alsa.c line 573

Quoted 5 lines
sound/arm/omap-alsa.c new file +5 -0
+      * Can't do it immediately, since it may still have
+      * buffered data.
+      */
+     set_current_state(TASK_INTERRUPTIBLE);
+     schedule_timeout(2);

We have now API to combine this two functions. There one long name if I remember.

Indeed, you mean schedule_timeout_interruptible . I will change. That is one issue of not being in the main line :-(

Quoted 27 lines

sound/arm/omap-alsa.c line 610

Quoted 4 lines
sound/arm/omap-alsa.c new file +4 -0
+
+     if (alsa_codec_config && alsa_codec_config->codec_configure_dev) {
+             alsa_codec_config->codec_configure_dev();
+     }

As mentioned earlier...{} not needed, also few more in code below.

Quoted 7 lines
sound/arm/omap-alsa.c new file +7 -0
+
+static int snd_omap_alsa_remove(struct platform_device *pdev)
+{
+     snd_card_t *card = platform_get_drvdata(pdev);
+     struct snd_card_omap_codec *chip = card->private_data;
+
+     snd_card_free(card);

sound/arm/omap-alsa.c line 684

Quoted 10 lines
sound/arm/omap-alsa.c new file +10 -0
+
+     alsa_codec = NULL;
+     card->private_data = NULL;
+     kfree(chip);
+
+     platform_set_drvdata(pdev, NULL);
+
+     return 0;
+
+}

Extra empty lines after return 0.

Quoted 8 lines

sound/arm/omap-alsa.c line 690

Quoted 6 lines
sound/arm/omap-alsa.c new file +6 -0
+
+static struct platform_driver omap_alsa_driver = {
+     .probe =        snd_omap_alsa_probe,
+     .remove =       snd_omap_alsa_remove,
+     .suspend =      omap_alsa_suspend,
+     .resume =       omap_alsa_resume,

May be keeping consistent naming will be good for suspend and resume.

Allright.

Quoted 26 lines

include/asm-arm/arch-omap/omap-alsa.h line 97

Quoted 4 lines
include/asm-arm/arch-omap/omap-alsa.h new file +4 -0
+
+/*
+ * Alsa card structure for aic23
+ */

aic23?

Quoted 19 lines
sound/arm/omap-alsa.c new file +3 -0
+
+/*
+ * Defines codec specific functions pointers that can be used from

the
+ * common omap-alse base driver for all omap codecs. (tsc2101 and aic23)
+ */
+void define_codec_functions(struct omap_alsa_codec_config *codec_config);

include/asm-arm/arch-omap/omap-alsa.h new file +10 -0
+inline void aic23_configure(void);
+void aic23_set_samplerate(long rate);
+void aic23_clock_setup(void);
+int aic23_clock_on(void);
+int aic23_clock_off(void);
+int aic23_get_default_samplerate(void);
+
+inline void tsc2101_configure(void);
+void tsc2101_set_samplerate(long rate);
+void tsc2101_clock_setup(void);
Quoted 8 lines

include/asm-arm/arch-omap/omap-alsa.h line 145

Quoted 3 lines
include/asm-arm/arch-omap/omap-alsa.h new file +3 -0
+int tsc2101_clock_on(void);
+int tsc2101_clock_off(void);
+int tsc2101_get_default_samplerate(void);

I think above functions should not be mentioned in omap-alsa.h, as it meant to be independant of any codec information. You may want to put them in specific codec header files, anyway they are going to called through function pointers I believe.

They are called through function pointers... And actually, this prototypes can go to specific codec files, their only need is in the board file.

Quoted 2 lines

---Komal Shah
http://komalshah.blogspot.com/

Thanks for that,
Daniel
--
INdT - Manaus - Brazil

#3 lore raw
Quoted 22 lines
Quoted 22 lines
Quoted 22 lines

+ *
+ * History:
+ *
+ * 2005-07-29 INdT Kernel Team - Alsa driver for omap osk.
Creation of new
+ * file omap-aic23.c
+ *
+ * 2005-12-18 Dirk Behme - Added L/R Channel Interchange fix
as proposed by Ajaya Babu
+ *
+ * 2006-02-07 Daniel Petrini - Codec specific function separated.
File renamed to
+ * omap-alsa.c
+ * 2006-02-10 Mika Laitio - Codec specific function pointers are set
in the codec.
+ * Default samplerate queried from the codec.
+ */

Quoted 10 lines
Quoted 6 lines

I am happy to see this big development and cleaned up driver interface, but I think we can trim down this History as I believe GIT is being really used for this purpose. Only thing we need to take care is give better comment at patch submit time :)

Very good suggestion. We will keep in mind to do it from now on.

Is there somekind of "kernel" policy for this one.
Can we leave the first (2005-07-29) and second one (2005-12-18) from the history to next patch round or just remove everything?

Mika

#4 lore raw
Quoted 4 lines · --- lamikr

Is there somekind of "kernel" policy for this one.
Can we leave the first (2005-07-29) and second one (2005-12-18) from the
history to next patch round or just remove everything?

AFAIK, There is no such kernel policy for history, but it depends upon the driver maintainer to accept that History change or not. Maintainer of subsystem/driver has authority to say NO for that History update.

---Komal Shah
http://komalshah.blogspot.com/

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

#6 lore raw

Yes, listened the presentation and talked today with Liam about that in the Fosdem.
He checked the tsc2101 specs I had and according to him it should be doable also for the tsc2101.
I have however not yet seen the driver code for the chipsets that are using ASoc technique and
in addition I think that alsa libraries will need some patches to fully support that.

Mika

Quoted 18 lines · Komal Shah

I hope you guys know about this ASoc stuff.

More info on: http://www.rpsys.net/openzaurus/patches/alsa/info.html

If you are going ot FOSDEM then you will be able to discuss with Liam about ALSA SoC layer.

---Komal Shah
http://komalshah.blogspot.com/

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com