Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/dev/i2c



Hi,

> Module Name:  src
> Committed By: soren
> Date:         Wed Aug  7 19:38:45 UTC 2013
> 
> Modified Files:
>       src/sys/dev/i2c: at24cxx.c dbcool_reg.h i2c.c lm75reg.h max6900reg.h
>           pcf8583reg.h sdtemp_reg.h spdmem_i2c.c x1226reg.h
> 
> Log Message:
> Allow i2c addr wildcard matching. Use with care!

> To generate a diff of this commit:
> cvs rdiff -u -r1.39 -r1.40 src/sys/dev/i2c/i2c.c

There is slight snag with this change to i2c.c, as it changes the match
when the kernel configuration contains both direct and indirect matching
for i2c busses, as on sparc64.  It causes the kernel to attempt to attach
the modified device at every possible address - for example:

  alipm0 at pci1 dev 6 function 0: 223KHz clock
  iic1 at alipm0: I2C bus 

  seeprom4 at iic1 addr 0x50: AT24Cxx EEPROM
  seeprom4: invalid size specified; assuming 2KB (16Kb)

  lmtemp0 at iic1 addr 0x48: LM75 Temperature Sensor
  lmtemp0: unable to write config register 

  dbcool_chip_ident: addr 0x2c c_id 0x00 d_id 0x00 r_id 0x00: No match.

  admtemp0 at iic1 addr 0x18: ADM1021 or compatible environmental sensor
  admtemp0: cannot get control register

(each device appears at each possible address for that device).  The
sparc64 configuration contains (direct config):

  spdmem*               at iic? addr?
  admtemp*      at iic? addr?
  lmtemp*               at iic? addr?
  dbcool*               at iic? addr?   # SB25000
  seeprom*      at iic? addr?   # i2c-at24c64 fru's

and (indirect config):

  spdmem*               at iic? addr 0x50       # SPARCle memory
  spdmem*               at iic? addr 0x51       # SPARCle memory

Prior to this change, the config entries "at iic? addr?" would only be
matched when ia->ia_name was not null.  With this change, they match for
busses that attach with indirect config too, like iic at alipm.  I'm not
sure what the best way to fix this is - we want to have the device entries
"at iic? addr?" only match with direct config.

Thanks,

J

-- 
   NetBSD: simple; works; documented    /        Sailing at Newbiggin
        http://www.netbsd.org/        /   http://www.newbigginsailingclub.org/


Home | Main Index | Thread Index | Old Index