Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1de9fdc2 authored by Alexander Beregalov's avatar Alexander Beregalov Committed by Jaroslav Kysela
Browse files

ALSA: ice1724.c: fix coding style



before:
total: 96 errors, 66 warnings, 2612 lines checked

after:
total: 11 errors, 64 warnings, 2624 lines checked

Compile tested only.

Signed-off-by: default avatarAlexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@perex.cz>
parent cc67b7f7
Loading
Loading
Loading
Loading
+96 −84
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@
 *
 */

#include <asm/io.h>
#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -733,17 +733,17 @@ static int snd_vt1724_playback_pro_prepare(struct snd_pcm_substream *substream)
	outl(substream->runtime->dma_addr, ICEMT1724(ice, PLAYBACK_ADDR));

	size = (snd_pcm_lib_buffer_bytes(substream) >> 2) - 1;
	// outl(size, ICEMT1724(ice, PLAYBACK_SIZE));
	/* outl(size, ICEMT1724(ice, PLAYBACK_SIZE)); */
	outw(size, ICEMT1724(ice, PLAYBACK_SIZE));
	outb(size >> 16, ICEMT1724(ice, PLAYBACK_SIZE) + 2);
	size = (snd_pcm_lib_period_bytes(substream) >> 2) - 1;
	// outl(size, ICEMT1724(ice, PLAYBACK_COUNT));
	/* outl(size, ICEMT1724(ice, PLAYBACK_COUNT)); */
	outw(size, ICEMT1724(ice, PLAYBACK_COUNT));
	outb(size >> 16, ICEMT1724(ice, PLAYBACK_COUNT) + 2);

	spin_unlock_irq(&ice->reg_lock);

	// printk("pro prepare: ch = %d, addr = 0x%x, buffer = 0x%x, period = 0x%x\n", substream->runtime->channels, (unsigned int)substream->runtime->dma_addr, snd_pcm_lib_buffer_bytes(substream), snd_pcm_lib_period_bytes(substream));
	/* printk("pro prepare: ch = %d, addr = 0x%x, buffer = 0x%x, period = 0x%x\n", substream->runtime->channels, (unsigned int)substream->runtime->dma_addr, snd_pcm_lib_buffer_bytes(substream), snd_pcm_lib_period_bytes(substream)); */
	return 0;
}

@@ -842,8 +842,7 @@ static const struct vt1724_pcm_reg vt1724_capture_pro_reg = {
	.start = VT1724_RDMA0_START,
};

static const struct snd_pcm_hardware snd_vt1724_playback_pro =
{
static const struct snd_pcm_hardware snd_vt1724_playback_pro = {
	.info =			(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
				 SNDRV_PCM_INFO_BLOCK_TRANSFER |
				 SNDRV_PCM_INFO_MMAP_VALID |
@@ -861,8 +860,7 @@ static const struct snd_pcm_hardware snd_vt1724_playback_pro =
	.periods_max =		1024,
};

static const struct snd_pcm_hardware snd_vt1724_spdif =
{
static const struct snd_pcm_hardware snd_vt1724_spdif = {
	.info =			(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
				 SNDRV_PCM_INFO_BLOCK_TRANSFER |
				 SNDRV_PCM_INFO_MMAP_VALID |
@@ -883,8 +881,7 @@ static const struct snd_pcm_hardware snd_vt1724_spdif =
	.periods_max =		1024,
};

static const struct snd_pcm_hardware snd_vt1724_2ch_stereo =
{
static const struct snd_pcm_hardware snd_vt1724_2ch_stereo = {
	.info =			(SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
				 SNDRV_PCM_INFO_BLOCK_TRANSFER |
				 SNDRV_PCM_INFO_MMAP_VALID |
@@ -1401,11 +1398,13 @@ static int __devinit snd_vt1724_ac97_mixer(struct snd_ice1712 * ice)
		mdelay(5); /* FIXME */
		outb(inb(ICEMT1724(ice, AC97_CMD)) & ~0x80, ICEMT1724(ice, AC97_CMD));

		if ((err = snd_ac97_bus(ice->card, 0, &ops, NULL, &pbus)) < 0)
		err = snd_ac97_bus(ice->card, 0, &ops, NULL, &pbus);
		if (err < 0)
			return err;
		memset(&ac97, 0, sizeof(ac97));
		ac97.private_data = ice;
		if ((err = snd_ac97_mixer(pbus, &ac97, &ice->ac97)) < 0)
		err = snd_ac97_mixer(pbus, &ac97, &ice->ac97);
		if (err < 0)
			printk(KERN_WARNING "ice1712: cannot initialize pro ac97, skipped\n");
		else
			return 0;
@@ -1607,7 +1606,7 @@ static int snd_vt1724_spdif_default_put(struct snd_kcontrol *kcontrol,
	if (val != old)
		update_spdif_bits(ice, val);
	spin_unlock_irq(&ice->reg_lock);
	return (val != old);
	return val != old;
}

static struct snd_kcontrol_new snd_vt1724_spdif_default __devinitdata =
@@ -1692,7 +1691,7 @@ static struct snd_kcontrol_new snd_vt1724_spdif_switch __devinitdata =
{
	.iface =	SNDRV_CTL_ELEM_IFACE_MIXER,
	/* FIXME: the following conflict with IEC958 Playback Route */
	// .name =         SNDRV_CTL_NAME_IEC958("",PLAYBACK,SWITCH),
	/* .name =         SNDRV_CTL_NAME_IEC958("", PLAYBACK, SWITCH), */
	.name =         SNDRV_CTL_NAME_IEC958("Output ", NONE, SWITCH),
	.info =		snd_vt1724_spdif_sw_info,
	.get =		snd_vt1724_spdif_sw_get,
@@ -1954,7 +1953,7 @@ static int get_route_val(struct snd_ice1712 *ice, int shift)

	val = inl(ICEMT1724(ice, ROUTE_PLAYBACK));
	val >>= shift;
	val &= 7;	//we now have 3 bits per output
	val &= 7; /* we now have 3 bits per output */
	eitem = xlate[val];
	if (eitem == 255) {
		snd_BUG();
@@ -2121,7 +2120,7 @@ unsigned char snd_vt1724_read_i2c(struct snd_ice1712 *ice,
	wait_i2c_busy(ice);
	val = inb(ICEREG1724(ice, I2C_DATA));
	mutex_unlock(&ice->i2c_mutex);
	//printk("i2c_read: [0x%x,0x%x] = 0x%x\n", dev, addr, val);
	/* printk("i2c_read: [0x%x,0x%x] = 0x%x\n", dev, addr, val); */
	return val;
}

@@ -2130,7 +2129,7 @@ void snd_vt1724_write_i2c(struct snd_ice1712 *ice,
{
	mutex_lock(&ice->i2c_mutex);
	wait_i2c_busy(ice);
	//printk("i2c_write: [0x%x,0x%x] = 0x%x\n", dev, addr, data);
	/* printk("i2c_write: [0x%x,0x%x] = 0x%x\n", dev, addr, data); */
	outb(addr, ICEREG1724(ice, I2C_BYTE_ADDR));
	outb(data, ICEREG1724(ice, I2C_DATA));
	outb(dev | VT1724_I2C_WRITE, ICEREG1724(ice, I2C_DEV_ADDR));
@@ -2360,7 +2359,8 @@ static int __devinit snd_vt1724_create(struct snd_card *card,
	*r_ice1712 = NULL;

	/* enable PCI device */
	if ((err = pci_enable_device(pci)) < 0)
	err = pci_enable_device(pci);
	if (err < 0)
		return err;

	ice = kzalloc(sizeof(*ice), GFP_KERNEL);
@@ -2384,7 +2384,8 @@ static int __devinit snd_vt1724_create(struct snd_card *card,
	snd_vt1724_proc_init(ice);
	synchronize_irq(pci->irq);

	if ((err = pci_request_regions(pci, "ICE1724")) < 0) {
	err = pci_request_regions(pci, "ICE1724");
	if (err < 0) {
		kfree(ice);
		pci_disable_device(pci);
		return err;
@@ -2419,7 +2420,8 @@ static int __devinit snd_vt1724_create(struct snd_card *card,
	 */
	outb(VT1724_MULTI_FIFO_ERR, ICEMT1724(ice, DMA_INT_MASK));

	if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, ice, &ops)) < 0) {
	err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, ice, &ops);
	if (err < 0) {
		snd_vt1724_free(ice);
		return err;
	}
@@ -2460,7 +2462,8 @@ static int __devinit snd_vt1724_probe(struct pci_dev *pci,
	strcpy(card->driver, "ICE1724");
	strcpy(card->shortname, "ICEnsemble ICE1724");

	if ((err = snd_vt1724_create(card, pci, model[dev], &ice)) < 0) {
	err = snd_vt1724_create(card, pci, model[dev], &ice);
	if (err < 0) {
		snd_card_free(card);
		return err;
	}
@@ -2472,7 +2475,8 @@ static int __devinit snd_vt1724_probe(struct pci_dev *pci,
				if (c->driver) /* specific driver? */
					strcpy(card->driver, c->driver);
				if (c->chip_init) {
					if ((err = c->chip_init(ice)) < 0) {
					err = c->chip_init(ice);
					if (err < 0) {
						snd_card_free(card);
						return err;
					}
@@ -2505,40 +2509,47 @@ static int __devinit snd_vt1724_probe(struct pci_dev *pci,
	if (!ice->hw_rates)
		set_std_hw_rates(ice);

	if ((err = snd_vt1724_pcm_profi(ice, pcm_dev++)) < 0) {
	err = snd_vt1724_pcm_profi(ice, pcm_dev++);
	if (err < 0) {
		snd_card_free(card);
		return err;
	}

	if ((err = snd_vt1724_pcm_spdif(ice, pcm_dev++)) < 0) {
	err = snd_vt1724_pcm_spdif(ice, pcm_dev++);
	if (err < 0) {
		snd_card_free(card);
		return err;
	}

	if ((err = snd_vt1724_pcm_indep(ice, pcm_dev++)) < 0) {
	err = snd_vt1724_pcm_indep(ice, pcm_dev++);
	if (err < 0) {
		snd_card_free(card);
		return err;
	}

	if ((err = snd_vt1724_ac97_mixer(ice)) < 0) {
	err = snd_vt1724_ac97_mixer(ice);
	if (err < 0) {
		snd_card_free(card);
		return err;
	}

	if ((err = snd_vt1724_build_controls(ice)) < 0) {
	err = snd_vt1724_build_controls(ice);
	if (err < 0) {
		snd_card_free(card);
		return err;
	}

	if (ice->pcm && ice->has_spdif) { /* has SPDIF I/O */
		if ((err = snd_vt1724_spdif_build_controls(ice)) < 0) {
		err = snd_vt1724_spdif_build_controls(ice);
		if (err < 0) {
			snd_card_free(card);
			return err;
		}
	}

	if (c->build_controls) {
		if ((err = c->build_controls(ice)) < 0) {
		err = c->build_controls(ice);
		if (err < 0) {
			snd_card_free(card);
			return err;
		}
@@ -2576,7 +2587,8 @@ static int __devinit snd_vt1724_probe(struct pci_dev *pci,
	sprintf(card->longname, "%s at 0x%lx, irq %i",
		card->shortname, ice->port, ice->irq);

	if ((err = snd_card_register(card)) < 0) {
	err = snd_card_register(card);
	if (err < 0) {
		snd_card_free(card);
		return err;
	}