Commit 287bcba7 authored by Jaroslav Kysela's avatar Jaroslav Kysela Committed by Linus Torvalds

ALSA CVS update - Jaroslav Kysela <perex@suse.cz>

I2C cs8427,ALSA Version,ICE1712 driver
Added cs8427_timeout parameter to the ICE1712 driver
parent 20233b5c
...@@ -187,7 +187,8 @@ ...@@ -187,7 +187,8 @@
#define CS8427_VER8427A 0x71 #define CS8427_VER8427A 0x71
int snd_cs8427_detect(snd_i2c_bus_t *bus, unsigned char addr); int snd_cs8427_detect(snd_i2c_bus_t *bus, unsigned char addr);
int snd_cs8427_create(snd_i2c_bus_t *bus, unsigned char addr, snd_i2c_device_t **r_cs8427); int snd_cs8427_create(snd_i2c_bus_t *bus, unsigned char addr,
unsigned int reset_timeout, snd_i2c_device_t **r_cs8427);
void snd_cs8427_reset(snd_i2c_device_t *cs8427); void snd_cs8427_reset(snd_i2c_device_t *cs8427);
int snd_cs8427_reg_write(snd_i2c_device_t *device, unsigned char reg, unsigned char val); int snd_cs8427_reg_write(snd_i2c_device_t *device, unsigned char reg, unsigned char val);
int snd_cs8427_reg_read(snd_i2c_device_t *device, unsigned char reg); int snd_cs8427_reg_read(snd_i2c_device_t *device, unsigned char reg);
......
/* include/version.h. Generated by configure. */ /* include/version.h. Generated automatically by configure. */
#define CONFIG_SND_VERSION "1.0.3" #define CONFIG_SND_VERSION "1.0.3"
#define CONFIG_SND_DATE " (Mon Mar 01 10:12:14 2004 UTC)" #define CONFIG_SND_DATE " (Mon Mar 01 10:12:14 2004 UTC)"
...@@ -50,6 +50,7 @@ typedef struct { ...@@ -50,6 +50,7 @@ typedef struct {
typedef struct { typedef struct {
unsigned char regmap[0x14]; /* map of first 1 + 13 registers */ unsigned char regmap[0x14]; /* map of first 1 + 13 registers */
unsigned int rate; unsigned int rate;
unsigned int reset_timeout;
cs8427_stream_t playback; cs8427_stream_t playback;
cs8427_stream_t capture; cs8427_stream_t capture;
} cs8427_t; } cs8427_t;
...@@ -163,6 +164,7 @@ static void snd_cs8427_free(snd_i2c_device_t *device) ...@@ -163,6 +164,7 @@ static void snd_cs8427_free(snd_i2c_device_t *device)
int snd_cs8427_create(snd_i2c_bus_t *bus, int snd_cs8427_create(snd_i2c_bus_t *bus,
unsigned char addr, unsigned char addr,
unsigned int reset_timeout,
snd_i2c_device_t **r_cs8427) snd_i2c_device_t **r_cs8427)
{ {
static unsigned char initvals1[] = { static unsigned char initvals1[] = {
...@@ -256,6 +258,7 @@ int snd_cs8427_create(snd_i2c_bus_t *bus, ...@@ -256,6 +258,7 @@ int snd_cs8427_create(snd_i2c_bus_t *bus,
snd_i2c_unlock(bus); snd_i2c_unlock(bus);
/* turn on run bit and rock'n'roll */ /* turn on run bit and rock'n'roll */
chip->reset_timeout = reset_timeout;
snd_cs8427_reset(device); snd_cs8427_reset(device);
#if 0 // it's nice for read tests #if 0 // it's nice for read tests
...@@ -301,7 +304,7 @@ void snd_cs8427_reset(snd_i2c_device_t *cs8427) ...@@ -301,7 +304,7 @@ void snd_cs8427_reset(snd_i2c_device_t *cs8427)
snd_cs8427_reg_write(cs8427, CS8427_REG_CLOCKSOURCE, chip->regmap[CS8427_REG_CLOCKSOURCE]); snd_cs8427_reg_write(cs8427, CS8427_REG_CLOCKSOURCE, chip->regmap[CS8427_REG_CLOCKSOURCE]);
udelay(200); udelay(200);
snd_i2c_unlock(cs8427->bus); snd_i2c_unlock(cs8427->bus);
end_time = jiffies + HZ / 2; end_time = jiffies + chip->reset_timeout;
while (time_after_eq(end_time, jiffies)) { while (time_after_eq(end_time, jiffies)) {
snd_i2c_lock(cs8427->bus); snd_i2c_lock(cs8427->bus);
data = snd_cs8427_reg_read(cs8427, CS8427_REG_RECVERRORS); data = snd_cs8427_reg_read(cs8427, CS8427_REG_RECVERRORS);
......
...@@ -82,6 +82,7 @@ static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ ...@@ -82,6 +82,7 @@ static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */
static int omni[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 0}; /* Delta44 & 66 Omni I/O support */ static int omni[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 0}; /* Delta44 & 66 Omni I/O support */
static int cs8427_timeout[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 50}; /* CS8427 S/PDIF transciever reset timeout value in HZ/100 */
MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(index, "Index value for ICE1712 soundcard."); MODULE_PARM_DESC(index, "Index value for ICE1712 soundcard.");
...@@ -95,6 +96,9 @@ MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC); ...@@ -95,6 +96,9 @@ MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC);
MODULE_PARM(omni, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); MODULE_PARM(omni, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(omni, "Enable Midiman M-Audio Delta Omni I/O support."); MODULE_PARM_DESC(omni, "Enable Midiman M-Audio Delta Omni I/O support.");
MODULE_PARM_SYNTAX(omni, SNDRV_ENABLED "," SNDRV_ENABLE_DESC); MODULE_PARM_SYNTAX(omni, SNDRV_ENABLED "," SNDRV_ENABLE_DESC);
MODULE_PARM(cs8427_timeout, "1-" __MODULE_STRING(SNDRV_CARDS) "i");
MODULE_PARM_DESC(cs8427_timeout, "Define reset timeout for cs8427 chip in HZ/100 resolution.");
MODULE_PARM_SYNTAX(cs8427_timeout, SNDRV_ENABLED ", allows:{{1,100}},default=50,skill:advanced");
#ifndef PCI_VENDOR_ID_ICE #ifndef PCI_VENDOR_ID_ICE
#define PCI_VENDOR_ID_ICE 0x1412 #define PCI_VENDOR_ID_ICE 0x1412
...@@ -386,7 +390,9 @@ int __devinit snd_ice1712_init_cs8427(ice1712_t *ice, int addr) ...@@ -386,7 +390,9 @@ int __devinit snd_ice1712_init_cs8427(ice1712_t *ice, int addr)
{ {
int err; int err;
if ((err = snd_cs8427_create(ice->i2c, addr, &ice->cs8427)) < 0) { if ((err = snd_cs8427_create(ice->i2c, addr,
(ice->cs8427_timeout * HZ) / 100,
&ice->cs8427)) < 0) {
snd_printk("CS8427 initialization failed\n"); snd_printk("CS8427 initialization failed\n");
return err; return err;
} }
...@@ -2404,6 +2410,7 @@ static int snd_ice1712_dev_free(snd_device_t *device) ...@@ -2404,6 +2410,7 @@ static int snd_ice1712_dev_free(snd_device_t *device)
static int __devinit snd_ice1712_create(snd_card_t * card, static int __devinit snd_ice1712_create(snd_card_t * card,
struct pci_dev *pci, struct pci_dev *pci,
int omni, int omni,
int cs8427_timeout,
ice1712_t ** r_ice1712) ice1712_t ** r_ice1712)
{ {
ice1712_t *ice; ice1712_t *ice;
...@@ -2428,6 +2435,11 @@ static int __devinit snd_ice1712_create(snd_card_t * card, ...@@ -2428,6 +2435,11 @@ static int __devinit snd_ice1712_create(snd_card_t * card,
if (ice == NULL) if (ice == NULL)
return -ENOMEM; return -ENOMEM;
ice->omni = omni ? 1 : 0; ice->omni = omni ? 1 : 0;
if (cs8427_timeout < 1)
cs8427_timeout = 1;
else if (cs8427_timeout > 100)
cs8427_timeout = 100;
ice->cs8427_timeout = cs8427_timeout;
spin_lock_init(&ice->reg_lock); spin_lock_init(&ice->reg_lock);
init_MUTEX(&ice->gpio_mutex); init_MUTEX(&ice->gpio_mutex);
init_MUTEX(&ice->open_mutex); init_MUTEX(&ice->open_mutex);
...@@ -2547,7 +2559,7 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci, ...@@ -2547,7 +2559,7 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
strcpy(card->driver, "ICE1712"); strcpy(card->driver, "ICE1712");
strcpy(card->shortname, "ICEnsemble ICE1712"); strcpy(card->shortname, "ICEnsemble ICE1712");
if ((err = snd_ice1712_create(card, pci, omni[dev], &ice)) < 0) { if ((err = snd_ice1712_create(card, pci, omni[dev], cs8427_timeout[dev], &ice)) < 0) {
snd_card_free(card); snd_card_free(card);
return err; return err;
} }
......
...@@ -346,6 +346,7 @@ struct _snd_ice1712 { ...@@ -346,6 +346,7 @@ struct _snd_ice1712 {
snd_i2c_bus_t *i2c; /* I2C bus */ snd_i2c_bus_t *i2c; /* I2C bus */
snd_i2c_device_t *cs8404; /* CS8404A I2C device */ snd_i2c_device_t *cs8404; /* CS8404A I2C device */
snd_i2c_device_t *cs8427; /* CS8427 I2C device */ snd_i2c_device_t *cs8427; /* CS8427 I2C device */
unsigned int cs8427_timeout; /* CS8427 reset timeout in HZ/100 */
snd_i2c_device_t *i2cdevs[2]; /* additional i2c devices */ snd_i2c_device_t *i2cdevs[2]; /* additional i2c devices */
struct ice1712_gpio { struct ice1712_gpio {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment