All of lore.kernel.org
 help / color / mirror / Atom feed
* i2c: xlp9xx: add ACPI support for Broadcom Vulcan
@ 2016-05-24  8:09 Tanmay Jagdale
  2016-06-03 11:14 ` [PATCH v2] " Tanmay Jagdale
  0 siblings, 1 reply; 7+ messages in thread
From: Tanmay Jagdale @ 2016-05-24  8:09 UTC (permalink / raw)
  To: wsa; +Cc: linux-i2c, jayachandran.chandrashekaran, tanmay.jagdale

Added ACPI support for the I2C controller present on Broadcom's
Vulcan ARM64 processor. ACPI ID used by the controller is BRCM9007.

Signed-off-by: Tanmay Jagdale <tanmay.jagdale@broadcom.com>
---
 drivers/i2c/busses/i2c-xlp9xx.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/i2c/busses/i2c-xlp9xx.c b/drivers/i2c/busses/i2c-xlp9xx.c
index c941418..62a7cff 100644
--- a/drivers/i2c/busses/i2c-xlp9xx.c
+++ b/drivers/i2c/busses/i2c-xlp9xx.c
@@ -13,6 +13,7 @@
 #include <linux/io.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/acpi.h>
 #include <linux/platform_device.h>
 
 #define XLP9XX_I2C_DIV			0x0
@@ -429,12 +430,21 @@ static const struct of_device_id xlp9xx_i2c_of_match[] = {
 	{ /* sentinel */ },
 };
 
+#ifdef CONFIG_ACPI
+static const struct acpi_device_id vulcan_i2c_acpi_ids[] = {
+	{"BRCM9007", 0},
+	{}
+};
+MODULE_DEVICE_TABLE(acpi, vulcan_i2c_acpi_ids);
+#endif
+
 static struct platform_driver xlp9xx_i2c_driver = {
 	.probe = xlp9xx_i2c_probe,
 	.remove = xlp9xx_i2c_remove,
 	.driver = {
 		.name = "xlp9xx-i2c",
 		.of_match_table = xlp9xx_i2c_of_match,
+		.acpi_match_table = ACPI_PTR(vulcan_i2c_acpi_ids),
 	},
 };
 
-- 
2.1.0

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

* [PATCH v2] i2c: xlp9xx: add ACPI support for Broadcom Vulcan
  2016-05-24  8:09 i2c: xlp9xx: add ACPI support for Broadcom Vulcan Tanmay Jagdale
@ 2016-06-03 11:14 ` Tanmay Jagdale
  2016-06-17 17:20   ` Jayachandran C
  2016-06-18 14:04   ` Wolfram Sang
  0 siblings, 2 replies; 7+ messages in thread
From: Tanmay Jagdale @ 2016-06-03 11:14 UTC (permalink / raw)
  To: wsa; +Cc: linux-i2c, jayachandran.chandrashekaran, Tanmay Jagdale

Added ACPI support for the I2C controller present on Broadcom's
Vulcan ARM64 processor. ACPI ID used by the controller is BRCM9007.

Changed the xlp9xx_i2c_get_frequency() function to use
device_property_read_u32() API so that the "clock-frequency" value
can be read from _DSD in ACPI mode.

Signed-off-by: Tanmay Jagdale <tanmay.jagdale@broadcom.com>
---
Changes in v2:
	Changed of_property_read_u32() to device_property_read_u32()
	so that the "clock-frequency" can be read from DTS or ACPI.

 drivers/i2c/busses/i2c-xlp9xx.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-xlp9xx.c b/drivers/i2c/busses/i2c-xlp9xx.c
index c941418..049aa4d 100644
--- a/drivers/i2c/busses/i2c-xlp9xx.c
+++ b/drivers/i2c/busses/i2c-xlp9xx.c
@@ -13,6 +13,7 @@
 #include <linux/io.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/acpi.h>
 #include <linux/platform_device.h>
 
 #define XLP9XX_I2C_DIV			0x0
@@ -341,11 +342,10 @@ static struct i2c_algorithm xlp9xx_i2c_algo = {
 static int xlp9xx_i2c_get_frequency(struct platform_device *pdev,
 				    struct xlp9xx_i2c_dev *priv)
 {
-	struct device_node *np = pdev->dev.of_node;
 	u32 freq;
 	int err;
 
-	err = of_property_read_u32(np, "clock-frequency", &freq);
+	err = device_property_read_u32(&pdev->dev, "clock-frequency", &freq);
 	if (err) {
 		freq = XLP9XX_I2C_DEFAULT_FREQ;
 		dev_dbg(&pdev->dev, "using default frequency %u\n", freq);
@@ -429,12 +429,21 @@ static const struct of_device_id xlp9xx_i2c_of_match[] = {
 	{ /* sentinel */ },
 };
 
+#ifdef CONFIG_ACPI
+static const struct acpi_device_id vulcan_i2c_acpi_ids[] = {
+	{"BRCM9007", 0},
+	{}
+};
+MODULE_DEVICE_TABLE(acpi, vulcan_i2c_acpi_ids);
+#endif
+
 static struct platform_driver xlp9xx_i2c_driver = {
 	.probe = xlp9xx_i2c_probe,
 	.remove = xlp9xx_i2c_remove,
 	.driver = {
 		.name = "xlp9xx-i2c",
 		.of_match_table = xlp9xx_i2c_of_match,
+		.acpi_match_table = ACPI_PTR(vulcan_i2c_acpi_ids),
 	},
 };
 
-- 
2.1.0

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

* Re: [PATCH v2] i2c: xlp9xx: add ACPI support for Broadcom Vulcan
  2016-06-03 11:14 ` [PATCH v2] " Tanmay Jagdale
@ 2016-06-17 17:20   ` Jayachandran C
  2016-06-18 14:04   ` Wolfram Sang
  1 sibling, 0 replies; 7+ messages in thread
From: Jayachandran C @ 2016-06-17 17:20 UTC (permalink / raw)
  To: wsa; +Cc: Tanmay Jagdale, linux-i2c, Jayachandran C

On Fri, Jun 3, 2016 at 4:44 PM, Tanmay Jagdale
<tanmay.jagdale@broadcom.com> wrote:
> Added ACPI support for the I2C controller present on Broadcom's
> Vulcan ARM64 processor. ACPI ID used by the controller is BRCM9007.
>
> Changed the xlp9xx_i2c_get_frequency() function to use
> device_property_read_u32() API so that the "clock-frequency" value
> can be read from _DSD in ACPI mode.
>
> Signed-off-by: Tanmay Jagdale <tanmay.jagdale@broadcom.com>

Tested-by: Jayachandran C <jchandra@broadcom.com>

Tested with broadcom vulcan UEFI firmware. It would be useful
if this is merged, then we can use the I2C controller when booting
with ACPI

Thanks,
JC.

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

* Re: [PATCH v2] i2c: xlp9xx: add ACPI support for Broadcom Vulcan
  2016-06-03 11:14 ` [PATCH v2] " Tanmay Jagdale
  2016-06-17 17:20   ` Jayachandran C
@ 2016-06-18 14:04   ` Wolfram Sang
  2016-06-20  9:26     ` [PATCH v3] " Tanmay Jagdale
  1 sibling, 1 reply; 7+ messages in thread
From: Wolfram Sang @ 2016-06-18 14:04 UTC (permalink / raw)
  To: Tanmay Jagdale; +Cc: linux-i2c, jayachandran.chandrashekaran

[-- Attachment #1: Type: text/plain, Size: 130 bytes --]

>  #include <linux/module.h>
> +#include <linux/acpi.h>
>  #include <linux/platform_device.h>

Keep the includes sorted, please.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* [PATCH v3] i2c: xlp9xx: add ACPI support for Broadcom Vulcan
  2016-06-18 14:04   ` Wolfram Sang
@ 2016-06-20  9:26     ` Tanmay Jagdale
  2016-06-20 10:27       ` Mika Westerberg
  2016-07-08  1:42       ` Wolfram Sang
  0 siblings, 2 replies; 7+ messages in thread
From: Tanmay Jagdale @ 2016-06-20  9:26 UTC (permalink / raw)
  To: wsa
  Cc: linux-i2c, jayachandran.chandrashekaran, mika.westerberg, Tanmay Jagdale

Added ACPI support for the I2C controller present on Broadcom's
Vulcan ARM64 processor. ACPI ID used by the controller is BRCM9007.

Changed the xlp9xx_i2c_get_frequency() function to use
device_property_read_u32() API so that the "clock-frequency" value
can be read from _DSD in ACPI mode.

Signed-off-by: Tanmay Jagdale <tanmay.jagdale@broadcom.com>
---
Changes in v3:
	Sorted header file inclusion.
	Rename vulcan_i2c_acpi_ids to xlp9xx_i2c_acpi_ids to stay
	consistent with rest of the driver.

Changes in v2:
	Changed of_property_read_u32() to device_property_read_u32()
	so that the "clock-frequency" can be read from DTS or ACPI.

 drivers/i2c/busses/i2c-xlp9xx.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-xlp9xx.c b/drivers/i2c/busses/i2c-xlp9xx.c
index c941418..55a7bef 100644
--- a/drivers/i2c/busses/i2c-xlp9xx.c
+++ b/drivers/i2c/busses/i2c-xlp9xx.c
@@ -6,6 +6,7 @@
  * warranty of any kind, whether express or implied.
  */
 
+#include <linux/acpi.h>
 #include <linux/completion.h>
 #include <linux/i2c.h>
 #include <linux/init.h>
@@ -341,11 +342,10 @@ static struct i2c_algorithm xlp9xx_i2c_algo = {
 static int xlp9xx_i2c_get_frequency(struct platform_device *pdev,
 				    struct xlp9xx_i2c_dev *priv)
 {
-	struct device_node *np = pdev->dev.of_node;
 	u32 freq;
 	int err;
 
-	err = of_property_read_u32(np, "clock-frequency", &freq);
+	err = device_property_read_u32(&pdev->dev, "clock-frequency", &freq);
 	if (err) {
 		freq = XLP9XX_I2C_DEFAULT_FREQ;
 		dev_dbg(&pdev->dev, "using default frequency %u\n", freq);
@@ -429,12 +429,21 @@ static const struct of_device_id xlp9xx_i2c_of_match[] = {
 	{ /* sentinel */ },
 };
 
+#ifdef CONFIG_ACPI
+static const struct acpi_device_id xlp9xx_i2c_acpi_ids[] = {
+	{"BRCM9007", 0},
+	{}
+};
+MODULE_DEVICE_TABLE(acpi, xlp9xx_i2c_acpi_ids);
+#endif
+
 static struct platform_driver xlp9xx_i2c_driver = {
 	.probe = xlp9xx_i2c_probe,
 	.remove = xlp9xx_i2c_remove,
 	.driver = {
 		.name = "xlp9xx-i2c",
 		.of_match_table = xlp9xx_i2c_of_match,
+		.acpi_match_table = ACPI_PTR(xlp9xx_i2c_acpi_ids),
 	},
 };
 
-- 
2.1.0

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

* Re: [PATCH v3] i2c: xlp9xx: add ACPI support for Broadcom Vulcan
  2016-06-20  9:26     ` [PATCH v3] " Tanmay Jagdale
@ 2016-06-20 10:27       ` Mika Westerberg
  2016-07-08  1:42       ` Wolfram Sang
  1 sibling, 0 replies; 7+ messages in thread
From: Mika Westerberg @ 2016-06-20 10:27 UTC (permalink / raw)
  To: Tanmay Jagdale; +Cc: wsa, linux-i2c, jayachandran.chandrashekaran

On Mon, Jun 20, 2016 at 02:56:18PM +0530, Tanmay Jagdale wrote:
> Added ACPI support for the I2C controller present on Broadcom's
> Vulcan ARM64 processor. ACPI ID used by the controller is BRCM9007.
> 
> Changed the xlp9xx_i2c_get_frequency() function to use
> device_property_read_u32() API so that the "clock-frequency" value
> can be read from _DSD in ACPI mode.
> 
> Signed-off-by: Tanmay Jagdale <tanmay.jagdale@broadcom.com>

Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>

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

* Re: [PATCH v3] i2c: xlp9xx: add ACPI support for Broadcom Vulcan
  2016-06-20  9:26     ` [PATCH v3] " Tanmay Jagdale
  2016-06-20 10:27       ` Mika Westerberg
@ 2016-07-08  1:42       ` Wolfram Sang
  1 sibling, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2016-07-08  1:42 UTC (permalink / raw)
  To: Tanmay Jagdale; +Cc: linux-i2c, jayachandran.chandrashekaran, mika.westerberg

[-- Attachment #1: Type: text/plain, Size: 475 bytes --]

On Mon, Jun 20, 2016 at 02:56:18PM +0530, Tanmay Jagdale wrote:
> Added ACPI support for the I2C controller present on Broadcom's
> Vulcan ARM64 processor. ACPI ID used by the controller is BRCM9007.
> 
> Changed the xlp9xx_i2c_get_frequency() function to use
> device_property_read_u32() API so that the "clock-frequency" value
> can be read from _DSD in ACPI mode.
> 
> Signed-off-by: Tanmay Jagdale <tanmay.jagdale@broadcom.com>

Applied to for-next, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2016-07-08  1:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-24  8:09 i2c: xlp9xx: add ACPI support for Broadcom Vulcan Tanmay Jagdale
2016-06-03 11:14 ` [PATCH v2] " Tanmay Jagdale
2016-06-17 17:20   ` Jayachandran C
2016-06-18 14:04   ` Wolfram Sang
2016-06-20  9:26     ` [PATCH v3] " Tanmay Jagdale
2016-06-20 10:27       ` Mika Westerberg
2016-07-08  1:42       ` Wolfram Sang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.