Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 11f16971 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/i2c-2.6



* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/i2c-2.6: (78 commits)
  commit e97b81dd
  Author: Mark M. Hoffman <mhoffman@lightlink.com>
  Date:   Thu Mar 23 16:50:25 2006 +0100
  
      [PATCH] i2c-parport: Make type parameter mandatory
      
      This patch forces the user to specify what type of adapter is present when
      loading i2c-parport or i2c-parport-light.  If none is specified, the driver
      init simply fails - instead of assuming adapter type 0.
      
      This alleviates the sometimes lengthy boot time delays which can be caused
      by accidentally building one of these into a kernel along with several i2c
      slave drivers that have lengthy probe routines (e.g. hwmon drivers).
      
      Kconfig and documentation updated accordingly.
      
      Signed-off-by: default avatarMark M. Hoffman <mhoffman@lightlink.com>
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
  
  ...
parents bcdc0842 e97b81dd
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -12,18 +12,22 @@ meant as a replacement for the older, individual drivers:
                      teletext adapters)

It currently supports the following devices:
 * Philips adapter
 * home brew teletext adapter
 * Velleman K8000 adapter
 * ELV adapter
 * Analog Devices evaluation boards (ADM1025, ADM1030, ADM1031, ADM1032)
 * Barco LPT->DVI (K5800236) adapter
 * (type=0) Philips adapter
 * (type=1) home brew teletext adapter
 * (type=2) Velleman K8000 adapter
 * (type=3) ELV adapter
 * (type=4) Analog Devices ADM1032 evaluation board
 * (type=5) Analog Devices evaluation boards: ADM1025, ADM1030, ADM1031
 * (type=6) Barco LPT->DVI (K5800236) adapter

These devices use different pinout configurations, so you have to tell
the driver what you have, using the type module parameter. There is no
way to autodetect the devices. Support for different pinout configurations
can be easily added when needed.

Earlier kernels defaulted to type=0 (Philips).  But now, if the type
parameter is missing, the driver will simply fail to initialize.


Building your own adapter
-------------------------
+3 −2
Original line number Diff line number Diff line
@@ -1161,7 +1161,7 @@ w83792d_detect(struct i2c_adapter *adapter, int address, int kind)
	   bank. */
	if (kind < 0) {
		if (w83792d_read_value(client, W83792D_REG_CONFIG) & 0x80) {
			dev_warn(dev, "Detection failed at step 3\n");
			dev_dbg(dev, "Detection failed at step 1\n");
			goto ERROR1;
		}
		val1 = w83792d_read_value(client, W83792D_REG_BANK);
@@ -1170,6 +1170,7 @@ w83792d_detect(struct i2c_adapter *adapter, int address, int kind)
		if (!(val1 & 0x07)) {  /* is Bank0 */
			if (((!(val1 & 0x80)) && (val2 != 0xa3)) ||
			     ((val1 & 0x80) && (val2 != 0x5c))) {
				dev_dbg(dev, "Detection failed at step 2\n");
				goto ERROR1;
			}
		}
@@ -1177,7 +1178,7 @@ w83792d_detect(struct i2c_adapter *adapter, int address, int kind)
		   should match */
		if (w83792d_read_value(client,
					W83792D_REG_I2C_ADDR) != address) {
			dev_warn(dev, "Detection failed at step 5\n");
			dev_dbg(dev, "Detection failed at step 3\n");
			goto ERROR1;
		}
	}
+4 −1
Original line number Diff line number Diff line
@@ -287,6 +287,9 @@ config I2C_PARPORT
	  driver named i2c-philips-par.  The new driver supports more devices,
	  and makes it easier to add support for new devices.

	  An adapter type parameter is now mandatory.  Please read the file
	  Documentation/i2c/busses/i2c-parport for details.

	  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.
+7 −2
Original line number Diff line number Diff line
@@ -121,9 +121,14 @@ static struct i2c_adapter parport_adapter = {

static int __init i2c_parport_init(void)
{
	if (type < 0 || type >= ARRAY_SIZE(adapter_parm)) {
	if (type < 0) {
		printk(KERN_WARNING "i2c-parport: adapter type unspecified\n");
		return -ENODEV;
	}

	if (type >= ARRAY_SIZE(adapter_parm)) {
		printk(KERN_WARNING "i2c-parport: invalid type (%d)\n", type);
		type = 0;
		return -ENODEV;
	}

	if (base == 0) {
+7 −2
Original line number Diff line number Diff line
@@ -241,9 +241,14 @@ static struct parport_driver i2c_parport_driver = {

static int __init i2c_parport_init(void)
{
	if (type < 0 || type >= ARRAY_SIZE(adapter_parm)) {
	if (type < 0) {
		printk(KERN_WARNING "i2c-parport: adapter type unspecified\n");
		return -ENODEV;
	}

	if (type >= ARRAY_SIZE(adapter_parm)) {
		printk(KERN_WARNING "i2c-parport: invalid type (%d)\n", type);
		type = 0;
		return -ENODEV;
	}

	return parport_register_driver(&i2c_parport_driver);
Loading