Lines Matching +full:sens +full:-

1 // SPDX-License-Identifier: GPL-2.0-only
39 struct wf_sensor sens; member
41 #define wf_to_lm75(c) container_of(c, struct wf_lm75_sensor, sens)
48 if (lm->i2c == NULL) in wf_lm75_get()
49 return -ENODEV; in wf_lm75_get()
52 if (!lm->inited) { in wf_lm75_get()
53 u8 cfg_new, cfg = (u8)i2c_smbus_read_byte_data(lm->i2c, 1); in wf_lm75_get()
56 sr->name, cfg); in wf_lm75_get()
62 i2c_smbus_write_byte_data(lm->i2c, 1, cfg_new); in wf_lm75_get()
63 lm->inited = 1; in wf_lm75_get()
70 data = (s32)le16_to_cpu(i2c_smbus_read_word_data(lm->i2c, 0)); in wf_lm75_get()
98 ds1775 = id->driver_data; in wf_lm75_probe()
100 ds1775 = !!of_device_get_match_data(&client->dev); in wf_lm75_probe()
103 ds1775 ? "ds1775" : "lm75", client->addr); in wf_lm75_probe()
105 loc = of_get_property(client->dev.of_node, "hwsensor-location", NULL); in wf_lm75_probe()
107 dev_warn(&client->dev, "Missing hwsensor-location property!\n"); in wf_lm75_probe()
108 return -ENXIO; in wf_lm75_probe()
112 * the device-tree, oh well ... in wf_lm75_probe()
116 name = "hd-temp"; in wf_lm75_probe()
118 name = "incoming-air-temp"; in wf_lm75_probe()
120 name = "optical-drive-temp"; in wf_lm75_probe()
122 name = "hard-drive-temp"; in wf_lm75_probe()
124 name = "slots-temp"; in wf_lm75_probe()
126 name = "cpu-inlet-temp-0"; in wf_lm75_probe()
128 name = "cpu-inlet-temp-1"; in wf_lm75_probe()
130 return -ENXIO; in wf_lm75_probe()
135 return -ENODEV; in wf_lm75_probe()
137 lm->inited = 0; in wf_lm75_probe()
138 lm->ds1775 = ds1775; in wf_lm75_probe()
139 lm->i2c = client; in wf_lm75_probe()
140 lm->sens.name = name; in wf_lm75_probe()
141 lm->sens.ops = &wf_lm75_ops; in wf_lm75_probe()
144 rc = wf_register_sensor(&lm->sens); in wf_lm75_probe()
155 lm->i2c = NULL; in wf_lm75_remove()
158 wf_unregister_sensor(&lm->sens); in wf_lm75_remove()