[ALSA] Add some more 'const', but needs changes in i2c/other/ak4*
authorTakashi Iwai <tiwai@suse.de>
Mon, 29 Jan 2007 14:27:56 +0000 (15:27 +0100)
committerJaroslav Kysela <perex@suse.cz>
Fri, 9 Feb 2007 08:03:17 +0000 (09:03 +0100)
Make data passed to ak4xxx_create 'const'.
Signed-of-by: Philipp Matthias Hahn <pmhahn@pmhahn.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
include/sound/ak4114.h
include/sound/ak4117.h
include/sound/ak4xxx-adda.h
sound/i2c/other/ak4114.c
sound/i2c/other/ak4117.c
sound/i2c/other/ak4xxx-adda.c
sound/pci/ice1712/juli.c
sound/pci/ice1712/revo.c

index 85f49d46475184e749a69927aafdfcc82277d22c..c149d3b2558b35bfa957ed7c42992471ca8da87a 100644 (file)
@@ -188,7 +188,7 @@ struct ak4114 {
 
 int snd_ak4114_create(struct snd_card *card,
                      ak4114_read_t *read, ak4114_write_t *write,
-                     unsigned char pgm[7], unsigned char txcsb[5],
+                     const unsigned char pgm[7], const unsigned char txcsb[5],
                      void *private_data, struct ak4114 **r_ak4114);
 void snd_ak4114_reg_write(struct ak4114 *ak4114, unsigned char reg, unsigned char mask, unsigned char val);
 void snd_ak4114_reinit(struct ak4114 *ak4114);
index 2b96c32f06fd06ef2313cebd804ce5dca0424918..d650d52e3d296429d9c8ee75e5f0f7d80336aa37 100644 (file)
@@ -178,7 +178,7 @@ struct ak4117 {
 };
 
 int snd_ak4117_create(struct snd_card *card, ak4117_read_t *read, ak4117_write_t *write,
-                     unsigned char pgm[5], void *private_data, struct ak4117 **r_ak4117);
+                     const unsigned char pgm[5], void *private_data, struct ak4117 **r_ak4117);
 void snd_ak4117_reg_write(struct ak4117 *ak4117, unsigned char reg, unsigned char mask, unsigned char val);
 void snd_ak4117_reinit(struct ak4117 *ak4117);
 int snd_ak4117_build(struct ak4117 *ak4117, struct snd_pcm_substream *capture_substream);
index d01d535280151cd0659c9e872c34ba076775991b..aa49dda4f4104b4a58032516e72f690b94191627 100644 (file)
@@ -71,8 +71,8 @@ struct snd_akm4xxx {
        } type;
 
        /* (array) information of combined codecs */
-       struct snd_akm4xxx_dac_channel *dac_info;
-       struct snd_akm4xxx_adc_channel *adc_info;
+       const struct snd_akm4xxx_dac_channel *dac_info;
+       const struct snd_akm4xxx_adc_channel *adc_info;
 
        struct snd_ak4xxx_ops ops;
 };
index 69dcaf8ac79316f6e66a4767e74cadba68347032..34bbafc81cf632b218063062a0d24d902d6e95c2 100644 (file)
@@ -79,7 +79,7 @@ static int snd_ak4114_dev_free(struct snd_device *device)
 
 int snd_ak4114_create(struct snd_card *card,
                      ak4114_read_t *read, ak4114_write_t *write,
-                     unsigned char pgm[7], unsigned char txcsb[5],
+                     const unsigned char pgm[7], const unsigned char txcsb[5],
                      void *private_data, struct ak4114 **r_ak4114)
 {
        struct ak4114 *chip;
index 4e45952dd95a78d292d62cca26381f3e496274d2..c022f29da2f744f192e903774f9ea87d03f78edc 100644 (file)
@@ -74,7 +74,7 @@ static int snd_ak4117_dev_free(struct snd_device *device)
 }
 
 int snd_ak4117_create(struct snd_card *card, ak4117_read_t *read, ak4117_write_t *write,
-                     unsigned char pgm[5], void *private_data, struct ak4117 **r_ak4117)
+                     const unsigned char pgm[5], void *private_data, struct ak4117 **r_ak4117)
 {
        struct ak4117 *chip;
        int err = 0;
index fe61b92f4e47ba83dde1cabb02319877f7c58ea9..3d9d6c5d354e02dc25c1898c2716cd8ad3cc6798 100644 (file)
@@ -140,7 +140,7 @@ EXPORT_SYMBOL(snd_akm4xxx_reset);
  * Used for AK4524 input/ouput attenuation, AK4528, and
  * AK5365 input attenuation
  */
-static unsigned char vol_cvt_datt[128] = {
+static const unsigned char vol_cvt_datt[128] = {
        0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04,
        0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x06, 0x06,
        0x06, 0x07, 0x07, 0x08, 0x08, 0x08, 0x09, 0x0a,
@@ -184,7 +184,7 @@ void snd_akm4xxx_init(struct snd_akm4xxx *ak)
                0x07, 0x00, /* 7: DAC right muted */
                0xff, 0xff
        };
-       static unsigned char inits_ak4528[] = {
+       static const unsigned char inits_ak4528[] = {
                0x00, 0x07, /* 0: all power up */
                0x01, 0x00, /* 1: ADC/DAC reset */
                0x02, 0x60, /* 2: 24bit I2S */
@@ -194,7 +194,7 @@ void snd_akm4xxx_init(struct snd_akm4xxx *ak)
                0x05, 0x00, /* 5: ADC right muted */
                0xff, 0xff
        };
-       static unsigned char inits_ak4529[] = {
+       static const unsigned char inits_ak4529[] = {
                0x09, 0x01, /* 9: ATS=0, RSTN=1 */
                0x0a, 0x3f, /* A: all power up, no zero/overflow detection */
                0x00, 0x0c, /* 0: TDM=0, 24bit I2S, SMUTE=0 */
@@ -210,7 +210,7 @@ void snd_akm4xxx_init(struct snd_akm4xxx *ak)
                0x08, 0x55, /* 8: deemphasis all off */
                0xff, 0xff
        };
-       static unsigned char inits_ak4355[] = {
+       static const unsigned char inits_ak4355[] = {
                0x01, 0x02, /* 1: reset and soft-mute */
                0x00, 0x06, /* 0: mode3(i2s), disable auto-clock detect,
                             * disable DZF, sharp roll-off, RSTN#=0 */
@@ -227,7 +227,7 @@ void snd_akm4xxx_init(struct snd_akm4xxx *ak)
                0x01, 0x01, /* 1: un-reset, unmute */
                0xff, 0xff
        };
-       static unsigned char inits_ak4358[] = {
+       static const unsigned char inits_ak4358[] = {
                0x01, 0x02, /* 1: reset and soft-mute */
                0x00, 0x06, /* 0: mode3(i2s), disable auto-clock detect,
                             * disable DZF, sharp roll-off, RSTN#=0 */
@@ -246,7 +246,7 @@ void snd_akm4xxx_init(struct snd_akm4xxx *ak)
                0x01, 0x01, /* 1: un-reset, unmute */
                0xff, 0xff
        };
-       static unsigned char inits_ak4381[] = {
+       static const unsigned char inits_ak4381[] = {
                0x00, 0x0c, /* 0: mode3(i2s), disable auto-clock detect */
                0x01, 0x02, /* 1: de-emphasis off, normal speed,
                             * sharp roll-off, DZF off */
@@ -259,7 +259,8 @@ void snd_akm4xxx_init(struct snd_akm4xxx *ak)
        };
 
        int chip, num_chips;
-       unsigned char *ptr, reg, data, *inits;
+       const unsigned char *ptr, *inits;
+       unsigned char reg, data;
 
        memset(ak->images, 0, sizeof(ak->images));
        memset(ak->volumes, 0, sizeof(ak->volumes));
index 4854eaf63a8af041ac11b1d0200002009d48964e..d88172fa95da5f9f539871e509afba47e72a2797 100644 (file)
@@ -146,7 +146,7 @@ static int __devinit juli_add_controls(struct snd_ice1712 *ice)
  */
 static int __devinit juli_init(struct snd_ice1712 *ice)
 {
-       static unsigned char ak4114_init_vals[] = {
+       static const unsigned char ak4114_init_vals[] = {
                /* AK4117_REG_PWRDN */  AK4114_RST | AK4114_PWN | AK4114_OCKS0 | AK4114_OCKS1,
                /* AK4114_REQ_FORMAT */ AK4114_DIF_I24I2S,
                /* AK4114_REG_IO0 */    AK4114_TX1E,
@@ -154,7 +154,7 @@ static int __devinit juli_init(struct snd_ice1712 *ice)
                /* AK4114_REG_INT0_MASK */ 0,
                /* AK4114_REG_INT1_MASK */ 0
        };
-       static unsigned char ak4114_init_txcsb[] = {
+       static const unsigned char ak4114_init_txcsb[] = {
                0x41, 0x02, 0x2c, 0x00, 0x00
        };
        int err;
index 7d3bccbf03139bc6f1f57bfc3e54f017dbfa6521..025a7e8497c30cbb44a847a722a04bd264a33213 100644 (file)
@@ -185,18 +185,18 @@ static int revo51_i2c_init(struct snd_ice1712 *ice,
 
 #define AK_DAC(xname,xch) { .name = xname, .num_channels = xch }
 
-static struct snd_akm4xxx_dac_channel revo71_front[] = {
+static const struct snd_akm4xxx_dac_channel revo71_front[] = {
        AK_DAC("PCM Playback Volume", 2)
 };
 
-static struct snd_akm4xxx_dac_channel revo71_surround[] = {
+static const struct snd_akm4xxx_dac_channel revo71_surround[] = {
        AK_DAC("PCM Center Playback Volume", 1),
        AK_DAC("PCM LFE Playback Volume", 1),
        AK_DAC("PCM Side Playback Volume", 2),
        AK_DAC("PCM Rear Playback Volume", 2),
 };
 
-static struct snd_akm4xxx_dac_channel revo51_dac[] = {
+static const struct snd_akm4xxx_dac_channel revo51_dac[] = {
        AK_DAC("PCM Playback Volume", 2),
        AK_DAC("PCM Center Playback Volume", 1),
        AK_DAC("PCM LFE Playback Volume", 1),
@@ -210,7 +210,7 @@ static const char *revo51_adc_input_names[] = {
        NULL
 };
 
-static struct snd_akm4xxx_adc_channel revo51_adc[] = {
+static const struct snd_akm4xxx_adc_channel revo51_adc[] = {
        {
                .name = "PCM Capture Volume",
                .switch_name = "PCM Capture Switch",
@@ -219,7 +219,7 @@ static struct snd_akm4xxx_adc_channel revo51_adc[] = {
        },
 };
 
-static struct snd_akm4xxx akm_revo_front __devinitdata = {
+static const struct snd_akm4xxx akm_revo_front __devinitdata = {
        .type = SND_AK4381,
        .num_dacs = 2,
        .ops = {
@@ -320,11 +320,11 @@ static void ap192_set_rate_val(struct snd_akm4xxx *ak, unsigned int rate)
 #endif
 }
 
-static struct snd_akm4xxx_dac_channel ap192_dac[] = {
+static const struct snd_akm4xxx_dac_channel ap192_dac[] = {
        AK_DAC("PCM Playback Volume", 2)
 };
 
-static struct snd_akm4xxx akm_ap192 __devinitdata = {
+static const struct snd_akm4xxx akm_ap192 __devinitdata = {
        .type = SND_AK4358,
        .num_dacs = 2,
        .ops = {