package: add fitblk util to release /dev/fit* devices
[openwrt/staging/jow.git] / target / linux / mediatek / patches-5.15 / 433-drivers-spi-mem-Add-spi-calibration-hook.patch
1 From 06640a5da2973318c06e516da16a5b579622e7c5 Mon Sep 17 00:00:00 2001
2 From: "SkyLake.Huang" <skylake.huang@mediatek.com>
3 Date: Thu, 23 Jun 2022 18:37:55 +0800
4 Subject: [PATCH 3/6] drivers: spi-mem: Add spi calibration hook
5
6 Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
7 ---
8 drivers/spi/spi-mem.c | 8 ++++++++
9 include/linux/spi/spi-mem.h | 4 ++++
10 2 files changed, 12 insertions(+)
11
12 --- a/drivers/spi/spi-mem.c
13 +++ b/drivers/spi/spi-mem.c
14 @@ -410,6 +410,14 @@ int spi_mem_exec_op(struct spi_mem *mem,
15 }
16 EXPORT_SYMBOL_GPL(spi_mem_exec_op);
17
18 +int spi_mem_do_calibration(struct spi_mem *mem,
19 + int (*cal_read)(void *priv, u32 *addr, int addrlen, u8 *buf, int readlen),
20 + void *priv)
21 +{
22 + return spi_do_calibration(mem->spi->controller, mem->spi, cal_read, priv);
23 +}
24 +EXPORT_SYMBOL_GPL(spi_mem_do_calibration);
25 +
26 /**
27 * spi_mem_get_name() - Return the SPI mem device name to be used by the
28 * upper layer if necessary
29 --- a/include/linux/spi/spi-mem.h
30 +++ b/include/linux/spi/spi-mem.h
31 @@ -366,6 +366,10 @@ bool spi_mem_supports_op(struct spi_mem
32 int spi_mem_exec_op(struct spi_mem *mem,
33 const struct spi_mem_op *op);
34
35 +int spi_mem_do_calibration(struct spi_mem *mem,
36 + int (*cal_read)(void *, u32 *, int, u8 *, int),
37 + void *priv);
38 +
39 const char *spi_mem_get_name(struct spi_mem *mem);
40
41 struct spi_mem_dirmap_desc *