Lines Matching refs:master

111 	struct i3c_master_controller *master;  in dev_to_i3cbus()  local
116 master = dev_to_i3cmaster(dev); in dev_to_i3cbus()
118 return &master->bus; in dev_to_i3cbus()
123 struct i3c_master_controller *master; in dev_to_i3cdesc() local
128 master = dev_to_i3cmaster(dev); in dev_to_i3cdesc()
130 return master->this; in dev_to_i3cdesc()
576 struct i3c_master_controller *master = dev_to_i3cmaster(dev); in i3c_masterdev_release() local
579 if (master->wq) in i3c_masterdev_release()
580 destroy_workqueue(master->wq); in i3c_masterdev_release()
595 struct i3c_master_controller *master = i3c_bus_to_i3c_master(i3cbus); in i3c_bus_set_mode() local
622 dev_dbg(&master->dev, "i2c-scl = %ld Hz i3c-scl = %ld Hz\n", in i3c_bus_set_mode()
643 i3c_master_to_i2c_adapter(struct i3c_master_controller *master) in i3c_master_to_i2c_adapter() argument
645 return &master->i2c; in i3c_master_to_i2c_adapter()
654 i3c_master_alloc_i2c_dev(struct i3c_master_controller *master, in i3c_master_alloc_i2c_dev() argument
663 dev->common.master = master; in i3c_master_alloc_i2c_dev()
699 static int i3c_master_send_ccc_cmd_locked(struct i3c_master_controller *master, in i3c_master_send_ccc_cmd_locked() argument
704 if (!cmd || !master) in i3c_master_send_ccc_cmd_locked()
707 if (WARN_ON(master->init_done && in i3c_master_send_ccc_cmd_locked()
708 !rwsem_is_locked(&master->bus.lock))) in i3c_master_send_ccc_cmd_locked()
711 if (!master->ops->send_ccc_cmd) in i3c_master_send_ccc_cmd_locked()
717 if (master->ops->supports_ccc_cmd && in i3c_master_send_ccc_cmd_locked()
718 !master->ops->supports_ccc_cmd(master, cmd)) in i3c_master_send_ccc_cmd_locked()
721 ret = master->ops->send_ccc_cmd(master, cmd); in i3c_master_send_ccc_cmd_locked()
733 i3c_master_find_i2c_dev_by_addr(const struct i3c_master_controller *master, in i3c_master_find_i2c_dev_by_addr() argument
738 i3c_bus_for_each_i2cdev(&master->bus, dev) { in i3c_master_find_i2c_dev_by_addr()
756 int i3c_master_get_free_addr(struct i3c_master_controller *master, in i3c_master_get_free_addr() argument
759 return i3c_bus_get_free_addr(&master->bus, start_addr); in i3c_master_get_free_addr()
779 i3c_master_alloc_i3c_dev(struct i3c_master_controller *master, in i3c_master_alloc_i3c_dev() argument
788 dev->common.master = master; in i3c_master_alloc_i3c_dev()
795 static int i3c_master_rstdaa_locked(struct i3c_master_controller *master, in i3c_master_rstdaa_locked() argument
803 if (!master) in i3c_master_rstdaa_locked()
806 addrstat = i3c_bus_get_addr_slot_status(&master->bus, addr); in i3c_master_rstdaa_locked()
814 ret = i3c_master_send_ccc_cmd_locked(master, &cmd); in i3c_master_rstdaa_locked()
836 int i3c_master_entdaa_locked(struct i3c_master_controller *master) in i3c_master_entdaa_locked() argument
844 ret = i3c_master_send_ccc_cmd_locked(master, &cmd); in i3c_master_entdaa_locked()
851 static int i3c_master_enec_disec_locked(struct i3c_master_controller *master, in i3c_master_enec_disec_locked() argument
869 ret = i3c_master_send_ccc_cmd_locked(master, &cmd); in i3c_master_enec_disec_locked()
889 int i3c_master_disec_locked(struct i3c_master_controller *master, u8 addr, in i3c_master_disec_locked() argument
892 return i3c_master_enec_disec_locked(master, addr, false, evts); in i3c_master_disec_locked()
910 int i3c_master_enec_locked(struct i3c_master_controller *master, u8 addr, in i3c_master_enec_locked() argument
913 return i3c_master_enec_disec_locked(master, addr, true, evts); in i3c_master_enec_locked()
936 int i3c_master_defslvs_locked(struct i3c_master_controller *master) in i3c_master_defslvs_locked() argument
948 if (!master) in i3c_master_defslvs_locked()
951 bus = i3c_master_get_bus(master); in i3c_master_defslvs_locked()
955 if (i3cdev == master->this) in i3c_master_defslvs_locked()
977 defslvs->master.bcr = master->this->info.bcr; in i3c_master_defslvs_locked()
978 defslvs->master.dcr = master->this->info.dcr; in i3c_master_defslvs_locked()
979 defslvs->master.dyn_addr = master->this->info.dyn_addr << 1; in i3c_master_defslvs_locked()
980 defslvs->master.static_addr = I3C_BROADCAST_ADDR << 1; in i3c_master_defslvs_locked()
991 if (i3cdev == master->this) in i3c_master_defslvs_locked()
1002 ret = i3c_master_send_ccc_cmd_locked(master, &cmd); in i3c_master_defslvs_locked()
1009 static int i3c_master_setda_locked(struct i3c_master_controller *master, in i3c_master_setda_locked() argument
1028 ret = i3c_master_send_ccc_cmd_locked(master, &cmd); in i3c_master_setda_locked()
1034 static int i3c_master_setdasa_locked(struct i3c_master_controller *master, in i3c_master_setdasa_locked() argument
1037 return i3c_master_setda_locked(master, static_addr, dyn_addr, true); in i3c_master_setdasa_locked()
1040 static int i3c_master_setnewda_locked(struct i3c_master_controller *master, in i3c_master_setnewda_locked() argument
1043 return i3c_master_setda_locked(master, oldaddr, newaddr, false); in i3c_master_setnewda_locked()
1046 static int i3c_master_getmrl_locked(struct i3c_master_controller *master, in i3c_master_getmrl_locked() argument
1066 ret = i3c_master_send_ccc_cmd_locked(master, &cmd); in i3c_master_getmrl_locked()
1088 static int i3c_master_getmwl_locked(struct i3c_master_controller *master, in i3c_master_getmwl_locked() argument
1101 ret = i3c_master_send_ccc_cmd_locked(master, &cmd); in i3c_master_getmwl_locked()
1118 static int i3c_master_getmxds_locked(struct i3c_master_controller *master, in i3c_master_getmxds_locked() argument
1132 ret = i3c_master_send_ccc_cmd_locked(master, &cmd); in i3c_master_getmxds_locked()
1154 static int i3c_master_gethdrcap_locked(struct i3c_master_controller *master, in i3c_master_gethdrcap_locked() argument
1168 ret = i3c_master_send_ccc_cmd_locked(master, &cmd); in i3c_master_gethdrcap_locked()
1185 static int i3c_master_getpid_locked(struct i3c_master_controller *master, in i3c_master_getpid_locked() argument
1198 ret = i3c_master_send_ccc_cmd_locked(master, &cmd); in i3c_master_getpid_locked()
1215 static int i3c_master_getbcr_locked(struct i3c_master_controller *master, in i3c_master_getbcr_locked() argument
1228 ret = i3c_master_send_ccc_cmd_locked(master, &cmd); in i3c_master_getbcr_locked()
1240 static int i3c_master_getdcr_locked(struct i3c_master_controller *master, in i3c_master_getdcr_locked() argument
1253 ret = i3c_master_send_ccc_cmd_locked(master, &cmd); in i3c_master_getdcr_locked()
1267 struct i3c_master_controller *master = i3c_dev_get_master(dev); in i3c_master_retrieve_dev_info() local
1274 slot_status = i3c_bus_get_addr_slot_status(&master->bus, in i3c_master_retrieve_dev_info()
1280 ret = i3c_master_getpid_locked(master, &dev->info); in i3c_master_retrieve_dev_info()
1284 ret = i3c_master_getbcr_locked(master, &dev->info); in i3c_master_retrieve_dev_info()
1288 ret = i3c_master_getdcr_locked(master, &dev->info); in i3c_master_retrieve_dev_info()
1293 ret = i3c_master_getmxds_locked(master, &dev->info); in i3c_master_retrieve_dev_info()
1301 i3c_master_getmrl_locked(master, &dev->info); in i3c_master_retrieve_dev_info()
1302 i3c_master_getmwl_locked(master, &dev->info); in i3c_master_retrieve_dev_info()
1305 ret = i3c_master_gethdrcap_locked(master, &dev->info); in i3c_master_retrieve_dev_info()
1315 struct i3c_master_controller *master = i3c_dev_get_master(dev); in i3c_master_put_i3c_addrs() local
1318 i3c_bus_set_addr_slot_status(&master->bus, in i3c_master_put_i3c_addrs()
1323 i3c_bus_set_addr_slot_status(&master->bus, dev->info.dyn_addr, in i3c_master_put_i3c_addrs()
1327 i3c_bus_set_addr_slot_status(&master->bus, dev->info.dyn_addr, in i3c_master_put_i3c_addrs()
1333 struct i3c_master_controller *master = i3c_dev_get_master(dev); in i3c_master_get_i3c_addrs() local
1340 status = i3c_bus_get_addr_slot_status(&master->bus, in i3c_master_get_i3c_addrs()
1349 i3c_bus_set_addr_slot_status(&master->bus, in i3c_master_get_i3c_addrs()
1362 status = i3c_bus_get_addr_slot_status(&master->bus, in i3c_master_get_i3c_addrs()
1367 i3c_bus_set_addr_slot_status(&master->bus, dev->info.dyn_addr, in i3c_master_get_i3c_addrs()
1375 i3c_bus_set_addr_slot_status(&master->bus, in i3c_master_get_i3c_addrs()
1382 static int i3c_master_attach_i3c_dev(struct i3c_master_controller *master, in i3c_master_attach_i3c_dev() argument
1399 if (master->this != dev && master->ops->attach_i3c_dev) { in i3c_master_attach_i3c_dev()
1400 ret = master->ops->attach_i3c_dev(dev); in i3c_master_attach_i3c_dev()
1407 list_add_tail(&dev->common.node, &master->bus.devs.i3c); in i3c_master_attach_i3c_dev()
1415 struct i3c_master_controller *master = i3c_dev_get_master(dev); in i3c_master_reattach_i3c_dev() local
1422 status = i3c_bus_get_addr_slot_status(&master->bus, in i3c_master_reattach_i3c_dev()
1426 i3c_bus_set_addr_slot_status(&master->bus, in i3c_master_reattach_i3c_dev()
1430 i3c_bus_set_addr_slot_status(&master->bus, old_dyn_addr, in i3c_master_reattach_i3c_dev()
1434 if (master->ops->reattach_i3c_dev) { in i3c_master_reattach_i3c_dev()
1435 ret = master->ops->reattach_i3c_dev(dev, old_dyn_addr); in i3c_master_reattach_i3c_dev()
1447 struct i3c_master_controller *master = i3c_dev_get_master(dev); in i3c_master_detach_i3c_dev() local
1450 if (master->this != dev && master->ops->detach_i3c_dev) in i3c_master_detach_i3c_dev()
1451 master->ops->detach_i3c_dev(dev); in i3c_master_detach_i3c_dev()
1457 static int i3c_master_attach_i2c_dev(struct i3c_master_controller *master, in i3c_master_attach_i2c_dev() argument
1462 if (master->ops->attach_i2c_dev) { in i3c_master_attach_i2c_dev()
1463 ret = master->ops->attach_i2c_dev(dev); in i3c_master_attach_i2c_dev()
1468 list_add_tail(&dev->common.node, &master->bus.devs.i2c); in i3c_master_attach_i2c_dev()
1475 struct i3c_master_controller *master = i2c_dev_get_master(dev); in i3c_master_detach_i2c_dev() local
1479 if (master->ops->detach_i2c_dev) in i3c_master_detach_i2c_dev()
1480 master->ops->detach_i2c_dev(dev); in i3c_master_detach_i2c_dev()
1483 static int i3c_master_early_i3c_dev_add(struct i3c_master_controller *master, in i3c_master_early_i3c_dev_add() argument
1493 i3cdev = i3c_master_alloc_i3c_dev(master, &info); in i3c_master_early_i3c_dev_add()
1499 ret = i3c_master_attach_i3c_dev(master, i3cdev); in i3c_master_early_i3c_dev_add()
1503 ret = i3c_master_setdasa_locked(master, i3cdev->info.static_addr, in i3c_master_early_i3c_dev_add()
1520 i3c_master_rstdaa_locked(master, i3cdev->boardinfo->init_dyn_addr); in i3c_master_early_i3c_dev_add()
1530 i3c_master_register_new_i3c_devs(struct i3c_master_controller *master) in i3c_master_register_new_i3c_devs() argument
1535 if (!master->init_done) in i3c_master_register_new_i3c_devs()
1538 i3c_bus_for_each_i3cdev(&master->bus, desc) { in i3c_master_register_new_i3c_devs()
1539 if (desc->dev || !desc->info.dyn_addr || desc == master->this) in i3c_master_register_new_i3c_devs()
1546 desc->dev->bus = &master->bus; in i3c_master_register_new_i3c_devs()
1548 desc->dev->dev.parent = &master->dev; in i3c_master_register_new_i3c_devs()
1552 dev_set_name(&desc->dev->dev, "%d-%llx", master->bus.id, in i3c_master_register_new_i3c_devs()
1560 dev_err(&master->dev, in i3c_master_register_new_i3c_devs()
1582 int i3c_master_do_daa(struct i3c_master_controller *master) in i3c_master_do_daa() argument
1586 i3c_bus_maintenance_lock(&master->bus); in i3c_master_do_daa()
1587 ret = master->ops->do_daa(master); in i3c_master_do_daa()
1588 i3c_bus_maintenance_unlock(&master->bus); in i3c_master_do_daa()
1593 i3c_bus_normaluse_lock(&master->bus); in i3c_master_do_daa()
1594 i3c_master_register_new_i3c_devs(master); in i3c_master_do_daa()
1595 i3c_bus_normaluse_unlock(&master->bus); in i3c_master_do_daa()
1625 int i3c_master_set_info(struct i3c_master_controller *master, in i3c_master_set_info() argument
1631 if (!i3c_bus_dev_addr_is_avail(&master->bus, info->dyn_addr)) in i3c_master_set_info()
1635 master->secondary) in i3c_master_set_info()
1638 if (master->this) in i3c_master_set_info()
1641 i3cdev = i3c_master_alloc_i3c_dev(master, info); in i3c_master_set_info()
1645 master->this = i3cdev; in i3c_master_set_info()
1646 master->bus.cur_master = master->this; in i3c_master_set_info()
1648 ret = i3c_master_attach_i3c_dev(master, i3cdev); in i3c_master_set_info()
1661 static void i3c_master_detach_free_devs(struct i3c_master_controller *master) in i3c_master_detach_free_devs() argument
1666 list_for_each_entry_safe(i3cdev, i3ctmp, &master->bus.devs.i3c, in i3c_master_detach_free_devs()
1671 i3c_bus_set_addr_slot_status(&master->bus, in i3c_master_detach_free_devs()
1678 list_for_each_entry_safe(i2cdev, i2ctmp, &master->bus.devs.i2c, in i3c_master_detach_free_devs()
1681 i3c_bus_set_addr_slot_status(&master->bus, in i3c_master_detach_free_devs()
1720 static int i3c_master_bus_init(struct i3c_master_controller *master) in i3c_master_bus_init() argument
1732 list_for_each_entry(i2cboardinfo, &master->boardinfo.i2c, node) { in i3c_master_bus_init()
1733 status = i3c_bus_get_addr_slot_status(&master->bus, in i3c_master_bus_init()
1740 i3c_bus_set_addr_slot_status(&master->bus, in i3c_master_bus_init()
1744 i2cdev = i3c_master_alloc_i2c_dev(master, in i3c_master_bus_init()
1752 ret = i3c_master_attach_i2c_dev(master, i2cdev); in i3c_master_bus_init()
1763 ret = master->ops->bus_init(master); in i3c_master_bus_init()
1771 if (!master->this) { in i3c_master_bus_init()
1772 dev_err(&master->dev, in i3c_master_bus_init()
1782 ret = i3c_master_rstdaa_locked(master, I3C_BROADCAST_ADDR); in i3c_master_bus_init()
1787 ret = i3c_master_disec_locked(master, I3C_BROADCAST_ADDR, in i3c_master_bus_init()
1800 list_for_each_entry(i3cboardinfo, &master->boardinfo.i3c, node) { in i3c_master_bus_init()
1809 ret = i3c_bus_get_addr_slot_status(&master->bus, in i3c_master_bus_init()
1816 i3c_bus_set_addr_slot_status(&master->bus, in i3c_master_bus_init()
1829 i3c_master_early_i3c_dev_add(master, i3cboardinfo); in i3c_master_bus_init()
1832 ret = i3c_master_do_daa(master); in i3c_master_bus_init()
1839 i3c_master_rstdaa_locked(master, I3C_BROADCAST_ADDR); in i3c_master_bus_init()
1842 if (master->ops->bus_cleanup) in i3c_master_bus_init()
1843 master->ops->bus_cleanup(master); in i3c_master_bus_init()
1846 i3c_master_detach_free_devs(master); in i3c_master_bus_init()
1851 static void i3c_master_bus_cleanup(struct i3c_master_controller *master) in i3c_master_bus_cleanup() argument
1853 if (master->ops->bus_cleanup) in i3c_master_bus_cleanup()
1854 master->ops->bus_cleanup(master); in i3c_master_bus_cleanup()
1856 i3c_master_detach_free_devs(master); in i3c_master_bus_cleanup()
1861 struct i3c_master_controller *master = i3cdev->common.master; in i3c_master_attach_boardinfo() local
1864 list_for_each_entry(i3cboardinfo, &master->boardinfo.i3c, node) { in i3c_master_attach_boardinfo()
1877 struct i3c_master_controller *master = i3c_dev_get_master(refdev); in i3c_master_search_i3c_dev_duplicate() local
1880 i3c_bus_for_each_i3cdev(&master->bus, i3cdev) { in i3c_master_search_i3c_dev_duplicate()
1904 int i3c_master_add_i3c_dev_locked(struct i3c_master_controller *master, in i3c_master_add_i3c_dev_locked() argument
1914 if (!master) in i3c_master_add_i3c_dev_locked()
1917 newdev = i3c_master_alloc_i3c_dev(master, &info); in i3c_master_add_i3c_dev_locked()
1921 ret = i3c_master_attach_i3c_dev(master, newdev); in i3c_master_add_i3c_dev_locked()
1986 ret = i3c_master_setnewda_locked(master, in i3c_master_add_i3c_dev_locked()
1994 dev_err(&master->dev, in i3c_master_add_i3c_dev_locked()
1996 master->bus.id, newdev->info.pid); in i3c_master_add_i3c_dev_locked()
2011 dev_err(&master->dev, in i3c_master_add_i3c_dev_locked()
2013 master->bus.id, newdev->info.pid); in i3c_master_add_i3c_dev_locked()
2017 dev_err(&master->dev, in i3c_master_add_i3c_dev_locked()
2019 master->bus.id, newdev->info.pid); in i3c_master_add_i3c_dev_locked()
2042 of_i3c_master_add_i2c_boardinfo(struct i3c_master_controller *master, in of_i3c_master_add_i2c_boardinfo() argument
2046 struct device *dev = &master->dev; in of_i3c_master_add_i2c_boardinfo()
2070 list_add_tail(&boardinfo->node, &master->boardinfo.i2c); in of_i3c_master_add_i2c_boardinfo()
2077 of_i3c_master_add_i3c_boardinfo(struct i3c_master_controller *master, in of_i3c_master_add_i3c_boardinfo() argument
2081 struct device *dev = &master->dev; in of_i3c_master_add_i3c_boardinfo()
2093 addrstatus = i3c_bus_get_addr_slot_status(&master->bus, in of_i3c_master_add_i3c_boardinfo()
2105 addrstatus = i3c_bus_get_addr_slot_status(&master->bus, in of_i3c_master_add_i3c_boardinfo()
2119 list_add_tail(&boardinfo->node, &master->boardinfo.i3c); in of_i3c_master_add_i3c_boardinfo()
2124 static int of_i3c_master_add_dev(struct i3c_master_controller *master, in of_i3c_master_add_dev() argument
2130 if (!master || !node) in of_i3c_master_add_dev()
2142 ret = of_i3c_master_add_i2c_boardinfo(master, node, reg); in of_i3c_master_add_dev()
2144 ret = of_i3c_master_add_i3c_boardinfo(master, node, reg); in of_i3c_master_add_dev()
2149 static int of_populate_i3c_bus(struct i3c_master_controller *master) in of_populate_i3c_bus() argument
2151 struct device *dev = &master->dev; in of_populate_i3c_bus()
2161 ret = of_i3c_master_add_dev(master, node); in of_populate_i3c_bus()
2174 master->bus.scl_rate.i2c = val; in of_populate_i3c_bus()
2177 master->bus.scl_rate.i3c = val; in of_populate_i3c_bus()
2185 struct i3c_master_controller *master = i2c_adapter_to_i3c_master(adap); in i3c_master_i2c_adapter_xfer() local
2190 if (!xfers || !master || nxfers <= 0) in i3c_master_i2c_adapter_xfer()
2193 if (!master->ops->i2c_xfers) in i3c_master_i2c_adapter_xfer()
2203 i3c_bus_normaluse_lock(&master->bus); in i3c_master_i2c_adapter_xfer()
2204 dev = i3c_master_find_i2c_dev_by_addr(master, addr); in i3c_master_i2c_adapter_xfer()
2208 ret = master->ops->i2c_xfers(dev, xfers, nxfers); in i3c_master_i2c_adapter_xfer()
2209 i3c_bus_normaluse_unlock(&master->bus); in i3c_master_i2c_adapter_xfer()
2237 struct i3c_master_controller *master = i2c_adapter_to_i3c_master(adap); in i3c_master_i2c_attach() local
2243 if (i3c_master_find_i2c_dev_by_addr(master, client->addr)) in i3c_master_i2c_attach()
2246 status = i3c_bus_get_addr_slot_status(&master->bus, client->addr); in i3c_master_i2c_attach()
2250 i3c_bus_set_addr_slot_status(&master->bus, client->addr, in i3c_master_i2c_attach()
2253 i2cdev = i3c_master_alloc_i2c_dev(master, client->addr, in i3c_master_i2c_attach()
2260 ret = i3c_master_attach_i2c_dev(master, i2cdev); in i3c_master_i2c_attach()
2269 i3c_bus_set_addr_slot_status(&master->bus, client->addr, in i3c_master_i2c_attach()
2277 struct i3c_master_controller *master = i2c_adapter_to_i3c_master(adap); in i3c_master_i2c_detach() local
2280 dev = i3c_master_find_i2c_dev_by_addr(master, client->addr); in i3c_master_i2c_detach()
2285 i3c_bus_set_addr_slot_status(&master->bus, dev->addr, in i3c_master_i2c_detach()
2303 struct i3c_master_controller *master; in i3c_i2c_notifier_call() local
2315 master = i2c_adapter_to_i3c_master(adap); in i3c_i2c_notifier_call()
2317 i3c_bus_maintenance_lock(&master->bus); in i3c_i2c_notifier_call()
2326 i3c_bus_maintenance_unlock(&master->bus); in i3c_i2c_notifier_call()
2335 static int i3c_master_i2c_adapter_init(struct i3c_master_controller *master) in i3c_master_i2c_adapter_init() argument
2337 struct i2c_adapter *adap = i3c_master_to_i2c_adapter(master); in i3c_master_i2c_adapter_init()
2342 adap->dev.parent = master->dev.parent; in i3c_master_i2c_adapter_init()
2343 adap->owner = master->dev.parent->driver->owner; in i3c_master_i2c_adapter_init()
2345 strncpy(adap->name, dev_name(master->dev.parent), sizeof(adap->name)); in i3c_master_i2c_adapter_init()
2359 list_for_each_entry(i2cboardinfo, &master->boardinfo.i2c, node) { in i3c_master_i2c_adapter_init()
2360 i2cdev = i3c_master_find_i2c_dev_by_addr(master, in i3c_master_i2c_adapter_init()
2370 static void i3c_master_i2c_adapter_cleanup(struct i3c_master_controller *master) in i3c_master_i2c_adapter_cleanup() argument
2374 i2c_del_adapter(&master->i2c); in i3c_master_i2c_adapter_cleanup()
2376 i3c_bus_for_each_i2cdev(&master->bus, i2cdev) in i3c_master_i2c_adapter_cleanup()
2380 static void i3c_master_unregister_i3c_devs(struct i3c_master_controller *master) in i3c_master_unregister_i3c_devs() argument
2384 i3c_bus_for_each_i3cdev(&master->bus, i3cdev) { in i3c_master_unregister_i3c_devs()
2408 queue_work(dev->common.master->wq, &slot->work); in i3c_master_queue_ibi()
2417 struct i3c_master_controller *master = i3c_dev_get_master(dev); in i3c_master_handle_ibi() local
2426 master->ops->recycle_ibi_slot(dev, slot); in i3c_master_handle_ibi()
2629 int i3c_master_register(struct i3c_master_controller *master, in i3c_master_register() argument
2635 struct i3c_bus *i3cbus = i3c_master_get_bus(master); in i3c_master_register()
2648 master->dev.parent = parent; in i3c_master_register()
2649 master->dev.of_node = of_node_get(parent->of_node); in i3c_master_register()
2650 master->dev.bus = &i3c_bus_type; in i3c_master_register()
2651 master->dev.type = &i3c_masterdev_type; in i3c_master_register()
2652 master->dev.release = i3c_masterdev_release; in i3c_master_register()
2653 master->ops = ops; in i3c_master_register()
2654 master->secondary = secondary; in i3c_master_register()
2655 INIT_LIST_HEAD(&master->boardinfo.i2c); in i3c_master_register()
2656 INIT_LIST_HEAD(&master->boardinfo.i3c); in i3c_master_register()
2658 ret = i3c_bus_init(i3cbus, master->dev.of_node); in i3c_master_register()
2662 device_initialize(&master->dev); in i3c_master_register()
2663 dev_set_name(&master->dev, "i3c-%d", i3cbus->id); in i3c_master_register()
2665 ret = of_populate_i3c_bus(master); in i3c_master_register()
2669 list_for_each_entry(i2cbi, &master->boardinfo.i2c, node) { in i3c_master_register()
2696 master->wq = alloc_workqueue("%s", 0, 0, dev_name(parent)); in i3c_master_register()
2697 if (!master->wq) { in i3c_master_register()
2702 ret = i3c_master_bus_init(master); in i3c_master_register()
2706 ret = device_add(&master->dev); in i3c_master_register()
2714 ret = i3c_master_i2c_adapter_init(master); in i3c_master_register()
2724 master->init_done = true; in i3c_master_register()
2725 i3c_bus_normaluse_lock(&master->bus); in i3c_master_register()
2726 i3c_master_register_new_i3c_devs(master); in i3c_master_register()
2727 i3c_bus_normaluse_unlock(&master->bus); in i3c_master_register()
2732 device_del(&master->dev); in i3c_master_register()
2735 i3c_master_bus_cleanup(master); in i3c_master_register()
2738 put_device(&master->dev); in i3c_master_register()
2750 void i3c_master_unregister(struct i3c_master_controller *master) in i3c_master_unregister() argument
2752 i3c_bus_notify(&master->bus, I3C_NOTIFY_BUS_REMOVE); in i3c_master_unregister()
2754 i3c_master_i2c_adapter_cleanup(master); in i3c_master_unregister()
2755 i3c_master_unregister_i3c_devs(master); in i3c_master_unregister()
2756 i3c_master_bus_cleanup(master); in i3c_master_unregister()
2757 device_unregister(&master->dev); in i3c_master_unregister()
2763 struct i3c_master_controller *master; in i3c_dev_setdasa_locked() local
2768 master = i3c_dev_get_master(dev); in i3c_dev_setdasa_locked()
2769 if (!master) in i3c_dev_setdasa_locked()
2776 return i3c_master_setdasa_locked(master, dev->info.static_addr, in i3c_dev_setdasa_locked()
2784 struct i3c_master_controller *master; in i3c_dev_do_priv_xfers_locked() local
2789 master = i3c_dev_get_master(dev); in i3c_dev_do_priv_xfers_locked()
2790 if (!master || !xfers) in i3c_dev_do_priv_xfers_locked()
2793 if (!master->ops->priv_xfers) in i3c_dev_do_priv_xfers_locked()
2796 return master->ops->priv_xfers(dev, xfers, nxfers); in i3c_dev_do_priv_xfers_locked()
2801 struct i3c_master_controller *master; in i3c_dev_disable_ibi_locked() local
2807 master = i3c_dev_get_master(dev); in i3c_dev_disable_ibi_locked()
2808 ret = master->ops->disable_ibi(dev); in i3c_dev_disable_ibi_locked()
2823 struct i3c_master_controller *master = i3c_dev_get_master(dev); in i3c_dev_enable_ibi_locked() local
2829 ret = master->ops->enable_ibi(dev); in i3c_dev_enable_ibi_locked()
2839 struct i3c_master_controller *master = i3c_dev_get_master(dev); in i3c_dev_request_ibi_locked() local
2843 if (!master->ops->request_ibi) in i3c_dev_request_ibi_locked()
2860 ret = master->ops->request_ibi(dev, req); in i3c_dev_request_ibi_locked()
2871 struct i3c_master_controller *master = i3c_dev_get_master(dev); in i3c_dev_free_ibi_locked() local
2879 master->ops->free_ibi(dev); in i3c_dev_free_ibi_locked()