Loading Documentation/SubmittingPatches +26 −0 Original line number Diff line number Diff line Loading @@ -528,7 +528,33 @@ See more details on the proper patch format in the following references. 16) Sending "git pull" requests (from Linus emails) Please write the git repo address and branch name alone on the same line so that I can't even by mistake pull from the wrong branch, and so that a triple-click just selects the whole thing. So the proper format is something along the lines of: "Please pull from git://jdelvare.pck.nerim.net/jdelvare-2.6 i2c-for-linus to get these changes:" so that I don't have to hunt-and-peck for the address and inevitably get it wrong (actually, I've only gotten it wrong a few times, and checking against the diffstat tells me when I get it wrong, but I'm just a lot more comfortable when I don't have to "look for" the right thing to pull, and double-check that I have the right branch-name). Please use "git diff -M --stat --summary" to generate the diffstat: the -M enables rename detection, and the summary enables a summary of new/deleted or renamed files. With rename detection, the statistics are rather different [...] because git will notice that a fair number of the changes are renames. ----------------------------------- SECTION 2 - HINTS, TIPS, AND TRICKS Loading Documentation/arm/Interrupts +2 −8 Original line number Diff line number Diff line Loading @@ -138,14 +138,8 @@ So, what's changed? Set active the IRQ edge(s)/level. This replaces the SA1111 INTPOL manipulation, and the set_GPIO_IRQ_edge() function. Type should be one of the following: #define IRQT_NOEDGE (0) #define IRQT_RISING (__IRQT_RISEDGE) #define IRQT_FALLING (__IRQT_FALEDGE) #define IRQT_BOTHEDGE (__IRQT_RISEDGE|__IRQT_FALEDGE) #define IRQT_LOW (__IRQT_LOWLVL) #define IRQT_HIGH (__IRQT_HIGHLVL) function. Type should be one of IRQ_TYPE_xxx defined in <linux/irq.h> 3. set_GPIO_IRQ_edge() is obsolete, and should be replaced by set_irq_type. Loading Documentation/feature-removal-schedule.txt +24 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,30 @@ Who: Mauro Carvalho Chehab <mchehab@infradead.org> --------------------------- What: old tuner-3036 i2c driver When: 2.6.28 Why: This driver is for VERY old i2c-over-parallel port teletext receiver boxes. Rather then spending effort on converting this driver to V4L2, and since it is extremely unlikely that anyone still uses one of these devices, it was decided to drop it. Who: Hans Verkuil <hverkuil@xs4all.nl> Mauro Carvalho Chehab <mchehab@infradead.org> --------------------------- What: V4L2 dpc7146 driver When: 2.6.28 Why: Old driver for the dpc7146 demonstration board that is no longer relevant. The last time this was tested on actual hardware was probably around 2002. Since this is a driver for a demonstration board the decision was made to remove it rather than spending a lot of effort continually updating this driver to stay in sync with the latest internal V4L2 or I2C API. Who: Hans Verkuil <hverkuil@xs4all.nl> Mauro Carvalho Chehab <mchehab@infradead.org> --------------------------- What: PCMCIA control ioctl (needed for pcmcia-cs [cardmgr, cardctl]) When: November 2005 Files: drivers/pcmcia/: pcmcia_ioctl.c Loading Documentation/i2c/upgrading-clients 0 → 100644 +281 −0 Original line number Diff line number Diff line Upgrading I2C Drivers to the new 2.6 Driver Model ================================================= Ben Dooks <ben-linux@fluff.org> Introduction ------------ This guide outlines how to alter existing Linux 2.6 client drivers from the old to the new new binding methods. Example old-style driver ------------------------ struct example_state { struct i2c_client client; .... }; static struct i2c_driver example_driver; static unsigned short ignore[] = { I2C_CLIENT_END }; static unsigned short normal_addr[] = { OUR_ADDR, I2C_CLIENT_END }; I2C_CLIENT_INSMOD; static int example_attach(struct i2c_adapter *adap, int addr, int kind) { struct example_state *state; struct device *dev = &adap->dev; /* to use for dev_ reports */ int ret; state = kzalloc(sizeof(struct example_state), GFP_KERNEL); if (state == NULL) { dev_err(dev, "failed to create our state\n"); return -ENOMEM; } example->client.addr = addr; example->client.flags = 0; example->client.adapter = adap; i2c_set_clientdata(&state->i2c_client, state); strlcpy(client->i2c_client.name, "example", I2C_NAME_SIZE); ret = i2c_attach_client(&state->i2c_client); if (ret < 0) { dev_err(dev, "failed to attach client\n"); kfree(state); return ret; } dev = &state->i2c_client.dev; /* rest of the initialisation goes here. */ dev_info(dev, "example client created\n"); return 0; } static int __devexit example_detach(struct i2c_client *client) { struct example_state *state = i2c_get_clientdata(client); i2c_detach_client(client); kfree(state); return 0; } static int example_attach_adapter(struct i2c_adapter *adap) { return i2c_probe(adap, &addr_data, example_attach); } static struct i2c_driver example_driver = { .driver = { .owner = THIS_MODULE, .name = "example", }, .attach_adapter = example_attach_adapter, .detach_client = __devexit_p(example_detach), .suspend = example_suspend, .resume = example_resume, }; Updating the client ------------------- The new style binding model will check against a list of supported devices and their associated address supplied by the code registering the busses. This means that the driver .attach_adapter and .detach_adapter methods can be removed, along with the addr_data, as follows: - static struct i2c_driver example_driver; - static unsigned short ignore[] = { I2C_CLIENT_END }; - static unsigned short normal_addr[] = { OUR_ADDR, I2C_CLIENT_END }; - I2C_CLIENT_INSMOD; - static int example_attach_adapter(struct i2c_adapter *adap) - { - return i2c_probe(adap, &addr_data, example_attach); - } static struct i2c_driver example_driver = { - .attach_adapter = example_attach_adapter, - .detach_client = __devexit_p(example_detach), } Add the probe and remove methods to the i2c_driver, as so: static struct i2c_driver example_driver = { + .probe = example_probe, + .remove = __devexit_p(example_remove), } Change the example_attach method to accept the new parameters which include the i2c_client that it will be working with: - static int example_attach(struct i2c_adapter *adap, int addr, int kind) + static int example_probe(struct i2c_client *client, + const struct i2c_device_id *id) Change the name of example_attach to example_probe to align it with the i2c_driver entry names. The rest of the probe routine will now need to be changed as the i2c_client has already been setup for use. The necessary client fields have already been setup before the probe function is called, so the following client setup can be removed: - example->client.addr = addr; - example->client.flags = 0; - example->client.adapter = adap; - - strlcpy(client->i2c_client.name, "example", I2C_NAME_SIZE); The i2c_set_clientdata is now: - i2c_set_clientdata(&state->client, state); + i2c_set_clientdata(client, state); The call to i2c_attach_client is no longer needed, if the probe routine exits successfully, then the driver will be automatically attached by the core. Change the probe routine as so: - ret = i2c_attach_client(&state->i2c_client); - if (ret < 0) { - dev_err(dev, "failed to attach client\n"); - kfree(state); - return ret; - } Remove the storage of 'struct i2c_client' from the 'struct example_state' as we are provided with the i2c_client in our example_probe. Instead we store a pointer to it for when it is needed. struct example_state { - struct i2c_client client; + struct i2c_client *client; the new i2c client as so: - struct device *dev = &adap->dev; /* to use for dev_ reports */ + struct device *dev = &i2c_client->dev; /* to use for dev_ reports */ And remove the change after our client is attached, as the driver no longer needs to register a new client structure with the core: - dev = &state->i2c_client.dev; In the probe routine, ensure that the new state has the client stored in it: static int example_probe(struct i2c_client *i2c_client, const struct i2c_device_id *id) { struct example_state *state; struct device *dev = &i2c_client->dev; int ret; state = kzalloc(sizeof(struct example_state), GFP_KERNEL); if (state == NULL) { dev_err(dev, "failed to create our state\n"); return -ENOMEM; } + state->client = i2c_client; Update the detach method, by changing the name to _remove and to delete the i2c_detach_client call. It is possible that you can also remove the ret variable as it is not not needed for any of the core functions. - static int __devexit example_detach(struct i2c_client *client) + static int __devexit example_remove(struct i2c_client *client) { struct example_state *state = i2c_get_clientdata(client); - i2c_detach_client(client); And finally ensure that we have the correct ID table for the i2c-core and other utilities: + struct i2c_device_id example_idtable[] = { + { "example", 0 }, + { } +}; + +MODULE_DEVICE_TABLE(i2c, example_idtable); static struct i2c_driver example_driver = { .driver = { .owner = THIS_MODULE, .name = "example", }, + .id_table = example_ids, Our driver should now look like this: struct example_state { struct i2c_client *client; .... }; static int example_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct example_state *state; struct device *dev = &client->dev; state = kzalloc(sizeof(struct example_state), GFP_KERNEL); if (state == NULL) { dev_err(dev, "failed to create our state\n"); return -ENOMEM; } state->client = client; i2c_set_clientdata(client, state); /* rest of the initialisation goes here. */ dev_info(dev, "example client created\n"); return 0; } static int __devexit example_remove(struct i2c_client *client) { struct example_state *state = i2c_get_clientdata(client); kfree(state); return 0; } static struct i2c_device_id example_idtable[] = { { "example", 0 }, { } }; MODULE_DEVICE_TABLE(i2c, example_idtable); static struct i2c_driver example_driver = { .driver = { .owner = THIS_MODULE, .name = "example", }, .id_table = example_idtable, .probe = example_probe, .remove = __devexit_p(example_remove), .suspend = example_suspend, .resume = example_resume, }; Documentation/kdump/kdump.txt +10 −10 Original line number Diff line number Diff line Loading @@ -65,26 +65,26 @@ Install kexec-tools 2) Download the kexec-tools user-space package from the following URL: http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/kexec-tools-testing.tar.gz http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/kexec-tools.tar.gz This is a symlink to the latest version, which at the time of writing is 20061214, the only release of kexec-tools-testing so far. As other versions are released, the older ones will remain available at http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/ This is a symlink to the latest version. Note: Latest kexec-tools-testing git tree is available at The latest kexec-tools git tree is available at: git://git.kernel.org/pub/scm/linux/kernel/git/horms/kexec-tools-testing.git git://git.kernel.org/pub/scm/linux/kernel/git/horms/kexec-tools.git or http://www.kernel.org/git/?p=linux/kernel/git/horms/kexec-tools-testing.git;a=summary http://www.kernel.org/git/?p=linux/kernel/git/horms/kexec-tools.git More information about kexec-tools can be found at http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/README.html 3) Unpack the tarball with the tar command, as follows: tar xvpzf kexec-tools-testing.tar.gz tar xvpzf kexec-tools.tar.gz 4) Change to the kexec-tools directory, as follows: cd kexec-tools-testing-VERSION cd kexec-tools-VERSION 5) Configure the package, as follows: Loading Loading
Documentation/SubmittingPatches +26 −0 Original line number Diff line number Diff line Loading @@ -528,7 +528,33 @@ See more details on the proper patch format in the following references. 16) Sending "git pull" requests (from Linus emails) Please write the git repo address and branch name alone on the same line so that I can't even by mistake pull from the wrong branch, and so that a triple-click just selects the whole thing. So the proper format is something along the lines of: "Please pull from git://jdelvare.pck.nerim.net/jdelvare-2.6 i2c-for-linus to get these changes:" so that I don't have to hunt-and-peck for the address and inevitably get it wrong (actually, I've only gotten it wrong a few times, and checking against the diffstat tells me when I get it wrong, but I'm just a lot more comfortable when I don't have to "look for" the right thing to pull, and double-check that I have the right branch-name). Please use "git diff -M --stat --summary" to generate the diffstat: the -M enables rename detection, and the summary enables a summary of new/deleted or renamed files. With rename detection, the statistics are rather different [...] because git will notice that a fair number of the changes are renames. ----------------------------------- SECTION 2 - HINTS, TIPS, AND TRICKS Loading
Documentation/arm/Interrupts +2 −8 Original line number Diff line number Diff line Loading @@ -138,14 +138,8 @@ So, what's changed? Set active the IRQ edge(s)/level. This replaces the SA1111 INTPOL manipulation, and the set_GPIO_IRQ_edge() function. Type should be one of the following: #define IRQT_NOEDGE (0) #define IRQT_RISING (__IRQT_RISEDGE) #define IRQT_FALLING (__IRQT_FALEDGE) #define IRQT_BOTHEDGE (__IRQT_RISEDGE|__IRQT_FALEDGE) #define IRQT_LOW (__IRQT_LOWLVL) #define IRQT_HIGH (__IRQT_HIGHLVL) function. Type should be one of IRQ_TYPE_xxx defined in <linux/irq.h> 3. set_GPIO_IRQ_edge() is obsolete, and should be replaced by set_irq_type. Loading
Documentation/feature-removal-schedule.txt +24 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,30 @@ Who: Mauro Carvalho Chehab <mchehab@infradead.org> --------------------------- What: old tuner-3036 i2c driver When: 2.6.28 Why: This driver is for VERY old i2c-over-parallel port teletext receiver boxes. Rather then spending effort on converting this driver to V4L2, and since it is extremely unlikely that anyone still uses one of these devices, it was decided to drop it. Who: Hans Verkuil <hverkuil@xs4all.nl> Mauro Carvalho Chehab <mchehab@infradead.org> --------------------------- What: V4L2 dpc7146 driver When: 2.6.28 Why: Old driver for the dpc7146 demonstration board that is no longer relevant. The last time this was tested on actual hardware was probably around 2002. Since this is a driver for a demonstration board the decision was made to remove it rather than spending a lot of effort continually updating this driver to stay in sync with the latest internal V4L2 or I2C API. Who: Hans Verkuil <hverkuil@xs4all.nl> Mauro Carvalho Chehab <mchehab@infradead.org> --------------------------- What: PCMCIA control ioctl (needed for pcmcia-cs [cardmgr, cardctl]) When: November 2005 Files: drivers/pcmcia/: pcmcia_ioctl.c Loading
Documentation/i2c/upgrading-clients 0 → 100644 +281 −0 Original line number Diff line number Diff line Upgrading I2C Drivers to the new 2.6 Driver Model ================================================= Ben Dooks <ben-linux@fluff.org> Introduction ------------ This guide outlines how to alter existing Linux 2.6 client drivers from the old to the new new binding methods. Example old-style driver ------------------------ struct example_state { struct i2c_client client; .... }; static struct i2c_driver example_driver; static unsigned short ignore[] = { I2C_CLIENT_END }; static unsigned short normal_addr[] = { OUR_ADDR, I2C_CLIENT_END }; I2C_CLIENT_INSMOD; static int example_attach(struct i2c_adapter *adap, int addr, int kind) { struct example_state *state; struct device *dev = &adap->dev; /* to use for dev_ reports */ int ret; state = kzalloc(sizeof(struct example_state), GFP_KERNEL); if (state == NULL) { dev_err(dev, "failed to create our state\n"); return -ENOMEM; } example->client.addr = addr; example->client.flags = 0; example->client.adapter = adap; i2c_set_clientdata(&state->i2c_client, state); strlcpy(client->i2c_client.name, "example", I2C_NAME_SIZE); ret = i2c_attach_client(&state->i2c_client); if (ret < 0) { dev_err(dev, "failed to attach client\n"); kfree(state); return ret; } dev = &state->i2c_client.dev; /* rest of the initialisation goes here. */ dev_info(dev, "example client created\n"); return 0; } static int __devexit example_detach(struct i2c_client *client) { struct example_state *state = i2c_get_clientdata(client); i2c_detach_client(client); kfree(state); return 0; } static int example_attach_adapter(struct i2c_adapter *adap) { return i2c_probe(adap, &addr_data, example_attach); } static struct i2c_driver example_driver = { .driver = { .owner = THIS_MODULE, .name = "example", }, .attach_adapter = example_attach_adapter, .detach_client = __devexit_p(example_detach), .suspend = example_suspend, .resume = example_resume, }; Updating the client ------------------- The new style binding model will check against a list of supported devices and their associated address supplied by the code registering the busses. This means that the driver .attach_adapter and .detach_adapter methods can be removed, along with the addr_data, as follows: - static struct i2c_driver example_driver; - static unsigned short ignore[] = { I2C_CLIENT_END }; - static unsigned short normal_addr[] = { OUR_ADDR, I2C_CLIENT_END }; - I2C_CLIENT_INSMOD; - static int example_attach_adapter(struct i2c_adapter *adap) - { - return i2c_probe(adap, &addr_data, example_attach); - } static struct i2c_driver example_driver = { - .attach_adapter = example_attach_adapter, - .detach_client = __devexit_p(example_detach), } Add the probe and remove methods to the i2c_driver, as so: static struct i2c_driver example_driver = { + .probe = example_probe, + .remove = __devexit_p(example_remove), } Change the example_attach method to accept the new parameters which include the i2c_client that it will be working with: - static int example_attach(struct i2c_adapter *adap, int addr, int kind) + static int example_probe(struct i2c_client *client, + const struct i2c_device_id *id) Change the name of example_attach to example_probe to align it with the i2c_driver entry names. The rest of the probe routine will now need to be changed as the i2c_client has already been setup for use. The necessary client fields have already been setup before the probe function is called, so the following client setup can be removed: - example->client.addr = addr; - example->client.flags = 0; - example->client.adapter = adap; - - strlcpy(client->i2c_client.name, "example", I2C_NAME_SIZE); The i2c_set_clientdata is now: - i2c_set_clientdata(&state->client, state); + i2c_set_clientdata(client, state); The call to i2c_attach_client is no longer needed, if the probe routine exits successfully, then the driver will be automatically attached by the core. Change the probe routine as so: - ret = i2c_attach_client(&state->i2c_client); - if (ret < 0) { - dev_err(dev, "failed to attach client\n"); - kfree(state); - return ret; - } Remove the storage of 'struct i2c_client' from the 'struct example_state' as we are provided with the i2c_client in our example_probe. Instead we store a pointer to it for when it is needed. struct example_state { - struct i2c_client client; + struct i2c_client *client; the new i2c client as so: - struct device *dev = &adap->dev; /* to use for dev_ reports */ + struct device *dev = &i2c_client->dev; /* to use for dev_ reports */ And remove the change after our client is attached, as the driver no longer needs to register a new client structure with the core: - dev = &state->i2c_client.dev; In the probe routine, ensure that the new state has the client stored in it: static int example_probe(struct i2c_client *i2c_client, const struct i2c_device_id *id) { struct example_state *state; struct device *dev = &i2c_client->dev; int ret; state = kzalloc(sizeof(struct example_state), GFP_KERNEL); if (state == NULL) { dev_err(dev, "failed to create our state\n"); return -ENOMEM; } + state->client = i2c_client; Update the detach method, by changing the name to _remove and to delete the i2c_detach_client call. It is possible that you can also remove the ret variable as it is not not needed for any of the core functions. - static int __devexit example_detach(struct i2c_client *client) + static int __devexit example_remove(struct i2c_client *client) { struct example_state *state = i2c_get_clientdata(client); - i2c_detach_client(client); And finally ensure that we have the correct ID table for the i2c-core and other utilities: + struct i2c_device_id example_idtable[] = { + { "example", 0 }, + { } +}; + +MODULE_DEVICE_TABLE(i2c, example_idtable); static struct i2c_driver example_driver = { .driver = { .owner = THIS_MODULE, .name = "example", }, + .id_table = example_ids, Our driver should now look like this: struct example_state { struct i2c_client *client; .... }; static int example_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct example_state *state; struct device *dev = &client->dev; state = kzalloc(sizeof(struct example_state), GFP_KERNEL); if (state == NULL) { dev_err(dev, "failed to create our state\n"); return -ENOMEM; } state->client = client; i2c_set_clientdata(client, state); /* rest of the initialisation goes here. */ dev_info(dev, "example client created\n"); return 0; } static int __devexit example_remove(struct i2c_client *client) { struct example_state *state = i2c_get_clientdata(client); kfree(state); return 0; } static struct i2c_device_id example_idtable[] = { { "example", 0 }, { } }; MODULE_DEVICE_TABLE(i2c, example_idtable); static struct i2c_driver example_driver = { .driver = { .owner = THIS_MODULE, .name = "example", }, .id_table = example_idtable, .probe = example_probe, .remove = __devexit_p(example_remove), .suspend = example_suspend, .resume = example_resume, };
Documentation/kdump/kdump.txt +10 −10 Original line number Diff line number Diff line Loading @@ -65,26 +65,26 @@ Install kexec-tools 2) Download the kexec-tools user-space package from the following URL: http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/kexec-tools-testing.tar.gz http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/kexec-tools.tar.gz This is a symlink to the latest version, which at the time of writing is 20061214, the only release of kexec-tools-testing so far. As other versions are released, the older ones will remain available at http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/ This is a symlink to the latest version. Note: Latest kexec-tools-testing git tree is available at The latest kexec-tools git tree is available at: git://git.kernel.org/pub/scm/linux/kernel/git/horms/kexec-tools-testing.git git://git.kernel.org/pub/scm/linux/kernel/git/horms/kexec-tools.git or http://www.kernel.org/git/?p=linux/kernel/git/horms/kexec-tools-testing.git;a=summary http://www.kernel.org/git/?p=linux/kernel/git/horms/kexec-tools.git More information about kexec-tools can be found at http://www.kernel.org/pub/linux/kernel/people/horms/kexec-tools/README.html 3) Unpack the tarball with the tar command, as follows: tar xvpzf kexec-tools-testing.tar.gz tar xvpzf kexec-tools.tar.gz 4) Change to the kexec-tools directory, as follows: cd kexec-tools-testing-VERSION cd kexec-tools-VERSION 5) Configure the package, as follows: Loading