i2c-parport disappeared from 2.6.11.9
Subsystems (2)
Hello
Drivers -> I2C -> Busses -> Parallel port adapter disappeared in 2.6.11.9. However the source drivers/i2c/busses/i2c-parport.c and i2c-parport.h are still there.
There is only parallel port light (i2c-parport-light.c) in the make menuconfig menu.
I am working on a driver in i2c-parport.c. What should I do? Stop the work and forget it? Or continue?
I took care to turn on "Prompt for development and/or incomplete code/drivers" and turn off "Select only drivers expected to compile cleanly".
CL<
Hi Karel,
Quoted 3 lines
Drivers -> I2C -> Busses -> Parallel port adapter disappeared in 2.6.11.9. However the source
drivers/i2c/busses/i2c-parport.candi2c-parport.hare still there.
No, it did not disappear. I'm using it. Check again. i2c-parport depends on CONFIG_PARPORT, maybe that's what you are missing.
Signature · 1 line
Jean Delvare
Hi Jean,
I am sending the patch where I changed:
1) Rewrote the initialization into zero-terminated lists as you suggested
2) Added exact listing of supported adapters into make menuconfig [Help] with their numbers.
Please review the patch and possibly test if it still works. Is it possibly to already introduce the driver into Linux kernel?
The patch has been worked on 2.6.11.9 kernel tree.
Cheers,
CL<
drivers/i2c/busses/Kconfig +14 -3
@@ -246,9 +246,10 @@ select I2C_ALGOBIT help This supports parallel port I2C adapters such as the ones made by - Philips or Velleman, Analog Devices evaluation boards, and more. - Basically any adapter using the parallel port as an I2C bus with - no extra chipset is supported by this driver, or could be. + Philips or Velleman, Analog Devices evaluation boards, Twibright + I2C2P, and more. Basically any adapter using the parallel port as an + I2C bus with no extra chipset is supported by this driver, or could + be. This driver is a replacement for (and was inspired by) an older driver named i2c-philips-par. The new driver supports more devices,
@@ -261,6 +262,16 @@ This support is also available as a module. If so, the module will be called i2c-parport. + Supported adapters + ------------------ + 0 Philips adapter + 1 home brew teletext adapter + 2 Velleman K8000 adapter + 3 ELV adapter + 4 ADM1032 evaluation board + 5 ADM1025, ADM1030 and ADM1031 evaluation boards + 6 Twibright I2C2P adapter http://i2c2p.twibright.com + config I2C_PARPORT_LIGHT tristate "Parallel port adapter (light)" depends on I2C
drivers/i2c/busses/i2c-parport.c +24 -6
@@ -28,6 +28,7 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> +#include <linux/delay.h> #include <linux/parport.h> #include <linux/i2c.h> #include <linux/i2c-algo-bit.h>
@@ -131,7 +132,7 @@/* Encapsulate the functions above in the correct structure. Note that this is only a template, from which the real structures are copied. The attaching code will set getscl to NULL for adapters that -cannot read SCL back, and will also make the the data field point to +cannot read SCL back, and will also make the data field point to the parallel port structure. */ static struct i2c_algo_bit_data parport_algo_data = { .setsda = parport_setsda,
@@ -140,7 +141,13 @@ .getscl = parport_getscl, .udelay = 60, .mdelay = 60, - .timeout = HZ, + .timeout = (HZ+99)/100, +/* This is 10ms rounded upwards. +* Parport adapter of type 6 may be +* powered down which introduces 90sec delay to +* machine boot if the original value "HZ" is used +* here. I think 10ms should be sufficient for +* the parport adapter timeout. --Clock */ };/* ----- I2c and parallel port call-back functions and structures --------- */
@@ -152,6 +159,19 @@ .name = "Parallel port adapter", }; +/* up=1 means start and up=0 stop. Also does a wait after init (and no wait +* on deinit). */ +static void start_stop_adapter (struct parport *port, +struct adapter_parm * adap,int up) +{ +struct lineop *p=adap->init; +if (p)while (p->val){ +line_set (port, up, p); + p++; + } +if (up&&adap->msleep)msleep_interruptible (adap->msleep); +} +static void i2c_parport_attach (struct parport *port) {struct i2c_par *adapter;
@@ -188,8 +208,7 @@parport_setsda (port,1 );parport_setscl (port,1 );/* Other init if needed (power on...) */ -if (adapter_parm[type].init.val) -line_set (port,1 , &adapter_parm[type].init); +start_stop_adapter (port,adapter_parm+type,1 );parport_release (adapter->pdev);
@@ -218,8 +237,7 @@ prev = adapter, adapter = adapter->next) {if (adapter->pdev->port == port) {/* Un-init if needed (power off...) */ -if (adapter_parm[type].init.val) -line_set (port,0 , &adapter_parm[type].init); +start_stop_adapter (port, adapter_parm+type,0 );i2c_bit_del_bus (&adapter->adapter);parport_unregister_device (adapter->pdev);
drivers/i2c/busses/i2c-parport.h +42 -7
93 lines not on this page · raw message