rpms/kernel/devel linux-2.6-debunk-i2c.patch, NONE, 1.1 linux-2.6-snd-powermac.patch, NONE, 1.1 kernel-2.6.spec, 1.1869, 1.1870

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Mon Jan 23 20:26:43 UTC 2006


Author: dwmw2

Update of /cvs/dist/rpms/kernel/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv23819

Modified Files:
	kernel-2.6.spec 
Added Files:
	linux-2.6-debunk-i2c.patch linux-2.6-snd-powermac.patch 
Log Message:
revert i2c Bunkage and fix powermac sound

linux-2.6-debunk-i2c.patch:
 drivers/i2c/i2c-core.c |   15 +++++++++++++++
 include/linux/i2c.h    |    3 +++
 2 files changed, 18 insertions(+)

--- NEW FILE linux-2.6-debunk-i2c.patch ---
>From benh at kernel.crashing.org Sun Jan  8 20:19:08 2006
From: Benjamin Herrenschmidt <benh at kernel.crashing.org>
To: Greg KH <greg at kroah.com>
Cc: Jean Delvare <khali at linux-fr.org>, Adrian Bunk <bunk at stusta.de>
Date: Mon, 09 Jan 2006 15:19:18 +1100
Message-Id: <1136780358.14374.2.camel at localhost.localdomain>
Subject: I2C: Resurrect i2c_smbus_write_i2c_block_data.

From: Jean Delvare <khali at linux-fr.org>

Signed-off-by: Jean Delvare <khali at linux-fr.org>

---
 drivers/i2c/i2c-core.c |   15 +++++++++++++++
 include/linux/i2c.h    |    3 +++
 2 files changed, 18 insertions(+)

--- gregkh-2.6.orig/drivers/i2c/i2c-core.c
+++ gregkh-2.6/drivers/i2c/i2c-core.c
@@ -946,6 +946,20 @@ s32 i2c_smbus_read_i2c_block_data(struct
 	}
 }
 
+s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client, u8 command,
+				   u8 length, u8 *values)
+{
+	union i2c_smbus_data data;
+
+	if (length > I2C_SMBUS_BLOCK_MAX)
+		length = I2C_SMBUS_BLOCK_MAX;
+	data.block[0] = length;
+	memcpy(data.block + 1, values, length);
+	return i2c_smbus_xfer(client->adapter, client->addr, client->flags,
+			      I2C_SMBUS_WRITE, command,
+			      I2C_SMBUS_I2C_BLOCK_DATA, &data);
+}
+
 /* Simulate a SMBus command using the i2c protocol 
    No checking of parameters is done!  */
 static s32 i2c_smbus_xfer_emulated(struct i2c_adapter * adapter, u16 addr, 
@@ -1150,6 +1164,7 @@ EXPORT_SYMBOL(i2c_smbus_read_word_data);
 EXPORT_SYMBOL(i2c_smbus_write_word_data);
 EXPORT_SYMBOL(i2c_smbus_write_block_data);
 EXPORT_SYMBOL(i2c_smbus_read_i2c_block_data);
+EXPORT_SYMBOL(i2c_smbus_write_i2c_block_data);
 
 MODULE_AUTHOR("Simon G. Vogl <simon at tk.uni-linz.ac.at>");
 MODULE_DESCRIPTION("I2C-Bus main module");
--- gregkh-2.6.orig/include/linux/i2c.h
+++ gregkh-2.6/include/linux/i2c.h
@@ -100,6 +100,9 @@ extern s32 i2c_smbus_write_block_data(st
 /* Returns the number of read bytes */
 extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client,
 					 u8 command, u8 *values);
+extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client,
+					  u8 command, u8 length,
+					  u8 *values);
 
 /*
  * A driver is capable of handling one or more physical devices present on

linux-2.6-snd-powermac.patch:
 oss/dmasound/tas_common.h |   16 ++++++++--------
 ppc/pmac.c                |    3 ++-
 ppc/tumbler.c             |   19 ++++++++++---------
 3 files changed, 20 insertions(+), 18 deletions(-)

--- NEW FILE linux-2.6-snd-powermac.patch ---
Ok, here's another version that uses the proper wrapper in the i2c
layer, that was removed but is coming back...

Index: linux-work/sound/ppc/tumbler.c
===================================================================
--- linux-work.orig/sound/ppc/tumbler.c	2006-01-09 10:29:54.000000000 +1100
+++ linux-work/sound/ppc/tumbler.c	2006-01-09 10:30:14.000000000 +1100
@@ -239,8 +238,8 @@ static int tumbler_set_master_volume(pma
 	block[4] = (right_vol >> 8)  & 0xff;
 	block[5] = (right_vol >> 0)  & 0xff;
   
-	if (i2c_smbus_write_block_data(mix->i2c.client, TAS_REG_VOL,
-				       6, block) < 0) {
+	if (i2c_smbus_write_i2c_block_data(mix->i2c.client, TAS_REG_VOL, 6,
+					   block) < 0) {
 		snd_printk("failed to set volume \n");
 		return -EINVAL;
 	}
@@ -340,8 +339,8 @@ static int tumbler_set_drc(pmac_tumbler_
 		val[1] = 0;
 	}
 
-	if (i2c_smbus_write_block_data(mix->i2c.client, TAS_REG_DRC,
-				       2, val) < 0) {
+	if (i2c_smbus_write_i2c_block_data(mix->i2c.client, TAS_REG_DRC,
+					   2, val) < 0) {
 		snd_printk("failed to set DRC\n");
 		return -EINVAL;
 	}
@@ -376,8 +375,8 @@ static int snapper_set_drc(pmac_tumbler_
 	val[4] = 0x60;
 	val[5] = 0xa0;
 
-	if (i2c_smbus_write_block_data(mix->i2c.client, TAS_REG_DRC,
-				       6, val) < 0) {
+	if (i2c_smbus_write_i2c_block_data(mix->i2c.client, TAS_REG_DRC,
+					   6, val) < 0) {
 		snd_printk("failed to set DRC\n");
 		return -EINVAL;
 	}
@@ -481,8 +480,8 @@ static int tumbler_set_mono_volume(pmac_
 	vol = info->table[vol];
 	for (i = 0; i < info->bytes; i++)
 		block[i] = (vol >> ((info->bytes - i - 1) * 8)) & 0xff;
-	if (i2c_smbus_write_block_data(mix->i2c.client, info->reg,
-				       info->bytes, block) < 0) {
+	if (i2c_smbus_write_i2c_block_data(mix->i2c.client, info->reg,
+					   info->bytes, block) < 0) {
 		snd_printk("failed to set mono volume %d\n", info->index);
 		return -EINVAL;
 	}
@@ -611,7 +610,8 @@ static int snapper_set_mix_vol1(pmac_tum
 		for (j = 0; j < 3; j++)
 			block[i * 3 + j] = (vol >> ((2 - j) * 8)) & 0xff;
 	}
-	if (i2c_smbus_write_block_data(mix->i2c.client, reg, 9, block) < 0) {
+	if (i2c_smbus_write_i2c_block_data(mix->i2c.client, reg,
+					   9, block) < 0) {
 		snd_printk("failed to set mono volume %d\n", reg);
 		return -EINVAL;
 	}
Index: linux-work/sound/ppc/pmac.c
===================================================================
--- linux-work.orig/sound/ppc/pmac.c	2006-01-09 10:29:54.000000000 +1100
+++ linux-work/sound/ppc/pmac.c	2006-01-09 10:30:14.000000000 +1100
@@ -74,7 +74,7 @@ static int snd_pmac_dbdma_alloc(pmac_t *
 
 static void snd_pmac_dbdma_free(pmac_t *chip, pmac_dbdma_t *rec)
 {
-	if (rec) {
+	if (rec->space) {
 		unsigned int rsize = sizeof(struct dbdma_cmd) * (rec->size + 1);
 
 		dma_free_coherent(&chip->pdev->dev, rsize, rec->space, rec->dma_base);
@@ -895,6 +895,7 @@ static int __init snd_pmac_detect(pmac_t
 	chip->can_capture = 1;
 	chip->num_freqs = ARRAY_SIZE(awacs_freqs);
 	chip->freq_table = awacs_freqs;
+	chip->pdev = NULL;
 
 	chip->control_mask = MASK_IEPC | MASK_IEE | 0x11; /* default */
 
Index: linux-work/sound/oss/dmasound/tas_common.h
===================================================================
--- linux-work.orig/sound/oss/dmasound/tas_common.h	2006-01-09 10:29:54.000000000 +1100
+++ linux-work/sound/oss/dmasound/tas_common.h	2006-01-09 10:31:09.000000000 +1100
@@ -178,10 +178,10 @@ tas_write_register(	struct tas_data_t *s
 	if (write_mode & WRITE_SHADOW)
 		memcpy(self->shadow[reg_num],data,reg_width);
 	if (write_mode & WRITE_HW) {
-		rc=i2c_smbus_write_block_data(self->client,
-					      reg_num,
-					      reg_width,
-					      data);
+		rc=i2c_smbus_write_i2c_block_data(self->client,
+						  reg_num,
+						  reg_width,
+						  data);
 		if (rc < 0) {
 			printk("tas: I2C block write failed \n");  
 			return rc; 
@@ -199,10 +199,10 @@ tas_sync_register(	struct tas_data_t *se
 
 	if (reg_width==0 || self==NULL)
 		return -EINVAL;
-	rc=i2c_smbus_write_block_data(self->client,
-				      reg_num,
-				      reg_width,
-				      self->shadow[reg_num]);
+	rc=i2c_smbus_write_i2c_block_data(self->client,
+					  reg_num,
+					  reg_width,
+					  self->shadow[reg_num]);
 	if (rc < 0) {
 		printk("tas: I2C block write failed \n");
 		return rc;




Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/kernel-2.6.spec,v
retrieving revision 1.1869
retrieving revision 1.1870
diff -u -r1.1869 -r1.1870
--- kernel-2.6.spec	23 Jan 2006 05:03:15 -0000	1.1869
+++ kernel-2.6.spec	23 Jan 2006 20:26:40 -0000	1.1870
@@ -225,6 +225,8 @@
 
 # 300 - 399   ppc(64)
 Patch301: linux-2.6.15-cell-numa-init.patch
+Patch302: linux-2.6-debunk-i2c.patch
+Patch303: linux-2.6-snd-powermac.patch
 #Patch304: linux-2.6.15-mv643xx-fixes.patch
 Patch305: linux-2.6-cell-mambo-drivers.patch
 Patch306: linux-2.6-hvc-console.patch
@@ -621,6 +623,10 @@
 #
 # Arnd says don't call cell_spumem_init() till he fixes it.
 %patch301 -p1
+# Revert I2C Bunkage.
+%patch302 -p1
+# Fix I2C handling in snd_powermac
+%patch303 -p1
 # Fix the MV643xx Gigabit Ethernet driver
 #%patch304 -p1
 # Support the IBM Mambo simulator; core as well as disk and network drivers.
@@ -1345,6 +1351,9 @@
 %endif
 
 %changelog
+* Tue Jan 24 2006 David Woidhouse <dwmw2 at redhat.com>
+- Fix snd_powermac I2C handling
+
 * Sun Jan 22 2006 Dave Jones <davej at redhat.com>
 - Add missing .kernelrelease to kernel-devel (#178491)
 - Make serial /dev nodes get created for pci modems again.




More information about the fedora-cvs-commits mailing list