]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.9.128/i2c-i801-fix-dnv-s-smbctrl-register-offset.patch
Fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 4.9.128 / i2c-i801-fix-dnv-s-smbctrl-register-offset.patch
CommitLineData
7e59e1c3
GKH
1From 851a15114895c5bce163a6f2d57e0aa4658a1be4 Mon Sep 17 00:00:00 2001
2From: Felipe Balbi <felipe.balbi@linux.intel.com>
3Date: Mon, 3 Sep 2018 11:24:57 +0300
4Subject: i2c: i801: fix DNV's SMBCTRL register offset
5
6From: Felipe Balbi <felipe.balbi@linux.intel.com>
7
8commit 851a15114895c5bce163a6f2d57e0aa4658a1be4 upstream.
9
10DNV's iTCO is slightly different with SMBCTRL sitting at a different
11offset when compared to all other devices. Let's fix so that we can
12properly use iTCO watchdog.
13
14Fixes: 84d7f2ebd70d ("i2c: i801: Add support for Intel DNV")
15Cc: <stable@vger.kernel.org> # v4.4+
16Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
17Reviewed-by: Jean Delvare <jdelvare@suse.de>
18Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
19Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20
21---
22 drivers/i2c/busses/i2c-i801.c | 7 ++++++-
23 1 file changed, 6 insertions(+), 1 deletion(-)
24
25--- a/drivers/i2c/busses/i2c-i801.c
26+++ b/drivers/i2c/busses/i2c-i801.c
27@@ -135,6 +135,7 @@
28
29 #define SBREG_BAR 0x10
30 #define SBREG_SMBCTRL 0xc6000c
31+#define SBREG_SMBCTRL_DNV 0xcf000c
32
33 /* Host status bits for SMBPCISTS */
34 #define SMBPCISTS_INTS 0x08
35@@ -1387,7 +1388,11 @@ static void i801_add_tco(struct i801_pri
36 spin_unlock(&p2sb_spinlock);
37
38 res = &tco_res[ICH_RES_MEM_OFF];
39- res->start = (resource_size_t)base64_addr + SBREG_SMBCTRL;
40+ if (pci_dev->device == PCI_DEVICE_ID_INTEL_DNV_SMBUS)
41+ res->start = (resource_size_t)base64_addr + SBREG_SMBCTRL_DNV;
42+ else
43+ res->start = (resource_size_t)base64_addr + SBREG_SMBCTRL;
44+
45 res->end = res->start + 3;
46 res->flags = IORESOURCE_MEM;
47