[][kernel][mt7986][spi][spi-calibration: Add support for 4B mode NOR flashes]

[Description]
Add support for 4B mode NOR flashes:
* For NOR flash, we'll calibrate with 3 bytes mode first and then 4 bytes mode.
* Remove controller's calibration data each time after calibration. We'll
append them again if another calibration is needed.
* Correct error code.

[Release-log]
N/A

Change-Id: Ia647cfa9b1e6228555b568184a5944a592ebe0c1
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/7104709
diff --git a/target/linux/mediatek/patches-5.4/9019-drivers-char-tpm-Add-calibration-example-for-SPI-TPM-module.patch b/target/linux/mediatek/patches-5.4/9019-drivers-char-tpm-Add-calibration-example-for-SPI-TPM-module.patch
index 8b39b12..5635f55 100644
--- a/target/linux/mediatek/patches-5.4/9019-drivers-char-tpm-Add-calibration-example-for-SPI-TPM-module.patch
+++ b/target/linux/mediatek/patches-5.4/9019-drivers-char-tpm-Add-calibration-example-for-SPI-TPM-module.patch
@@ -11,11 +11,9 @@
  drivers/char/tpm/tpm_tis_spi.c  |  7 +++++++
  3 files changed, 28 insertions(+)
 
-diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c
-index 70f785994..b9898a56d 100644
 --- a/drivers/char/tpm/tpm_tis_core.c
 +++ b/drivers/char/tpm/tpm_tis_core.c
-@@ -817,6 +817,21 @@ static const struct tpm_class_ops tpm_tis = {
+@@ -817,6 +817,21 @@ static const struct tpm_class_ops tpm_ti
  	.clk_enable = tpm_tis_clkrun_enable,
  };
  
@@ -37,7 +35,7 @@
  int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
  		      const struct tpm_tis_phy_ops *phy_ops,
  		      acpi_handle acpi_dev_handle)
-@@ -864,6 +879,10 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
+@@ -864,6 +879,10 @@ int tpm_tis_core_init(struct device *dev
  	if (chip->ops->clk_enable != NULL)
  		chip->ops->clk_enable(chip, true);
  
@@ -48,8 +46,6 @@
  	if (wait_startup(chip, 0) != 0) {
  		rc = -ENODEV;
  		goto out_err;
-diff --git a/drivers/char/tpm/tpm_tis_core.h b/drivers/char/tpm/tpm_tis_core.h
-index 7337819f5..7bb0bc8b6 100644
 --- a/drivers/char/tpm/tpm_tis_core.h
 +++ b/drivers/char/tpm/tpm_tis_core.h
 @@ -106,6 +106,7 @@ struct tpm_tis_phy_ops {
@@ -68,11 +64,9 @@
  int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,
  		      const struct tpm_tis_phy_ops *phy_ops,
  		      acpi_handle acpi_dev_handle);
-diff --git a/drivers/char/tpm/tpm_tis_spi.c b/drivers/char/tpm/tpm_tis_spi.c
-index 19513e622..3be2d53a5 100644
 --- a/drivers/char/tpm/tpm_tis_spi.c
 +++ b/drivers/char/tpm/tpm_tis_spi.c
-@@ -184,12 +184,19 @@ static int tpm_tis_spi_write32(struct tpm_tis_data *data, u32 addr, u32 value)
+@@ -184,12 +184,19 @@ static int tpm_tis_spi_write32(struct tp
  	return rc;
  }
  
@@ -92,6 +86,3 @@
  };
  
  static int tpm_tis_spi_probe(struct spi_device *dev)
--- 
-2.18.0
-