Patchwork [v1] i2c: acpi: Move I2C bits from acpi.h to i2c.h

login
register
mail settings
Submitter Andy Shevchenko
Date Jan. 9, 2019, 3:24 p.m.
Message ID <20190109152455.66042-1-andriy.shevchenko@linux.intel.com>
Download mbox | patch
Permalink /patch/696001/
State New
Headers show

Comments

Andy Shevchenko - Jan. 9, 2019, 3:24 p.m.
As discussed previously the best location for certain bus related bits,
e.g. I2C, is its own realm of the headers.

In order to uncontaminate acpi.h move the I2C bits to i2c.h.

There is no functional change intended.

Link: https://lkml.org/lkml/2018/11/28/744
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 include/linux/acpi.h | 11 -----------
 include/linux/i2c.h  | 10 ++++++++++
 2 files changed, 10 insertions(+), 11 deletions(-)
Mika Westerberg - Jan. 10, 2019, 1:09 p.m.
On Wed, Jan 09, 2019 at 05:24:55PM +0200, Andy Shevchenko wrote:
> As discussed previously the best location for certain bus related bits,
> e.g. I2C, is its own realm of the headers.
> 
> In order to uncontaminate acpi.h move the I2C bits to i2c.h.
> 
> There is no functional change intended.
> 
> Link: https://lkml.org/lkml/2018/11/28/744
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Rafael J. Wysocki - Jan. 10, 2019, 9:57 p.m.
On Wednesday, January 9, 2019 4:24:55 PM CET Andy Shevchenko wrote:
> As discussed previously the best location for certain bus related bits,
> e.g. I2C, is its own realm of the headers.
> 
> In order to uncontaminate acpi.h move the I2C bits to i2c.h.
> 
> There is no functional change intended.
> 
> Link: https://lkml.org/lkml/2018/11/28/744
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  include/linux/acpi.h | 11 -----------
>  include/linux/i2c.h  | 10 ++++++++++
>  2 files changed, 10 insertions(+), 11 deletions(-)
> 
> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
> index 83e55a704870..5d6caba28c00 100644
> --- a/include/linux/acpi.h
> +++ b/include/linux/acpi.h
> @@ -1023,17 +1023,6 @@ static inline int acpi_dev_gpio_irq_get(struct acpi_device *adev, int index)
>  }
>  #endif
>  
> -#if defined(CONFIG_ACPI) && IS_ENABLED(CONFIG_I2C)
> -bool i2c_acpi_get_i2c_resource(struct acpi_resource *ares,
> -			       struct acpi_resource_i2c_serialbus **i2c);
> -#else
> -static inline bool i2c_acpi_get_i2c_resource(struct acpi_resource *ares,
> -					     struct acpi_resource_i2c_serialbus **i2c)
> -{
> -	return false;
> -}
> -#endif
> -
>  /* Device properties */
>  
>  #ifdef CONFIG_ACPI
> diff --git a/include/linux/i2c.h b/include/linux/i2c.h
> index 65b4eaed1d96..10c8e021b35f 100644
> --- a/include/linux/i2c.h
> +++ b/include/linux/i2c.h
> @@ -933,11 +933,21 @@ static inline int of_i2c_get_board_info(struct device *dev,
>  
>  #endif /* CONFIG_OF */
>  
> +struct acpi_resource;
> +struct acpi_resource_i2c_serialbus;
> +
>  #if IS_ENABLED(CONFIG_ACPI)
> +bool i2c_acpi_get_i2c_resource(struct acpi_resource *ares,
> +			       struct acpi_resource_i2c_serialbus **i2c);
>  u32 i2c_acpi_find_bus_speed(struct device *dev);
>  struct i2c_client *i2c_acpi_new_device(struct device *dev, int index,
>  				       struct i2c_board_info *info);
>  #else
> +static inline bool i2c_acpi_get_i2c_resource(struct acpi_resource *ares,
> +					     struct acpi_resource_i2c_serialbus **i2c)
> +{
> +	return false;
> +}
>  static inline u32 i2c_acpi_find_bus_speed(struct device *dev)
>  {
>  	return 0;
> 

Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Wolfram Sang - Jan. 15, 2019, 9:49 p.m.
> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Do you want an immutable branch for this patch, Rafael?
Rafael J. Wysocki - Jan. 15, 2019, 10:12 p.m.
On Tue, Jan 15, 2019 at 10:49 PM Wolfram Sang <wsa@the-dreams.de> wrote:
>
>
> > Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Do you want an immutable branch for this patch, Rafael?

No, thanks!
Wolfram Sang - Jan. 15, 2019, 10:20 p.m.
On Wed, Jan 09, 2019 at 05:24:55PM +0200, Andy Shevchenko wrote:
> As discussed previously the best location for certain bus related bits,
> e.g. I2C, is its own realm of the headers.
> 
> In order to uncontaminate acpi.h move the I2C bits to i2c.h.
> 
> There is no functional change intended.
> 
> Link: https://lkml.org/lkml/2018/11/28/744
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Applied to for-next, thanks!

Patch

diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 83e55a704870..5d6caba28c00 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -1023,17 +1023,6 @@  static inline int acpi_dev_gpio_irq_get(struct acpi_device *adev, int index)
 }
 #endif
 
-#if defined(CONFIG_ACPI) && IS_ENABLED(CONFIG_I2C)
-bool i2c_acpi_get_i2c_resource(struct acpi_resource *ares,
-			       struct acpi_resource_i2c_serialbus **i2c);
-#else
-static inline bool i2c_acpi_get_i2c_resource(struct acpi_resource *ares,
-					     struct acpi_resource_i2c_serialbus **i2c)
-{
-	return false;
-}
-#endif
-
 /* Device properties */
 
 #ifdef CONFIG_ACPI
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 65b4eaed1d96..10c8e021b35f 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -933,11 +933,21 @@  static inline int of_i2c_get_board_info(struct device *dev,
 
 #endif /* CONFIG_OF */
 
+struct acpi_resource;
+struct acpi_resource_i2c_serialbus;
+
 #if IS_ENABLED(CONFIG_ACPI)
+bool i2c_acpi_get_i2c_resource(struct acpi_resource *ares,
+			       struct acpi_resource_i2c_serialbus **i2c);
 u32 i2c_acpi_find_bus_speed(struct device *dev);
 struct i2c_client *i2c_acpi_new_device(struct device *dev, int index,
 				       struct i2c_board_info *info);
 #else
+static inline bool i2c_acpi_get_i2c_resource(struct acpi_resource *ares,
+					     struct acpi_resource_i2c_serialbus **i2c)
+{
+	return false;
+}
 static inline u32 i2c_acpi_find_bus_speed(struct device *dev)
 {
 	return 0;