Page MenuHomeFreeBSD

lm75: Refactor code to fix io error
ClosedPublic

Authored by jkol_semihalf.com on Nov 24 2022, 2:22 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 30, 1:28 AM
Unknown Object (File)
Thu, Oct 24, 10:04 AM
Unknown Object (File)
Wed, Oct 23, 3:30 AM
Unknown Object (File)
Oct 1 2024, 1:10 PM
Unknown Object (File)
Sep 29 2024, 1:02 AM
Unknown Object (File)
Sep 27 2024, 10:49 PM
Unknown Object (File)
Sep 27 2024, 10:24 PM
Unknown Object (File)
Sep 26 2024, 9:28 AM
Subscribers

Details

Summary

Use correct resolution by compat table. If dtb is not defined use default 9 bit mode.
11 bit detection is called if 9 bit mode is used.
Sysctl resolution variable is added to change resolution in case.
Some sensors didn't pull ACK while reading from nonexistent registers and it caused I2C read error and detect failure, so now detect failure does not cause driver break.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

jkol_semihalf.com created this revision.
sys/dev/iicbus/lm75.c
272

blank line, remove

315–322

I would invert logic here. If lm75_type_detect fails, use width guessed by fdt compat - that method is the one which we trust the least. If there is no fdt then fail immediately.

318

Anyway, I think it would be much more meaningful to always print number of bits detected. Right now we've got two ways of resolving that number (plus sysctl to change it) so the user should always know what had been set automatically.

This revision is now accepted and ready to land.Nov 30 2022, 10:01 AM
This revision was automatically updated to reflect the committed changes.