| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * ALSA driver for ICEnsemble ICE1712 (Envy24) |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Copyright (c) 2000 Jaroslav Kysela <perex@perex.cz> |
|---|
| 7 | 8 | * 2002 Takashi Iwai <tiwai@suse.de> |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 10 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 11 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 12 | | - * (at your option) any later version. |
|---|
| 13 | | - * |
|---|
| 14 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 15 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 16 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 17 | | - * GNU General Public License for more details. |
|---|
| 18 | | - * |
|---|
| 19 | | - * You should have received a copy of the GNU General Public License |
|---|
| 20 | | - * along with this program; if not, write to the Free Software |
|---|
| 21 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 22 | | - * |
|---|
| 23 | 9 | */ |
|---|
| 24 | 10 | |
|---|
| 25 | 11 | #include <linux/delay.h> |
|---|
| .. | .. |
|---|
| 611 | 597 | return val != nval; |
|---|
| 612 | 598 | } |
|---|
| 613 | 599 | |
|---|
| 614 | | -static struct snd_kcontrol_new snd_ice1712_ewx2496_controls[] = { |
|---|
| 600 | +static const struct snd_kcontrol_new snd_ice1712_ewx2496_controls[] = { |
|---|
| 615 | 601 | { |
|---|
| 616 | 602 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
|---|
| 617 | 603 | .name = "Input Sensitivity Switch", |
|---|
| .. | .. |
|---|
| 806 | 792 | .private_value = xshift | (xinvert << 8),\ |
|---|
| 807 | 793 | } |
|---|
| 808 | 794 | |
|---|
| 809 | | -static struct snd_kcontrol_new snd_ice1712_ews88d_controls[] = { |
|---|
| 795 | +static const struct snd_kcontrol_new snd_ice1712_ews88d_controls[] = { |
|---|
| 810 | 796 | EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "IEC958 Input Optical", 0, 1, 0), /* inverted */ |
|---|
| 811 | 797 | EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "ADAT Output Optical", 1, 0, 0), |
|---|
| 812 | 798 | EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "ADAT External Master Clock", 2, 0, 0), |
|---|
| .. | .. |
|---|
| 826 | 812 | |
|---|
| 827 | 813 | snd_i2c_lock(ice->i2c); |
|---|
| 828 | 814 | byte = reg; |
|---|
| 829 | | - snd_i2c_sendbytes(spec->i2cdevs[EWS_I2C_6FIRE], &byte, 1); |
|---|
| 815 | + if (snd_i2c_sendbytes(spec->i2cdevs[EWS_I2C_6FIRE], &byte, 1) != 1) { |
|---|
| 816 | + snd_i2c_unlock(ice->i2c); |
|---|
| 817 | + dev_err(ice->card->dev, "cannot send pca\n"); |
|---|
| 818 | + return -EIO; |
|---|
| 819 | + } |
|---|
| 820 | + |
|---|
| 830 | 821 | byte = 0; |
|---|
| 831 | 822 | if (snd_i2c_readbytes(spec->i2cdevs[EWS_I2C_6FIRE], &byte, 1) != 1) { |
|---|
| 832 | 823 | snd_i2c_unlock(ice->i2c); |
|---|
| .. | .. |
|---|
| 937 | 928 | .private_value = xshift | (xinvert << 8),\ |
|---|
| 938 | 929 | } |
|---|
| 939 | 930 | |
|---|
| 940 | | -static struct snd_kcontrol_new snd_ice1712_6fire_controls[] = { |
|---|
| 931 | +static const struct snd_kcontrol_new snd_ice1712_6fire_controls[] = { |
|---|
| 941 | 932 | { |
|---|
| 942 | 933 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
|---|
| 943 | 934 | .name = "Analog Input Select", |
|---|