All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 01/19] ALSA: Oxygen: Add the separate SPI waiting function
@ 2014-01-24 12:18 Roman Volkov
  2014-01-24 12:18 ` [PATCH v4 02/19] ALSA: Oxygen: Modify the SPI writing function Roman Volkov
                   ` (18 more replies)
  0 siblings, 19 replies; 23+ messages in thread
From: Roman Volkov @ 2014-01-24 12:18 UTC (permalink / raw)
  To: patch; +Cc: alsa-devel, Roman Volkov

The oxygen_wait_spi() function now performs waiting when the
SPI bus completes a transaction. Introduce the timeout error
checking and increase timeout to 200 from 40.

Signed-off-by: Roman Volkov <v1ron@mail.ru>
---
 sound/pci/oxygen/oxygen_io.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/sound/pci/oxygen/oxygen_io.c b/sound/pci/oxygen/oxygen_io.c
index 521eae4..471e64a 100644
--- a/sound/pci/oxygen/oxygen_io.c
+++ b/sound/pci/oxygen/oxygen_io.c
@@ -194,6 +194,21 @@ void oxygen_write_ac97_masked(struct oxygen *chip, unsigned int codec,
 }
 EXPORT_SYMBOL(oxygen_write_ac97_masked);
 
+static int oxygen_wait_spi(struct oxygen *chip)
+{
+	/* Higher timeout to be sure: 200 us,
+	   Actual transaction should not need more than 40 us */
+	unsigned int count;
+	for (count = 50; count > 0; count--) {
+		udelay(4);
+		if ((oxygen_read8(chip, OXYGEN_SPI_CONTROL) &
+						OXYGEN_SPI_BUSY) == 0)
+			return 0;
+	}
+	snd_printk(KERN_ERR "Oxygen: SPI wait timeout\n");
+	return -EIO;
+}
+
 void oxygen_write_spi(struct oxygen *chip, u8 control, unsigned int data)
 {
 	unsigned int count;
-- 
1.7.10.4

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

end of thread, other threads:[~2014-01-30 11:43 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-24 12:18 [PATCH v4 01/19] ALSA: Oxygen: Add the separate SPI waiting function Roman Volkov
2014-01-24 12:18 ` [PATCH v4 02/19] ALSA: Oxygen: Modify the SPI writing function Roman Volkov
2014-01-24 12:18 ` [PATCH v4 03/19] ALSA: Oxygen: Add mute mask for the OXYGEN_PLAY_ROUTING register Roman Volkov
2014-01-24 12:18 ` [PATCH v4 04/19] ALSA: Oxygen: Export oxygen_update_dac_routing symbol Roman Volkov
2014-01-24 12:18 ` [PATCH v4 05/19] ALSA: Oxygen: Change description of the xonar_dg.c file Roman Volkov
2014-01-24 12:18 ` [PATCH v4 06/19] ALSA: Oxygen: Additional definitions for the Xonar DG/DGX card Roman Volkov
2014-01-24 12:18 ` [PATCH v4 07/19] ALSA: Oxygen: Add new CS4245 SPI functions Roman Volkov
2014-01-24 13:43   ` Mark Brown
2014-01-24 14:46     ` Clemens Ladisch
2014-01-24 12:18 ` [PATCH v4 08/19] ALSA: Oxygen: Modify initialization functions Roman Volkov
2014-01-24 12:18 ` [PATCH v4 09/19] ALSA: Oxygen: Modify DAC/ADC parameters function Roman Volkov
2014-01-24 12:18 ` [PATCH v4 10/19] ALSA: Oxygen: Modify adjust_dg_dac_routing function Roman Volkov
2014-01-24 12:18 ` [PATCH v4 11/19] ALSA: Oxygen: Modify CS4245 register dumping function Roman Volkov
2014-01-24 12:18 ` [PATCH v4 12/19] ALSA: Oxygen: Move the mixer code into another file Roman Volkov
2014-01-24 12:18 ` [PATCH v4 13/19] ALSA: Oxygen: Capture from I2S channel 1, not 2 Roman Volkov
2014-01-24 12:18 ` [PATCH v4 14/19] ALSA: Oxygen: Modify playback output select Roman Volkov
2014-01-24 12:18 ` [PATCH v4 15/19] ALSA: Oxygen: Use headphone volume control Roman Volkov
2014-01-24 12:18 ` [PATCH v4 16/19] ALSA: Oxygen: Modify capture volume functions Roman Volkov
2014-01-24 12:18 ` [PATCH v4 17/19] ALSA: Oxygen: Modify input select functions Roman Volkov
2014-01-24 12:18 ` [PATCH v4 18/19] ALSA: Oxygen: Modify High-pass filter control Roman Volkov
2014-01-24 12:18 ` [PATCH v4 19/19] ALSA: Oxygen: Cleanup and minor changes Roman Volkov
2014-01-29 21:06 ` [GIT PULL] real support for Xonar DG(X), for 3.15 Clemens Ladisch
2014-01-30 11:43   ` Takashi Iwai

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.