]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - sound/pci/ice1712/ews.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas...
[mv-sheeva.git] / sound / pci / ice1712 / ews.c
index 064760d2a0278596d415a252399f7c366fdad462..6fe35b8120400ddb8c073f9166879b9821984a33 100644 (file)
@@ -149,7 +149,8 @@ static int snd_ice1712_ews88mt_chip_select(struct snd_ice1712 *ice, int chip_mas
        struct ews_spec *spec = ice->spec;
        unsigned char data, ndata;
 
-       snd_assert(chip_mask >= 0 && chip_mask <= 0x0f, return -EINVAL);
+       if (snd_BUG_ON(chip_mask < 0 || chip_mask > 0x0f))
+               return -EINVAL;
        snd_i2c_lock(ice->i2c);
        if (snd_i2c_readbytes(spec->i2cdevs[EWS_I2C_PCF2], &data, 1) != 1)
                goto __error;
@@ -238,6 +239,7 @@ static void snd_ice1712_ews_cs8404_spdif_write(struct snd_ice1712 *ice, unsigned
        case ICE1712_SUBDEVICE_EWS88MT:
        case ICE1712_SUBDEVICE_EWS88MT_NEW:
        case ICE1712_SUBDEVICE_PHASE88:
+       case ICE1712_SUBDEVICE_TS88:
                if (snd_i2c_sendbytes(spec->i2cdevs[EWS_I2C_CS8404], &bits, 1)
                    != 1)
                        goto _error;
@@ -433,6 +435,7 @@ static int __devinit snd_ice1712_ews_init(struct snd_ice1712 *ice)
        case ICE1712_SUBDEVICE_EWS88MT:
        case ICE1712_SUBDEVICE_EWS88MT_NEW:
        case ICE1712_SUBDEVICE_PHASE88:
+       case ICE1712_SUBDEVICE_TS88:
                ice->num_total_dacs = 8;
                ice->num_total_adcs = 8;
                break;
@@ -475,6 +478,8 @@ static int __devinit snd_ice1712_ews_init(struct snd_ice1712 *ice)
        case ICE1712_SUBDEVICE_EWS88MT:
        case ICE1712_SUBDEVICE_EWS88MT_NEW:
        case ICE1712_SUBDEVICE_PHASE88:
+       case ICE1712_SUBDEVICE_TS88:
+
                err = snd_i2c_device_create(ice->i2c, "CS8404",
                                            ICE1712_EWS88MT_CS8404_ADDR,
                                            &spec->i2cdevs[EWS_I2C_CS8404]);
@@ -518,6 +523,7 @@ static int __devinit snd_ice1712_ews_init(struct snd_ice1712 *ice)
        case ICE1712_SUBDEVICE_EWS88MT:
        case ICE1712_SUBDEVICE_EWS88MT_NEW:
        case ICE1712_SUBDEVICE_PHASE88:
+       case ICE1712_SUBDEVICE_TS88:
        case ICE1712_SUBDEVICE_EWS88D:
                /* set up CS8404 */
                ice->spdif.ops.open = ews88_open_spdif;
@@ -547,6 +553,7 @@ static int __devinit snd_ice1712_ews_init(struct snd_ice1712 *ice)
        case ICE1712_SUBDEVICE_EWS88MT:
        case ICE1712_SUBDEVICE_EWS88MT_NEW:
        case ICE1712_SUBDEVICE_PHASE88:
+       case ICE1712_SUBDEVICE_TS88:
                err = snd_ice1712_akm4xxx_init(ak, &akm_ews88mt, &akm_ews88mt_priv, ice);
                break;
        case ICE1712_SUBDEVICE_EWX2496:
@@ -679,7 +686,8 @@ static int snd_ice1712_ews88mt_input_sense_get(struct snd_kcontrol *kcontrol, st
        int channel = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
        unsigned char data;
 
-       snd_assert(channel >= 0 && channel <= 7, return 0);
+       if (snd_BUG_ON(channel < 0 || channel > 7))
+               return 0;
        snd_i2c_lock(ice->i2c);
        if (snd_i2c_readbytes(spec->i2cdevs[EWS_I2C_PCF1], &data, 1) != 1) {
                snd_i2c_unlock(ice->i2c);
@@ -699,7 +707,8 @@ static int snd_ice1712_ews88mt_input_sense_put(struct snd_kcontrol *kcontrol, st
        int channel = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
        unsigned char data, ndata;
 
-       snd_assert(channel >= 0 && channel <= 7, return 0);
+       if (snd_BUG_ON(channel < 0 || channel > 7))
+               return 0;
        snd_i2c_lock(ice->i2c);
        if (snd_i2c_readbytes(spec->i2cdevs[EWS_I2C_PCF1], &data, 1) != 1) {
                snd_i2c_unlock(ice->i2c);
@@ -973,6 +982,7 @@ static int __devinit snd_ice1712_ews_add_controls(struct snd_ice1712 *ice)
        case ICE1712_SUBDEVICE_EWS88MT:
        case ICE1712_SUBDEVICE_EWS88MT_NEW:
        case ICE1712_SUBDEVICE_PHASE88:
+       case ICE1712_SUBDEVICE_TS88:
        case ICE1712_SUBDEVICE_DMX6FIRE:
                err = snd_ice1712_akm4xxx_build_controls(ice);
                if (err < 0)
@@ -992,6 +1002,7 @@ static int __devinit snd_ice1712_ews_add_controls(struct snd_ice1712 *ice)
        case ICE1712_SUBDEVICE_EWS88MT:
        case ICE1712_SUBDEVICE_EWS88MT_NEW:
        case ICE1712_SUBDEVICE_PHASE88:
+       case ICE1712_SUBDEVICE_TS88:
                err = snd_ctl_add(ice->card, snd_ctl_new1(&snd_ice1712_ews88mt_input_sense, ice));
                if (err < 0)
                        return err;
@@ -1048,6 +1059,13 @@ struct snd_ice1712_card_info snd_ice1712_ews_cards[] __devinitdata = {
                .chip_init = snd_ice1712_ews_init,
                .build_controls = snd_ice1712_ews_add_controls,
        },
+       {
+               .subvendor = ICE1712_SUBDEVICE_TS88,
+               .name = "terrasoniq TS88",
+               .model = "phase88",
+               .chip_init = snd_ice1712_ews_init,
+               .build_controls = snd_ice1712_ews_add_controls,
+       },
        {
                .subvendor = ICE1712_SUBDEVICE_EWS88D,
                .name = "TerraTec EWS88D",