On 6/5/08, Jean Delvare <[EMAIL PROTECTED]> wrote:
>  > Doesn't something like this work? (obviously this isn't complete)
>  >
>  > for (address = start; address <= stop;) {
>  >       make a new client
>  >       for (; address <=stop; address++) {
>  >               client->address = address;
>  >               res = device_register(&client->dev);
>  >               if (res != -ENODEV)
>  >                       break;
>  >       }
>  > }
>  > delete the extra client
>
>
> You don't seriously propose to scan all addresses on every I2C bus for
>  every i2c chip driver that we load, do you? This would be awfully slow
>  and dangerous. No way.

This is just a small part of the code, you need to add in all the
other parts from the patch.
Exactly the same addresses would be scanned  under each scheme. .My
question is, does the driver need two entry points (detect and probe)
or could only one (probe) be used? I think detect and probe can be the
same function.

With the detect() function it would look somthing like this:

for (address = start; address <= stop;) {
      for (; address <=stop; address++) {
             do a generic detect
              if (driver->detect(address) {
                     make a new client
                     client->address = address;
                     res = device_register(&client->dev);
                     if (!res)
                            delete the extra client
             }
       }
}





-- 
Jon Smirl
[EMAIL PROTECTED]

_______________________________________________
i2c mailing list
i2c@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/i2c

Reply via email to