@@ -75,6 +75,19 @@ static bool rpcif_spi_mem_supports_op(struct spi_mem *mem,
7575 return true;
7676}
7777
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+
7891static ssize_t rpcif_spi_mem_dirmap_read (struct spi_mem_dirmap_desc * desc ,
7992 u64 offs , size_t len , void * buf )
8093{
@@ -103,7 +116,7 @@ static int rpcif_spi_mem_dirmap_create(struct spi_mem_dirmap_desc *desc)
103116 if (!rpc -> dirmap )
104117 return - EOPNOTSUPP ;
105118
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 )
107120 return - EOPNOTSUPP ;
108121
109122 return 0 ;
@@ -125,6 +138,7 @@ static const struct spi_controller_mem_ops rpcif_spi_mem_ops = {
125138 .exec_op = rpcif_spi_mem_exec_op ,
126139 .dirmap_create = rpcif_spi_mem_dirmap_create ,
127140 .dirmap_read = rpcif_spi_mem_dirmap_read ,
141+ .dirmap_write = xspi_spi_mem_dirmap_write ,
128142};
129143
130144static int rpcif_spi_probe (struct platform_device * pdev )
0 commit comments