linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1] mfd: intel-lpss: Pass I2C configuration via properties on BXT
@ 2016-01-26 12:17 Andy Shevchenko
  2016-03-08  7:43 ` Mika Westerberg
  2016-03-09  5:43 ` Lee Jones
  0 siblings, 2 replies; 3+ messages in thread
From: Andy Shevchenko @ 2016-01-26 12:17 UTC (permalink / raw)
  To: Mika Westerberg, Lee Jones, linux-kernel; +Cc: Andy Shevchenko

From: Mika Westerberg <mika.westerberg@linux.intel.com>

I2C host controller need to be configured properly in order to meet I2C
timings specified in the I2C protocol specification. Some Intel Broxton
based machines do not have this information in the ACPI namespace (or the
boot firmware does not support ACPI at all) so we use build-in device
properties instead.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/mfd/intel-lpss-acpi.c | 12 ++++++++++++
 drivers/mfd/intel-lpss-pci.c  | 12 ++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/drivers/mfd/intel-lpss-acpi.c b/drivers/mfd/intel-lpss-acpi.c
index 06f00d6..5a8d9c7 100644
--- a/drivers/mfd/intel-lpss-acpi.c
+++ b/drivers/mfd/intel-lpss-acpi.c
@@ -44,8 +44,20 @@ static const struct intel_lpss_platform_info bxt_info = {
 	.clk_rate = 100000000,
 };
 
+static struct property_entry bxt_i2c_properties[] = {
+	PROPERTY_ENTRY_U32("i2c-sda-hold-time-ns", 42),
+	PROPERTY_ENTRY_U32("i2c-sda-falling-time-ns", 171),
+	PROPERTY_ENTRY_U32("i2c-scl-falling-time-ns", 208),
+	{ },
+};
+
+static struct property_set bxt_i2c_pset = {
+	.properties = bxt_i2c_properties,
+};
+
 static const struct intel_lpss_platform_info bxt_i2c_info = {
 	.clk_rate = 133000000,
+	.pset = &bxt_i2c_pset,
 };
 
 static const struct acpi_device_id intel_lpss_acpi_ids[] = {
diff --git a/drivers/mfd/intel-lpss-pci.c b/drivers/mfd/intel-lpss-pci.c
index a7136c7..92b456f 100644
--- a/drivers/mfd/intel-lpss-pci.c
+++ b/drivers/mfd/intel-lpss-pci.c
@@ -107,8 +107,20 @@ static const struct intel_lpss_platform_info bxt_uart_info = {
 	.pset = &uart_pset,
 };
 
+static struct property_entry bxt_i2c_properties[] = {
+	PROPERTY_ENTRY_U32("i2c-sda-hold-time-ns", 42),
+	PROPERTY_ENTRY_U32("i2c-sda-falling-time-ns", 171),
+	PROPERTY_ENTRY_U32("i2c-scl-falling-time-ns", 208),
+	{ },
+};
+
+static struct property_set bxt_i2c_pset = {
+	.properties = bxt_i2c_properties,
+};
+
 static const struct intel_lpss_platform_info bxt_i2c_info = {
 	.clk_rate = 133000000,
+	.pset = &bxt_i2c_pset,
 };
 
 static const struct pci_device_id intel_lpss_pci_ids[] = {
-- 
2.7.0.rc3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 1/1] mfd: intel-lpss: Pass I2C configuration via properties on BXT
  2016-01-26 12:17 [PATCH v1 1/1] mfd: intel-lpss: Pass I2C configuration via properties on BXT Andy Shevchenko
@ 2016-03-08  7:43 ` Mika Westerberg
  2016-03-09  5:43 ` Lee Jones
  1 sibling, 0 replies; 3+ messages in thread
From: Mika Westerberg @ 2016-03-08  7:43 UTC (permalink / raw)
  To: Lee Jones; +Cc: Andy Shevchenko, linux-kernel

On Tue, Jan 26, 2016 at 02:17:49PM +0200, Andy Shevchenko wrote:
> From: Mika Westerberg <mika.westerberg@linux.intel.com>
> 
> I2C host controller need to be configured properly in order to meet I2C
> timings specified in the I2C protocol specification. Some Intel Broxton
> based machines do not have this information in the ACPI namespace (or the
> boot firmware does not support ACPI at all) so we use build-in device
> properties instead.
> 
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Hi Lee,

Any comments on this patch? If not, could you consider applying it to
the MFD tree?

Thanks.

> ---
>  drivers/mfd/intel-lpss-acpi.c | 12 ++++++++++++
>  drivers/mfd/intel-lpss-pci.c  | 12 ++++++++++++
>  2 files changed, 24 insertions(+)
> 
> diff --git a/drivers/mfd/intel-lpss-acpi.c b/drivers/mfd/intel-lpss-acpi.c
> index 06f00d6..5a8d9c7 100644
> --- a/drivers/mfd/intel-lpss-acpi.c
> +++ b/drivers/mfd/intel-lpss-acpi.c
> @@ -44,8 +44,20 @@ static const struct intel_lpss_platform_info bxt_info = {
>  	.clk_rate = 100000000,
>  };
>  
> +static struct property_entry bxt_i2c_properties[] = {
> +	PROPERTY_ENTRY_U32("i2c-sda-hold-time-ns", 42),
> +	PROPERTY_ENTRY_U32("i2c-sda-falling-time-ns", 171),
> +	PROPERTY_ENTRY_U32("i2c-scl-falling-time-ns", 208),
> +	{ },
> +};
> +
> +static struct property_set bxt_i2c_pset = {
> +	.properties = bxt_i2c_properties,
> +};
> +
>  static const struct intel_lpss_platform_info bxt_i2c_info = {
>  	.clk_rate = 133000000,
> +	.pset = &bxt_i2c_pset,
>  };
>  
>  static const struct acpi_device_id intel_lpss_acpi_ids[] = {
> diff --git a/drivers/mfd/intel-lpss-pci.c b/drivers/mfd/intel-lpss-pci.c
> index a7136c7..92b456f 100644
> --- a/drivers/mfd/intel-lpss-pci.c
> +++ b/drivers/mfd/intel-lpss-pci.c
> @@ -107,8 +107,20 @@ static const struct intel_lpss_platform_info bxt_uart_info = {
>  	.pset = &uart_pset,
>  };
>  
> +static struct property_entry bxt_i2c_properties[] = {
> +	PROPERTY_ENTRY_U32("i2c-sda-hold-time-ns", 42),
> +	PROPERTY_ENTRY_U32("i2c-sda-falling-time-ns", 171),
> +	PROPERTY_ENTRY_U32("i2c-scl-falling-time-ns", 208),
> +	{ },
> +};
> +
> +static struct property_set bxt_i2c_pset = {
> +	.properties = bxt_i2c_properties,
> +};
> +
>  static const struct intel_lpss_platform_info bxt_i2c_info = {
>  	.clk_rate = 133000000,
> +	.pset = &bxt_i2c_pset,
>  };
>  
>  static const struct pci_device_id intel_lpss_pci_ids[] = {
> -- 
> 2.7.0.rc3

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 1/1] mfd: intel-lpss: Pass I2C configuration via properties on BXT
  2016-01-26 12:17 [PATCH v1 1/1] mfd: intel-lpss: Pass I2C configuration via properties on BXT Andy Shevchenko
  2016-03-08  7:43 ` Mika Westerberg
@ 2016-03-09  5:43 ` Lee Jones
  1 sibling, 0 replies; 3+ messages in thread
From: Lee Jones @ 2016-03-09  5:43 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Mika Westerberg, linux-kernel

On Tue, 26 Jan 2016, Andy Shevchenko wrote:

> From: Mika Westerberg <mika.westerberg@linux.intel.com>
> 
> I2C host controller need to be configured properly in order to meet I2C
> timings specified in the I2C protocol specification. Some Intel Broxton
> based machines do not have this information in the ACPI namespace (or the
> boot firmware does not support ACPI at all) so we use build-in device
> properties instead.
> 
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/mfd/intel-lpss-acpi.c | 12 ++++++++++++
>  drivers/mfd/intel-lpss-pci.c  | 12 ++++++++++++
>  2 files changed, 24 insertions(+)

Applied, thanks.

> diff --git a/drivers/mfd/intel-lpss-acpi.c b/drivers/mfd/intel-lpss-acpi.c
> index 06f00d6..5a8d9c7 100644
> --- a/drivers/mfd/intel-lpss-acpi.c
> +++ b/drivers/mfd/intel-lpss-acpi.c
> @@ -44,8 +44,20 @@ static const struct intel_lpss_platform_info bxt_info = {
>  	.clk_rate = 100000000,
>  };
>  
> +static struct property_entry bxt_i2c_properties[] = {
> +	PROPERTY_ENTRY_U32("i2c-sda-hold-time-ns", 42),
> +	PROPERTY_ENTRY_U32("i2c-sda-falling-time-ns", 171),
> +	PROPERTY_ENTRY_U32("i2c-scl-falling-time-ns", 208),
> +	{ },
> +};
> +
> +static struct property_set bxt_i2c_pset = {
> +	.properties = bxt_i2c_properties,
> +};
> +
>  static const struct intel_lpss_platform_info bxt_i2c_info = {
>  	.clk_rate = 133000000,
> +	.pset = &bxt_i2c_pset,
>  };
>  
>  static const struct acpi_device_id intel_lpss_acpi_ids[] = {
> diff --git a/drivers/mfd/intel-lpss-pci.c b/drivers/mfd/intel-lpss-pci.c
> index a7136c7..92b456f 100644
> --- a/drivers/mfd/intel-lpss-pci.c
> +++ b/drivers/mfd/intel-lpss-pci.c
> @@ -107,8 +107,20 @@ static const struct intel_lpss_platform_info bxt_uart_info = {
>  	.pset = &uart_pset,
>  };
>  
> +static struct property_entry bxt_i2c_properties[] = {
> +	PROPERTY_ENTRY_U32("i2c-sda-hold-time-ns", 42),
> +	PROPERTY_ENTRY_U32("i2c-sda-falling-time-ns", 171),
> +	PROPERTY_ENTRY_U32("i2c-scl-falling-time-ns", 208),
> +	{ },
> +};
> +
> +static struct property_set bxt_i2c_pset = {
> +	.properties = bxt_i2c_properties,
> +};
> +
>  static const struct intel_lpss_platform_info bxt_i2c_info = {
>  	.clk_rate = 133000000,
> +	.pset = &bxt_i2c_pset,
>  };
>  
>  static const struct pci_device_id intel_lpss_pci_ids[] = {

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-09  5:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-26 12:17 [PATCH v1 1/1] mfd: intel-lpss: Pass I2C configuration via properties on BXT Andy Shevchenko
2016-03-08  7:43 ` Mika Westerberg
2016-03-09  5:43 ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).