Lines Matching +full:slave +full:- +full:addr

1 // SPDX-License-Identifier: GPL-2.0-only
14 #include "fsi-master.h"
29 * device (the hub->upstream device), and provides access to the downstream FSI
30 * bus as through an address range on the slave itself (->addr and ->size).
39 uint32_t addr, size; /* slave-relative addr of */ member
46 uint8_t id, uint32_t addr, void *val, size_t size) in hub_master_read() argument
51 return -EINVAL; in hub_master_read()
53 addr += hub->addr + (link * FSI_HUB_LINK_SIZE); in hub_master_read()
54 return fsi_slave_read(hub->upstream->slave, addr, val, size); in hub_master_read()
58 uint8_t id, uint32_t addr, const void *val, size_t size) in hub_master_write() argument
63 return -EINVAL; in hub_master_write()
65 addr += hub->addr + (link * FSI_HUB_LINK_SIZE); in hub_master_write()
66 return fsi_slave_write(hub->upstream->slave, addr, val, size); in hub_master_write()
71 uint32_t addr; in hub_master_break() local
74 addr = 0x4; in hub_master_break()
77 return hub_master_write(master, link, 0, addr, &cmd, sizeof(cmd)); in hub_master_break()
94 return fsi_device_write(hub->upstream, FSI_MCENP0 + (4 * idx), in hub_master_link_enable()
97 rc = fsi_device_write(hub->upstream, FSI_MSENP0 + (4 * idx), &reg, 4); in hub_master_link_enable()
126 struct fsi_device *dev = hub->upstream; in hub_master_init()
211 rc = fsi_slave_claim_range(fsi_dev->slave, FSI_HUB_LINK_OFFSET, in hub_master_probe()
214 dev_err(dev, "can't claim slave address range for links"); in hub_master_probe()
220 rc = -ENOMEM; in hub_master_probe()
224 hub->addr = FSI_HUB_LINK_OFFSET; in hub_master_probe()
225 hub->size = FSI_HUB_LINK_SIZE * links; in hub_master_probe()
226 hub->upstream = fsi_dev; in hub_master_probe()
228 hub->master.dev.parent = dev; in hub_master_probe()
229 hub->master.dev.release = hub_master_release; in hub_master_probe()
230 hub->master.dev.of_node = of_node_get(dev_of_node(dev)); in hub_master_probe()
232 hub->master.n_links = links; in hub_master_probe()
233 hub->master.read = hub_master_read; in hub_master_probe()
234 hub->master.write = hub_master_write; in hub_master_probe()
235 hub->master.send_break = hub_master_break; in hub_master_probe()
236 hub->master.link_enable = hub_master_link_enable; in hub_master_probe()
242 rc = fsi_master_register(&hub->master); in hub_master_probe()
248 * will be freed (via ->release) during any subsequent call to in hub_master_probe()
253 get_device(&hub->master.dev); in hub_master_probe()
257 fsi_slave_release_range(fsi_dev->slave, FSI_HUB_LINK_OFFSET, in hub_master_probe()
266 fsi_master_unregister(&hub->master); in hub_master_remove()
267 fsi_slave_release_range(hub->upstream->slave, hub->addr, hub->size); in hub_master_remove()
268 of_node_put(hub->master.dev.of_node); in hub_master_remove()
271 * master.dev will likely be ->release()ed after this, which free()s in hub_master_remove()
274 put_device(&hub->master.dev); in hub_master_remove()
290 .name = "fsi-master-hub",