diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-01-18 13:36:07 +0100 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-01-31 17:30:05 +0100 |
commit | 7cda8ba9f4e471dfba914ecf67fd14ebffb17c16 (patch) | |
tree | 5786b450d9099809b974929ea356b444c9f2bc07 /sound/pci/ice1712/revo.c | |
parent | 797760ab14db4e82a50c06a9916dd5c6147b415b (diff) |
[ALSA] ice1712, ice1724 - Code clean up
Clean up ice1712/ice1724 codes. The board-specific data is allocated
locally in each code instead of having an ungly union in struct ice1712.
Also, fix coding issues in prodigy_hifi.c.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci/ice1712/revo.c')
-rw-r--r-- | sound/pci/ice1712/revo.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/sound/pci/ice1712/revo.c b/sound/pci/ice1712/revo.c index 05a751c5989..ddd5fc8d4fe 100644 --- a/sound/pci/ice1712/revo.c +++ b/sound/pci/ice1712/revo.c @@ -32,6 +32,12 @@ #include "envy24ht.h" #include "revo.h" +/* a non-standard I2C device for revo51 */ +struct revo51_spec { + struct snd_i2c_device *dev; + struct snd_pt2258 *pt2258; +} revo51; + static void revo_i2s_mclk_changed(struct snd_ice1712 *ice) { /* assert PRST# to converters; MT05 bit 7 */ @@ -152,8 +158,14 @@ static struct snd_i2c_bit_ops revo51_bit_ops = { static int revo51_i2c_init(struct snd_ice1712 *ice, struct snd_pt2258 *pt) { + struct revo51_spec *spec; int err; + spec = kzalloc(sizeof(*spec), GFP_KERNEL); + if (!spec) + return -ENOMEM; + ice->spec = spec; + /* create the I2C bus */ err = snd_i2c_bus_create(ice->card, "ICE1724 GPIO6", NULL, &ice->i2c); if (err < 0) @@ -163,15 +175,14 @@ static int revo51_i2c_init(struct snd_ice1712 *ice, ice->i2c->hw_ops.bit = &revo51_bit_ops; /* create the I2C device */ - err = snd_i2c_device_create(ice->i2c, "PT2258", 0x40, - &ice->spec.revo51.dev); + err = snd_i2c_device_create(ice->i2c, "PT2258", 0x40, &spec->dev); if (err < 0) return err; pt->card = ice->card; pt->i2c_bus = ice->i2c; - pt->i2c_dev = ice->spec.revo51.dev; - ice->spec.revo51.pt2258 = pt; + pt->i2c_dev = spec->dev; + spec->pt2258 = pt; snd_pt2258_reset(pt); @@ -555,6 +566,7 @@ static int __devinit revo_init(struct snd_ice1712 *ice) static int __devinit revo_add_controls(struct snd_ice1712 *ice) { + struct revo51_spec *spec; int err; switch (ice->eeprom.subvendor) { @@ -567,7 +579,8 @@ static int __devinit revo_add_controls(struct snd_ice1712 *ice) err = snd_ice1712_akm4xxx_build_controls(ice); if (err < 0) return err; - err = snd_pt2258_build_controls(ice->spec.revo51.pt2258); + spec = ice->spec; + err = snd_pt2258_build_controls(spec->pt2258); if (err < 0) return err; break; |