Lines Matching +full:sens +full:-
1 // SPDX-License-Identifier: GPL-2.0-only
40 struct wf_sensor sens; member
42 #define wf_to_lm75(c) container_of(c, struct wf_lm75_sensor, sens)
49 if (lm->i2c == NULL) in wf_lm75_get()
50 return -ENODEV; in wf_lm75_get()
53 if (!lm->inited) { in wf_lm75_get()
54 u8 cfg_new, cfg = (u8)i2c_smbus_read_byte_data(lm->i2c, 1); in wf_lm75_get()
57 sr->name, cfg); in wf_lm75_get()
63 i2c_smbus_write_byte_data(lm->i2c, 1, cfg_new); in wf_lm75_get()
64 lm->inited = 1; in wf_lm75_get()
71 data = (s32)le16_to_cpu(i2c_smbus_read_word_data(lm->i2c, 0)); in wf_lm75_get()
99 ds1775 = id->driver_data; in wf_lm75_probe()
101 ds1775 = !!of_device_get_match_data(&client->dev); in wf_lm75_probe()
104 ds1775 ? "ds1775" : "lm75", client->addr); in wf_lm75_probe()
106 loc = of_get_property(client->dev.of_node, "hwsensor-location", NULL); in wf_lm75_probe()
108 dev_warn(&client->dev, "Missing hwsensor-location property!\n"); in wf_lm75_probe()
109 return -ENXIO; in wf_lm75_probe()
113 * the device-tree, oh well ... in wf_lm75_probe()
117 name = "hd-temp"; in wf_lm75_probe()
119 name = "incoming-air-temp"; in wf_lm75_probe()
121 name = "optical-drive-temp"; in wf_lm75_probe()
123 name = "hard-drive-temp"; in wf_lm75_probe()
125 name = "slots-temp"; in wf_lm75_probe()
127 name = "cpu-inlet-temp-0"; in wf_lm75_probe()
129 name = "cpu-inlet-temp-1"; in wf_lm75_probe()
131 return -ENXIO; in wf_lm75_probe()
136 return -ENODEV; in wf_lm75_probe()
138 lm->inited = 0; in wf_lm75_probe()
139 lm->ds1775 = ds1775; in wf_lm75_probe()
140 lm->i2c = client; in wf_lm75_probe()
141 lm->sens.name = name; in wf_lm75_probe()
142 lm->sens.ops = &wf_lm75_ops; in wf_lm75_probe()
145 rc = wf_register_sensor(&lm->sens); in wf_lm75_probe()
156 lm->i2c = NULL; in wf_lm75_remove()
159 wf_unregister_sensor(&lm->sens); in wf_lm75_remove()