1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Renesas RPC-IF core driver
5 * Copyright (C) 2018~2019 Renesas Solutions Corp.
6 * Copyright (C) 2019 Macronix International Co., Ltd.
7 * Copyright (C) 2019-2020 Cogent Embedded, Inc.
10 #ifndef __RENESAS_RPC_IF_H
11 #define __RENESAS_RPC_IF_H
13 #include <linux/pm_runtime.h>
14 #include <linux/types.h>
51 enum rpcif_data_dir dir;
69 struct regmap *regmap;
70 struct reset_control *rstc;
73 enum rpcif_data_dir dir;
80 u32 command; /* DRCMR or SMCMR */
81 u32 option; /* DROPR or SMOPR */
82 u32 enable; /* DRENR or SMENR */
83 u32 dummy; /* DRDMCR or SMDMCR */
84 u32 ddr; /* DRDRENR or SMDRENR */
87 int rpcif_sw_init(struct rpcif *rpc, struct device *dev);
88 int rpcif_hw_init(struct rpcif *rpc, bool hyperflash);
89 void rpcif_prepare(struct rpcif *rpc, const struct rpcif_op *op, u64 *offs,
91 int rpcif_manual_xfer(struct rpcif *rpc);
92 ssize_t rpcif_dirmap_read(struct rpcif *rpc, u64 offs, size_t len, void *buf);
94 static inline void rpcif_enable_rpm(struct rpcif *rpc)
96 pm_runtime_enable(rpc->dev);
99 static inline void rpcif_disable_rpm(struct rpcif *rpc)
101 pm_runtime_disable(rpc->dev);
104 #endif // __RENESAS_RPC_IF_H