Lines Matching +full:fsi +full:- +full:slave +full:- +full:engine

1 // SPDX-License-Identifier: GPL-2.0-only
3 * FSI hub master driver
9 #include <linux/fsi.h>
14 #include "fsi-master.h"
21 * FSI hub master support
24 * primary FSI master can access. For each link a primary master supports,
28 * The hub is controlled by a set of control registers exposed as a regular fsi
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).
33 * bus entirely through the fsi device address range, and so have a smaller
39 uint32_t addr, size; /* slave-relative addr of */
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()
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()
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()
136 /* Initialize the MFSI (hub master) engine */ 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",
298 MODULE_DESCRIPTION("FSI hub master driver");