linux-gbmc(npcm): Update i2c patches

The patches have all been accepted into HEAD of the upstream kernel
since their last sync. Use the final versions of these patches until
they fall off with kernel uprevs.

The changes between these versions are very minor.

Tested: Run on an AMD rome machine and verified that sensor i2c devices
are reporting values correctly.

Google-Bug-Id: 324970585
Change-Id: I7993e33eab7afffff591cc26f8c159d2192e3779
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/recipes-kernel/linux/files/0001-i2c-npcm-correct-the-read-write-operation-procedure.patch b/recipes-kernel/linux/files/0001-i2c-npcm-correct-the-read-write-operation-procedure.patch
index 5880d48..02452a1 100644
--- a/recipes-kernel/linux/files/0001-i2c-npcm-correct-the-read-write-operation-procedure.patch
+++ b/recipes-kernel/linux/files/0001-i2c-npcm-correct-the-read-write-operation-procedure.patch
@@ -1,4 +1,4 @@
-From ed15a5d4af148fb728701ae8d2dd8cca71be659b Mon Sep 17 00:00:00 2001
+From e365422cef1ca2c964e25d26536120aab17991e2 Mon Sep 17 00:00:00 2001
 From: Tyrone Ting <kfting@nuvoton.com>
 Date: Tue, 1 Oct 2024 14:28:50 +0800
 Subject: [PATCH 1/6] i2c: npcm: correct the read/write operation procedure
@@ -20,18 +20,19 @@
 However the maser already "knows" what the bus state is, so this bit
 is not needed and the driver can just track what it is currently doing.
 
-Upstream-Status: Pending [https://patchwork.ozlabs.org/project/linux-i2c/list/?series=426080]
+Upstream-Status: Accepted
 Signed-off-by: Tyrone Ting <kfting@nuvoton.com>
 Reviewed-by: Tali Perry <tali.perry1@gmail.com>
+Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
 ---
  drivers/i2c/busses/i2c-npcm7xx.c | 7 ++-----
  1 file changed, 2 insertions(+), 5 deletions(-)
 
 diff --git a/drivers/i2c/busses/i2c-npcm7xx.c b/drivers/i2c/busses/i2c-npcm7xx.c
-index 2fe68615942e..c8503acdaff8 100644
+index bbcb4d6668ce..2b76dbfba438 100644
 --- a/drivers/i2c/busses/i2c-npcm7xx.c
 +++ b/drivers/i2c/busses/i2c-npcm7xx.c
-@@ -1626,13 +1626,10 @@ static void npcm_i2c_irq_handle_sda(struct npcm_i2c *bus, u8 i2cst)
+@@ -1628,13 +1628,10 @@ static void npcm_i2c_irq_handle_sda(struct npcm_i2c *bus, u8 i2cst)
  			npcm_i2c_wr_byte(bus, bus->dest_addr | BIT(0));
  	/* SDA interrupt, after start\restart */
  	} else {
@@ -48,5 +49,5 @@
  }
  
 -- 
-2.46.1.824.gd892dcdcdd-goog
+2.48.1.502.g6dc24dfdaf-goog
 
diff --git a/recipes-kernel/linux/files/0002-i2c-npcm-use-a-software-flag-to-indicate-a-BER-condi.patch b/recipes-kernel/linux/files/0002-i2c-npcm-use-a-software-flag-to-indicate-a-BER-condi.patch
index c0e61a2..3567be7 100644
--- a/recipes-kernel/linux/files/0002-i2c-npcm-use-a-software-flag-to-indicate-a-BER-condi.patch
+++ b/recipes-kernel/linux/files/0002-i2c-npcm-use-a-software-flag-to-indicate-a-BER-condi.patch
@@ -1,4 +1,4 @@
-From 0cefcee79a3b0012f00b61f4fc05347c0c04c014 Mon Sep 17 00:00:00 2001
+From b0118105725eb30a96102d135dafcb94956b05bf Mon Sep 17 00:00:00 2001
 From: Tyrone Ting <kfting@nuvoton.com>
 Date: Tue, 1 Oct 2024 14:28:51 +0800
 Subject: [PATCH 2/6] i2c: npcm: use a software flag to indicate a BER
@@ -13,18 +13,19 @@
 used. The driver does an i2c recovery without causing the timeout
 if the flag is set.
 
-Upstream-Status: Pending [https://patchwork.ozlabs.org/project/linux-i2c/list/?series=426080]
+Upstream-Status: Accepted
 Signed-off-by: Tyrone Ting <kfting@nuvoton.com>
 Reviewed-by: Tali Perry <tali.perry1@gmail.com>
+Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
 ---
  drivers/i2c/busses/i2c-npcm7xx.c | 15 ++++++++++++++-
  1 file changed, 14 insertions(+), 1 deletion(-)
 
 diff --git a/drivers/i2c/busses/i2c-npcm7xx.c b/drivers/i2c/busses/i2c-npcm7xx.c
-index c8503acdaff8..0847ce5b4343 100644
+index 2b76dbfba438..7620bdcdc235 100644
 --- a/drivers/i2c/busses/i2c-npcm7xx.c
 +++ b/drivers/i2c/busses/i2c-npcm7xx.c
-@@ -332,6 +332,7 @@ struct npcm_i2c {
+@@ -334,6 +334,7 @@ struct npcm_i2c {
  	u64 nack_cnt;
  	u64 timeout_cnt;
  	u64 tx_complete_cnt;
@@ -32,7 +33,7 @@
  };
  
  static inline void npcm_i2c_select_bank(struct npcm_i2c *bus,
-@@ -1519,6 +1520,7 @@ static void npcm_i2c_irq_handle_ber(struct npcm_i2c *bus)
+@@ -1521,6 +1522,7 @@ static void npcm_i2c_irq_handle_ber(struct npcm_i2c *bus)
  	if (npcm_i2c_is_master(bus)) {
  		npcm_i2c_master_abort(bus);
  	} else {
@@ -40,7 +41,7 @@
  		npcm_i2c_clear_master_status(bus);
  
  		/* Clear BB (BUS BUSY) bit */
-@@ -1697,6 +1699,7 @@ static int npcm_i2c_recovery_tgclk(struct i2c_adapter *_adap)
+@@ -1699,6 +1701,7 @@ static int npcm_i2c_recovery_tgclk(struct i2c_adapter *_adap)
  		dev_dbg(bus->dev, "bus%d-0x%x recovery skipped, bus not stuck",
  			bus->num, bus->dest_addr);
  		npcm_i2c_reset(bus);
@@ -48,7 +49,7 @@
  		return 0;
  	}
  
-@@ -1761,6 +1764,7 @@ static int npcm_i2c_recovery_tgclk(struct i2c_adapter *_adap)
+@@ -1763,6 +1766,7 @@ static int npcm_i2c_recovery_tgclk(struct i2c_adapter *_adap)
  		if (bus->rec_succ_cnt < ULLONG_MAX)
  			bus->rec_succ_cnt++;
  	}
@@ -56,7 +57,7 @@
  	return status;
  }
  
-@@ -2156,7 +2160,16 @@ static int npcm_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
+@@ -2158,7 +2162,16 @@ static int npcm_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
  
  	} while (time_is_after_jiffies(time_left) && bus_busy);
  
@@ -75,5 +76,5 @@
  		npcm_i2c_reset(bus);
  		i2c_recover_bus(adap);
 -- 
-2.46.1.824.gd892dcdcdd-goog
+2.48.1.502.g6dc24dfdaf-goog
 
diff --git a/recipes-kernel/linux/files/0003-i2c-npcm-Modify-timeout-evaluation-mechanism.patch b/recipes-kernel/linux/files/0003-i2c-npcm-Modify-timeout-evaluation-mechanism.patch
index 6eff25b..ae44490 100644
--- a/recipes-kernel/linux/files/0003-i2c-npcm-Modify-timeout-evaluation-mechanism.patch
+++ b/recipes-kernel/linux/files/0003-i2c-npcm-Modify-timeout-evaluation-mechanism.patch
@@ -1,6 +1,6 @@
-From 7cafb6ca386a2213bd36da8dca804abbdfbfdeda Mon Sep 17 00:00:00 2001
+From 4a34b9bf5f6f3f3ed910863fd1b4741a62864d4b Mon Sep 17 00:00:00 2001
 From: Tyrone Ting <kfting@nuvoton.com>
-Date: Tue, 1 Oct 2024 14:28:52 +0800
+Date: Thu, 19 Dec 2024 17:08:56 +0800
 Subject: [PATCH 3/6] i2c: npcm: Modify timeout evaluation mechanism
 
 The users want to connect a lot of masters on the same bus.
@@ -12,20 +12,22 @@
 
 The i2c core layer will have chances to retry to call the i2c driver
 transfer function if the i2c driver reports that the bus is busy and
-returns EAGAIN.
+returns -EAGAIN.
 
-Upstream-Status: Pending [https://patchwork.ozlabs.org/project/linux-i2c/list/?series=426080]
+Upstream-Status: Accepted
 Signed-off-by: Tyrone Ting <kfting@nuvoton.com>
 Reviewed-by: Tali Perry <tali.perry1@gmail.com>
+Link: https://lore.kernel.org/r/20241219090859.18722-2-kfting@nuvoton.com
+Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
 ---
  drivers/i2c/busses/i2c-npcm7xx.c | 24 +++++++++++++++---------
  1 file changed, 15 insertions(+), 9 deletions(-)
 
 diff --git a/drivers/i2c/busses/i2c-npcm7xx.c b/drivers/i2c/busses/i2c-npcm7xx.c
-index 0847ce5b4343..7ed4306854cd 100644
+index 482a0074d448..c96a25d37c14 100644
 --- a/drivers/i2c/busses/i2c-npcm7xx.c
 +++ b/drivers/i2c/busses/i2c-npcm7xx.c
-@@ -2130,19 +2130,12 @@ static int npcm_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
+@@ -2132,19 +2132,12 @@ static int npcm_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
  		}
  	}
  
@@ -46,7 +48,7 @@
  	do {
  		/*
  		 * we must clear slave address immediately when the bus is not
-@@ -2190,6 +2183,14 @@ static int npcm_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
+@@ -2192,6 +2185,14 @@ static int npcm_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
  	if (npcm_i2c_master_start_xmit(bus, slave_addr, nwrite, nread,
  				       write_data, read_data, read_PEC,
  				       read_block)) {
@@ -61,7 +63,7 @@
  		time_left = wait_for_completion_timeout(&bus->cmd_complete,
  							timeout);
  
-@@ -2315,7 +2316,12 @@ static int npcm_i2c_probe_bus(struct platform_device *pdev)
+@@ -2317,7 +2318,12 @@ static int npcm_i2c_probe_bus(struct platform_device *pdev)
  	adap = &bus->adap;
  	adap->owner = THIS_MODULE;
  	adap->retries = 3;
@@ -76,5 +78,5 @@
  	adap->quirks = &npcm_i2c_quirks;
  	adap->algo_data = bus;
 -- 
-2.46.1.824.gd892dcdcdd-goog
+2.48.1.502.g6dc24dfdaf-goog
 
diff --git a/recipes-kernel/linux/files/0004-i2c-npcm-Assign-client-address-earlier-for-i2c_recov.patch b/recipes-kernel/linux/files/0004-i2c-npcm-Assign-client-address-earlier-for-i2c_recov.patch
new file mode 100644
index 0000000..640a729
--- /dev/null
+++ b/recipes-kernel/linux/files/0004-i2c-npcm-Assign-client-address-earlier-for-i2c_recov.patch
@@ -0,0 +1,98 @@
+From 862dd4f7733a694b12ad9e023ce639e9c21d6abd Mon Sep 17 00:00:00 2001
+From: Tyrone Ting <kfting@nuvoton.com>
+Date: Thu, 19 Dec 2024 17:08:57 +0800
+Subject: [PATCH 4/6] i2c: npcm: Assign client address earlier for
+ `i2c_recover_bus()`
+
+Store the client address earlier since it might get called in
+the i2c_recover_bus() logic flow at the early stage of
+npcm_i2c_master_xfer().
+
+Upstream-Status: Accepted
+Signed-off-by: Tyrone Ting <kfting@nuvoton.com>
+Reviewed-by: Tali Perry <tali.perry1@gmail.com>
+Link: https://lore.kernel.org/r/20241219090859.18722-3-kfting@nuvoton.com
+Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
+---
+ drivers/i2c/busses/i2c-npcm7xx.c | 23 +++++++++++++++++------
+ 1 file changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/i2c/busses/i2c-npcm7xx.c b/drivers/i2c/busses/i2c-npcm7xx.c
+index c96a25d37c14..760608fdd075 100644
+--- a/drivers/i2c/busses/i2c-npcm7xx.c
++++ b/drivers/i2c/busses/i2c-npcm7xx.c
+@@ -2035,7 +2035,7 @@ static irqreturn_t npcm_i2c_bus_irq(int irq, void *dev_id)
+ }
+ 
+ static bool npcm_i2c_master_start_xmit(struct npcm_i2c *bus,
+-				       u8 slave_addr, u16 nwrite, u16 nread,
++				       u16 nwrite, u16 nread,
+ 				       u8 *write_data, u8 *read_data,
+ 				       bool use_PEC, bool use_read_block)
+ {
+@@ -2043,7 +2043,6 @@ static bool npcm_i2c_master_start_xmit(struct npcm_i2c *bus,
+ 		bus->cmd_err = -EBUSY;
+ 		return false;
+ 	}
+-	bus->dest_addr = slave_addr << 1;
+ 	bus->wr_buf = write_data;
+ 	bus->wr_size = nwrite;
+ 	bus->wr_ind = 0;
+@@ -2086,7 +2085,6 @@ static int npcm_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
+ 	unsigned long time_left, flags;
+ 	u16 nwrite, nread;
+ 	u8 *write_data, *read_data;
+-	u8 slave_addr;
+ 	unsigned long timeout;
+ 	bool read_block = false;
+ 	bool read_PEC = false;
+@@ -2099,7 +2097,6 @@ static int npcm_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
+ 	}
+ 
+ 	msg0 = &msgs[0];
+-	slave_addr = msg0->addr;
+ 	if (msg0->flags & I2C_M_RD) { /* read */
+ 		nwrite = 0;
+ 		write_data = NULL;
+@@ -2155,6 +2152,21 @@ static int npcm_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
+ 
+ 	} while (time_is_after_jiffies(time_left) && bus_busy);
+ 
++	/*
++	 * Store the address early in a global position to ensure it is
++	 * accessible for a potential call to i2c_recover_bus().
++	 *
++	 * Since the transfer might be a read operation, remove the I2C_M_RD flag
++	 * from the bus->dest_addr for the i2c_recover_bus() call later.
++	 *
++	 * The i2c_recover_bus() uses the address in a write direction to recover
++	 * the i2c bus if some error condition occurs.
++	 *
++	 * Remove the I2C_M_RD flag from the address since npcm_i2c_master_start_xmit()
++	 * handles the read/write operation internally.
++	 */
++	bus->dest_addr = i2c_8bit_addr_from_msg(msg0) & ~I2C_M_RD;
++
+ 	/*
+ 	 * Check the BER (bus error) state, when ber_state is true, it means that the module
+ 	 * detects the bus error which is caused by some factor like that the electricity
+@@ -2172,7 +2184,6 @@ static int npcm_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
+ 	}
+ 
+ 	npcm_i2c_init_params(bus);
+-	bus->dest_addr = slave_addr;
+ 	bus->msgs = msgs;
+ 	bus->msgs_num = num;
+ 	bus->cmd_err = 0;
+@@ -2182,7 +2193,7 @@ static int npcm_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
+ 
+ 	npcm_i2c_int_enable(bus, true);
+ 
+-	if (npcm_i2c_master_start_xmit(bus, slave_addr, nwrite, nread,
++	if (npcm_i2c_master_start_xmit(bus, nwrite, nread,
+ 				       write_data, read_data, read_PEC,
+ 				       read_block)) {
+ 		/*
+-- 
+2.48.1.502.g6dc24dfdaf-goog
+
diff --git a/recipes-kernel/linux/files/0004-i2c-npcm-Modify-the-client-address-assignment.patch b/recipes-kernel/linux/files/0004-i2c-npcm-Modify-the-client-address-assignment.patch
deleted file mode 100644
index 6fbc2c4..0000000
--- a/recipes-kernel/linux/files/0004-i2c-npcm-Modify-the-client-address-assignment.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From c27d35d1759112aab19c289b79f5f499f8c71ff5 Mon Sep 17 00:00:00 2001
-From: Tyrone Ting <kfting@nuvoton.com>
-Date: Tue, 1 Oct 2024 14:28:53 +0800
-Subject: [PATCH 4/6] i2c: npcm: Modify the client address assignment
-
-Store the client address earlier since it might get called in
-the i2c_recover_bus() logic flow at the early stage of
-npcm_i2c_master_xfer().
-
-Upstream-Status: Pending [https://patchwork.ozlabs.org/project/linux-i2c/list/?series=426080]
-Signed-off-by: Tyrone Ting <kfting@nuvoton.com>
-Reviewed-by: Tali Perry <tali.perry1@gmail.com>
----
- drivers/i2c/busses/i2c-npcm7xx.c | 14 +++++++++++++-
- 1 file changed, 13 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/i2c/busses/i2c-npcm7xx.c b/drivers/i2c/busses/i2c-npcm7xx.c
-index 7ed4306854cd..c4c68a9242c0 100644
---- a/drivers/i2c/busses/i2c-npcm7xx.c
-+++ b/drivers/i2c/busses/i2c-npcm7xx.c
-@@ -2153,6 +2153,19 @@ static int npcm_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
- 
- 	} while (time_is_after_jiffies(time_left) && bus_busy);
- 
-+	/*
-+	 * Previously, the address was stored w/o left-shift by one bit and
-+	 * with that shift in the following call to npcm_i2c_master_start_xmit().
-+	 *
-+	 * Since there are cases that the i2c_recover_bus() gets called at the
-+	 * early stage of npcm_i2c_master_xfer(), the address is stored with
-+	 * the shift and used in the i2c_recover_bus().
-+	 *
-+	 * The address is stored from bit 1 to bit 7 in the register for
-+	 * sending the i2c address later so it's left-shifted by 1 bit.
-+	 */
-+	bus->dest_addr = slave_addr << 1;
-+
- 	/*
- 	 * Check the BER (bus error) state, when ber_state is true, it means that the module
- 	 * detects the bus error which is caused by some factor like that the electricity
-@@ -2170,7 +2183,6 @@ static int npcm_i2c_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
- 	}
- 
- 	npcm_i2c_init_params(bus);
--	bus->dest_addr = slave_addr;
- 	bus->msgs = msgs;
- 	bus->msgs_num = num;
- 	bus->cmd_err = 0;
--- 
-2.46.1.824.gd892dcdcdd-goog
-
diff --git a/recipes-kernel/linux/files/0005-i2c-npcm-use-i2c-frequency-table.patch b/recipes-kernel/linux/files/0005-i2c-npcm-use-i2c-frequency-table.patch
index 4b38eb8..9a7fc85 100644
--- a/recipes-kernel/linux/files/0005-i2c-npcm-use-i2c-frequency-table.patch
+++ b/recipes-kernel/linux/files/0005-i2c-npcm-use-i2c-frequency-table.patch
@@ -1,10 +1,9 @@
-From 36f9eabf2c0e82a6bb0d18b5b01404837a0a5078 Mon Sep 17 00:00:00 2001
+From 6ddc9132bc42a7dfcaca0cce4ff0f94e69bc5114 Mon Sep 17 00:00:00 2001
 From: Tyrone Ting <kfting@nuvoton.com>
-Date: Tue, 1 Oct 2024 14:28:54 +0800
+Date: Thu, 19 Dec 2024 17:08:58 +0800
 Subject: [PATCH 5/6] i2c: npcm: use i2c frequency table
 
-Modify i2c frequency from table parameters
-for NPCM i2c modules.
+Modify i2c frequency from table parameters for NPCM i2c modules.
 
 Supported frequencies are:
 
@@ -41,18 +40,20 @@
 
 This process was led by the chip architect and included a lot of testing.
 
-Upstream-Status: Pending [https://patchwork.ozlabs.org/project/linux-i2c/list/?series=426080]
+Upstream-Status: Accepted
 Signed-off-by: Tyrone Ting <kfting@nuvoton.com>
 Reviewed-by: Tali Perry <tali.perry1@gmail.com>
+Link: https://lore.kernel.org/r/20241219090859.18722-4-kfting@nuvoton.com
+Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
 ---
  drivers/i2c/busses/i2c-npcm7xx.c | 374 ++++++++++++++++++++++++-------
  1 file changed, 288 insertions(+), 86 deletions(-)
 
 diff --git a/drivers/i2c/busses/i2c-npcm7xx.c b/drivers/i2c/busses/i2c-npcm7xx.c
-index c4c68a9242c0..06023bcefb7a 100644
+index 760608fdd075..1aae1a8a8055 100644
 --- a/drivers/i2c/busses/i2c-npcm7xx.c
 +++ b/drivers/i2c/busses/i2c-npcm7xx.c
-@@ -261,6 +261,265 @@ static const int npcm_i2caddr[I2C_NUM_OWN_ADDR] = {
+@@ -263,6 +263,265 @@ static const int npcm_i2caddr[I2C_NUM_OWN_ADDR] = {
  #define I2C_FREQ_MIN_HZ			10000
  #define I2C_FREQ_MAX_HZ			I2C_MAX_FAST_MODE_PLUS_FREQ
  
@@ -318,7 +319,7 @@
  struct npcm_i2c_data {
  	u8 fifo_size;
  	u32 segctl_init_val;
-@@ -1803,102 +2062,45 @@ static void npcm_i2c_recovery_init(struct i2c_adapter *_adap)
+@@ -1805,102 +2064,45 @@ static void npcm_i2c_recovery_init(struct i2c_adapter *_adap)
   */
  static int npcm_i2c_init_clk(struct npcm_i2c *bus, u32 bus_freq_hz)
  {
@@ -446,7 +447,7 @@
  		 bus->reg + NPCM_I2CCTL3);
  
  	/* Select Bank 0 to access NPCM_I2CCTL4/NPCM_I2CCTL5 */
-@@ -1910,13 +2112,13 @@ static int npcm_i2c_init_clk(struct npcm_i2c *bus, u32 bus_freq_hz)
+@@ -1912,13 +2114,13 @@ static int npcm_i2c_init_clk(struct npcm_i2c *bus, u32 bus_freq_hz)
  		 * k1 = 2 * SCLLT7-0 -> Low Time  = k1 / 2
  		 * k2 = 2 * SCLLT7-0 -> High Time = k2 / 2
  		 */
@@ -465,5 +466,5 @@
  	/* Return to Bank 1, and stay there by default: */
  	npcm_i2c_select_bank(bus, I2C_BANK_1);
 -- 
-2.46.1.824.gd892dcdcdd-goog
+2.48.1.502.g6dc24dfdaf-goog
 
diff --git a/recipes-kernel/linux/files/0006-i2c-npcm-Enable-slave-in-eob-interrupt.patch b/recipes-kernel/linux/files/0006-i2c-npcm-Enable-slave-in-eob-interrupt.patch
index d828ba8..8006a6e 100644
--- a/recipes-kernel/linux/files/0006-i2c-npcm-Enable-slave-in-eob-interrupt.patch
+++ b/recipes-kernel/linux/files/0006-i2c-npcm-Enable-slave-in-eob-interrupt.patch
@@ -1,6 +1,6 @@
-From 71274c32a85c39025c3348cdd7969790bd97bf60 Mon Sep 17 00:00:00 2001
+From 8b56f98b28e6238bcfe00de743b4361d26a7f980 Mon Sep 17 00:00:00 2001
 From: Charles Boyer <Charles.Boyer@fii-usa.com>
-Date: Tue, 1 Oct 2024 14:28:55 +0800
+Date: Thu, 19 Dec 2024 17:08:59 +0800
 Subject: [PATCH 6/6] i2c: npcm: Enable slave in eob interrupt
 
 Nuvoton slave enable was in user space API call master_xfer, so it is
@@ -12,32 +12,34 @@
 the BMC can be ready in slave mode by the time it needs to receive a
 response.
 
-Upstream-Status: Pending [https://patchwork.ozlabs.org/project/linux-i2c/list/?series=426080]
+Upstream-Status: Accepted
 Signed-off-by: Charles Boyer <Charles.Boyer@fii-usa.com>
 Signed-off-by: Vivekanand Veeracholan <vveerach@google.com>
 Signed-off-by: Tyrone Ting <kfting@nuvoton.com>
 Reviewed-by: Tali Perry <tali.perry1@gmail.com>
+Link: https://lore.kernel.org/r/20241219090859.18722-5-kfting@nuvoton.com
+Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
 ---
  drivers/i2c/busses/i2c-npcm7xx.c | 6 ++++++
  1 file changed, 6 insertions(+)
 
 diff --git a/drivers/i2c/busses/i2c-npcm7xx.c b/drivers/i2c/busses/i2c-npcm7xx.c
-index 06023bcefb7a..cf1829fa262e 100644
+index 1aae1a8a8055..3ca08b8ef8af 100644
 --- a/drivers/i2c/busses/i2c-npcm7xx.c
 +++ b/drivers/i2c/busses/i2c-npcm7xx.c
-@@ -1923,6 +1923,12 @@ static int npcm_i2c_int_master_handler(struct npcm_i2c *bus)
+@@ -1925,6 +1925,12 @@ static int npcm_i2c_int_master_handler(struct npcm_i2c *bus)
  	    (FIELD_GET(NPCM_I2CCST3_EO_BUSY,
  		       ioread8(bus->reg + NPCM_I2CCST3)))) {
  		npcm_i2c_irq_handle_eob(bus);
 +#if IS_ENABLED(CONFIG_I2C_SLAVE)
 +		/* reenable slave if it was enabled */
 +		if (bus->slave)
-+			iowrite8((bus->slave->addr & 0x7F) | NPCM_I2CADDR_SAEN,
++			iowrite8(bus->slave->addr | NPCM_I2CADDR_SAEN,
 +				 bus->reg + NPCM_I2CADDR1);
 +#endif
  		return 0;
  	}
  
 -- 
-2.46.1.824.gd892dcdcdd-goog
+2.48.1.502.g6dc24dfdaf-goog
 
diff --git a/recipes-kernel/linux/linux-gbmc_mainline.bb b/recipes-kernel/linux/linux-gbmc_mainline.bb
index a04bcd3..8c38b11 100644
--- a/recipes-kernel/linux/linux-gbmc_mainline.bb
+++ b/recipes-kernel/linux/linux-gbmc_mainline.bb
@@ -17,7 +17,7 @@
   file://0001-i2c-npcm-correct-the-read-write-operation-procedure.patch \
   file://0002-i2c-npcm-use-a-software-flag-to-indicate-a-BER-condi.patch \
   file://0003-i2c-npcm-Modify-timeout-evaluation-mechanism.patch \
-  file://0004-i2c-npcm-Modify-the-client-address-assignment.patch \
+  file://0004-i2c-npcm-Assign-client-address-earlier-for-i2c_recov.patch \
   file://0005-i2c-npcm-use-i2c-frequency-table.patch \
   file://0006-i2c-npcm-Enable-slave-in-eob-interrupt.patch \
   file://DOWNSTREAM_0001-i2c-npcm-speed-set.patch \
diff --git a/recipes-kernel/linux/linux-gbmc_stable.bb b/recipes-kernel/linux/linux-gbmc_stable.bb
index bda73df..5b9548c 100644
--- a/recipes-kernel/linux/linux-gbmc_stable.bb
+++ b/recipes-kernel/linux/linux-gbmc_stable.bb
@@ -22,7 +22,7 @@
   file://0001-i2c-npcm-correct-the-read-write-operation-procedure.patch \
   file://0002-i2c-npcm-use-a-software-flag-to-indicate-a-BER-condi.patch \
   file://0003-i2c-npcm-Modify-timeout-evaluation-mechanism.patch \
-  file://0004-i2c-npcm-Modify-the-client-address-assignment.patch \
+  file://0004-i2c-npcm-Assign-client-address-earlier-for-i2c_recov.patch \
   file://0005-i2c-npcm-use-i2c-frequency-table.patch \
   file://0006-i2c-npcm-Enable-slave-in-eob-interrupt.patch \
   file://DOWNSTREAM_0001-i2c-npcm-speed-set.patch \