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://jdelvare.pck.nerim.net/jdelvare-2.6

* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6:
i2c: Convert some more new-style drivers to use module aliasing
i2c: Match dummy devices by type
i2c-sibyte: Mark i2c_sibyte_add_bus() as static
i2c-sibyte: Correct a comment about frequency
i2c: Improve the functionality documentation
i2c: Improve smbus-protocol documentation
i2c-piix4: Blacklist two mainboards
i2c-piix4: Increase the intitial delay for the ServerWorks CSB5
i2c-mpc: Compare to NO_IRQ instead of zero

+191 -106
+54 -45
Documentation/i2c/functionality
··· 51 51 the transparent emulation layer) 52 52 53 53 54 - ALGORITHM/ADAPTER IMPLEMENTATION 55 - -------------------------------- 54 + ADAPTER IMPLEMENTATION 55 + ---------------------- 56 56 57 - When you write a new algorithm driver, you will have to implement a 58 - function callback `functionality', that gets an i2c_adapter structure 59 - pointer as its only parameter: 57 + When you write a new adapter driver, you will have to implement a 58 + function callback `functionality'. Typical implementations are given 59 + below. 60 60 61 - struct i2c_algorithm { 62 - /* Many other things of course; check <linux/i2c.h>! */ 63 - u32 (*functionality) (struct i2c_adapter *); 64 - } 61 + A typical SMBus-only adapter would list all the SMBus transactions it 62 + supports. This example comes from the i2c-piix4 driver: 65 63 66 - A typically implementation is given below, from i2c-algo-bit.c: 67 - 68 - static u32 bit_func(struct i2c_adapter *adap) 64 + static u32 piix4_func(struct i2c_adapter *adapter) 69 65 { 70 - return I2C_FUNC_SMBUS_EMUL | I2C_FUNC_10BIT_ADDR | 71 - I2C_FUNC_PROTOCOL_MANGLING; 66 + return I2C_FUNC_SMBUS_QUICK | I2C_FUNC_SMBUS_BYTE | 67 + I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA | 68 + I2C_FUNC_SMBUS_BLOCK_DATA; 72 69 } 73 70 71 + A typical full-I2C adapter would use the following (from the i2c-pxa 72 + driver): 73 + 74 + static u32 i2c_pxa_functionality(struct i2c_adapter *adap) 75 + { 76 + return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; 77 + } 78 + 79 + I2C_FUNC_SMBUS_EMUL includes all the SMBus transactions (with the 80 + addition of I2C block transactions) which i2c-core can emulate using 81 + I2C_FUNC_I2C without any help from the adapter driver. The idea is 82 + to let the client drivers check for the support of SMBus functions 83 + without having to care whether the said functions are implemented in 84 + hardware by the adapter, or emulated in software by i2c-core on top 85 + of an I2C adapter. 74 86 75 87 76 88 CLIENT CHECKING ··· 90 78 91 79 Before a client tries to attach to an adapter, or even do tests to check 92 80 whether one of the devices it supports is present on an adapter, it should 93 - check whether the needed functionality is present. There are two functions 94 - defined which should be used instead of calling the functionality hook 95 - in the algorithm structure directly: 81 + check whether the needed functionality is present. The typical way to do 82 + this is (from the lm75 driver): 96 83 97 - /* Return the functionality mask */ 98 - extern u32 i2c_get_functionality (struct i2c_adapter *adap); 99 - 100 - /* Return 1 if adapter supports everything we need, 0 if not. */ 101 - extern int i2c_check_functionality (struct i2c_adapter *adap, u32 func); 102 - 103 - This is a typical way to use these functions (from the writing-clients 104 - document): 105 - int foo_detect_client(struct i2c_adapter *adapter, int address, 106 - unsigned short flags, int kind) 84 + static int lm75_detect(...) 107 85 { 108 - /* Define needed variables */ 109 - 110 - /* As the very first action, we check whether the adapter has the 111 - needed functionality: we need the SMBus read_word_data, 112 - write_word_data and write_byte functions in this example. */ 113 - if (!i2c_check_functionality(adapter,I2C_FUNC_SMBUS_WORD_DATA | 114 - I2C_FUNC_SMBUS_WRITE_BYTE)) 115 - goto ERROR0; 116 - 117 - /* Now we can do the real detection */ 118 - 119 - ERROR0: 120 - /* Return an error */ 86 + (...) 87 + if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA | 88 + I2C_FUNC_SMBUS_WORD_DATA)) 89 + goto exit; 90 + (...) 121 91 } 122 92 93 + Here, the lm75 driver checks if the adapter can do both SMBus byte data 94 + and SMBus word data transactions. If not, then the driver won't work on 95 + this adapter and there's no point in going on. If the check above is 96 + successful, then the driver knows that it can call the following 97 + functions: i2c_smbus_read_byte_data(), i2c_smbus_write_byte_data(), 98 + i2c_smbus_read_word_data() and i2c_smbus_write_word_data(). As a rule of 99 + thumb, the functionality constants you test for with 100 + i2c_check_functionality() should match exactly the i2c_smbus_* functions 101 + which you driver is calling. 102 + 103 + Note that the check above doesn't tell whether the functionalities are 104 + implemented in hardware by the underlying adapter or emulated in 105 + software by i2c-core. Client drivers don't have to care about this, as 106 + i2c-core will transparently implement SMBus transactions on top of I2C 107 + adapters. 123 108 124 109 125 110 CHECKING THROUGH /DEV ··· 125 116 If you try to access an adapter from a userspace program, you will have 126 117 to use the /dev interface. You will still have to check whether the 127 118 functionality you need is supported, of course. This is done using 128 - the I2C_FUNCS ioctl. An example, adapted from the lm_sensors i2cdetect 129 - program, is below: 119 + the I2C_FUNCS ioctl. An example, adapted from the i2cdetect program, is 120 + below: 130 121 131 122 int file; 132 - if (file = open("/dev/i2c-0",O_RDWR) < 0) { 123 + if (file = open("/dev/i2c-0", O_RDWR) < 0) { 133 124 /* Some kind of error handling */ 134 125 exit(1); 135 126 } 136 - if (ioctl(file,I2C_FUNCS,&funcs) < 0) { 127 + if (ioctl(file, I2C_FUNCS, &funcs) < 0) { 137 128 /* Some kind of error handling */ 138 129 exit(1); 139 130 } 140 - if (! (funcs & I2C_FUNC_SMBUS_QUICK)) { 131 + if (!(funcs & I2C_FUNC_SMBUS_QUICK)) { 141 132 /* Oops, the needed functionality (SMBus write_quick function) is 142 133 not available! */ 143 134 exit(1);
+46 -35
Documentation/i2c/smbus-protocol
··· 1 1 SMBus Protocol Summary 2 2 ====================== 3 + 3 4 The following is a summary of the SMBus protocol. It applies to 4 5 all revisions of the protocol (1.0, 1.1, and 2.0). 5 6 Certain protocol features which are not supported by ··· 9 8 Some adapters understand only the SMBus (System Management Bus) protocol, 10 9 which is a subset from the I2C protocol. Fortunately, many devices use 11 10 only the same subset, which makes it possible to put them on an SMBus. 11 + 12 12 If you write a driver for some I2C device, please try to use the SMBus 13 13 commands if at all possible (if the device uses only that subset of the 14 14 I2C protocol). This makes it possible to use the device driver on both ··· 17 15 translated to I2C on I2C adapters, but plain I2C commands can not be 18 16 handled at all on most pure SMBus adapters). 19 17 20 - Below is a list of SMBus commands. 18 + Below is a list of SMBus protocol operations, and the functions executing 19 + them. Note that the names used in the SMBus protocol specifications usually 20 + don't match these function names. For some of the operations which pass a 21 + single data byte, the functions using SMBus protocol operation names execute 22 + a different protocol operation entirely. 23 + 21 24 22 25 Key to symbols 23 26 ============== ··· 42 35 [..]: Data sent by I2C device, as opposed to data sent by the host adapter. 43 36 44 37 45 - SMBus Write Quick 46 - ================= 38 + SMBus Quick Command: i2c_smbus_write_quick() 39 + ============================================= 47 40 48 41 This sends a single bit to the device, at the place of the Rd/Wr bit. 49 - There is no equivalent Read Quick command. 50 42 51 43 A Addr Rd/Wr [A] P 52 44 53 45 54 - SMBus Read Byte 55 - =============== 46 + SMBus Receive Byte: i2c_smbus_read_byte() 47 + ========================================== 56 48 57 49 This reads a single byte from a device, without specifying a device 58 50 register. Some devices are so simple that this interface is enough; for ··· 61 55 S Addr Rd [A] [Data] NA P 62 56 63 57 64 - SMBus Write Byte 65 - ================ 58 + SMBus Send Byte: i2c_smbus_write_byte() 59 + ======================================== 66 60 67 - This is the reverse of Read Byte: it sends a single byte to a device. 68 - See Read Byte for more information. 61 + This operation is the reverse of Receive Byte: it sends a single byte 62 + to a device. See Receive Byte for more information. 69 63 70 64 S Addr Wr [A] Data [A] P 71 65 72 66 73 - SMBus Read Byte Data 74 - ==================== 67 + SMBus Read Byte: i2c_smbus_read_byte_data() 68 + ============================================ 75 69 76 70 This reads a single byte from a device, from a designated register. 77 71 The register is specified through the Comm byte. ··· 79 73 S Addr Wr [A] Comm [A] S Addr Rd [A] [Data] NA P 80 74 81 75 82 - SMBus Read Word Data 83 - ==================== 76 + SMBus Read Word: i2c_smbus_read_word_data() 77 + ============================================ 84 78 85 - This command is very like Read Byte Data; again, data is read from a 79 + This operation is very like Read Byte; again, data is read from a 86 80 device, from a designated register that is specified through the Comm 87 81 byte. But this time, the data is a complete word (16 bits). 88 82 89 83 S Addr Wr [A] Comm [A] S Addr Rd [A] [DataLow] A [DataHigh] NA P 90 84 91 85 92 - SMBus Write Byte Data 93 - ===================== 86 + SMBus Write Byte: i2c_smbus_write_byte_data() 87 + ============================================== 94 88 95 89 This writes a single byte to a device, to a designated register. The 96 90 register is specified through the Comm byte. This is the opposite of 97 - the Read Byte Data command. 91 + the Read Byte operation. 98 92 99 93 S Addr Wr [A] Comm [A] Data [A] P 100 94 101 95 102 - SMBus Write Word Data 103 - ===================== 96 + SMBus Write Word: i2c_smbus_write_word_data() 97 + ============================================== 104 98 105 - This is the opposite operation of the Read Word Data command. 16 bits 99 + This is the opposite of the Read Word operation. 16 bits 106 100 of data is written to a device, to the designated register that is 107 101 specified through the Comm byte. 108 102 ··· 119 113 S Addr Rd [A] [DataLow] A [DataHigh] NA P 120 114 121 115 122 - SMBus Block Read 123 - ================ 116 + SMBus Block Read: i2c_smbus_read_block_data() 117 + ============================================== 124 118 125 119 This command reads a block of up to 32 bytes from a device, from a 126 120 designated register that is specified through the Comm byte. The amount ··· 130 124 S Addr Rd [A] [Count] A [Data] A [Data] A ... A [Data] NA P 131 125 132 126 133 - SMBus Block Write 134 - ================= 127 + SMBus Block Write: i2c_smbus_write_block_data() 128 + ================================================ 135 129 136 130 The opposite of the Block Read command, this writes up to 32 bytes to 137 131 a device, to a designated register that is specified through the ··· 140 134 S Addr Wr [A] Comm [A] Count [A] Data [A] Data [A] ... [A] Data [A] P 141 135 142 136 143 - SMBus Block Process Call 144 - ======================== 137 + SMBus Block Write - Block Read Process Call 138 + =========================================== 145 139 146 - SMBus Block Process Call was introduced in Revision 2.0 of the specification. 140 + SMBus Block Write - Block Read Process Call was introduced in 141 + Revision 2.0 of the specification. 147 142 148 143 This command selects a device register (through the Comm byte), sends 149 144 1 to 31 bytes of data to it, and reads 1 to 31 bytes of data in return. ··· 166 159 167 160 Packet Error Checking (PEC) 168 161 =========================== 162 + 169 163 Packet Error Checking was introduced in Revision 1.1 of the specification. 170 164 171 - PEC adds a CRC-8 error-checking byte to all transfers. 165 + PEC adds a CRC-8 error-checking byte to transfers using it, immediately 166 + before the terminating STOP. 172 167 173 168 174 169 Address Resolution Protocol (ARP) 175 170 ================================= 171 + 176 172 The Address Resolution Protocol was introduced in Revision 2.0 of 177 173 the specification. It is a higher-layer protocol which uses the 178 174 messages above. ··· 187 177 188 178 I2C Block Transactions 189 179 ====================== 180 + 190 181 The following I2C block transactions are supported by the 191 182 SMBus layer and are described here for completeness. 183 + They are *NOT* defined by the SMBus specification. 184 + 192 185 I2C block transactions do not limit the number of bytes transferred 193 186 but the SMBus layer places a limit of 32 bytes. 194 187 195 188 196 - I2C Block Read 197 - ============== 189 + I2C Block Read: i2c_smbus_read_i2c_block_data() 190 + ================================================ 198 191 199 192 This command reads a block of bytes from a device, from a 200 193 designated register that is specified through the Comm byte. ··· 216 203 S Addr Rd [A] [Data] A [Data] A ... A [Data] NA P 217 204 218 205 219 - I2C Block Write 220 - =============== 206 + I2C Block Write: i2c_smbus_write_i2c_block_data() 207 + ================================================== 221 208 222 209 The opposite of the Block Read command, this writes bytes to 223 210 a device, to a designated register that is specified through the ··· 225 212 supported as they are indistinguishable from data. 226 213 227 214 S Addr Wr [A] Comm [A] Data [A] Data [A] ... [A] Data [A] P 228 - 229 -
+7 -9
drivers/i2c/busses/i2c-mpc.c
··· 99 99 u32 x; 100 100 int result = 0; 101 101 102 - if (i2c->irq == 0) 102 + if (i2c->irq == NO_IRQ) 103 103 { 104 104 while (!(readb(i2c->base + MPC_I2C_SR) & CSR_MIF)) { 105 105 schedule(); ··· 329 329 return -ENOMEM; 330 330 331 331 i2c->irq = platform_get_irq(pdev, 0); 332 - if (i2c->irq < 0) { 333 - result = -ENXIO; 334 - goto fail_get_irq; 335 - } 332 + if (i2c->irq < 0) 333 + i2c->irq = NO_IRQ; /* Use polling */ 334 + 336 335 i2c->flags = pdata->device_flags; 337 336 init_waitqueue_head(&i2c->queue); 338 337 ··· 343 344 goto fail_map; 344 345 } 345 346 346 - if (i2c->irq != 0) 347 + if (i2c->irq != NO_IRQ) 347 348 if ((result = request_irq(i2c->irq, mpc_i2c_isr, 348 349 IRQF_SHARED, "i2c-mpc", i2c)) < 0) { 349 350 printk(KERN_ERR ··· 366 367 return result; 367 368 368 369 fail_add: 369 - if (i2c->irq != 0) 370 + if (i2c->irq != NO_IRQ) 370 371 free_irq(i2c->irq, i2c); 371 372 fail_irq: 372 373 iounmap(i2c->base); 373 374 fail_map: 374 - fail_get_irq: 375 375 kfree(i2c); 376 376 return result; 377 377 }; ··· 382 384 i2c_del_adapter(&i2c->adap); 383 385 platform_set_drvdata(pdev, NULL); 384 386 385 - if (i2c->irq != 0) 387 + if (i2c->irq != NO_IRQ) 386 388 free_irq(i2c->irq, i2c); 387 389 388 390 iounmap(i2c->base);
+42 -5
drivers/i2c/busses/i2c-piix4.c
··· 104 104 static int piix4_transaction(void); 105 105 106 106 static unsigned short piix4_smba; 107 + static int srvrworks_csb5_delay; 107 108 static struct pci_driver piix4_driver; 108 109 static struct i2c_adapter piix4_adapter; 109 110 110 - static struct dmi_system_id __devinitdata piix4_dmi_table[] = { 111 + static struct dmi_system_id __devinitdata piix4_dmi_blacklist[] = { 112 + { 113 + .ident = "Sapphire AM2RD790", 114 + .matches = { 115 + DMI_MATCH(DMI_BOARD_VENDOR, "SAPPHIRE Inc."), 116 + DMI_MATCH(DMI_BOARD_NAME, "PC-AM2RD790"), 117 + }, 118 + }, 119 + { 120 + .ident = "DFI Lanparty UT 790FX", 121 + .matches = { 122 + DMI_MATCH(DMI_BOARD_VENDOR, "DFI Inc."), 123 + DMI_MATCH(DMI_BOARD_NAME, "LP UT 790FX"), 124 + }, 125 + }, 126 + { } 127 + }; 128 + 129 + /* The IBM entry is in a separate table because we only check it 130 + on Intel-based systems */ 131 + static struct dmi_system_id __devinitdata piix4_dmi_ibm[] = { 111 132 { 112 133 .ident = "IBM", 113 134 .matches = { DMI_MATCH(DMI_SYS_VENDOR, "IBM"), }, ··· 143 122 144 123 dev_info(&PIIX4_dev->dev, "Found %s device\n", pci_name(PIIX4_dev)); 145 124 125 + if ((PIIX4_dev->vendor == PCI_VENDOR_ID_SERVERWORKS) && 126 + (PIIX4_dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5)) 127 + srvrworks_csb5_delay = 1; 128 + 129 + /* On some motherboards, it was reported that accessing the SMBus 130 + caused severe hardware problems */ 131 + if (dmi_check_system(piix4_dmi_blacklist)) { 132 + dev_err(&PIIX4_dev->dev, 133 + "Accessing the SMBus on this system is unsafe!\n"); 134 + return -EPERM; 135 + } 136 + 146 137 /* Don't access SMBus on IBM systems which get corrupted eeproms */ 147 - if (dmi_check_system(piix4_dmi_table) && 138 + if (dmi_check_system(piix4_dmi_ibm) && 148 139 PIIX4_dev->vendor == PCI_VENDOR_ID_INTEL) { 149 140 dev_err(&PIIX4_dev->dev, "IBM system detected; this module " 150 141 "may corrupt your serial eeprom! Refusing to load " ··· 263 230 outb_p(inb(SMBHSTCNT) | 0x040, SMBHSTCNT); 264 231 265 232 /* We will always wait for a fraction of a second! (See PIIX4 docs errata) */ 266 - do { 233 + if (srvrworks_csb5_delay) /* Extra delay for SERVERWORKS_CSB5 */ 234 + msleep(2); 235 + else 267 236 msleep(1); 268 - temp = inb_p(SMBHSTSTS); 269 - } while ((temp & 0x01) && (timeout++ < MAX_TIMEOUT)); 237 + 238 + while ((timeout++ < MAX_TIMEOUT) && 239 + ((temp = inb_p(SMBHSTSTS)) & 0x01)) 240 + msleep(1); 270 241 271 242 /* If the SMBus is still busy, we give up */ 272 243 if (timeout >= MAX_TIMEOUT) {
+3 -3
drivers/i2c/busses/i2c-sibyte.c
··· 132 132 /* 133 133 * registering functions to load algorithms at runtime 134 134 */ 135 - int __init i2c_sibyte_add_bus(struct i2c_adapter *i2c_adap, int speed) 135 + static int __init i2c_sibyte_add_bus(struct i2c_adapter *i2c_adap, int speed) 136 136 { 137 137 struct i2c_algo_sibyte_data *adap = i2c_adap->algo_data; 138 138 139 - /* register new adapter to i2c module... */ 139 + /* Register new adapter to i2c module... */ 140 140 i2c_adap->algo = &i2c_sibyte_algo; 141 141 142 - /* Set the frequency to 100 kHz */ 142 + /* Set the requested frequency. */ 143 143 csr_out32(speed, SMB_CSR(adap,R_SMB_FREQ)); 144 144 csr_out32(0, SMB_CSR(adap,R_SMB_CONTROL)); 145 145
+8 -6
drivers/i2c/i2c-core.c
··· 327 327 EXPORT_SYMBOL_GPL(i2c_unregister_device); 328 328 329 329 330 + static const struct i2c_device_id dummy_id[] = { 331 + { "dummy", 0 }, 332 + { }, 333 + }; 334 + 330 335 static int dummy_probe(struct i2c_client *client, 331 336 const struct i2c_device_id *id) 332 337 { ··· 347 342 .driver.name = "dummy", 348 343 .probe = dummy_probe, 349 344 .remove = dummy_remove, 345 + .id_table = dummy_id, 350 346 }; 351 347 352 348 /** 353 349 * i2c_new_dummy - return a new i2c device bound to a dummy driver 354 350 * @adapter: the adapter managing the device 355 351 * @address: seven bit address to be used 356 - * @type: optional label used for i2c_client.name 357 352 * Context: can sleep 358 353 * 359 354 * This returns an I2C client bound to the "dummy" driver, intended for use ··· 369 364 * i2c_unregister_device(); or NULL to indicate an error. 370 365 */ 371 366 struct i2c_client * 372 - i2c_new_dummy(struct i2c_adapter *adapter, u16 address, const char *type) 367 + i2c_new_dummy(struct i2c_adapter *adapter, u16 address) 373 368 { 374 369 struct i2c_board_info info = { 375 - .driver_name = "dummy", 376 - .addr = address, 370 + I2C_BOARD_INFO("dummy", address), 377 371 }; 378 372 379 - if (type) 380 - strlcpy(info.type, type, sizeof info.type); 381 373 return i2c_new_device(adapter, &info); 382 374 } 383 375 EXPORT_SYMBOL_GPL(i2c_new_dummy);
+7
drivers/media/video/tcm825x.c
··· 885 885 return 0; 886 886 } 887 887 888 + static const struct i2c_device_id tcm825x_id[] = { 889 + { "tcm825x", 0 }, 890 + { } 891 + }; 892 + MODULE_DEVICE_TABLE(i2c, tcm825x_id); 893 + 888 894 static struct i2c_driver tcm825x_i2c_driver = { 889 895 .driver = { 890 896 .name = TCM825X_NAME, 891 897 }, 892 898 .probe = tcm825x_probe, 893 899 .remove = __exit_p(tcm825x_remove), 900 + .id_table = tcm825x_id, 894 901 }; 895 902 896 903 static struct tcm825x_sensor tcm825x = {
+6
drivers/media/video/tlv320aic23b.c
··· 168 168 169 169 /* ----------------------------------------------------------------------- */ 170 170 171 + static const struct i2c_device_id tlv320aic23b_id[] = { 172 + { "tlv320aic23b", 0 }, 173 + { } 174 + }; 175 + MODULE_DEVICE_TABLE(i2c, tlv320aic23b_id); 171 176 172 177 static struct v4l2_i2c_driver_data v4l2_i2c_data = { 173 178 .name = "tlv320aic23b", ··· 180 175 .command = tlv320aic23b_command, 181 176 .probe = tlv320aic23b_probe, 182 177 .remove = tlv320aic23b_remove, 178 + .id_table = tlv320aic23b_id, 183 179 };
+12 -1
drivers/media/video/tvaudio.c
··· 1505 1505 } 1506 1506 1507 1507 /* fill required data structures */ 1508 - strcpy(client->name, desc->name); 1508 + if (!id) 1509 + strlcpy(client->name, desc->name, I2C_NAME_SIZE); 1509 1510 chip->type = desc-chiplist; 1510 1511 chip->shadow.count = desc->registers+1; 1511 1512 chip->prevmode = -1; ··· 1831 1830 return 0; 1832 1831 } 1833 1832 1833 + /* This driver supports many devices and the idea is to let the driver 1834 + detect which device is present. So rather than listing all supported 1835 + devices here, we pretend to support a single, fake device type. */ 1836 + static const struct i2c_device_id chip_id[] = { 1837 + { "tvaudio", 0 }, 1838 + { } 1839 + }; 1840 + MODULE_DEVICE_TABLE(i2c, chip_id); 1841 + 1834 1842 static struct v4l2_i2c_driver_data v4l2_i2c_data = { 1835 1843 .name = "tvaudio", 1836 1844 .driverid = I2C_DRIVERID_TVAUDIO, ··· 1847 1837 .probe = chip_probe, 1848 1838 .remove = chip_remove, 1849 1839 .legacy_probe = chip_legacy_probe, 1840 + .id_table = chip_id, 1850 1841 }; 1851 1842 1852 1843 /*
+1 -1
drivers/rtc/rtc-s35390a.c
··· 227 227 /* This chip uses multiple addresses, use dummy devices for them */ 228 228 for (i = 1; i < 8; ++i) { 229 229 s35390a->client[i] = i2c_new_dummy(client->adapter, 230 - client->addr + i, "rtc-s35390a"); 230 + client->addr + i); 231 231 if (!s35390a->client[i]) { 232 232 dev_err(&client->dev, "Address %02x unavailable\n", 233 233 client->addr + i);
+1 -1
include/linux/i2c.h
··· 262 262 * client handles for the extra addresses. 263 263 */ 264 264 extern struct i2c_client * 265 - i2c_new_dummy(struct i2c_adapter *adap, u16 address, const char *type); 265 + i2c_new_dummy(struct i2c_adapter *adap, u16 address); 266 266 267 267 extern void i2c_unregister_device(struct i2c_client *); 268 268
+2
include/media/v4l2-i2c-drv-legacy.h
··· 31 31 int (*resume)(struct i2c_client *client); 32 32 int (*legacy_probe)(struct i2c_adapter *adapter); 33 33 int legacy_class; 34 + const struct i2c_device_id *id_table; 34 35 }; 35 36 36 37 static struct v4l2_i2c_driver_data v4l2_i2c_data; ··· 125 124 v4l2_i2c_driver.command = v4l2_i2c_data.command; 126 125 v4l2_i2c_driver.probe = v4l2_i2c_data.probe; 127 126 v4l2_i2c_driver.remove = v4l2_i2c_data.remove; 127 + v4l2_i2c_driver.id_table = v4l2_i2c_data.id_table; 128 128 err = i2c_add_driver(&v4l2_i2c_driver); 129 129 if (err) 130 130 i2c_del_driver(&v4l2_i2c_driver_legacy);
+2
include/media/v4l2-i2c-drv.h
··· 36 36 int (*resume)(struct i2c_client *client); 37 37 int (*legacy_probe)(struct i2c_adapter *adapter); 38 38 int legacy_class; 39 + const struct i2c_device_id *id_table; 39 40 }; 40 41 41 42 static struct v4l2_i2c_driver_data v4l2_i2c_data; ··· 54 53 v4l2_i2c_driver.remove = v4l2_i2c_data.remove; 55 54 v4l2_i2c_driver.suspend = v4l2_i2c_data.suspend; 56 55 v4l2_i2c_driver.resume = v4l2_i2c_data.resume; 56 + v4l2_i2c_driver.id_table = v4l2_i2c_data.id_table; 57 57 return i2c_add_driver(&v4l2_i2c_driver); 58 58 } 59 59