15e9ae4b1SCorey Minyard /*
25e9ae4b1SCorey Minyard * Texas Instruments TMP105 temperature sensor.
35e9ae4b1SCorey Minyard *
45e9ae4b1SCorey Minyard * Copyright (C) 2008 Nokia Corporation
55e9ae4b1SCorey Minyard * Written by Andrzej Zaborowski <andrew@openedhand.com>
65e9ae4b1SCorey Minyard *
75e9ae4b1SCorey Minyard * This program is free software; you can redistribute it and/or
85e9ae4b1SCorey Minyard * modify it under the terms of the GNU General Public License as
95e9ae4b1SCorey Minyard * published by the Free Software Foundation; either version 2 or
105e9ae4b1SCorey Minyard * (at your option) version 3 of the License.
115e9ae4b1SCorey Minyard *
125e9ae4b1SCorey Minyard * This program is distributed in the hope that it will be useful,
135e9ae4b1SCorey Minyard * but WITHOUT ANY WARRANTY; without even the implied warranty of
145e9ae4b1SCorey Minyard * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
155e9ae4b1SCorey Minyard * GNU General Public License for more details.
165e9ae4b1SCorey Minyard *
175e9ae4b1SCorey Minyard * You should have received a copy of the GNU General Public License along
185e9ae4b1SCorey Minyard * with this program; if not, see <http://www.gnu.org/licenses/>.
195e9ae4b1SCorey Minyard */
205e9ae4b1SCorey Minyard
215e9ae4b1SCorey Minyard #include "qemu/osdep.h"
225e9ae4b1SCorey Minyard #include "hw/i2c/i2c.h"
235e9ae4b1SCorey Minyard #include "hw/irq.h"
245e9ae4b1SCorey Minyard #include "migration/vmstate.h"
255e9ae4b1SCorey Minyard #include "hw/sensor/tmp105.h"
265e9ae4b1SCorey Minyard #include "qapi/error.h"
275e9ae4b1SCorey Minyard #include "qapi/visitor.h"
285e9ae4b1SCorey Minyard #include "qemu/module.h"
2994a4e18cSPhilippe Mathieu-Daudé #include "hw/registerfields.h"
30*3647dca9SBernhard Beschow #include "trace.h"
3194a4e18cSPhilippe Mathieu-Daudé
3294a4e18cSPhilippe Mathieu-Daudé FIELD(CONFIG, SHUTDOWN_MODE, 0, 1)
3394a4e18cSPhilippe Mathieu-Daudé FIELD(CONFIG, THERMOSTAT_MODE, 1, 1)
3494a4e18cSPhilippe Mathieu-Daudé FIELD(CONFIG, POLARITY, 2, 1)
3594a4e18cSPhilippe Mathieu-Daudé FIELD(CONFIG, FAULT_QUEUE, 3, 2)
3694a4e18cSPhilippe Mathieu-Daudé FIELD(CONFIG, CONVERTER_RESOLUTION, 5, 2)
3794a4e18cSPhilippe Mathieu-Daudé FIELD(CONFIG, ONE_SHOT, 7, 1)
385e9ae4b1SCorey Minyard
tmp105_interrupt_update(TMP105State * s)395e9ae4b1SCorey Minyard static void tmp105_interrupt_update(TMP105State *s)
405e9ae4b1SCorey Minyard {
4194a4e18cSPhilippe Mathieu-Daudé qemu_set_irq(s->pin, s->alarm ^ FIELD_EX8(~s->config, CONFIG, POLARITY));
425e9ae4b1SCorey Minyard }
435e9ae4b1SCorey Minyard
tmp105_alarm_update(TMP105State * s,bool one_shot)440339fa79SPhilippe Mathieu-Daudé static void tmp105_alarm_update(TMP105State *s, bool one_shot)
455e9ae4b1SCorey Minyard {
46bf4e4870SPhilippe Mathieu-Daudé if (FIELD_EX8(s->config, CONFIG, SHUTDOWN_MODE) && !one_shot) {
475e9ae4b1SCorey Minyard return;
485e9ae4b1SCorey Minyard }
495e9ae4b1SCorey Minyard
5094a4e18cSPhilippe Mathieu-Daudé if (FIELD_EX8(s->config, CONFIG, THERMOSTAT_MODE)) {
515e9ae4b1SCorey Minyard /*
525e9ae4b1SCorey Minyard * TM == 1 : Interrupt mode. We signal Alert when the
535e9ae4b1SCorey Minyard * temperature rises above T_high, and expect the guest to clear
545e9ae4b1SCorey Minyard * it (eg by reading a device register).
555e9ae4b1SCorey Minyard */
565e9ae4b1SCorey Minyard if (s->detect_falling) {
575e9ae4b1SCorey Minyard if (s->temperature < s->limit[0]) {
585e9ae4b1SCorey Minyard s->alarm = 1;
595e9ae4b1SCorey Minyard s->detect_falling = false;
605e9ae4b1SCorey Minyard }
615e9ae4b1SCorey Minyard } else {
625e9ae4b1SCorey Minyard if (s->temperature >= s->limit[1]) {
635e9ae4b1SCorey Minyard s->alarm = 1;
645e9ae4b1SCorey Minyard s->detect_falling = true;
655e9ae4b1SCorey Minyard }
665e9ae4b1SCorey Minyard }
675e9ae4b1SCorey Minyard } else {
685e9ae4b1SCorey Minyard /*
695e9ae4b1SCorey Minyard * TM == 0 : Comparator mode. We signal Alert when the temperature
705e9ae4b1SCorey Minyard * rises above T_high, and stop signalling it when the temperature
715e9ae4b1SCorey Minyard * falls below T_low.
725e9ae4b1SCorey Minyard */
735e9ae4b1SCorey Minyard if (s->detect_falling) {
745e9ae4b1SCorey Minyard if (s->temperature < s->limit[0]) {
755e9ae4b1SCorey Minyard s->alarm = 0;
765e9ae4b1SCorey Minyard s->detect_falling = false;
775e9ae4b1SCorey Minyard }
785e9ae4b1SCorey Minyard } else {
795e9ae4b1SCorey Minyard if (s->temperature >= s->limit[1]) {
805e9ae4b1SCorey Minyard s->alarm = 1;
815e9ae4b1SCorey Minyard s->detect_falling = true;
825e9ae4b1SCorey Minyard }
835e9ae4b1SCorey Minyard }
845e9ae4b1SCorey Minyard }
855e9ae4b1SCorey Minyard
865e9ae4b1SCorey Minyard tmp105_interrupt_update(s);
875e9ae4b1SCorey Minyard }
885e9ae4b1SCorey Minyard
tmp105_get_temperature(Object * obj,Visitor * v,const char * name,void * opaque,Error ** errp)895e9ae4b1SCorey Minyard static void tmp105_get_temperature(Object *obj, Visitor *v, const char *name,
905e9ae4b1SCorey Minyard void *opaque, Error **errp)
915e9ae4b1SCorey Minyard {
925e9ae4b1SCorey Minyard TMP105State *s = TMP105(obj);
935e9ae4b1SCorey Minyard int64_t value = s->temperature * 1000 / 256;
945e9ae4b1SCorey Minyard
955e9ae4b1SCorey Minyard visit_type_int(v, name, &value, errp);
965e9ae4b1SCorey Minyard }
975e9ae4b1SCorey Minyard
986efabadaSGuenter Roeck /*
996efabadaSGuenter Roeck * Units are 0.001 centigrades relative to 0 C. s->temperature is 8.8
1005e9ae4b1SCorey Minyard * fixed point, so units are 1/256 centigrades. A simple ratio will do.
1015e9ae4b1SCorey Minyard */
tmp105_set_temperature(Object * obj,Visitor * v,const char * name,void * opaque,Error ** errp)1025e9ae4b1SCorey Minyard static void tmp105_set_temperature(Object *obj, Visitor *v, const char *name,
1035e9ae4b1SCorey Minyard void *opaque, Error **errp)
1045e9ae4b1SCorey Minyard {
1055e9ae4b1SCorey Minyard TMP105State *s = TMP105(obj);
1065e9ae4b1SCorey Minyard int64_t temp;
1075e9ae4b1SCorey Minyard
1085e9ae4b1SCorey Minyard if (!visit_type_int(v, name, &temp, errp)) {
1095e9ae4b1SCorey Minyard return;
1105e9ae4b1SCorey Minyard }
1115e9ae4b1SCorey Minyard if (temp >= 128000 || temp < -128000) {
1125e9ae4b1SCorey Minyard error_setg(errp, "value %" PRId64 ".%03" PRIu64 " C is out of range",
1135e9ae4b1SCorey Minyard temp / 1000, temp % 1000);
1145e9ae4b1SCorey Minyard return;
1155e9ae4b1SCorey Minyard }
1165e9ae4b1SCorey Minyard
1175e9ae4b1SCorey Minyard s->temperature = (int16_t) (temp * 256 / 1000);
1185e9ae4b1SCorey Minyard
1190339fa79SPhilippe Mathieu-Daudé tmp105_alarm_update(s, false);
1205e9ae4b1SCorey Minyard }
1215e9ae4b1SCorey Minyard
1225e9ae4b1SCorey Minyard static const int tmp105_faultq[4] = { 1, 2, 4, 6 };
1235e9ae4b1SCorey Minyard
tmp105_read(TMP105State * s)1245e9ae4b1SCorey Minyard static void tmp105_read(TMP105State *s)
1255e9ae4b1SCorey Minyard {
1265e9ae4b1SCorey Minyard s->len = 0;
1275e9ae4b1SCorey Minyard
12894a4e18cSPhilippe Mathieu-Daudé if (FIELD_EX8(s->config, CONFIG, THERMOSTAT_MODE)) {
1295e9ae4b1SCorey Minyard s->alarm = 0;
1305e9ae4b1SCorey Minyard tmp105_interrupt_update(s);
1315e9ae4b1SCorey Minyard }
1325e9ae4b1SCorey Minyard
1335e9ae4b1SCorey Minyard switch (s->pointer & 3) {
1345e9ae4b1SCorey Minyard case TMP105_REG_TEMPERATURE:
1355e9ae4b1SCorey Minyard s->buf[s->len++] = (((uint16_t) s->temperature) >> 8);
1365e9ae4b1SCorey Minyard s->buf[s->len++] = (((uint16_t) s->temperature) >> 0) &
13794a4e18cSPhilippe Mathieu-Daudé (0xf0 << (FIELD_EX8(~s->config, CONFIG, CONVERTER_RESOLUTION)));
1385e9ae4b1SCorey Minyard break;
1395e9ae4b1SCorey Minyard
1405e9ae4b1SCorey Minyard case TMP105_REG_CONFIG:
1415e9ae4b1SCorey Minyard s->buf[s->len++] = s->config;
1425e9ae4b1SCorey Minyard break;
1435e9ae4b1SCorey Minyard
1445e9ae4b1SCorey Minyard case TMP105_REG_T_LOW:
1455e9ae4b1SCorey Minyard s->buf[s->len++] = ((uint16_t) s->limit[0]) >> 8;
1465e9ae4b1SCorey Minyard s->buf[s->len++] = ((uint16_t) s->limit[0]) >> 0;
1475e9ae4b1SCorey Minyard break;
1485e9ae4b1SCorey Minyard
1495e9ae4b1SCorey Minyard case TMP105_REG_T_HIGH:
1505e9ae4b1SCorey Minyard s->buf[s->len++] = ((uint16_t) s->limit[1]) >> 8;
1515e9ae4b1SCorey Minyard s->buf[s->len++] = ((uint16_t) s->limit[1]) >> 0;
1525e9ae4b1SCorey Minyard break;
1535e9ae4b1SCorey Minyard }
154*3647dca9SBernhard Beschow
155*3647dca9SBernhard Beschow trace_tmp105_read(s->i2c.address, s->pointer);
1565e9ae4b1SCorey Minyard }
1575e9ae4b1SCorey Minyard
tmp105_write(TMP105State * s)1585e9ae4b1SCorey Minyard static void tmp105_write(TMP105State *s)
1595e9ae4b1SCorey Minyard {
160*3647dca9SBernhard Beschow trace_tmp105_write(s->i2c.address, s->pointer);
161*3647dca9SBernhard Beschow
1625e9ae4b1SCorey Minyard switch (s->pointer & 3) {
1635e9ae4b1SCorey Minyard case TMP105_REG_TEMPERATURE:
1645e9ae4b1SCorey Minyard break;
1655e9ae4b1SCorey Minyard
1665e9ae4b1SCorey Minyard case TMP105_REG_CONFIG:
16794a4e18cSPhilippe Mathieu-Daudé if (FIELD_EX8(s->buf[0] & ~s->config, CONFIG, SHUTDOWN_MODE)) {
168*3647dca9SBernhard Beschow trace_tmp105_write_shutdown(s->i2c.address);
1696efabadaSGuenter Roeck }
170bf4e4870SPhilippe Mathieu-Daudé s->config = FIELD_DP8(s->buf[0], CONFIG, ONE_SHOT, 0);
17194a4e18cSPhilippe Mathieu-Daudé s->faults = tmp105_faultq[FIELD_EX8(s->config, CONFIG, FAULT_QUEUE)];
1720339fa79SPhilippe Mathieu-Daudé tmp105_alarm_update(s, FIELD_EX8(s->buf[0], CONFIG, ONE_SHOT));
1735e9ae4b1SCorey Minyard break;
1745e9ae4b1SCorey Minyard
1755e9ae4b1SCorey Minyard case TMP105_REG_T_LOW:
1765e9ae4b1SCorey Minyard case TMP105_REG_T_HIGH:
1776efabadaSGuenter Roeck if (s->len >= 3) {
1785e9ae4b1SCorey Minyard s->limit[s->pointer & 1] = (int16_t)
1793a0b7588SGuenter Roeck ((((uint16_t) s->buf[0]) << 8) | (s->buf[1] & 0xf0));
1806efabadaSGuenter Roeck }
1810339fa79SPhilippe Mathieu-Daudé tmp105_alarm_update(s, false);
1825e9ae4b1SCorey Minyard break;
1835e9ae4b1SCorey Minyard }
1845e9ae4b1SCorey Minyard }
1855e9ae4b1SCorey Minyard
tmp105_rx(I2CSlave * i2c)1865e9ae4b1SCorey Minyard static uint8_t tmp105_rx(I2CSlave *i2c)
1875e9ae4b1SCorey Minyard {
1885e9ae4b1SCorey Minyard TMP105State *s = TMP105(i2c);
1895e9ae4b1SCorey Minyard
1905e9ae4b1SCorey Minyard if (s->len < 2) {
1915e9ae4b1SCorey Minyard return s->buf[s->len++];
1925e9ae4b1SCorey Minyard } else {
1935e9ae4b1SCorey Minyard return 0xff;
1945e9ae4b1SCorey Minyard }
1955e9ae4b1SCorey Minyard }
1965e9ae4b1SCorey Minyard
tmp105_tx(I2CSlave * i2c,uint8_t data)1975e9ae4b1SCorey Minyard static int tmp105_tx(I2CSlave *i2c, uint8_t data)
1985e9ae4b1SCorey Minyard {
1995e9ae4b1SCorey Minyard TMP105State *s = TMP105(i2c);
2005e9ae4b1SCorey Minyard
2015e9ae4b1SCorey Minyard if (s->len == 0) {
2025e9ae4b1SCorey Minyard s->pointer = data;
2035e9ae4b1SCorey Minyard s->len++;
2045e9ae4b1SCorey Minyard } else {
2055e9ae4b1SCorey Minyard if (s->len <= 2) {
2065e9ae4b1SCorey Minyard s->buf[s->len - 1] = data;
2075e9ae4b1SCorey Minyard }
2085e9ae4b1SCorey Minyard s->len++;
2095e9ae4b1SCorey Minyard tmp105_write(s);
2105e9ae4b1SCorey Minyard }
2115e9ae4b1SCorey Minyard
2125e9ae4b1SCorey Minyard return 0;
2135e9ae4b1SCorey Minyard }
2145e9ae4b1SCorey Minyard
tmp105_event(I2CSlave * i2c,enum i2c_event event)2155e9ae4b1SCorey Minyard static int tmp105_event(I2CSlave *i2c, enum i2c_event event)
2165e9ae4b1SCorey Minyard {
2175e9ae4b1SCorey Minyard TMP105State *s = TMP105(i2c);
2185e9ae4b1SCorey Minyard
2195e9ae4b1SCorey Minyard if (event == I2C_START_RECV) {
2205e9ae4b1SCorey Minyard tmp105_read(s);
2215e9ae4b1SCorey Minyard }
2225e9ae4b1SCorey Minyard
2235e9ae4b1SCorey Minyard s->len = 0;
2245e9ae4b1SCorey Minyard return 0;
2255e9ae4b1SCorey Minyard }
2265e9ae4b1SCorey Minyard
tmp105_post_load(void * opaque,int version_id)2275e9ae4b1SCorey Minyard static int tmp105_post_load(void *opaque, int version_id)
2285e9ae4b1SCorey Minyard {
2295e9ae4b1SCorey Minyard TMP105State *s = opaque;
2305e9ae4b1SCorey Minyard
23194a4e18cSPhilippe Mathieu-Daudé s->faults = tmp105_faultq[FIELD_EX8(s->config, CONFIG, FAULT_QUEUE)];
2325e9ae4b1SCorey Minyard
2335e9ae4b1SCorey Minyard tmp105_interrupt_update(s);
2345e9ae4b1SCorey Minyard return 0;
2355e9ae4b1SCorey Minyard }
2365e9ae4b1SCorey Minyard
detect_falling_needed(void * opaque)2375e9ae4b1SCorey Minyard static bool detect_falling_needed(void *opaque)
2385e9ae4b1SCorey Minyard {
2395e9ae4b1SCorey Minyard TMP105State *s = opaque;
2405e9ae4b1SCorey Minyard
2415e9ae4b1SCorey Minyard /*
2425e9ae4b1SCorey Minyard * We only need to migrate the detect_falling bool if it's set;
2435e9ae4b1SCorey Minyard * for migration from older machines we assume that it is false
2445e9ae4b1SCorey Minyard * (ie temperature is not out of range).
2455e9ae4b1SCorey Minyard */
2465e9ae4b1SCorey Minyard return s->detect_falling;
2475e9ae4b1SCorey Minyard }
2485e9ae4b1SCorey Minyard
2495e9ae4b1SCorey Minyard static const VMStateDescription vmstate_tmp105_detect_falling = {
2505e9ae4b1SCorey Minyard .name = "TMP105/detect-falling",
2515e9ae4b1SCorey Minyard .version_id = 1,
2525e9ae4b1SCorey Minyard .minimum_version_id = 1,
2535e9ae4b1SCorey Minyard .needed = detect_falling_needed,
254af10fff2SRichard Henderson .fields = (const VMStateField[]) {
2555e9ae4b1SCorey Minyard VMSTATE_BOOL(detect_falling, TMP105State),
2565e9ae4b1SCorey Minyard VMSTATE_END_OF_LIST()
2575e9ae4b1SCorey Minyard }
2585e9ae4b1SCorey Minyard };
2595e9ae4b1SCorey Minyard
2605e9ae4b1SCorey Minyard static const VMStateDescription vmstate_tmp105 = {
2615e9ae4b1SCorey Minyard .name = "TMP105",
2625e9ae4b1SCorey Minyard .version_id = 0,
2635e9ae4b1SCorey Minyard .minimum_version_id = 0,
2645e9ae4b1SCorey Minyard .post_load = tmp105_post_load,
265af10fff2SRichard Henderson .fields = (const VMStateField[]) {
2665e9ae4b1SCorey Minyard VMSTATE_UINT8(len, TMP105State),
2675e9ae4b1SCorey Minyard VMSTATE_UINT8_ARRAY(buf, TMP105State, 2),
2685e9ae4b1SCorey Minyard VMSTATE_UINT8(pointer, TMP105State),
2695e9ae4b1SCorey Minyard VMSTATE_UINT8(config, TMP105State),
2705e9ae4b1SCorey Minyard VMSTATE_INT16(temperature, TMP105State),
2715e9ae4b1SCorey Minyard VMSTATE_INT16_ARRAY(limit, TMP105State, 2),
2725e9ae4b1SCorey Minyard VMSTATE_UINT8(alarm, TMP105State),
2735e9ae4b1SCorey Minyard VMSTATE_I2C_SLAVE(i2c, TMP105State),
2745e9ae4b1SCorey Minyard VMSTATE_END_OF_LIST()
2755e9ae4b1SCorey Minyard },
276af10fff2SRichard Henderson .subsections = (const VMStateDescription * const []) {
2775e9ae4b1SCorey Minyard &vmstate_tmp105_detect_falling,
2785e9ae4b1SCorey Minyard NULL
2795e9ae4b1SCorey Minyard }
2805e9ae4b1SCorey Minyard };
2815e9ae4b1SCorey Minyard
tmp105_reset(I2CSlave * i2c)2825e9ae4b1SCorey Minyard static void tmp105_reset(I2CSlave *i2c)
2835e9ae4b1SCorey Minyard {
2845e9ae4b1SCorey Minyard TMP105State *s = TMP105(i2c);
2855e9ae4b1SCorey Minyard
2865e9ae4b1SCorey Minyard s->temperature = 0;
2875e9ae4b1SCorey Minyard s->pointer = 0;
2885e9ae4b1SCorey Minyard s->config = 0;
28994a4e18cSPhilippe Mathieu-Daudé s->faults = tmp105_faultq[FIELD_EX8(s->config, CONFIG, FAULT_QUEUE)];
2905e9ae4b1SCorey Minyard s->alarm = 0;
2915e9ae4b1SCorey Minyard s->detect_falling = false;
2925e9ae4b1SCorey Minyard
2935e9ae4b1SCorey Minyard s->limit[0] = 0x4b00; /* T_LOW, 75 degrees C */
2945e9ae4b1SCorey Minyard s->limit[1] = 0x5000; /* T_HIGH, 80 degrees C */
2955e9ae4b1SCorey Minyard
2965e9ae4b1SCorey Minyard tmp105_interrupt_update(s);
2975e9ae4b1SCorey Minyard }
2985e9ae4b1SCorey Minyard
tmp105_realize(DeviceState * dev,Error ** errp)2995e9ae4b1SCorey Minyard static void tmp105_realize(DeviceState *dev, Error **errp)
3005e9ae4b1SCorey Minyard {
3015e9ae4b1SCorey Minyard I2CSlave *i2c = I2C_SLAVE(dev);
3025e9ae4b1SCorey Minyard TMP105State *s = TMP105(i2c);
3035e9ae4b1SCorey Minyard
3045e9ae4b1SCorey Minyard qdev_init_gpio_out(&i2c->qdev, &s->pin, 1);
3055e9ae4b1SCorey Minyard
3065e9ae4b1SCorey Minyard tmp105_reset(&s->i2c);
3075e9ae4b1SCorey Minyard }
3085e9ae4b1SCorey Minyard
tmp105_initfn(Object * obj)3095e9ae4b1SCorey Minyard static void tmp105_initfn(Object *obj)
3105e9ae4b1SCorey Minyard {
3115e9ae4b1SCorey Minyard object_property_add(obj, "temperature", "int",
3125e9ae4b1SCorey Minyard tmp105_get_temperature,
3135e9ae4b1SCorey Minyard tmp105_set_temperature, NULL, NULL);
3145e9ae4b1SCorey Minyard }
3155e9ae4b1SCorey Minyard
tmp105_class_init(ObjectClass * klass,void * data)3165e9ae4b1SCorey Minyard static void tmp105_class_init(ObjectClass *klass, void *data)
3175e9ae4b1SCorey Minyard {
3185e9ae4b1SCorey Minyard DeviceClass *dc = DEVICE_CLASS(klass);
3195e9ae4b1SCorey Minyard I2CSlaveClass *k = I2C_SLAVE_CLASS(klass);
3205e9ae4b1SCorey Minyard
3215e9ae4b1SCorey Minyard dc->realize = tmp105_realize;
3225e9ae4b1SCorey Minyard k->event = tmp105_event;
3235e9ae4b1SCorey Minyard k->recv = tmp105_rx;
3245e9ae4b1SCorey Minyard k->send = tmp105_tx;
3255e9ae4b1SCorey Minyard dc->vmsd = &vmstate_tmp105;
3265e9ae4b1SCorey Minyard }
3275e9ae4b1SCorey Minyard
3285e9ae4b1SCorey Minyard static const TypeInfo tmp105_info = {
3295e9ae4b1SCorey Minyard .name = TYPE_TMP105,
3305e9ae4b1SCorey Minyard .parent = TYPE_I2C_SLAVE,
3315e9ae4b1SCorey Minyard .instance_size = sizeof(TMP105State),
3325e9ae4b1SCorey Minyard .instance_init = tmp105_initfn,
3335e9ae4b1SCorey Minyard .class_init = tmp105_class_init,
3345e9ae4b1SCorey Minyard };
3355e9ae4b1SCorey Minyard
tmp105_register_types(void)3365e9ae4b1SCorey Minyard static void tmp105_register_types(void)
3375e9ae4b1SCorey Minyard {
3385e9ae4b1SCorey Minyard type_register_static(&tmp105_info);
3395e9ae4b1SCorey Minyard }
3405e9ae4b1SCorey Minyard
3415e9ae4b1SCorey Minyard type_init(tmp105_register_types)
342