diff mbox series

[v4,06/11] i2c: designware: Add Baytrail sem config DW I2C platform dependency

Message ID 20200527120111.5781-7-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
Currently Intel Baytrail I2C semaphore is a feature of the DW APB I2C
platform driver. It's a bit confusing to see it's config in the menu at
some separated place with no reference to the platform code. Let's move the
config definition to be below the I2C_DESIGNWARE_PLATFORM config and mark
it with "depends on I2C_DESIGNWARE_PLATFORM" statement. By doing so the
config menu will display the feature right below the DW I2C platform
driver item and will indent it to the right so signifying its belonging.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: devicetree@vger.kernel.org

---

Changelog v3:
- Replace if-endif clause around the I2C_DESIGNWARE_BAYTRAIL config
  with "depends on" operator.
---
 drivers/i2c/busses/Kconfig | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

Comments

Andy Shevchenko May 27, 2020, 1:42 p.m. UTC | #1
On Wed, May 27, 2020 at 03:01:06PM +0300, Serge Semin wrote:
> Currently Intel Baytrail I2C semaphore is a feature of the DW APB I2C
> platform driver. It's a bit confusing to see it's config in the menu at
> some separated place with no reference to the platform code. Let's move the
> config definition to be below the I2C_DESIGNWARE_PLATFORM config and mark
> it with "depends on I2C_DESIGNWARE_PLATFORM" statement. By doing so the
> config menu will display the feature right below the DW I2C platform
> driver item and will indent it to the right so signifying its belonging.

...

>  config I2C_DESIGNWARE_BAYTRAIL
>  	bool "Intel Baytrail I2C semaphore support"
>  	depends on ACPI
> +	depends on I2C_DESIGNWARE_PLATFORM
>  	depends on (I2C_DESIGNWARE_PLATFORM=m && IOSF_MBI) || \
>  		   (I2C_DESIGNWARE_PLATFORM=y && IOSF_MBI=y)

I didn't get this. What is broken now with existing dependencies?

(The move of the PCI part is fine)
Serge Semin May 27, 2020, 2:24 p.m. UTC | #2
On Wed, May 27, 2020 at 04:42:20PM +0300, Andy Shevchenko wrote:
> On Wed, May 27, 2020 at 03:01:06PM +0300, Serge Semin wrote:
> > Currently Intel Baytrail I2C semaphore is a feature of the DW APB I2C
> > platform driver. It's a bit confusing to see it's config in the menu at
> > some separated place with no reference to the platform code. Let's move the
> > config definition to be below the I2C_DESIGNWARE_PLATFORM config and mark
> > it with "depends on I2C_DESIGNWARE_PLATFORM" statement. By doing so the
> > config menu will display the feature right below the DW I2C platform
> > driver item and will indent it to the right so signifying its belonging.
> 
> ...
> 

> >  config I2C_DESIGNWARE_BAYTRAIL
> >  	bool "Intel Baytrail I2C semaphore support"
> >  	depends on ACPI
> > +	depends on I2C_DESIGNWARE_PLATFORM
> >  	depends on (I2C_DESIGNWARE_PLATFORM=m && IOSF_MBI) || \
> >  		   (I2C_DESIGNWARE_PLATFORM=y && IOSF_MBI=y)
> 
> I didn't get this. What is broken now with existing dependencies?

With no explicit "depends on I2C_DESIGNWARE_PLATFORM" the entry isn't right
shifted with respect to the I2C_DESIGNWARE_PLATFORM config entry in the kernel
menuconfig. So it looks like a normal no-yes driver without it. 

-Sergey

> 
> (The move of the PCI part is fine)
> 
> -- 
> With Best Regards,
> Andy Shevchenko
> 
>
Andy Shevchenko May 27, 2020, 3:46 p.m. UTC | #3
On Wed, May 27, 2020 at 05:24:06PM +0300, Serge Semin wrote:
> On Wed, May 27, 2020 at 04:42:20PM +0300, Andy Shevchenko wrote:
> > On Wed, May 27, 2020 at 03:01:06PM +0300, Serge Semin wrote:
> > > Currently Intel Baytrail I2C semaphore is a feature of the DW APB I2C
> > > platform driver. It's a bit confusing to see it's config in the menu at
> > > some separated place with no reference to the platform code. Let's move the
> > > config definition to be below the I2C_DESIGNWARE_PLATFORM config and mark
> > > it with "depends on I2C_DESIGNWARE_PLATFORM" statement. By doing so the
> > > config menu will display the feature right below the DW I2C platform
> > > driver item and will indent it to the right so signifying its belonging.

...

> > >  config I2C_DESIGNWARE_BAYTRAIL
> > >  	bool "Intel Baytrail I2C semaphore support"
> > >  	depends on ACPI
> > > +	depends on I2C_DESIGNWARE_PLATFORM
> > >  	depends on (I2C_DESIGNWARE_PLATFORM=m && IOSF_MBI) || \
> > >  		   (I2C_DESIGNWARE_PLATFORM=y && IOSF_MBI=y)
> > 
> > I didn't get this. What is broken now with existing dependencies?
> 
> With no explicit "depends on I2C_DESIGNWARE_PLATFORM" the entry isn't right
> shifted with respect to the I2C_DESIGNWARE_PLATFORM config entry in the kernel
> menuconfig. So it looks like a normal no-yes driver without it. 

I didn't get. Is there problems with current case? (I don't see it).
If there is a problem, it should have a separate patch and commit message.

As for now above excerpt seems redundant and unneeded churn.
Serge Semin May 27, 2020, 4 p.m. UTC | #4
On Wed, May 27, 2020 at 06:46:32PM +0300, Andy Shevchenko wrote:
> On Wed, May 27, 2020 at 05:24:06PM +0300, Serge Semin wrote:
> > On Wed, May 27, 2020 at 04:42:20PM +0300, Andy Shevchenko wrote:
> > > On Wed, May 27, 2020 at 03:01:06PM +0300, Serge Semin wrote:
> > > > Currently Intel Baytrail I2C semaphore is a feature of the DW APB I2C
> > > > platform driver. It's a bit confusing to see it's config in the menu at
> > > > some separated place with no reference to the platform code. Let's move the
> > > > config definition to be below the I2C_DESIGNWARE_PLATFORM config and mark
> > > > it with "depends on I2C_DESIGNWARE_PLATFORM" statement. By doing so the
> > > > config menu will display the feature right below the DW I2C platform
> > > > driver item and will indent it to the right so signifying its belonging.
> 
> ...
> 
> > > >  config I2C_DESIGNWARE_BAYTRAIL
> > > >  	bool "Intel Baytrail I2C semaphore support"
> > > >  	depends on ACPI
> > > > +	depends on I2C_DESIGNWARE_PLATFORM
> > > >  	depends on (I2C_DESIGNWARE_PLATFORM=m && IOSF_MBI) || \
> > > >  		   (I2C_DESIGNWARE_PLATFORM=y && IOSF_MBI=y)
> > > 
> > > I didn't get this. What is broken now with existing dependencies?
> > 
> > With no explicit "depends on I2C_DESIGNWARE_PLATFORM" the entry isn't right
> > shifted with respect to the I2C_DESIGNWARE_PLATFORM config entry in the kernel
> > menuconfig. So it looks like a normal no-yes driver without it. 
> 
> I didn't get. Is there problems with current case? (I don't see it).
> If there is a problem, it should have a separate patch and commit message.
> 
> As for now above excerpt seems redundant and unneeded churn.

Please read the commit log more carefully.

Without explicit "depends on I2C_DESIGNWARE_PLATFORM" you'd see the DW
I2C-related menuconfig as:
[*] Synopsys DesignWare Platform
[ ] Intel Baytrail I2C semaphore support
with that "depends on I2C_DESIGNWARE_PLATFORM" added:
[*] Synopsys DesignWare Platform
[ ]     Intel Baytrail I2C semaphore support
The second case presents the Baytrail semaphore as the DW I2C platform
feature. Otherwise it's just a simple menuentry. As I see it without adding
the explicit "depends on I2C_DESIGNWARE_PLATFORM" there is no need in moving
the config at all. So if you think it's a churn. Well, I'll wait for
Jarkko' comment in this regard.

BTW Jarkko asked in v3 whether it would work with just explicit "depends on"
without if-endif enclosing the config.

-Sergey

> 
> -- 
> With Best Regards,
> Andy Shevchenko
> 
>
Andy Shevchenko May 27, 2020, 4:43 p.m. UTC | #5
On Wed, May 27, 2020 at 07:00:56PM +0300, Serge Semin wrote:
> On Wed, May 27, 2020 at 06:46:32PM +0300, Andy Shevchenko wrote:
> > On Wed, May 27, 2020 at 05:24:06PM +0300, Serge Semin wrote:
> > > On Wed, May 27, 2020 at 04:42:20PM +0300, Andy Shevchenko wrote:
> > > > On Wed, May 27, 2020 at 03:01:06PM +0300, Serge Semin wrote:
> > > > > Currently Intel Baytrail I2C semaphore is a feature of the DW APB I2C
> > > > > platform driver. It's a bit confusing to see it's config in the menu at
> > > > > some separated place with no reference to the platform code. Let's move the
> > > > > config definition to be below the I2C_DESIGNWARE_PLATFORM config and mark
> > > > > it with "depends on I2C_DESIGNWARE_PLATFORM" statement. By doing so the
> > > > > config menu will display the feature right below the DW I2C platform
> > > > > driver item and will indent it to the right so signifying its belonging.
> > 
> > ...
> > 
> > > > >  config I2C_DESIGNWARE_BAYTRAIL
> > > > >  	bool "Intel Baytrail I2C semaphore support"
> > > > >  	depends on ACPI
> > > > > +	depends on I2C_DESIGNWARE_PLATFORM
> > > > >  	depends on (I2C_DESIGNWARE_PLATFORM=m && IOSF_MBI) || \
> > > > >  		   (I2C_DESIGNWARE_PLATFORM=y && IOSF_MBI=y)
> > > > 
> > > > I didn't get this. What is broken now with existing dependencies?
> > > 
> > > With no explicit "depends on I2C_DESIGNWARE_PLATFORM" the entry isn't right
> > > shifted with respect to the I2C_DESIGNWARE_PLATFORM config entry in the kernel
> > > menuconfig. So it looks like a normal no-yes driver without it. 
> > 
> > I didn't get. Is there problems with current case? (I don't see it).
> > If there is a problem, it should have a separate patch and commit message.
> > 
> > As for now above excerpt seems redundant and unneeded churn.
> 
> Please read the commit log more carefully.
> 
> Without explicit "depends on I2C_DESIGNWARE_PLATFORM" you'd see the DW
> I2C-related menuconfig as:
> [*] Synopsys DesignWare Platform
> [ ] Intel Baytrail I2C semaphore support
> with that "depends on I2C_DESIGNWARE_PLATFORM" added:
> [*] Synopsys DesignWare Platform
> [ ]     Intel Baytrail I2C semaphore support
> The second case presents the Baytrail semaphore as the DW I2C platform
> feature. Otherwise it's just a simple menuentry. As I see it without adding
> the explicit "depends on I2C_DESIGNWARE_PLATFORM" there is no need in moving
> the config at all.

Thanks for explanation, this makes sense.


> So if you think it's a churn. Well, I'll wait for
> Jarkko' comment in this regard.
> 
> BTW Jarkko asked in v3 whether it would work with just explicit "depends on"
> without if-endif enclosing the config.
> 
> -Sergey
> 
> > 
> > -- 
> > With Best Regards,
> > Andy Shevchenko
> > 
> >
diff mbox series

Patch

diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index 7f92f6a96042..7cd279c36898 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -549,20 +549,10 @@  config I2C_DESIGNWARE_PLATFORM
 	  This driver can also be built as a module.  If so, the module
 	  will be called i2c-designware-platform.
 
-config I2C_DESIGNWARE_PCI
-	tristate "Synopsys DesignWare PCI"
-	depends on PCI
-	select I2C_DESIGNWARE_CORE
-	help
-	  If you say yes to this option, support will be included for the
-	  Synopsys DesignWare I2C adapter. Only master mode is supported.
-
-	  This driver can also be built as a module.  If so, the module
-	  will be called i2c-designware-pci.
-
 config I2C_DESIGNWARE_BAYTRAIL
 	bool "Intel Baytrail I2C semaphore support"
 	depends on ACPI
+	depends on I2C_DESIGNWARE_PLATFORM
 	depends on (I2C_DESIGNWARE_PLATFORM=m && IOSF_MBI) || \
 		   (I2C_DESIGNWARE_PLATFORM=y && IOSF_MBI=y)
 	help
@@ -572,6 +562,17 @@  config I2C_DESIGNWARE_BAYTRAIL
 	  the platform firmware controlling it. You should say Y if running on
 	  a BayTrail system using the AXP288.
 
+config I2C_DESIGNWARE_PCI
+	tristate "Synopsys DesignWare PCI"
+	depends on PCI
+	select I2C_DESIGNWARE_CORE
+	help
+	  If you say yes to this option, support will be included for the
+	  Synopsys DesignWare I2C adapter. Only master mode is supported.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called i2c-designware-pci.
+
 config I2C_DIGICOLOR
 	tristate "Conexant Digicolor I2C driver"
 	depends on ARCH_DIGICOLOR || COMPILE_TEST