[alsa-devel] [PATCH] ALSA: ASoC: Fix compile-time warning for tlv320aic23.c
Fixes this warning:
sound/soc/codecs/tlv320aic23.c: In function 'tlv320aic23_write': sound/soc/codecs/tlv320aic23.c:104: warning: passing argument 2 of 'codec->hw_write' makes pointer from integer without a cast
Replaces i2c smbus write function with standard i2c write function
Signed-off-by: Arun KS arunks@mistralsolutions.com --- sound/soc/codecs/tlv320aic23.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/tlv320aic23.c b/sound/soc/codecs/tlv320aic23.c index bac7815..44308da 100644 --- a/sound/soc/codecs/tlv320aic23.c +++ b/sound/soc/codecs/tlv320aic23.c @@ -84,7 +84,7 @@ static int tlv320aic23_write(struct snd_soc_codec *codec, unsigned int reg, unsigned int value) {
- u8 data; + u8 data[2];
/* TLV320AIC23 has 7 bit address and 9 bits of data * so we need to switch one data bit into reg and rest @@ -96,12 +96,12 @@ static int tlv320aic23_write(struct snd_soc_codec *codec, unsigned int reg, return -1; }
- data = (reg << 1) | (value >> 8 & 0x01); + data[0] = (reg << 1) | (value >> 8 & 0x01); + data[1] = value & 0xff;
tlv320aic23_write_reg_cache(codec, reg, value);
- if (codec->hw_write(codec->control_data, data, - (value & 0xff)) == 0) + if (codec->hw_write(codec->control_data, data, 2) == 2) return 0;
printk(KERN_ERR "%s cannot write %03x to register R%d\n", __func__, @@ -674,7 +674,7 @@ static int tlv320aic23_probe(struct platform_device *pdev)
tlv320aic23_socdev = socdev; #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) - codec->hw_write = (hw_write_t) i2c_smbus_write_byte_data; + codec->hw_write = (hw_write_t) i2c_master_send; codec->hw_read = NULL; ret = i2c_add_driver(&tlv320aic23_i2c_driver); if (ret != 0)
At Mon, 13 Oct 2008 18:09:36 +0530, Arun KS wrote:
From 5355b18bec0d5286776be806dc06ef58ac1a818d Mon Sep 17 00:00:00 2001 From: Arun KS arunks@mistralsolutions.com Date: Mon, 13 Oct 2008 15:47:25 +0530 Subject: [PATCH] ALSA: ASoC: Fix compile-time warning for tlv320aic23.c
Fixes this warning:
sound/soc/codecs/tlv320aic23.c: In function 'tlv320aic23_write': sound/soc/codecs/tlv320aic23.c:104: warning: passing argument 2 of 'codec->hw_write' makes pointer from integer without a cast
Replaces i2c smbus write function with standard i2c write function
Signed-off-by: Arun KS arunks@mistralsolutions.com
Applied now. Thanks.
Takashi
Hello
I have a bit more information. I've got newer kernel and alsa build from last snapshot (10.13.2008), ALC1200 is recognized as ALC888. Still no light at spdif output.
Results of alsa-info.sh http://www.alsa-project.org/db/?f=caa27b0a7c7a18b1350e96ee8e872dc72b808e0d
[root@nelson ~]# dmesg | grep -i alsa ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/../../alsa-kernel/pci/hda/hda_intel.c:2130: chipset global capabilities = 0x4401 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/../../alsa-kernel/pci/hda/hda_intel.c:771: codec_mask = 0x1 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:3285: autoconfig: line_outs=4 (0x14/0x15/0x16/0x17/0x0) ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:3289: speaker_outs=0 (0x0/0x0/0x0/0x0/0x0) ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:3293: hp_outs=1 (0x1b/0x0/0x0/0x0/0x0) ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:3294: mono: mono_out=0x0 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:3302: inputs: mic=0x18, fmic=0x19, line=0x1a, fline=0x0, cd=0x0, aux=0x0 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:1213: Cannot find slave Headphone Playback Volume, skipped ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:1213: Cannot find slave Speaker Playback Volume, skipped ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:1213: Cannot find slave Mono Playback Volume, skipped ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:1213: Cannot find slave Line-Out Playback Volume, skipped ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:1213: Cannot find slave Speaker Playback Switch, skipped ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:1213: Cannot find slave Mono Playback Switch, skipped ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/../../alsa-kernel/pci/hda/hda_intel.c:1434: azx_pcm_prepare: bufsize=0x10000, format=0x4011 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:780: hda_codec_setup_stream: NID=0x6, stream=0x5, channel=0, format=0x4011 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:780: hda_codec_setup_stream: NID=0x2, stream=0x5, channel=0, format=0x4011 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:780: hda_codec_setup_stream: NID=0x3, stream=0x5, channel=0, format=0x4011 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:780: hda_codec_setup_stream: NID=0x4, stream=0x5, channel=0, format=0x4011 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:780: hda_codec_setup_stream: NID=0x5, stream=0x5, channel=0, format=0x4011 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/../../alsa-kernel/pci/hda/hda_intel.c:1434: azx_pcm_prepare: bufsize=0x10000, format=0x4011 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:780: hda_codec_setup_stream: NID=0x6, stream=0x5, channel=0, format=0x4011 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:780: hda_codec_setup_stream: NID=0x2, stream=0x5, channel=0, format=0x4011 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:780: hda_codec_setup_stream: NID=0x3, stream=0x5, channel=0, format=0x4011 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:780: hda_codec_setup_stream: NID=0x4, stream=0x5, channel=0, format=0x4011 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:780: hda_codec_setup_stream: NID=0x5, stream=0x5, channel=0, format=0x4011 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/../../alsa-kernel/pci/hda/hda_intel.c:1434: azx_pcm_prepare: bufsize=0x10000, format=0x4011 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:780: hda_codec_setup_stream: NID=0x8, stream=0x1, channel=0, format=0x4011 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/../../alsa-kernel/pci/hda/hda_intel.c:1434: azx_pcm_prepare: bufsize=0x10000, format=0x4011 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:780: hda_codec_setup_stream: NID=0x8, stream=0x1, channel=0, format=0x4011 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:792: hda_codec_cleanup_stream: NID=0x8 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:792: hda_codec_cleanup_stream: NID=0x8 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:792: hda_codec_cleanup_stream: NID=0x2 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:792: hda_codec_cleanup_stream: NID=0x3 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:792: hda_codec_cleanup_stream: NID=0x4 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:792: hda_codec_cleanup_stream: NID=0x5 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:792: hda_codec_cleanup_stream: NID=0x6 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:792: hda_codec_cleanup_stream: NID=0x2 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:792: hda_codec_cleanup_stream: NID=0x3 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:792: hda_codec_cleanup_stream: NID=0x4 ALSA /home/norbert/alsa-git/alsa-driver-unstable/pci/hda/hda_codec.c:792: hda_codec_cleanup_stream: NID=0x5
Best regards, Norbert
participants (3)
-
Arun KS
-
Norbert Piotrowski
-
Takashi Iwai