Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging

Pull i2c subsystem fixes from Jean Delvare.

* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
i2c-i801: Fix comment
i2c-i801: Simplify dependency towards GPIOLIB
i2c-stub: Move to drivers/i2c

+40 -40
+1
drivers/i2c/Makefile
··· 8 8 obj-$(CONFIG_I2C_CHARDEV) += i2c-dev.o 9 9 obj-$(CONFIG_I2C_MUX) += i2c-mux.o 10 10 obj-y += algos/ busses/ muxes/ 11 + obj-$(CONFIG_I2C_STUB) += i2c-stub.o 11 12 12 13 ccflags-$(CONFIG_I2C_DEBUG_CORE) := -DDEBUG 13 14 CFLAGS_i2c-core.o := -Wno-deprecated-declarations
-1
drivers/i2c/busses/Kconfig
··· 81 81 tristate "Intel 82801 (ICH/PCH)" 82 82 depends on PCI 83 83 select CHECK_SIGNATURE if X86 && DMI 84 - select GPIOLIB if I2C_MUX 85 84 help 86 85 If you say yes to this option, support will be included for the Intel 87 86 801 family of mainboard I2C interfaces. Specifically, the following
-1
drivers/i2c/busses/Makefile
··· 85 85 obj-$(CONFIG_I2C_ELEKTOR) += i2c-elektor.o 86 86 obj-$(CONFIG_I2C_PCA_ISA) += i2c-pca-isa.o 87 87 obj-$(CONFIG_I2C_SIBYTE) += i2c-sibyte.o 88 - obj-$(CONFIG_I2C_STUB) += i2c-stub.o 89 88 obj-$(CONFIG_SCx200_ACB) += scx200_acb.o 90 89 obj-$(CONFIG_SCx200_I2C) += scx200_i2c.o 91 90
+7 -4
drivers/i2c/busses/i2c-i801.c
··· 82 82 #include <linux/wait.h> 83 83 #include <linux/err.h> 84 84 85 - #if defined CONFIG_I2C_MUX || defined CONFIG_I2C_MUX_MODULE 85 + #if (defined CONFIG_I2C_MUX_GPIO || defined CONFIG_I2C_MUX_GPIO_MODULE) && \ 86 + defined CONFIG_DMI 86 87 #include <linux/gpio.h> 87 88 #include <linux/i2c-mux-gpio.h> 88 89 #include <linux/platform_device.h> ··· 193 192 int len; 194 193 u8 *data; 195 194 196 - #if defined CONFIG_I2C_MUX || defined CONFIG_I2C_MUX_MODULE 195 + #if (defined CONFIG_I2C_MUX_GPIO || defined CONFIG_I2C_MUX_GPIO_MODULE) && \ 196 + defined CONFIG_DMI 197 197 const struct i801_mux_config *mux_drvdata; 198 198 struct platform_device *mux_pdev; 199 199 #endif ··· 923 921 static void __devinit i801_probe_optional_slaves(struct i801_priv *priv) {} 924 922 #endif /* CONFIG_X86 && CONFIG_DMI */ 925 923 926 - #if defined CONFIG_I2C_MUX || defined CONFIG_I2C_MUX_MODULE 924 + #if (defined CONFIG_I2C_MUX_GPIO || defined CONFIG_I2C_MUX_GPIO_MODULE) && \ 925 + defined CONFIG_DMI 927 926 static struct i801_mux_config i801_mux_config_asus_z8_d12 = { 928 927 .gpio_chip = "gpio_ich", 929 928 .values = { 0x02, 0x03 }, ··· 1062 1059 1063 1060 id = dmi_first_match(mux_dmi_table); 1064 1061 if (id) { 1065 - /* Remove from branch classes from trunk */ 1062 + /* Remove branch classes from trunk */ 1066 1063 mux_config = id->driver_data; 1067 1064 for (i = 0; i < mux_config->n_values; i++) 1068 1065 class &= ~mux_config->classes[i];
+32 -34
drivers/i2c/busses/i2c-stub.c drivers/i2c/i2c-stub.c
··· 2 2 i2c-stub.c - I2C/SMBus chip emulator 3 3 4 4 Copyright (c) 2004 Mark M. Hoffman <mhoffman@lightlink.com> 5 - Copyright (C) 2007 Jean Delvare <khali@linux-fr.org> 5 + Copyright (C) 2007, 2012 Jean Delvare <khali@linux-fr.org> 6 6 7 7 This program is free software; you can redistribute it and/or modify 8 8 it under the terms of the GNU General Public License as published by ··· 51 51 static struct stub_chip *stub_chips; 52 52 53 53 /* Return negative errno on error. */ 54 - static s32 stub_xfer(struct i2c_adapter * adap, u16 addr, unsigned short flags, 55 - char read_write, u8 command, int size, union i2c_smbus_data * data) 54 + static s32 stub_xfer(struct i2c_adapter *adap, u16 addr, unsigned short flags, 55 + char read_write, u8 command, int size, union i2c_smbus_data *data) 56 56 { 57 57 s32 ret; 58 58 int i, len; ··· 78 78 case I2C_SMBUS_BYTE: 79 79 if (read_write == I2C_SMBUS_WRITE) { 80 80 chip->pointer = command; 81 - dev_dbg(&adap->dev, "smbus byte - addr 0x%02x, " 82 - "wrote 0x%02x.\n", 83 - addr, command); 81 + dev_dbg(&adap->dev, 82 + "smbus byte - addr 0x%02x, wrote 0x%02x.\n", 83 + addr, command); 84 84 } else { 85 85 data->byte = chip->words[chip->pointer++] & 0xff; 86 - dev_dbg(&adap->dev, "smbus byte - addr 0x%02x, " 87 - "read 0x%02x.\n", 88 - addr, data->byte); 86 + dev_dbg(&adap->dev, 87 + "smbus byte - addr 0x%02x, read 0x%02x.\n", 88 + addr, data->byte); 89 89 } 90 90 91 91 ret = 0; ··· 95 95 if (read_write == I2C_SMBUS_WRITE) { 96 96 chip->words[command] &= 0xff00; 97 97 chip->words[command] |= data->byte; 98 - dev_dbg(&adap->dev, "smbus byte data - addr 0x%02x, " 99 - "wrote 0x%02x at 0x%02x.\n", 100 - addr, data->byte, command); 98 + dev_dbg(&adap->dev, 99 + "smbus byte data - addr 0x%02x, wrote 0x%02x at 0x%02x.\n", 100 + addr, data->byte, command); 101 101 } else { 102 102 data->byte = chip->words[command] & 0xff; 103 - dev_dbg(&adap->dev, "smbus byte data - addr 0x%02x, " 104 - "read 0x%02x at 0x%02x.\n", 105 - addr, data->byte, command); 103 + dev_dbg(&adap->dev, 104 + "smbus byte data - addr 0x%02x, read 0x%02x at 0x%02x.\n", 105 + addr, data->byte, command); 106 106 } 107 107 chip->pointer = command + 1; 108 108 ··· 112 112 case I2C_SMBUS_WORD_DATA: 113 113 if (read_write == I2C_SMBUS_WRITE) { 114 114 chip->words[command] = data->word; 115 - dev_dbg(&adap->dev, "smbus word data - addr 0x%02x, " 116 - "wrote 0x%04x at 0x%02x.\n", 117 - addr, data->word, command); 115 + dev_dbg(&adap->dev, 116 + "smbus word data - addr 0x%02x, wrote 0x%04x at 0x%02x.\n", 117 + addr, data->word, command); 118 118 } else { 119 119 data->word = chip->words[command]; 120 - dev_dbg(&adap->dev, "smbus word data - addr 0x%02x, " 121 - "read 0x%04x at 0x%02x.\n", 122 - addr, data->word, command); 120 + dev_dbg(&adap->dev, 121 + "smbus word data - addr 0x%02x, read 0x%04x at 0x%02x.\n", 122 + addr, data->word, command); 123 123 } 124 124 125 125 ret = 0; ··· 132 132 chip->words[command + i] &= 0xff00; 133 133 chip->words[command + i] |= data->block[1 + i]; 134 134 } 135 - dev_dbg(&adap->dev, "i2c block data - addr 0x%02x, " 136 - "wrote %d bytes at 0x%02x.\n", 137 - addr, len, command); 135 + dev_dbg(&adap->dev, 136 + "i2c block data - addr 0x%02x, wrote %d bytes at 0x%02x.\n", 137 + addr, len, command); 138 138 } else { 139 139 for (i = 0; i < len; i++) { 140 140 data->block[1 + i] = 141 141 chip->words[command + i] & 0xff; 142 142 } 143 - dev_dbg(&adap->dev, "i2c block data - addr 0x%02x, " 144 - "read %d bytes at 0x%02x.\n", 145 - addr, len, command); 143 + dev_dbg(&adap->dev, 144 + "i2c block data - addr 0x%02x, read %d bytes at 0x%02x.\n", 145 + addr, len, command); 146 146 } 147 147 148 148 ret = 0; ··· 179 179 int i, ret; 180 180 181 181 if (!chip_addr[0]) { 182 - printk(KERN_ERR "i2c-stub: Please specify a chip address\n"); 182 + pr_err("i2c-stub: Please specify a chip address\n"); 183 183 return -ENODEV; 184 184 } 185 185 186 186 for (i = 0; i < MAX_CHIPS && chip_addr[i]; i++) { 187 187 if (chip_addr[i] < 0x03 || chip_addr[i] > 0x77) { 188 - printk(KERN_ERR "i2c-stub: Invalid chip address " 189 - "0x%02x\n", chip_addr[i]); 188 + pr_err("i2c-stub: Invalid chip address 0x%02x\n", 189 + chip_addr[i]); 190 190 return -EINVAL; 191 191 } 192 192 193 - printk(KERN_INFO "i2c-stub: Virtual chip at 0x%02x\n", 194 - chip_addr[i]); 193 + pr_info("i2c-stub: Virtual chip at 0x%02x\n", chip_addr[i]); 195 194 } 196 195 197 196 /* Allocate memory for all chips at once */ 198 197 stub_chips = kzalloc(i * sizeof(struct stub_chip), GFP_KERNEL); 199 198 if (!stub_chips) { 200 - printk(KERN_ERR "i2c-stub: Out of memory\n"); 199 + pr_err("i2c-stub: Out of memory\n"); 201 200 return -ENOMEM; 202 201 } 203 202 ··· 218 219 219 220 module_init(i2c_stub_init); 220 221 module_exit(i2c_stub_exit); 221 -