Skip to contentSkip to conversation

i2c: designware-baytrail: Pass dw_i2c_dev into helper functions

PATCH In review Hans de Goede 2 participants 5 messages Dec 9, 2016 – Dec 10, 2016

Subsystems (3)
lore
Share & tools
lore
#1 lore raw

PATCH 2/2 i2c: designware-baytrail: Add support for cherrytrail

In reply to Hans de Goede

The cherrytrail punit has the pmic i2c bus access semaphore at a different register address.

---
 drivers/i2c/busses/i2c-designware-baytrail.c |  3 ++-
 drivers/i2c/busses/i2c-designware-core.h     |  2 ++
 drivers/i2c/busses/i2c-designware-pcidrv.c   | 25 ++++++++++++++++++-------
 drivers/i2c/busses/i2c-designware-platdrv.c  |  2 +-
 4 files changed, 23 insertions(+), 9 deletions(-)
drivers/i2c/busses/i2c-designware-baytrail.c +2 -1
index a3f581c..938ff3b 100644
@@ -22,7 +22,8 @@
 #include "i2c-designware-core.h"
 
 #define SEMAPHORE_TIMEOUT	100
-#define PUNIT_SEMAPHORE		0x7
+#define PUNIT_SEMAPHORE		((dev->accessor_flags & ACCESS_IS_CHERRYTRAIL) \
+				 ? 0x10e : 0x7)
 #define PUNIT_SEMAPHORE_BIT	BIT(0)
 #define PUNIT_SEMAPHORE_ACQUIRE	BIT(1)
 
drivers/i2c/busses/i2c-designware-core.h +2 -0
index 0d44d2a..4a66959 100644
@@ -123,6 +123,8 @@ struct dw_i2c_dev {
 #define ACCESS_SWAP		0x00000001
 #define ACCESS_16BIT		0x00000002
 #define ACCESS_INTR_MASK	0x00000004
+/* Not really an accessor_flag but also set through driver_data */
+#define ACCESS_IS_CHERRYTRAIL	0x00000008
 
 extern int i2c_dw_init(struct dw_i2c_dev *dev);
 extern void i2c_dw_disable(struct dw_i2c_dev *dev);
drivers/i2c/busses/i2c-designware-pcidrv.c +18 -7
index 96f8230..d774bab 100644
@@ -45,6 +45,7 @@ enum dw_pci_ctl_id_t {
 	medfield,
 	merrifield,
 	baytrail,
+	cherrytrail,
 	haswell,
 };
 
@@ -174,6 +175,14 @@ static struct dw_pci_controller dw_pci_controllers[] = {
 		.functionality = I2C_FUNC_10BIT_ADDR,
 		.scl_sda_cfg = &hsw_config,
 	},
+	[cherrytrail] = {
+		.bus_num = -1,
+		.bus_cfg = INTEL_MID_STD_CFG | DW_IC_CON_SPEED_FAST,
+		.tx_fifo_depth = 32,
+		.rx_fifo_depth = 32,
+		.functionality = I2C_FUNC_10BIT_ADDR,
+		.scl_sda_cfg = &byt_config,
+	},
 };
 
 #ifdef CONFIG_PM
@@ -241,6 +250,8 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev,
 	dev->base = pcim_iomap_table(pdev)[0];
 	dev->dev = &pdev->dev;
 	dev->irq = pdev->irq;
+	if (id->driver_data == cherrytrail)
+		dev->accessor_flags |= ACCESS_IS_CHERRYTRAIL;
 
 	if (controller->setup) {
 		r = controller->setup(pdev, controller);
@@ -321,13 +332,13 @@ static const struct pci_device_id i2_designware_pci_ids[] = {
 	{ PCI_VDEVICE(INTEL, 0x9c61), haswell },
 	{ PCI_VDEVICE(INTEL, 0x9c62), haswell },
 	/* Braswell / Cherrytrail */
-	{ PCI_VDEVICE(INTEL, 0x22C1), baytrail },
-	{ PCI_VDEVICE(INTEL, 0x22C2), baytrail },
-	{ PCI_VDEVICE(INTEL, 0x22C3), baytrail },
-	{ PCI_VDEVICE(INTEL, 0x22C4), baytrail },
-	{ PCI_VDEVICE(INTEL, 0x22C5), baytrail },
-	{ PCI_VDEVICE(INTEL, 0x22C6), baytrail },
-	{ PCI_VDEVICE(INTEL, 0x22C7), baytrail },
+	{ PCI_VDEVICE(INTEL, 0x22C1), cherrytrail },
+	{ PCI_VDEVICE(INTEL, 0x22C2), cherrytrail },
+	{ PCI_VDEVICE(INTEL, 0x22C3), cherrytrail },
+	{ PCI_VDEVICE(INTEL, 0x22C4), cherrytrail },
+	{ PCI_VDEVICE(INTEL, 0x22C5), cherrytrail },
+	{ PCI_VDEVICE(INTEL, 0x22C6), cherrytrail },
+	{ PCI_VDEVICE(INTEL, 0x22C7), cherrytrail },
 	{ 0,}
 };
 MODULE_DEVICE_TABLE(pci, i2_designware_pci_ids);
drivers/i2c/busses/i2c-designware-platdrv.c +1 -1
index 0b42a12..8974467 100644
@@ -123,7 +123,7 @@ static const struct acpi_device_id dw_i2c_acpi_match[] = {
 	{ "INT3432", 0 },
 	{ "INT3433", 0 },
 	{ "80860F41", 0 },
-	{ "808622C1", 0 },
+	{ "808622C1", ACCESS_IS_CHERRYTRAIL },
 	{ "AMD0010", ACCESS_INTR_MASK },
 	{ "AMDI0010", ACCESS_INTR_MASK },
 	{ "AMDI0510", 0 },
Signature · 1 line
2.9.3
#0 lore raw

PATCH 1/2 i2c: designware-baytrail: Pass dw_i2c_dev into helper functions

Pass dw_i2c_dev into the helper functions, this is a preparation patch for adding cherrytrail support.

---
 drivers/i2c/busses/i2c-designware-baytrail.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/i2c/busses/i2c-designware-baytrail.c +8 -8
index 1590ad0..a3f581c 100644
@@ -28,14 +28,14 @@
 
 static unsigned long acquired;
 
-static int get_sem(struct device *dev, u32 *sem)
+static int get_sem(struct dw_i2c_dev *dev, u32 *sem)
 {
 	u32 data;
 	int ret;
 
 	ret = iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ, PUNIT_SEMAPHORE, &data);
 	if (ret) {
-		dev_err(dev, "iosf failed to read punit semaphore\n");
+		dev_err(dev->dev, "iosf failed to read punit semaphore\n");
 		return ret;
 	}
 
@@ -44,18 +44,18 @@ static int get_sem(struct device *dev, u32 *sem)
 	return 0;
 }
 
-static void reset_semaphore(struct device *dev)
+static void reset_semaphore(struct dw_i2c_dev *dev)
 {
 	u32 data;
 
 	if (iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ, PUNIT_SEMAPHORE, &data)) {
-		dev_err(dev, "iosf failed to reset punit semaphore during read\n");
+		dev_err(dev->dev, "iosf failed to reset punit semaphore during read\n");
 		return;
 	}
 
 	data &= ~PUNIT_SEMAPHORE_BIT;
 	if (iosf_mbi_write(BT_MBI_UNIT_PMC, MBI_REG_WRITE, PUNIT_SEMAPHORE, data))
-		dev_err(dev, "iosf failed to reset punit semaphore during write\n");
+		dev_err(dev->dev, "iosf failed to reset punit semaphore during write\n");
 }
 
 static int baytrail_i2c_acquire(struct dw_i2c_dev *dev)
@@ -83,7 +83,7 @@ static int baytrail_i2c_acquire(struct dw_i2c_dev *dev)
 	start = jiffies;
 	end = start + msecs_to_jiffies(SEMAPHORE_TIMEOUT);
 	do {
-		ret = get_sem(dev->dev, &sem);
+		ret = get_sem(dev, &sem);
 		if (!ret && sem) {
 			acquired = jiffies;
 			dev_dbg(dev->dev, "punit semaphore acquired after %ums\n",
@@ -95,7 +95,7 @@ static int baytrail_i2c_acquire(struct dw_i2c_dev *dev)
 	} while (time_before(jiffies, end));
 
 	dev_err(dev->dev, "punit semaphore timed out, resetting\n");
-	reset_semaphore(dev->dev);
+	reset_semaphore(dev);
 
 	ret = iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ, PUNIT_SEMAPHORE, &sem);
 	if (ret)
@@ -116,7 +116,7 @@ static void baytrail_i2c_release(struct dw_i2c_dev *dev)
 	if (!dev->acquire_lock)
 		return;
 
-	reset_semaphore(dev->dev);
+	reset_semaphore(dev);
 	dev_dbg(dev->dev, "punit semaphore held for %ums\n",
 		jiffies_to_msecs(jiffies - acquired));
 }
Signature · 1 line
2.9.3
reviewer Reviewed-by on v1 1/2
#4 lore raw
Quoted 6 lines · Hans de Goede

Pass dw_i2c_dev into the helper functions, this is a preparation patch for adding cherrytrail support.

Quoted 89 lines

---
 drivers/i2c/busses/i2c-designware-baytrail.c | 16 ++++++++--------

 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/i2c/busses/i2c-designware-baytrail.c +0 -0
index 1590ad0..a3f581c 100644
@@ -28,14 +28,14 @@


 static unsigned long acquired;

drivers/i2c/busses/i2c-designware-baytrail.c +1 -1
-static int get_sem(struct device *dev, u32 *sem)
+static int get_sem(struct dw_i2c_dev *dev, u32 *sem)

 {
  u32 data;
  int ret;

  ret = iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ, PUNIT_SEMAPHORE, &data);
  if (ret) {

drivers/i2c/busses/i2c-designware-baytrail.c +0 -1
-		dev_err(dev, "iosf failed to read punit

semaphore\n");

drivers/i2c/busses/i2c-designware-baytrail.c +1 -0
+		dev_err(dev->dev, "iosf failed to read punit

semaphore\n");
  return ret;
  }

drivers/i2c/busses/i2c-designware-baytrail.c +0 -0
@@ -44,18 +44,18 @@ static int get_sem(struct device *dev, u32 *sem)
  	return 0;
  }

drivers/i2c/busses/i2c-designware-baytrail.c +1 -1
-static void reset_semaphore(struct device *dev)
+static void reset_semaphore(struct dw_i2c_dev *dev)

 {
  u32 data;

  if (iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ, PUNIT_SEMAPHORE, &data)) {

drivers/i2c/busses/i2c-designware-baytrail.c +0 -1
-		dev_err(dev, "iosf failed to reset punit semaphore

during read\n");

drivers/i2c/busses/i2c-designware-baytrail.c +1 -0
+		dev_err(dev->dev, "iosf failed to reset punit

semaphore during read\n");
  return;
  }

  data &= ~PUNIT_SEMAPHORE_BIT;
  if (iosf_mbi_write(BT_MBI_UNIT_PMC, MBI_REG_WRITE, PUNIT_SEMAPHORE, data))

drivers/i2c/busses/i2c-designware-baytrail.c +0 -1
-		dev_err(dev, "iosf failed to reset punit semaphore

during write\n");

drivers/i2c/busses/i2c-designware-baytrail.c +1 -0
+		dev_err(dev->dev, "iosf failed to reset punit

semaphore during write\n");
 }

 static int baytrail_i2c_acquire(struct dw_i2c_dev *dev)

drivers/i2c/busses/i2c-designware-baytrail.c +1 -1
@@ -83,7 +83,7 @@ static int baytrail_i2c_acquire(struct dw_i2c_dev
 *dev)
  	start = jiffies;
  	end = start + msecs_to_jiffies(SEMAPHORE_TIMEOUT);
  	do {
-		ret = get_sem(dev->dev, &sem);
+		ret = get_sem(dev, &sem);
  		if (!ret && sem) {
  			acquired = jiffies;

  dev_dbg(dev->dev, "punit semaphore acquired after %ums\n",

drivers/i2c/busses/i2c-designware-baytrail.c +0 -0
@@ -95,7 +95,7 @@ static int baytrail_i2c_acquire(struct dw_i2c_dev
 *dev)
  	} while (time_before(jiffies, end));


  dev_err(dev->dev, "punit semaphore timed out, resetting\n");

drivers/i2c/busses/i2c-designware-baytrail.c +1 -1
-	reset_semaphore(dev->dev);
+	reset_semaphore(dev);


  ret = iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ, PUNIT_SEMAPHORE, &sem);
  if (ret)

drivers/i2c/busses/i2c-designware-baytrail.c +0 -0
@@ -116,7 +116,7 @@ static void baytrail_i2c_release(struct dw_i2c_dev
 *dev)
  	if (!dev->acquire_lock)
  		return;

drivers/i2c/busses/i2c-designware-baytrail.c +1 -1
-	reset_semaphore(dev->dev);
+	reset_semaphore(dev);

  dev_dbg(dev->dev, "punit semaphore held for %ums\n", jiffies_to_msecs(jiffies - acquired)); }

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
#2 lore raw

Re: [PATCH 2/2] i2c: designware-baytrail: Add support for cherrytrail

In reply to Hans de Goede
Quoted 2 lines · Hans de Goede

The cherrytrail punit has the pmic i2c bus access semaphore at a different register address.

Thanks for the patch. My comments below.

drivers/i2c/busses/i2c-designware-baytrail.c line 26

Quoted 10 lines
drivers/i2c/busses/i2c-designware-baytrail.c +0 -0
@@ -22,7 +22,8 @@
  #include "i2c-designware-core.h"


 #define SEMAPHORE_TIMEOUT 100

drivers/i2c/busses/i2c-designware-baytrail.c +1 -1
-#define PUNIT_SEMAPHORE		0x7
+#define PUNIT_SEMAPHORE		((dev->accessor_flags &

ACCESS_IS_CHERRYTRAIL) \

drivers/i2c/busses/i2c-designware-baytrail.c +1 -0
+				 ? 0x10e : 0x7)

Personally I don't like this.

What if we do it in a helper function

static u32 get_sem_addr()
{
...
return addr;
}

And user

{
u32 addr = get_sem_addr(...);

iosf...(..., addr, ...);
}

drivers/i2c/busses/i2c-designware-core.h struct dw_i2c_dev { · line 127

Quoted 8 lines
drivers/i2c/busses/i2c-designware-core.h +2 -0
@@ -123,6 +123,8 @@ struct dw_i2c_dev {
  #define ACCESS_SWAP		0x00000001
  #define ACCESS_16BIT		0x00000002
  #define ACCESS_INTR_MASK	0x00000004
+/* Not really an accessor_flag but also set through driver_data */
+#define ACCESS_IS_CHERRYTRAIL	0x00000008

Don't like it either. Here two ways I see:
Introduce another member to keep non-accessor flags, or rename existing one and create new flags with some other prefix.

Quoted 19 lines


 extern int i2c_dw_init(struct dw_i2c_dev *dev); extern void i2c_dw_disable(struct dw_i2c_dev *dev);

drivers/i2c/busses/i2c-designware-pcidrv.c +1 -0
index 96f8230..d774bab 100644
@@ -45,6 +45,7 @@ enum dw_pci_ctl_id_t {
  	medfield,
  	merrifield,
  	baytrail,
+	cherrytrail,
  	haswell,
  };

drivers/i2c/busses/i2c-designware-pcidrv.c +0 -0
@@ -174,6 +175,14 @@ static struct dw_pci_controller
 dw_pci_controllers[] = {
  		.functionality = I2C_FUNC_10BIT_ADDR,

drivers/i2c/busses/i2c-designware-pcidrv.c static struct dw_pci_controller · line 186

Quoted 10 lines
drivers/i2c/busses/i2c-designware-pcidrv.c +7 -0
  		.scl_sda_cfg = &hsw_config,
  	},
 
+	[cherrytrail] = {
+		.bus_num = -1,
+		.bus_cfg = INTEL_MID_STD_CFG | DW_IC_CON_SPEED_FAST,
+		.tx_fifo_depth = 32,
+		.rx_fifo_depth = 32,
+		.functionality = I2C_FUNC_10BIT_ADDR,
+		.scl_sda_cfg = &byt_config,

Would be ugly if we actually put...

drivers/i2c/busses/i2c-designware-pcidrv.c static int i2c_dw_pci_probe(struct pci_dev *pdev, · line 254

Quoted 10 lines
drivers/i2c/busses/i2c-designware-pcidrv.c +1 -0
+	},
  };


 #ifdef CONFIG_PM

drivers/i2c/busses/i2c-designware-pcidrv.c +2 -0
@@ -241,6 +250,8 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev,
  	dev->base = pcim_iomap_table(pdev)[0];
  	dev->dev = &pdev->dev;
  	dev->irq = pdev->irq;
+	if (id->driver_data == cherrytrail)
+		dev->accessor_flags |= ACCESS_IS_CHERRYTRAIL;

...above inside the struct dw_pci_controller?

Quoted 40 lines


  if (controller->setup) {
  r = controller->setup(pdev, controller);

drivers/i2c/busses/i2c-designware-pcidrv.c +7 -7
@@ -321,13 +332,13 @@ static const struct pci_device_id
 i2_designware_pci_ids[] = {
  	{ PCI_VDEVICE(INTEL, 0x9c61), haswell },
  	{ PCI_VDEVICE(INTEL, 0x9c62), haswell },
  	/* Braswell / Cherrytrail */
-	{ PCI_VDEVICE(INTEL, 0x22C1), baytrail },
-	{ PCI_VDEVICE(INTEL, 0x22C2), baytrail },
-	{ PCI_VDEVICE(INTEL, 0x22C3), baytrail },
-	{ PCI_VDEVICE(INTEL, 0x22C4), baytrail },
-	{ PCI_VDEVICE(INTEL, 0x22C5), baytrail },
-	{ PCI_VDEVICE(INTEL, 0x22C6), baytrail },
-	{ PCI_VDEVICE(INTEL, 0x22C7), baytrail },
+	{ PCI_VDEVICE(INTEL, 0x22C1), cherrytrail },
+	{ PCI_VDEVICE(INTEL, 0x22C2), cherrytrail },
+	{ PCI_VDEVICE(INTEL, 0x22C3), cherrytrail },
+	{ PCI_VDEVICE(INTEL, 0x22C4), cherrytrail },
+	{ PCI_VDEVICE(INTEL, 0x22C5), cherrytrail },
+	{ PCI_VDEVICE(INTEL, 0x22C6), cherrytrail },
+	{ PCI_VDEVICE(INTEL, 0x22C7), cherrytrail },
  	{ 0,}
  };

 MODULE_DEVICE_TABLE(pci, i2_designware_pci_ids);

drivers/i2c/busses/i2c-designware-platdrv.c +1 -1
index 0b42a12..8974467 100644
@@ -123,7 +123,7 @@ static const struct acpi_device_id
 dw_i2c_acpi_match[] = {
  	{ "INT3432", 0 },
  	{ "INT3433", 0 },
  	{ "80860F41", 0 },
-	{ "808622C1", 0 },
+	{ "808622C1", ACCESS_IS_CHERRYTRAIL },
  	{ "AMD0010", ACCESS_INTR_MASK },
  	{ "AMDI0010", ACCESS_INTR_MASK },

  { "AMDI0510", 0 },

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
#3 lore raw

Re: [PATCH 2/2] i2c: designware-baytrail: Add support for cherrytrail

Hi,

Quoted 27 lines · Andy Shevchenko
Quoted 2 lines · Hans de Goede

The cherrytrail punit has the pmic i2c bus access semaphore at a different register address.

Thanks for the patch. My comments below.

drivers/i2c/busses/i2c-designware-baytrail.c line 27

Quoted 10 lines
drivers/i2c/busses/i2c-designware-baytrail.c +2 -1
@@ -22,7 +22,8 @@
 #include "i2c-designware-core.h"
 
 #define SEMAPHORE_TIMEOUT	100
-#define PUNIT_SEMAPHORE		0x7
+#define PUNIT_SEMAPHORE		((dev->accessor_flags &
 ACCESS_IS_CHERRYTRAIL) \
+				 ? 0x10e : 0x7)

Personally I don't like this.

What if we do it in a helper function

static u32 get_sem_addr()
{
...
return addr;
}

Quoted 7 lines

And user

{
u32 addr = get_sem_addr(...);

iosf...(..., addr, ...);
}

Ok I will change this for the next version.

Quoted 14 lines

drivers/i2c/busses/i2c-designware-core.h struct dw_i2c_dev { · line 127

Quoted 10 lines
drivers/i2c/busses/i2c-designware-core.h +2 -0
@@ -123,6 +123,8 @@ struct dw_i2c_dev {
 #define ACCESS_SWAP		0x00000001
 #define ACCESS_16BIT		0x00000002
 #define ACCESS_INTR_MASK	0x00000004
+/* Not really an accessor_flag but also set through driver_data */
+#define ACCESS_IS_CHERRYTRAIL	0x00000008

Don't like it either. Here two ways I see:
Introduce another member to keep non-accessor flags, or rename existing one and create new flags with some other prefix.

Ok, I will introduce a new patch in the next version of the series which renames the flags field as preparation for the other changes.

Quoted 36 lines
Quoted 20 lines
drivers/i2c/busses/i2c-designware-core.h +0 -0
 extern int i2c_dw_init(struct dw_i2c_dev *dev);
 extern void i2c_dw_disable(struct dw_i2c_dev *dev);
drivers/i2c/busses/i2c-designware-pcidrv.c +1 -0
index 96f8230..d774bab 100644
@@ -45,6 +45,7 @@ enum dw_pci_ctl_id_t {
 	medfield,
 	merrifield,
 	baytrail,
+	cherrytrail,
 	haswell,
 };
 
@@ -174,6 +175,14 @@ static struct dw_pci_controller
 dw_pci_controllers[] = {
 		.functionality = I2C_FUNC_10BIT_ADDR,

drivers/i2c/busses/i2c-designware-pcidrv.c static struct dw_pci_controller · line 186

Quoted 10 lines
drivers/i2c/busses/i2c-designware-pcidrv.c +7 -0
 		.scl_sda_cfg = &hsw_config,
 	},
 
+	[cherrytrail] = {
+		.bus_num = -1,
+		.bus_cfg = INTEL_MID_STD_CFG | DW_IC_CON_SPEED_FAST,
+		.tx_fifo_depth = 32,
+		.rx_fifo_depth = 32,
+		.functionality = I2C_FUNC_10BIT_ADDR,
+		.scl_sda_cfg = &byt_config,

Would be ugly if we actually put...

Quoted 3 lines
drivers/i2c/busses/i2c-designware-pcidrv.c +1 -0
+	},
 };
Quoted 9 lines

drivers/i2c/busses/i2c-designware-pcidrv.c static int i2c_dw_pci_probe(struct pci_dev *pdev, · line 254

Quoted 7 lines

#ifdef CONFIG_PM

drivers/i2c/busses/i2c-designware-pcidrv.c +2 -0
@@ -241,6 +250,8 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev,
 	dev->base = pcim_iomap_table(pdev)[0];
 	dev->dev = &pdev->dev;
 	dev->irq = pdev->irq;
+	if (id->driver_data == cherrytrail)
+		dev->accessor_flags |= ACCESS_IS_CHERRYTRAIL;

...above inside the struct dw_pci_controller?

Ack.

Note BTW that while trying to get battery readings from the axp288 pmic on my tablet now that the punit semaphore is working I repeatedly locked up my tablet. Without any i2c client drivers loaded a simple "i2cdump -y 14 0x34" would lookup the tablet in 1 - 3 runs guaranteed, and that is only reading from the pmic.

I managed to find a fix for this which I will include (as a separate patch) in the next version of my series. This will also hopefully fix the infamous: https://bugzilla.kernel.org/show_bug.cgi?id=109051,
as I could also make things work without my fix with "intel_idle.max_cstate=0" so they seem to be related.

Regards,

Hans

Quoted 42 lines
Quoted 41 lines
drivers/i2c/busses/i2c-designware-pcidrv.c +7 -7
 	if (controller->setup) {
 		r = controller->setup(pdev, controller);
@@ -321,13 +332,13 @@ static const struct pci_device_id
 i2_designware_pci_ids[] = {
 	{ PCI_VDEVICE(INTEL, 0x9c61), haswell },
 	{ PCI_VDEVICE(INTEL, 0x9c62), haswell },
 	/* Braswell / Cherrytrail */
-	{ PCI_VDEVICE(INTEL, 0x22C1), baytrail },
-	{ PCI_VDEVICE(INTEL, 0x22C2), baytrail },
-	{ PCI_VDEVICE(INTEL, 0x22C3), baytrail },
-	{ PCI_VDEVICE(INTEL, 0x22C4), baytrail },
-	{ PCI_VDEVICE(INTEL, 0x22C5), baytrail },
-	{ PCI_VDEVICE(INTEL, 0x22C6), baytrail },
-	{ PCI_VDEVICE(INTEL, 0x22C7), baytrail },
+	{ PCI_VDEVICE(INTEL, 0x22C1), cherrytrail },
+	{ PCI_VDEVICE(INTEL, 0x22C2), cherrytrail },
+	{ PCI_VDEVICE(INTEL, 0x22C3), cherrytrail },
+	{ PCI_VDEVICE(INTEL, 0x22C4), cherrytrail },
+	{ PCI_VDEVICE(INTEL, 0x22C5), cherrytrail },
+	{ PCI_VDEVICE(INTEL, 0x22C6), cherrytrail },
+	{ PCI_VDEVICE(INTEL, 0x22C7), cherrytrail },
 	{ 0,}
 };

MODULE_DEVICE_TABLE(pci, i2_designware_pci_ids);

drivers/i2c/busses/i2c-designware-platdrv.c +1 -1
index 0b42a12..8974467 100644
@@ -123,7 +123,7 @@ static const struct acpi_device_id
 dw_i2c_acpi_match[] = {
 	{ "INT3432", 0 },
 	{ "INT3433", 0 },
 	{ "80860F41", 0 },
-	{ "808622C1", 0 },
+	{ "808622C1", ACCESS_IS_CHERRYTRAIL },
 	{ "AMD0010", ACCESS_INTR_MASK },
 	{ "AMDI0010", ACCESS_INTR_MASK },

{ "AMDI0510", 0 },