Lines Matching refs:i3cdev
278 struct i3c_device *i3cdev = dev_to_i3cdev(dev); in i3c_device_uevent() local
282 i3c_device_get_info(i3cdev, &devinfo); in i3c_device_uevent()
303 struct i3c_device *i3cdev; in i3c_device_match() local
309 i3cdev = dev_to_i3cdev(dev); in i3c_device_match()
311 if (i3c_device_match_id(i3cdev, i3cdrv->id_table)) in i3c_device_match()
319 struct i3c_device *i3cdev = dev_to_i3cdev(dev); in i3c_device_probe() local
322 return driver->probe(i3cdev); in i3c_device_probe()
327 struct i3c_device *i3cdev = dev_to_i3cdev(dev); in i3c_device_remove() local
331 driver->remove(i3cdev); in i3c_device_remove()
333 i3c_device_free_ibi(i3cdev); in i3c_device_remove()
722 struct i3c_device *i3cdev = dev_to_i3cdev(dev); in i3c_device_release() local
724 WARN_ON(i3cdev->desc); in i3c_device_release()
726 of_node_put(i3cdev->dev.of_node); in i3c_device_release()
727 kfree(i3cdev); in i3c_device_release()
898 struct i3c_dev_desc *i3cdev; in i3c_master_defslvs_locked() local
909 i3c_bus_for_each_i3cdev(bus, i3cdev) { in i3c_master_defslvs_locked()
912 if (i3cdev == master->this) in i3c_master_defslvs_locked()
915 if (I3C_BCR_DEVICE_ROLE(i3cdev->info.bcr) == in i3c_master_defslvs_locked()
946 i3c_bus_for_each_i3cdev(bus, i3cdev) { in i3c_master_defslvs_locked()
948 if (i3cdev == master->this) in i3c_master_defslvs_locked()
951 desc->bcr = i3cdev->info.bcr; in i3c_master_defslvs_locked()
952 desc->dcr = i3cdev->info.dcr; in i3c_master_defslvs_locked()
953 desc->dyn_addr = i3cdev->info.dyn_addr << 1; in i3c_master_defslvs_locked()
954 desc->static_addr = i3cdev->info.static_addr << 1; in i3c_master_defslvs_locked()
1439 struct i3c_dev_desc *i3cdev; in i3c_master_early_i3c_dev_add() local
1442 i3cdev = i3c_master_alloc_i3c_dev(master, &info); in i3c_master_early_i3c_dev_add()
1443 if (IS_ERR(i3cdev)) in i3c_master_early_i3c_dev_add()
1446 i3cdev->boardinfo = boardinfo; in i3c_master_early_i3c_dev_add()
1448 ret = i3c_master_attach_i3c_dev(master, i3cdev); in i3c_master_early_i3c_dev_add()
1452 ret = i3c_master_setdasa_locked(master, i3cdev->info.static_addr, in i3c_master_early_i3c_dev_add()
1453 i3cdev->boardinfo->init_dyn_addr); in i3c_master_early_i3c_dev_add()
1457 i3cdev->info.dyn_addr = i3cdev->boardinfo->init_dyn_addr; in i3c_master_early_i3c_dev_add()
1458 ret = i3c_master_reattach_i3c_dev(i3cdev, 0); in i3c_master_early_i3c_dev_add()
1462 ret = i3c_master_retrieve_dev_info(i3cdev); in i3c_master_early_i3c_dev_add()
1469 i3c_master_rstdaa_locked(master, i3cdev->boardinfo->init_dyn_addr); in i3c_master_early_i3c_dev_add()
1471 i3c_master_detach_i3c_dev(i3cdev); in i3c_master_early_i3c_dev_add()
1473 i3c_master_free_i3c_dev(i3cdev); in i3c_master_early_i3c_dev_add()
1575 struct i3c_dev_desc *i3cdev; in i3c_master_set_info() local
1588 i3cdev = i3c_master_alloc_i3c_dev(master, info); in i3c_master_set_info()
1589 if (IS_ERR(i3cdev)) in i3c_master_set_info()
1590 return PTR_ERR(i3cdev); in i3c_master_set_info()
1592 master->this = i3cdev; in i3c_master_set_info()
1595 ret = i3c_master_attach_i3c_dev(master, i3cdev); in i3c_master_set_info()
1602 i3c_master_free_i3c_dev(i3cdev); in i3c_master_set_info()
1610 struct i3c_dev_desc *i3cdev, *i3ctmp; in i3c_master_detach_free_devs() local
1613 list_for_each_entry_safe(i3cdev, i3ctmp, &master->bus.devs.i3c, in i3c_master_detach_free_devs()
1615 i3c_master_detach_i3c_dev(i3cdev); in i3c_master_detach_free_devs()
1617 if (i3cdev->boardinfo && i3cdev->boardinfo->init_dyn_addr) in i3c_master_detach_free_devs()
1619 i3cdev->boardinfo->init_dyn_addr, in i3c_master_detach_free_devs()
1622 i3c_master_free_i3c_dev(i3cdev); in i3c_master_detach_free_devs()
1806 static void i3c_master_attach_boardinfo(struct i3c_dev_desc *i3cdev) in i3c_master_attach_boardinfo() argument
1808 struct i3c_master_controller *master = i3cdev->common.master; in i3c_master_attach_boardinfo()
1812 if (i3cdev->info.pid != i3cboardinfo->pid) in i3c_master_attach_boardinfo()
1815 i3cdev->boardinfo = i3cboardinfo; in i3c_master_attach_boardinfo()
1816 i3cdev->info.static_addr = i3cboardinfo->static_addr; in i3c_master_attach_boardinfo()
1825 struct i3c_dev_desc *i3cdev; in i3c_master_search_i3c_dev_duplicate() local
1827 i3c_bus_for_each_i3cdev(&master->bus, i3cdev) { in i3c_master_search_i3c_dev_duplicate()
1828 if (i3cdev != refdev && i3cdev->info.pid == refdev->info.pid) in i3c_master_search_i3c_dev_duplicate()
1829 return i3cdev; in i3c_master_search_i3c_dev_duplicate()
2333 struct i3c_dev_desc *i3cdev; in i3c_master_unregister_i3c_devs() local
2335 i3c_bus_for_each_i3cdev(&master->bus, i3cdev) { in i3c_master_unregister_i3c_devs()
2336 if (!i3cdev->dev) in i3c_master_unregister_i3c_devs()
2339 i3cdev->dev->desc = NULL; in i3c_master_unregister_i3c_devs()
2340 if (device_is_registered(&i3cdev->dev->dev)) in i3c_master_unregister_i3c_devs()
2341 device_unregister(&i3cdev->dev->dev); in i3c_master_unregister_i3c_devs()
2343 put_device(&i3cdev->dev->dev); in i3c_master_unregister_i3c_devs()
2344 i3cdev->dev = NULL; in i3c_master_unregister_i3c_devs()