Lines Matching defs:dip
56 static void pcf8584_resume(dev_info_t *dip);
57 static void pcf8584_suspend(dev_info_t *dip);
58 static int pcf8584_bus_ctl(dev_info_t *dip, dev_info_t *rdip,
60 static void pcf8584_acquire(pcf8584_t *, dev_info_t *dip,
63 static int pcf8584_attach(dev_info_t *dip, ddi_attach_cmd_t cmd);
64 static int pcf8584_detach(dev_info_t *dip, ddi_detach_cmd_t cmd);
82 static int pcf8584_setup_regs(dev_info_t *dip, pcf8584_t *i2c);
84 static void pcf8584_reportdev(dev_info_t *dip, dev_info_t *rdip);
85 static int pcf8584_dip_to_addr(dev_info_t *dip);
88 int pcf8584_transfer(dev_info_t *dip, i2c_transfer_t *tp);
91 static void pcf8584_take_over(pcf8584_t *i2c, dev_info_t *dip,
277 pcf8584_dodetach(dev_info_t *dip)
280 int instance = ddi_get_instance(dip);
285 ddi_remove_intr(dip, 0, i2c->pcf8584_icookie);
298 i2c_nexus_unregister(dip);
301 (void) ddi_prop_remove(DDI_DEV_T_NONE, dip,
305 ddi_remove_minor_node(dip, NULL);
312 pcf8584_doattach(dev_info_t *dip)
315 int instance = ddi_get_instance(dip);
327 i2c->pcf8584_dip = dip;
330 "%s_%d", ddi_node_name(dip), instance);
347 if (ddi_prop_exists(DDI_DEV_T_ANY, dip,
350 (void) ddi_prop_create(DDI_DEV_T_NONE, dip,
359 if (pcf8584_setup_regs(dip, i2c) != DDI_SUCCESS) {
365 if (ddi_prop_exists(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS |
370 if (ddi_get_iblock_cookie(dip, 0,
377 if (ddi_add_intr(dip, 0, NULL, NULL, pcf8584_intr,
402 i2c_nexus_register(dip, &pcf8584_regvec);
405 if (ddi_create_minor_node(dip, "devctl", S_IFCHR, instance,
416 i2c->pcf8584_nexus_dip = dip;
421 pcf8584_dodetach(dip);
427 pcf8584_attach(dev_info_t *dip, ddi_attach_cmd_t cmd)
432 return (pcf8584_doattach(dip));
434 pcf8584_resume(dip);
444 pcf8584_detach(dev_info_t *dip, ddi_detach_cmd_t cmd)
448 pcf8584_dodetach(dip);
452 pcf8584_suspend(dip);
560 pcf8584_bus_ctl(dev_info_t *dip, dev_info_t *rdip, ddi_ctl_enum_t op,
572 pcf8584_reportdev(dip, rdip);
591 return (ddi_ctlops(dip, rdip, op, arg, result));
601 pcf8584_suspend(dev_info_t *dip)
606 instance = ddi_get_instance(dip);
618 pcf8584_resume(dev_info_t *dip)
623 instance = ddi_get_instance(dip);
637 pcf8584_acquire(pcf8584_t *i2c, dev_info_t *dip, i2c_transfer_t *tp,
643 i2c->pcf8584_cur_dip = dip;
662 * dip == NULL during CPR.
664 if ((&plat_shared_i2c_enter != NULL) && (dip != NULL)) {
670 i2c->pcf8584_cur_dip = dip;
1044 pcf8584_setup_regs(dev_info_t *dip, pcf8584_t *i2c)
1054 if (ddi_dev_nregs(dip, &nregs) != DDI_SUCCESS) {
1059 if (ddi_regs_map_setup(dip, 0,
1082 if (ddi_regs_map_setup(dip,
1110 pcf8584_reportdev(dev_info_t *dip, dev_info_t *rdip)
1118 ddi_driver_name(dip), ddi_get_instance(dip),
1123 * i2_nexus_dip_to_addr() takes a dip and returns an I2C address.
1126 pcf8584_dip_to_addr(dev_info_t *dip)
1130 ppvt = ddi_get_parent_data(dip);
1390 pcf8584_transfer(dev_info_t *dip, i2c_transfer_t *tp)
1398 ddi_get_instance(ddi_get_parent(dip)));
1411 pcf8584_take_over(i2c, dip, tp, &waiter, &saved_mode);
1414 pcf8584_acquire(i2c, dip, tp, B_FALSE);
1484 else if (&plat_shared_i2c_exit && dip)
1515 pcf8584_take_over(pcf8584_t *i2c, dev_info_t *dip, i2c_transfer_t *tp,
1539 pcf8584_acquire(i2c, dip, tp, B_TRUE);