Lines Matching refs:statep

232 	static ds1337_state_t	*statep = NULL;  in todds1337_attach()  local
261 statep = ddi_get_soft_state(ds1337_statep, instance); in todds1337_attach()
262 if (statep == NULL) { in todds1337_attach()
269 statep->dip = dip; in todds1337_attach()
271 if (i2c_client_register(dip, &statep->ds1337_i2c_hdl) != I2C_SUCCESS) { in todds1337_attach()
281 (void) i2c_transfer_alloc(statep->ds1337_i2c_hdl, in todds1337_attach()
289 if ((i2c_transfer(statep->ds1337_i2c_hdl, i2c_tp)) != I2C_SUCCESS) { in todds1337_attach()
290 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp); in todds1337_attach()
291 i2c_client_unregister(statep->ds1337_i2c_hdl); in todds1337_attach()
301 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp); in todds1337_attach()
308 (void) i2c_transfer_alloc(statep->ds1337_i2c_hdl, &i2c_tp, in todds1337_attach()
315 if ((i2c_transfer(statep->ds1337_i2c_hdl, i2c_tp)) in todds1337_attach()
317 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, in todds1337_attach()
319 i2c_client_unregister(statep->ds1337_i2c_hdl); in todds1337_attach()
327 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp); in todds1337_attach()
332 (void) i2c_transfer_alloc(statep->ds1337_i2c_hdl, &i2c_tp, in todds1337_attach()
338 if ((i2c_transfer(statep->ds1337_i2c_hdl, i2c_tp)) in todds1337_attach()
340 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, in todds1337_attach()
342 i2c_client_unregister(statep->ds1337_i2c_hdl); in todds1337_attach()
350 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp); in todds1337_attach()
356 ASSERT(statep->cycid == NULL); in todds1337_attach()
357 statep->cycid = ddi_periodic_add(todds1337_cyclic, &soft_rtc, in todds1337_attach()
359 statep->state = TOD_ATTACHED; in todds1337_attach()
479 ds1337_state_t *statep = NULL; in todds1337_set_power_alarm() local
490 statep = ddi_get_soft_state(ds1337_statep, instance); in todds1337_set_power_alarm()
491 if (statep == NULL) { in todds1337_set_power_alarm()
510 (void) i2c_transfer_alloc(statep->ds1337_i2c_hdl, in todds1337_set_power_alarm()
516 if ((i2c_transfer(statep->ds1337_i2c_hdl, i2c_tp)) != I2C_SUCCESS) { in todds1337_set_power_alarm()
517 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp); in todds1337_set_power_alarm()
527 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp); in todds1337_set_power_alarm()
529 (void) i2c_transfer_alloc(statep->ds1337_i2c_hdl, in todds1337_set_power_alarm()
536 if ((i2c_transfer(statep->ds1337_i2c_hdl, i2c_tp)) != I2C_SUCCESS) { in todds1337_set_power_alarm()
537 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp); in todds1337_set_power_alarm()
545 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp); in todds1337_set_power_alarm()
552 (void) i2c_transfer_alloc(statep->ds1337_i2c_hdl, in todds1337_set_power_alarm()
562 if ((i2c_transfer(statep->ds1337_i2c_hdl, i2c_tp)) != I2C_SUCCESS) { in todds1337_set_power_alarm()
563 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp); in todds1337_set_power_alarm()
571 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp); in todds1337_set_power_alarm()
577 (void) i2c_transfer_alloc(statep->ds1337_i2c_hdl, in todds1337_set_power_alarm()
584 if ((i2c_transfer(statep->ds1337_i2c_hdl, i2c_tp)) != I2C_SUCCESS) { in todds1337_set_power_alarm()
585 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp); in todds1337_set_power_alarm()
593 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp); in todds1337_set_power_alarm()
603 ds1337_state_t *statep = NULL; in todds1337_clear_power_alarm() local
614 statep = ddi_get_soft_state(ds1337_statep, instance); in todds1337_clear_power_alarm()
615 if (statep == NULL) { in todds1337_clear_power_alarm()
632 (void) i2c_transfer_alloc(statep->ds1337_i2c_hdl, in todds1337_clear_power_alarm()
638 if ((i2c_transfer(statep->ds1337_i2c_hdl, i2c_tp)) != I2C_SUCCESS) { in todds1337_clear_power_alarm()
639 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp); in todds1337_clear_power_alarm()
649 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp); in todds1337_clear_power_alarm()
651 (void) i2c_transfer_alloc(statep->ds1337_i2c_hdl, in todds1337_clear_power_alarm()
658 if ((i2c_transfer(statep->ds1337_i2c_hdl, i2c_tp)) != I2C_SUCCESS) { in todds1337_clear_power_alarm()
659 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp); in todds1337_clear_power_alarm()
667 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp); in todds1337_clear_power_alarm()
672 (void) i2c_transfer_alloc(statep->ds1337_i2c_hdl, in todds1337_clear_power_alarm()
678 if ((i2c_transfer(statep->ds1337_i2c_hdl, i2c_tp)) != I2C_SUCCESS) { in todds1337_clear_power_alarm()
679 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp); in todds1337_clear_power_alarm()
689 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp); in todds1337_clear_power_alarm()
691 (void) i2c_transfer_alloc(statep->ds1337_i2c_hdl, in todds1337_clear_power_alarm()
698 if ((i2c_transfer(statep->ds1337_i2c_hdl, i2c_tp)) != I2C_SUCCESS) { in todds1337_clear_power_alarm()
699 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp); in todds1337_clear_power_alarm()
707 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp); in todds1337_clear_power_alarm()
735 static ds1337_state_t *statep = NULL; in todds1337_read_rtc() local
744 statep = ddi_get_soft_state(ds1337_statep, instance); in todds1337_read_rtc()
745 if (statep == NULL) { in todds1337_read_rtc()
756 if ((i2c_transfer_alloc(statep->ds1337_i2c_hdl, &i2c_tp, 1, in todds1337_read_rtc()
769 if ((i2c_cmd_status = i2c_transfer(statep->ds1337_i2c_hdl, in todds1337_read_rtc()
783 if ((i2c_cmd_status = i2c_transfer(statep->ds1337_i2c_hdl, in todds1337_read_rtc()
815 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp); in todds1337_read_rtc()
825 ds1337_state_t *statep = NULL; in todds1337_write_rtc() local
834 statep = ddi_get_soft_state(ds1337_statep, instance); in todds1337_write_rtc()
835 if (statep == NULL) { in todds1337_write_rtc()
839 if ((i2c_cmd_status = i2c_transfer_alloc(statep->ds1337_i2c_hdl, in todds1337_write_rtc()
856 if ((i2c_cmd_status = i2c_transfer(statep->ds1337_i2c_hdl, in todds1337_write_rtc()
858 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp); in todds1337_write_rtc()
864 (void) i2c_transfer_free(statep->ds1337_i2c_hdl, i2c_tp); in todds1337_write_rtc()