@@ -75,6 +75,19 @@ static bool rpcif_spi_mem_supports_op(struct spi_mem *mem,
75
75
return true;
76
76
}
77
77
78
+ static ssize_t xspi_spi_mem_dirmap_write (struct spi_mem_dirmap_desc * desc ,
79
+ u64 offs , size_t len , const void * buf )
80
+ {
81
+ struct rpcif * rpc = spi_controller_get_devdata (desc -> mem -> spi -> controller );
82
+
83
+ if (offs + desc -> info .offset + len > U32_MAX )
84
+ return - EINVAL ;
85
+
86
+ rpcif_spi_mem_prepare (desc -> mem -> spi , & desc -> info .op_tmpl , & offs , & len );
87
+
88
+ return xspi_dirmap_write (rpc -> dev , offs , len , buf );
89
+ }
90
+
78
91
static ssize_t rpcif_spi_mem_dirmap_read (struct spi_mem_dirmap_desc * desc ,
79
92
u64 offs , size_t len , void * buf )
80
93
{
@@ -103,7 +116,7 @@ static int rpcif_spi_mem_dirmap_create(struct spi_mem_dirmap_desc *desc)
103
116
if (!rpc -> dirmap )
104
117
return - EOPNOTSUPP ;
105
118
106
- if (desc -> info .op_tmpl .data .dir != SPI_MEM_DATA_IN )
119
+ if (! rpc -> xspi && desc -> info .op_tmpl .data .dir != SPI_MEM_DATA_IN )
107
120
return - EOPNOTSUPP ;
108
121
109
122
return 0 ;
@@ -125,6 +138,7 @@ static const struct spi_controller_mem_ops rpcif_spi_mem_ops = {
125
138
.exec_op = rpcif_spi_mem_exec_op ,
126
139
.dirmap_create = rpcif_spi_mem_dirmap_create ,
127
140
.dirmap_read = rpcif_spi_mem_dirmap_read ,
141
+ .dirmap_write = xspi_spi_mem_dirmap_write ,
128
142
};
129
143
130
144
static int rpcif_spi_probe (struct platform_device * pdev )
0 commit comments