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

This function performs waiting when the SPI bus completes
a transaction. Timeout error checking introduced and
the timeout increased to 400 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..a917f37 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: 400 microseconds */
+	unsigned int count;
+	for (count = 100; count > 0; count--) {
+		if ((oxygen_read8(chip, OXYGEN_SPI_CONTROL) &
+						OXYGEN_SPI_BUSY) == 0)
+			return 0;
+		udelay(4);
+		--count;
+	}
+	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] 24+ messages in thread

end of thread, other threads:[~2014-01-20 14:14 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-17 15:08 [PATCH v3 01/16] ALSA: Oxygen: Add the separate SPI waiting function Roman Volkov
2014-01-17 15:08 ` [PATCH v3 02/16] ALSA: Oxygen: Modify the SPI writing function Roman Volkov
2014-01-17 15:08 ` [PATCH v3 03/16] ALSA: Oxygen: Add mute mask for the OXYGEN_PLAY_ROUTING register Roman Volkov
2014-01-17 15:08 ` [PATCH v3 04/16] ALSA: Oxygen: Add CS4245_SPI_READ constant Roman Volkov
2014-01-18 10:29   ` Clemens Ladisch
2014-01-17 15:08 ` [PATCH v3 05/16] ALSA: Oxygen: Export oxygen_update_dac_routing symbol Roman Volkov
2014-01-17 15:08 ` [PATCH v3 06/16] ALSA: Oxygen: Change description of the xonar_dg.c file Roman Volkov
2014-01-17 15:08 ` [PATCH v3 07/16] ALSA: Oxygen: Additional definitions for the Xonar DG/DGX card Roman Volkov
2014-01-17 15:08 ` [PATCH v3 08/16] ALSA: Oxygen: Add new CS4245 SPI functions Roman Volkov
2014-01-18 10:36   ` Clemens Ladisch
2014-01-17 15:08 ` [PATCH v3 09/16] ALSA: Oxygen: Modify initialization functions Roman Volkov
2014-01-18 10:50   ` Clemens Ladisch
2014-01-20 14:14     ` Roman Volkov
2014-01-17 15:08 ` [PATCH v3 10/16] ALSA: Oxygen: Modify DAC/ADC parameters function Roman Volkov
2014-01-17 15:08 ` [PATCH v3 11/16] ALSA: Oxygen: Modify adjust_dg_dac_routing function Roman Volkov
2014-01-17 15:08 ` [PATCH v3 12/16] ALSA: Oxygen: Modify CS4245 register dumping function Roman Volkov
2014-01-17 15:08 ` [PATCH v3 13/16] ALSA: Oxygen: Modify suspend, resume, and cleanup functions Roman Volkov
2014-01-17 15:08 ` [PATCH v3 14/16] ALSA: Oxygen: Remove code from the xonar_dg.c file Roman Volkov
2014-01-18 11:08   ` Clemens Ladisch
2014-01-17 15:08 ` [PATCH v3 15/16] ALSA: Oxygen: Additional declarations for the new mixer implementation Roman Volkov
2014-01-17 15:08 ` [PATCH v3 16/16] ALSA: Oxygen: The " Roman Volkov
2014-01-18 10:26 ` [PATCH v3 01/16] ALSA: Oxygen: Add the separate SPI waiting function Clemens Ladisch
2014-01-19  8:10   ` Roman Volkov
2014-01-19  9:39     ` Clemens Ladisch

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.