New parport bus drivers
Subsystems (2)
PATCH 1/1 New parport bus drivers
Hi Greg,
Here comes a patch which adds my new i2c-over-parport drivers to Linux 2.6.1. It applies on top of what I suppose is your current stack of pending patches.
Quoting myself:
***
These are replacements for the i2c-philips-par, i2c-elv and i2c-velleman drivers, as well as for the i2c-old i2c-parport driver as found under drivers/media/video in linux 2.4. My reason for writing them, as already discussed on the sensors and linux-kernel mailing-lists, is that all these drivers basically do the same thing, so I thought it would be easier to maintain a single driver instead of four. As Simon Vogl pointed out that using a direct I/O access (as done in i2c-elv and i2c-velleman) could be prefered over clean parport access (as done in i2c-philips-par) on embedded devices, I finally wrote two drivers instead of one. But both drivers support all devices, it's just a matter of how they are accessed (and wether the driver depends on the parport driver).
I made it so that the definition of the adapters (i.e. how to set and get SDA and SCL, basically) is completely separated from the code itself. Thus, adding support for a new adapter is simply adding a new set of data to the definition table, describing how the adapter works, in a single file.
This means that all simple parallel port adapters are virtually supported. The i2c-pport driver we have in i2c CVS isn't supported yet because it works a bit differently, but I believe that extending the current driver(s) to support it should be possible (although it can be discussed wether it's worth it).
You'll have to pass the type parameter that is correct for your board:
0 = Philips
2 = Velleman
3 = ELV
4 = ADM evaluation board
I could only test with my ADM eval board, and it worked OK with both drivers. If they are confirmed to work, we could get rid of all other parallel port i2c drivers in 2.6.
***
I think we should mark the i2c-philips-par, i2c-elv and i2c-velleman drivers as "deprecated" in i2c/busses/Kconfig. Is there a standard way to do so (like there is "&& EXPERIMENTAL" for new drivers)?
Thanks.
drivers/i2c/busses/Kconfig +43 -0
@@ -155,6 +155,49 @@ This support is also available as a module. If so, the module will be called i2c-philips-par. +config I2C_PARPORT + tristate "Parallel port adapter" + depends on I2C_ALGOBIT && PARPORT + 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. + + This driver is a replacement for (and was inspired by) an older + driver named i2c-philips-par. The new driver supports more devices, + and makes it easier to add support for new devices. + + Another driver exists, named i2c-parport-light, which doesn't depend + on the parport driver. This is meant for embedded systems. Don't say + Y here if you intend to say Y or M there. + + This support is also available as a module. If so, the module + will be called i2c-parport. + +config I2C_PARPORT_LIGHT + tristate "Parallel port adapter (light)" + depends on 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. + + This driver is a light version of i2c-parport. It doesn't depend + on the parport driver, and uses direct I/O access instead. This + might be prefered on embedded systems where wasting memory for + the clean but heavy parport handling is not an option. The + drawback is a reduced portability and the impossibility to + dasiy-chain other parallel port devices. + + Don't say Y here if you said Y or M to i2c-parport. Saying M to + both is possible but both modules should not be loaded at the same + time. + + This support is also available as a module. If so, the module + will be called i2c-parport-light. + config I2C_PIIX4 tristate "Intel PIIX4" depends on I2C && PCI && EXPERIMENTAL && !64BIT
drivers/i2c/busses/Makefile +2 -0
@@ -17,6 +17,8 @@ obj-$(CONFIG_I2C_KEYWEST) += i2c-keywest.o obj-$(CONFIG_I2C_NFORCE2) += i2c-nforce2.o obj-$(CONFIG_I2C_PHILIPSPAR) += i2c-philips-par.o +obj-$(CONFIG_I2C_PARPORT) += i2c-parport.o +obj-$(CONFIG_I2C_PARPORT_LIGHT) += i2c-parport-light.o obj-$(CONFIG_I2C_PIIX4) += i2c-piix4.o obj-$(CONFIG_I2C_PROSAVAGE) += i2c-prosavage.o obj-$(CONFIG_I2C_RPXLITE) += i2c-rpx.o
drivers/i2c/busses/i2c-parport-light.c +174 -0
174 lines not on this page · raw message
drivers/i2c/busses/i2c-parport.c +266 -0
266 lines not on this page · raw message
drivers/i2c/busses/i2c-parport.h +87 -0
87 lines not on this page · raw message
Signature · 2 lines
Jean Delvare http://www.ensicaen.ismra.fr/~delvare/
Greg KH
AppliedPATCH 1/1 New parport bus drivers
Quoted 5 lines · Jean Delvare
Hi Greg,
Here comes a patch which adds my new i2c-over-parport drivers to Linux 2.6.1. It applies on top of what I suppose is your current stack of pending patches.
Applied, thanks.
greg k-h