diff mbox series

[v4,07/11] i2c: designware: Discard Cherry Trail model flag

Message ID 20200527120111.5781-8-Sergey.Semin@baikalelectronics.ru (mailing list archive)
State Superseded
Headers show
Series i2c: designeware: Add Baikal-T1 System I2C support | expand

Commit Message

Serge Semin May 27, 2020, 12:01 p.m. UTC
A PM workaround activated by the flag MODEL_CHERRYTRAIL has been removed
since commit 9cbeeca05049 ("i2c: designware: Remove Cherry Trail PMIC I2C
bus pm_disabled workaround"), but the flag most likely by mistake has been
left in the Dw I2C drivers. Let's remove it.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: devicetree@vger.kernel.org

---

Changelog v3:
- Since MSCC and Baikal-T1 will be a part of the platform driver code, we
  have to preserve the MODEL_MASK macro to use it to filter the model
  flags during the IP-specific quirks activation.
---
 drivers/i2c/busses/i2c-designware-core.h    | 3 +--
 drivers/i2c/busses/i2c-designware-pcidrv.c  | 1 -
 drivers/i2c/busses/i2c-designware-platdrv.c | 2 +-
 3 files changed, 2 insertions(+), 4 deletions(-)

Comments

Andy Shevchenko May 27, 2020, 1:43 p.m. UTC | #1
On Wed, May 27, 2020 at 03:01:07PM +0300, Serge Semin wrote:
> A PM workaround activated by the flag MODEL_CHERRYTRAIL has been removed
> since commit 9cbeeca05049 ("i2c: designware: Remove Cherry Trail PMIC I2C
> bus pm_disabled workaround"), but the flag most likely by mistake has been
> left in the Dw I2C drivers. Let's remove it.

...

> -#define MODEL_MSCC_OCELOT	0x00000200
> +#define MODEL_MSCC_OCELOT	0x00000100

But why?

Does 0x200 work or not? I didn't see this in commit message.
Serge Semin May 27, 2020, 2:29 p.m. UTC | #2
On Wed, May 27, 2020 at 04:43:39PM +0300, Andy Shevchenko wrote:
> On Wed, May 27, 2020 at 03:01:07PM +0300, Serge Semin wrote:
> > A PM workaround activated by the flag MODEL_CHERRYTRAIL has been removed
> > since commit 9cbeeca05049 ("i2c: designware: Remove Cherry Trail PMIC I2C
> > bus pm_disabled workaround"), but the flag most likely by mistake has been
> > left in the Dw I2C drivers. Let's remove it.
> 
> ...
> 
> > -#define MODEL_MSCC_OCELOT	0x00000200
> > +#define MODEL_MSCC_OCELOT	0x00000100
> 
> But why?
> 
> Does 0x200 work or not? I didn't see this in commit message.

I removed the MODEL_CHERRYTRAIL flag and redefined the only left
MODEL_MSCC_OCELOT flag to set the very first bit allocated for the model
flags. Isn't that obvious?

-Sergey

> 
> -- 
> With Best Regards,
> Andy Shevchenko
> 
>
Andy Shevchenko May 27, 2020, 3:48 p.m. UTC | #3
On Wed, May 27, 2020 at 05:29:02PM +0300, Serge Semin wrote:
> On Wed, May 27, 2020 at 04:43:39PM +0300, Andy Shevchenko wrote:
> > On Wed, May 27, 2020 at 03:01:07PM +0300, Serge Semin wrote:
> > > A PM workaround activated by the flag MODEL_CHERRYTRAIL has been removed
> > > since commit 9cbeeca05049 ("i2c: designware: Remove Cherry Trail PMIC I2C
> > > bus pm_disabled workaround"), but the flag most likely by mistake has been
> > > left in the Dw I2C drivers. Let's remove it.
> > 
> > ...
> > 
> > > -#define MODEL_MSCC_OCELOT	0x00000200
> > > +#define MODEL_MSCC_OCELOT	0x00000100
> > 
> > But why?
> > 
> > Does 0x200 work or not? I didn't see this in commit message.
> 
> I removed the MODEL_CHERRYTRAIL flag and redefined the only left
> MODEL_MSCC_OCELOT flag to set the very first bit allocated for the model
> flags. Isn't that obvious?

Yes, but how it's related to the MSCC_OCELOT?

Can't you simple put your define later to that number if absence of 0x100
provokes an exception when reading this code.

Again, unneeded churn.
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-designware-core.h b/drivers/i2c/busses/i2c-designware-core.h
index 150de5e5c31b..b9ef9b0deef0 100644
--- a/drivers/i2c/busses/i2c-designware-core.h
+++ b/drivers/i2c/busses/i2c-designware-core.h
@@ -289,8 +289,7 @@  struct dw_i2c_dev {
 #define ACCESS_INTR_MASK	0x00000004
 #define ACCESS_NO_IRQ_SUSPEND	0x00000008
 
-#define MODEL_CHERRYTRAIL	0x00000100
-#define MODEL_MSCC_OCELOT	0x00000200
+#define MODEL_MSCC_OCELOT	0x00000100
 #define MODEL_MASK		0x00000f00
 
 u32 dw_readl(struct dw_i2c_dev *dev, int offset);
diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c
index 11a5e4751eab..947c096f86e3 100644
--- a/drivers/i2c/busses/i2c-designware-pcidrv.c
+++ b/drivers/i2c/busses/i2c-designware-pcidrv.c
@@ -149,7 +149,6 @@  static struct dw_pci_controller dw_pci_controllers[] = {
 	},
 	[cherrytrail] = {
 		.bus_num = -1,
-		.flags = MODEL_CHERRYTRAIL,
 		.scl_sda_cfg = &byt_config,
 	},
 	[elkhartlake] = {
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index f6d2c96e35ce..ca057aa9eac4 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -44,7 +44,7 @@  static const struct acpi_device_id dw_i2c_acpi_match[] = {
 	{ "INT3432", 0 },
 	{ "INT3433", 0 },
 	{ "80860F41", ACCESS_NO_IRQ_SUSPEND },
-	{ "808622C1", ACCESS_NO_IRQ_SUSPEND | MODEL_CHERRYTRAIL },
+	{ "808622C1", ACCESS_NO_IRQ_SUSPEND },
 	{ "AMD0010", ACCESS_INTR_MASK },
 	{ "AMDI0010", ACCESS_INTR_MASK },
 	{ "AMDI0510", 0 },