Lines Matching +full:rpc +full:- +full:if

1 // SPDX-License-Identifier: GPL-2.0
3 * Linux driver for RPC-IF HyperFlash
5 * Copyright (C) 2019-2020 Cogent Embedded, Inc.
18 #include <memory/renesas-rpc-if.h>
21 struct rpcif rpc; member
46 static void rpcif_hb_prepare_read(struct rpcif *rpc, void *to, in rpcif_hb_prepare_read() argument
59 rpcif_prepare(rpc->dev, &op, NULL, NULL); in rpcif_hb_prepare_read()
62 static void rpcif_hb_prepare_write(struct rpcif *rpc, unsigned long to, in rpcif_hb_prepare_write() argument
73 rpcif_prepare(rpc->dev, &op, NULL, NULL); in rpcif_hb_prepare_write()
82 rpcif_hb_prepare_read(&hyperbus->rpc, &data, addr, 2); in rpcif_hb_read16()
84 rpcif_manual_xfer(hyperbus->rpc.dev); in rpcif_hb_read16()
95 rpcif_hb_prepare_write(&hyperbus->rpc, addr, &data, 2); in rpcif_hb_write16()
97 rpcif_manual_xfer(hyperbus->rpc.dev); in rpcif_hb_write16()
106 rpcif_hb_prepare_read(&hyperbus->rpc, to, from, len); in rpcif_hb_copy_from()
108 rpcif_dirmap_read(hyperbus->rpc.dev, from, len, to); in rpcif_hb_copy_from()
119 struct device *dev = &pdev->dev; in rpcif_hb_probe()
124 if (!hyperbus) in rpcif_hb_probe()
125 return -ENOMEM; in rpcif_hb_probe()
127 error = rpcif_sw_init(&hyperbus->rpc, pdev->dev.parent); in rpcif_hb_probe()
128 if (error) in rpcif_hb_probe()
133 pm_runtime_enable(hyperbus->rpc.dev); in rpcif_hb_probe()
135 error = rpcif_hw_init(hyperbus->rpc.dev, true); in rpcif_hb_probe()
136 if (error) in rpcif_hb_probe()
139 hyperbus->hbdev.map.size = hyperbus->rpc.size; in rpcif_hb_probe()
140 hyperbus->hbdev.map.virt = hyperbus->rpc.dirmap; in rpcif_hb_probe()
142 hyperbus->ctlr.dev = dev; in rpcif_hb_probe()
143 hyperbus->ctlr.ops = &rpcif_hb_ops; in rpcif_hb_probe()
144 hyperbus->hbdev.ctlr = &hyperbus->ctlr; in rpcif_hb_probe()
145 hyperbus->hbdev.np = of_get_next_child(pdev->dev.parent->of_node, NULL); in rpcif_hb_probe()
146 error = hyperbus_register_device(&hyperbus->hbdev); in rpcif_hb_probe()
147 if (error) in rpcif_hb_probe()
153 pm_runtime_disable(hyperbus->rpc.dev); in rpcif_hb_probe()
161 hyperbus_unregister_device(&hyperbus->hbdev); in rpcif_hb_remove()
163 pm_runtime_disable(hyperbus->rpc.dev); in rpcif_hb_remove()
170 .name = "rpc-if-hyperflash",
176 MODULE_DESCRIPTION("Renesas RPC-IF HyperFlash driver");