Lines Matching refs:unitp

148 	struct lm75_unit *unitp;
158 unitp = (struct lm75_unit *)
161 if (unitp == NULL) {
169 mutex_enter(&unitp->lm75_mutex);
172 if (unitp->lm75_oflag != 0) {
175 unitp->lm75_oflag = FEXCL;
178 if (unitp->lm75_oflag == FEXCL) {
181 unitp->lm75_oflag = FOPEN;
185 mutex_exit(&unitp->lm75_mutex);
195 struct lm75_unit *unitp;
204 unitp = (struct lm75_unit *)
207 if (unitp == NULL) {
211 mutex_enter(&unitp->lm75_mutex);
213 unitp->lm75_oflag = 0;
215 mutex_exit(&unitp->lm75_mutex);
220 lm75_get16(intptr_t arg, int reg, struct lm75_unit *unitp, int mode) {
226 (void) i2c_transfer_alloc(unitp->lm75_hdl, &i2c_tran_pointer,
231 unitp->lm75_name));
238 err = i2c_transfer(unitp->lm75_hdl, i2c_tran_pointer);
242 unitp->lm75_name));
243 i2c_transfer_free(unitp->lm75_hdl, i2c_tran_pointer);
248 unitp->lm75_name, i2c_tran_pointer->i2c_rbuf[0],
267 unitp->lm75_name));
270 i2c_transfer_free(unitp->lm75_hdl, i2c_tran_pointer);
275 lm75_set16(intptr_t arg, int reg, struct lm75_unit *unitp, int mode) {
284 unitp->lm75_name));
288 (void) i2c_transfer_alloc(unitp->lm75_hdl, &i2c_tran_pointer,
293 unitp->lm75_name));
312 err = i2c_transfer(unitp->lm75_hdl, i2c_tran_pointer);
313 i2c_transfer_free(unitp->lm75_hdl, i2c_tran_pointer);
323 struct lm75_unit *unitp;
336 unitp = (struct lm75_unit *)
339 if (unitp == NULL) {
340 cmn_err(CE_WARN, "LM75: ioctl: unitp = NULL\n");
345 mutex_enter(&unitp->lm75_mutex);
349 err = lm75_get16(arg, LM75_TEMPERATURE_REG, unitp, mode);
353 err = lm75_get16(arg, LM75_HYST_REG, unitp, mode);
357 err = lm75_set16(arg, LM75_HYST_REG, unitp, mode);
361 err = lm75_get16(arg, LM75_OVERTEMP_REG, unitp, mode);
365 err = lm75_set16(arg, LM75_OVERTEMP_REG, unitp, mode);
369 (void) i2c_transfer_alloc(unitp->lm75_hdl, &i2c_tran_pointer,
374 unitp->lm75_name));
381 err = i2c_transfer(unitp->lm75_hdl, i2c_tran_pointer);
385 unitp->lm75_name));
386 i2c_transfer_free(unitp->lm75_hdl, i2c_tran_pointer);
394 unitp->lm75_name));
397 i2c_transfer_free(unitp->lm75_hdl, i2c_tran_pointer);
405 unitp->lm75_name));
409 (void) i2c_transfer_alloc(unitp->lm75_hdl, &i2c_tran_pointer,
414 unitp->lm75_name));
422 err = i2c_transfer(unitp->lm75_hdl, i2c_tran_pointer);
423 i2c_transfer_free(unitp->lm75_hdl, i2c_tran_pointer);
428 unitp->lm75_name, cmd));
432 mutex_exit(&unitp->lm75_mutex);
465 struct lm75_unit *unitp;
476 unitp = ddi_get_soft_state(lm75soft_statep, instance);
478 if (unitp == NULL) {
479 cmn_err(CE_WARN, "LM75: ioctl: unitp = NULL\n");
483 (void) snprintf(unitp->lm75_name, sizeof (unitp->lm75_name),
489 "%s\n", unitp->lm75_name, "lm75");
495 if (i2c_client_register(dip, &unitp->lm75_hdl) != I2C_SUCCESS) {
502 mutex_init(&unitp->lm75_mutex, NULL, MUTEX_DRIVER, NULL);
526 struct lm75_unit *unitp;
531 unitp = ddi_get_soft_state(lm75soft_statep, instance);
533 if (unitp == NULL) {
534 cmn_err(CE_WARN, "LM75: ioctl: unitp = NULL\n");
538 i2c_client_unregister(unitp->lm75_hdl);
542 mutex_destroy(&unitp->lm75_mutex);