1.\" 2.\" Copyright (c) 2014 Luiz Otavio O Souza <loos@freebsd.org> 3.\" All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright 9.\" notice, this list of conditions and the following disclaimer. 10.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" notice, this list of conditions and the following disclaimer in the 12.\" documentation and/or other materials provided with the distribution. 13.\" 14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 15.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 18.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24.\" 25.\" $FreeBSD$ 26.\" 27.Dd May 11, 2014 28.Dt LM75 4 29.Os 30.Sh NAME 31.Nm lm75 32.Nd lm75 i2c digital temperature sensor driver 33.Sh SYNOPSIS 34.Cd "device iic" 35.Cd "device iicbus" 36.Cd "device lm75" 37.Sh DESCRIPTION 38The 39.Nm 40driver provides access to sensor data and configuration over the 41.Xr iicbus 4 . 42.Pp 43It provides an easy and simple way to check the functionality of an i2c bus 44as it provides read and write access to the 45.Nm 46configuration register. 47.Pp 48The access to 49.Nm 50data is made via the 51.Xr sysctl 8 52interface: 53.Bd -literal 54dev.lm75.0.%desc: LM75 temperature sensor 55dev.lm75.0.%driver: lm75 56dev.lm75.0.%location: addr=0x49 57dev.lm75.0.%pnpinfo: name=lm750 compat=national,lm75 58dev.lm75.0.%parent: iicbus3 59dev.lm75.0.temperature: 27.1C 60dev.lm75.0.thyst: 75.0C 61dev.lm75.0.tos: 80.0C 62dev.lm75.0.faults: 1 63dev.lm75.0.mode: comparator 64dev.lm75.0.polarity: active-low 65dev.lm75.0.shutdown: 0 66.Ed 67.Bl -tag -width ".Va dev.lm75.%d.temperature" 68.It Va dev.lm75.%d.temperature 69Is the read-only value of the current temperature read by the sensor. 70.It Va dev.lm75.%d.thyst 71Sets the hysteresis temperature. 72Once the temperature gets over the overtemperature shutdown value (tos) 73it needs to drop below the hysteresis temperature to disable the output 74(interrupt) pin again. 75.It Va dev.lm75.%d.tos 76Sets the overtemperature shutdown value. 77Once the temperature gets over this value the output pin will be enabled. 78The way the output (interrupt) pin works, depends on the mode configuration. 79.It Va dev.lm75.%d.faults 80Is the number of faults that must occur consecutively to activate the 81interrupt (output) pin. 82It can be set to 1, 2, 4, and 6. 83.It Va dev.lm75.%d.mode 84Sets the operation mode for the sensor interrupt pin. 85It can be set to 'comparator' (default) or 'interrupt'. 86.It Va dev.lm75.%d.polarity 87Sets the polarity of the sensor interrupt pin. 88It can be set to 'active-low' (default) or 'active-high'. 89Please note that the output pin is an open-drain output and it needs a 90proper pull-up resistor to work. 91.It Va dev.lm75.%d.shutdown 92When set to '1' it shuts down the sensor. 93The temperature conversion stops but the sensor remains with its i2c bus 94active, i.e., it can be woken up by setting this option to '0' again. 95.El 96.Pp 97Please check the 98.Nm 99datasheet for more details. 100.Pp 101When used together with 102.Xr snmp_lm75 3 103it allows the monitoring of 104.Nm 105temperature data over SNMP. 106.Pp 107The 108.Nm 109driver supports both the low and the high resolution models. 110.Pp 111The low resolution model (lm75) provides a 9 bit output with the LSB 112representing 0.5C. 113.Pp 114The high resolution model (lm75a) provides an 11 bit output with the LSB 115representing 0.125C. 116.Pp 117The driver tries to auto-detect the 118.Nm 119model, but the detection of some 120.Nm 121clones may not work reliably. 122.Pp 123On a 124.Xr device.hints 5 125based system, like 126.Li MIPS , 127these values are configurable for 128.Nm : 129.Bl -tag -width ".Va hint.lm75.%d.addr" 130.It Va hint.lm75.%d.at 131Is the 132.Xr iicbus 4 133you are attaching to. 134.It Va hint.lm75.%d.addr 135Is the 136.Nm 137i2c address on the 138.Xr iicbus 4 . 139.El 140.Pp 141On a 142.Xr FDT 4 143based system, like 144.Li ARM , 145the DTS part for a 146.Nm 147device usually looks like: 148.Bd -literal 149i2c { 150 151 ... 152 153 lm750 { 154 compatible = "national,lm75"; 155 i2c-address = <0x49>; 156 }; 157}; 158.Ed 159.Pp 160Where: 161.Bl -tag -width ".Va i2c-address" 162.It Va compatible 163Should always be set to "national,lm75". 164.It Va i2c-address 165The 166.Va i2c-address 167property indicates which i2c address the 168.Nm 169is wired at. 170.Nm 171temperature sensors can be wired to 8 different addresses, allowing up to 8 172sensors on the same 173.Xr iicbus 4 . 174.El 175.Sh SEE ALSO 176.Xr snmp_lm75 3 , 177.Xr fdt 4 , 178.Xr iic 4 , 179.Xr iicbus 4 , 180.Xr sysctl 8 181.Sh HISTORY 182The 183.Nm 184driver first appeared in 185.Fx 11.0 . 186.Sh AUTHORS 187.An -nosplit 188The 189.Nm 190driver and this manual page were written by 191.An Luiz Otavio O Souza Aq Mt loos@FreeBSD.org . 192