All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-next: manual merge of the arm-soc tree with the i2c-embedded tree
@ 2012-07-10  6:41 ` Stephen Rothwell
  0 siblings, 0 replies; 80+ messages in thread
From: Stephen Rothwell @ 2012-07-10  6:41 UTC (permalink / raw)
  To: Olof Johansson, Arnd Bergmann, linux-arm-kernel
  Cc: linux-next, linux-kernel, Lee Jones, Alessandro Rubini, Wolfram Sang

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

Hi all,

Today's linux-next merge of the arm-soc tree got a conflict in
drivers/i2c/busses/i2c-nomadik.c between commit af97bace2cca
("i2c-nomadik: move header to <linux/platform_data/i2c-nomadik.h>") from
the i2c-embedded tree and commits 32e42c687e0a ("ARM: ux500: Remove
unused i2c platform_data initialisation code") and 8214fd238a66 ("i2c:
Add Device Tree support to the Nomadik I2C driver") from the arm-soc tree.

I fixed it up (I think - see below) and can carry the fix as necessary.
Please check this and talk to each other ...

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/i2c/busses/i2c-nomadik.c
index e6b93f3,5471303..0000000
--- a/drivers/i2c/busses/i2c-nomadik.c
+++ b/drivers/i2c/busses/i2c-nomadik.c
@@@ -24,8 -23,10 +24,9 @@@
  #include <linux/io.h>
  #include <linux/regulator/consumer.h>
  #include <linux/pm_runtime.h>
 +#include <linux/platform_data/i2c-nomadik.h>
+ #include <linux/of.h>
  
 -#include <plat/i2c.h>
 -
  #define DRIVER_NAME "nmk-i2c"
  
  /* I2C Controller register offsets */
@@@ -911,23 -896,93 +908,94 @@@ static const struct i2c_algorithm nmk_i
  	.functionality	= nmk_i2c_functionality
  };
  
+ static struct nmk_i2c_controller u8500_i2c = {
+ 	/*
+ 	 * Slave data setup time; 250ns, 100ns, and 10ns, which
+ 	 * is 14, 6 and 2 respectively for a 48Mhz i2c clock.
+ 	 */
+ 	.slsu           = 0xe,
+ 	.tft            = 1,      /* Tx FIFO threshold */
+ 	.rft            = 8,      /* Rx FIFO threshold */
+ 	.clk_freq       = 400000, /* std. mode operation */
+ 	.timeout        = 200,    /* Slave response timeout(ms) */
+ 	.sm             = I2C_FREQ_MODE_FAST,
+ };
+ 
+ static int __devinit
+ nmk_i2c_of_probe(struct device_node *np, struct nmk_i2c_controller *pdata)
+ {
+ 	of_property_read_u32(np, "clock-frequency", (u32*)&pdata->clk_freq);
+ 	if (!pdata->clk_freq) {
+ 		pr_warn("%s: Clock frequency not found\n", np->full_name);
+ 		return -EINVAL;
+ 	}
+ 
+ 	of_property_read_u32(np, "stericsson,slsu", (u32*)&pdata->slsu);
+ 	if (!pdata->slsu) {
+ 		pr_warn("%s: Data line delay not found\n", np->full_name);
+ 		return -EINVAL;
+ 	}
+ 
+ 	of_property_read_u32(np, "stericsson,tft", (u32*)&pdata->tft);
+ 	if (!pdata->tft) {
+ 		pr_warn("%s: Tx FIFO threshold not found\n", np->full_name);
+ 		return -EINVAL;
+ 	}
+ 
+ 	of_property_read_u32(np, "stericsson,rft", (u32*)&pdata->rft);
+ 	if (!pdata->rft) {
+ 		pr_warn("%s: Rx FIFO threshold not found\n", np->full_name);
+ 		return -EINVAL;
+ 	}
+ 
+ 	of_property_read_u32(np, "stericsson,timeout", (u32*)&pdata->timeout);
+ 	if (!pdata->timeout) {
+ 		pr_warn("%s: Timeout not found\n", np->full_name);
+ 		return -EINVAL;
+ 	}
+ 
+ 	/*
+ 	 * This driver only supports fast and standard frequency
+ 	 * modes. If anything else is requested fall-back to standard.
+ 	 */
+ 	if (of_get_property(np, "stericsson,i2c_freq_mode_fast", NULL))
+ 		pdata->sm = I2C_FREQ_MODE_FAST;
+ 	else
+ 		pdata->sm = I2C_FREQ_MODE_STANDARD;
+ 
+ 	return 0;
+ }
+ 
 -static int __devinit nmk_i2c_probe(struct platform_device *pdev)
 +static atomic_t adapter_id = ATOMIC_INIT(0);
 +
 +static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id)
  {
  	int ret = 0;
- 	struct nmk_i2c_controller *pdata =
- 			adev->dev.platform_data;
 -	struct resource *res;
 -	struct nmk_i2c_controller *pdata = pdev->dev.platform_data;
 -	struct device_node *np = pdev->dev.of_node;
++	struct nmk_i2c_controller *pdata = adev->dev.platform_data;
++	struct device_node *np = adev->dev.of_node;
  	struct nmk_i2c_dev	*dev;
  	struct i2c_adapter *adap;
  
- 	if (!pdata) {
- 		dev_warn(&adev->dev, "no platform data\n");
- 		return -ENODEV;
+ 	if (np) {
+ 		if (!pdata) {
 -			pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
++			pdata = devm_kzalloc(&adev->dev, sizeof(*pdata), GFP_KERNEL);
+ 			if (!pdata) {
+ 				ret = -ENOMEM;
+ 				goto err_no_mem;
+ 			}
+ 		}
+ 		ret = nmk_i2c_of_probe(np, pdata);
+ 		if (ret)
+ 			kfree(pdata);
  	}
+ 
+ 	if (!pdata)
+ 		/* No i2c configuration found, using the default. */
+ 		pdata = &u8500_i2c;
+ 
  	dev = kzalloc(sizeof(struct nmk_i2c_dev), GFP_KERNEL);
  	if (!dev) {
 -		dev_err(&pdev->dev, "cannot allocate memory\n");
 +		dev_err(&adev->dev, "cannot allocate memory\n");
  		ret = -ENOMEM;
  		goto err_no_mem;
  	}
@@@ -969,12 -1037,12 +1037,11 @@@
  	adap->owner	= THIS_MODULE;
  	adap->class	= I2C_CLASS_HWMON | I2C_CLASS_SPD;
  	adap->algo	= &nmk_i2c_algo;
- 	adap->timeout	= pdata->timeout ? msecs_to_jiffies(pdata->timeout) :
- 		msecs_to_jiffies(20000);
+ 	adap->timeout	= msecs_to_jiffies(pdata->timeout);
 +	adap->nr = atomic_read(&adapter_id);
  	snprintf(adap->name, sizeof(adap->name),
 -		 "Nomadik I2C%d at %lx", pdev->id, (unsigned long)res->start);
 -
 -	/* fetch the controller id */
 -	adap->nr	= pdev->id;
 +		 "Nomadik I2C%d at %pR", adap->nr, &adev->res);
 +	atomic_inc(&adapter_id);
  
  	/* fetch the controller configuration from machine */
  	dev->cfg.clk_freq = pdata->clk_freq;
@@@ -1040,29 -1110,20 +1107,35 @@@ static int nmk_i2c_remove(struct amba_d
  	return 0;
  }
  
 +static struct amba_id nmk_i2c_ids[] = {
 +	{
 +		.id	= 0x00180024,
 +		.mask	= 0x00ffffff,
 +	},
 +	{
 +		.id	= 0x00380024,
 +		.mask	= 0x00ffffff,
 +	},
 +	{},
 +};
 +
 +MODULE_DEVICE_TABLE(amba, nmk_i2c_ids);
 +
+ static const struct of_device_id nmk_gpio_match[] = {
+ 	{ .compatible = "st,nomadik-i2c", },
+ 	{},
+ };
+ 
 -static struct platform_driver nmk_i2c_driver = {
 -	.driver = {
 +static struct amba_driver nmk_i2c_driver = {
 +	.drv = {
  		.owner = THIS_MODULE,
  		.name = DRIVER_NAME,
  		.pm = &nmk_i2c_pm,
+ 		.of_match_table = nmk_gpio_match,
  	},
 +	.id_table = nmk_i2c_ids,
  	.probe = nmk_i2c_probe,
 -	.remove = __devexit_p(nmk_i2c_remove),
 +	.remove = nmk_i2c_remove,
  };
  
  static int __init nmk_i2c_init(void)

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 80+ messages in thread
* linux-next: manual merge of the arm-soc tree with the i2c-embedded tree
@ 2012-07-19  5:28 ` Stephen Rothwell
  0 siblings, 0 replies; 80+ messages in thread
From: Stephen Rothwell @ 2012-07-19  5:28 UTC (permalink / raw)
  To: Olof Johansson, Arnd Bergmann, linux-arm-kernel
  Cc: linux-next, linux-kernel, Lee Jones, Alessandro Rubini, Wolfram Sang

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

Hi all,

Today's linux-next merge of the arm-soc tree got a conflict in
drivers/i2c/busses/i2c-nomadik.c between commit 235602146ec9
("i2c-nomadik: turn the platform driver to an amba driver") from the
i2c-embedded tree and commit 98582d9562b4 ("ARM: ux500: Remove unused i2c
platform_data initialisation code") from the arm-soc tree.

Just context changes.  I fixed it up (see below) and can carry the fix as
necessary.
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/i2c/busses/i2c-nomadik.c
index e6b93f3,a92440d..0000000
--- a/drivers/i2c/busses/i2c-nomadik.c
+++ b/drivers/i2c/busses/i2c-nomadik.c
@@@ -969,12 -965,12 +969,11 @@@ static int nmk_i2c_probe(struct amba_de
  	adap->owner	= THIS_MODULE;
  	adap->class	= I2C_CLASS_HWMON | I2C_CLASS_SPD;
  	adap->algo	= &nmk_i2c_algo;
- 	adap->timeout	= pdata->timeout ? msecs_to_jiffies(pdata->timeout) :
- 		msecs_to_jiffies(20000);
+ 	adap->timeout	= msecs_to_jiffies(pdata->timeout);
 +	adap->nr = atomic_read(&adapter_id);
  	snprintf(adap->name, sizeof(adap->name),
 -		 "Nomadik I2C%d at %lx", pdev->id, (unsigned long)res->start);
 -
 -	/* fetch the controller id */
 -	adap->nr	= pdev->id;
 +		 "Nomadik I2C%d at %pR", adap->nr, &adev->res);
 +	atomic_inc(&adapter_id);
  
  	/* fetch the controller configuration from machine */
  	dev->cfg.clk_freq = pdata->clk_freq;

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 80+ messages in thread
* linux-next: manual merge of the arm-soc tree with the i2c-embedded tree
@ 2012-09-13  6:41 ` Stephen Rothwell
  0 siblings, 0 replies; 80+ messages in thread
From: Stephen Rothwell @ 2012-09-13  6:41 UTC (permalink / raw)
  To: Olof Johansson, Arnd Bergmann, linux-arm-kernel
  Cc: linux-next, linux-kernel, "Uwe Kleine-König",
	Felipe Balbi, Wolfram Sang, Shubhrajyoti D

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

Hi all,

Today's linux-next merge of the arm-soc tree got a conflict in
drivers/i2c/busses/i2c-omap.c between commit d9ebd04d3476 ("i2c: omap:
switch to devm_* API") from the i2c-embedded tree and commit 07baca6f8fc2
("i2c/i2c-omap: add a const qualifier") from the arm-soc tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/i2c/busses/i2c-omap.c
index c78431a,a0e49f6..0000000
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@@ -1051,11 -943,12 +1051,12 @@@ omap_i2c_probe(struct platform_device *
  {
  	struct omap_i2c_dev	*dev;
  	struct i2c_adapter	*adap;
 -	struct resource		*mem, *irq, *ioarea;
 +	struct resource		*mem;
- 	struct omap_i2c_bus_platform_data *pdata = pdev->dev.platform_data;
+ 	const struct omap_i2c_bus_platform_data *pdata =
+ 		pdev->dev.platform_data;
  	struct device_node	*node = pdev->dev.of_node;
  	const struct of_device_id *match;
 -	irq_handler_t isr;
 +	int irq;
  	int r;
  
  	/* NOTE: driver uses the static register mapping */

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 80+ messages in thread
* linux-next: manual merge of the arm-soc tree with the i2c-embedded tree
@ 2012-11-15  5:27 ` Stephen Rothwell
  0 siblings, 0 replies; 80+ messages in thread
From: Stephen Rothwell @ 2012-11-15  5:27 UTC (permalink / raw)
  To: Olof Johansson, Arnd Bergmann, linux-arm-kernel
  Cc: linux-next, linux-kernel, Paul Walmsley, Wolfram Sang, Tony Lindgren

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

Hi all,

Today's linux-next merge of the arm-soc tree got a conflict in
arch/arm/plat-omap/i2c.c between commit 49839dc93970 ("Revert "ARM: OMAP:
convert I2C driver to PM QoS for MPU latency constraints"") from the
i2c-embedded tree and various commits from the arm-soc tree.

I used the version from the arm-soc tree (not sure if that is the correct
choice) and can carry the fix as necessary (no action is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2012-11-15  5:27 UTC | newest]

Thread overview: 80+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-10  6:41 linux-next: manual merge of the arm-soc tree with the i2c-embedded tree Stephen Rothwell
2012-07-10  6:41 ` Stephen Rothwell
2012-07-10  6:41 ` Stephen Rothwell
2012-07-10  6:50 ` Stephen Rothwell
2012-07-10  6:50   ` Stephen Rothwell
2012-07-10  6:50   ` Stephen Rothwell
2012-07-10  8:38 ` Wolfram Sang
2012-07-10  8:38   ` Wolfram Sang
2012-07-12 13:12 ` Wolfram Sang
2012-07-12 13:12   ` Wolfram Sang
2012-07-12 15:54   ` Arnd Bergmann
2012-07-12 15:54     ` Arnd Bergmann
2012-07-13 11:03     ` Lee Jones
2012-07-13 11:03       ` Lee Jones
2012-07-14 21:34   ` Linus Walleij
2012-07-14 21:34     ` Linus Walleij
2012-07-14 21:34     ` Linus Walleij
2012-07-16 10:17     ` Wolfram Sang
2012-07-16 10:17       ` Wolfram Sang
2012-07-16 11:31       ` Lee Jones
2012-07-16 11:31         ` Lee Jones
2012-07-16 13:00         ` Wolfram Sang
2012-07-16 13:00           ` Wolfram Sang
2012-07-16 13:55           ` Lee Jones
2012-07-16 13:55             ` Lee Jones
2012-07-17 13:06         ` Mark Brown
2012-07-17 13:06           ` Mark Brown
2012-07-17 13:30           ` Lee Jones
2012-07-17 13:30             ` Lee Jones
2012-07-17 13:35             ` Mark Brown
2012-07-17 13:35               ` Mark Brown
2012-07-17 14:02               ` Lee Jones
2012-07-17 14:02                 ` Lee Jones
2012-07-17 14:22                 ` Mark Brown
2012-07-17 14:22                   ` Mark Brown
2012-07-17 14:52                   ` Lee Jones
2012-07-17 14:52                     ` Lee Jones
2012-07-17 15:20                     ` Mark Brown
2012-07-17 15:20                       ` Mark Brown
2012-07-17 15:20                       ` Mark Brown
2012-07-18  5:33                       ` Shawn Guo
2012-07-18  5:33                         ` Shawn Guo
2012-07-18  5:33                         ` Shawn Guo
2012-07-18  9:59                         ` Mark Brown
2012-07-18  9:59                           ` Mark Brown
2012-07-18 10:29                           ` Lee Jones
2012-07-18 10:29                             ` Lee Jones
2012-07-18 10:33                             ` Mark Brown
2012-07-18 10:33                               ` Mark Brown
2012-07-18 10:43                               ` Lee Jones
2012-07-18 10:43                                 ` Lee Jones
2012-07-18  7:35                       ` Lee Jones
2012-07-18  7:35                         ` Lee Jones
2012-07-18 11:12                         ` Mark Brown
2012-07-18 11:12                           ` Mark Brown
2012-07-18 11:24                           ` Lee Jones
2012-07-18 11:24                             ` Lee Jones
2012-07-16 11:37       ` Linus Walleij
2012-07-16 11:37         ` Linus Walleij
2012-07-16 12:35         ` Wolfram Sang
2012-07-16 12:35           ` Wolfram Sang
2012-07-16 19:45           ` Linus Walleij
2012-07-16 19:45             ` Linus Walleij
2012-07-16 19:45             ` Linus Walleij
2012-07-16 20:04             ` Chris Ball
2012-07-16 20:04               ` Chris Ball
2012-07-16 20:04               ` Chris Ball
2012-07-17 13:10           ` Mark Brown
2012-07-17 13:10             ` Mark Brown
2012-07-19  5:28 Stephen Rothwell
2012-07-19  5:28 ` Stephen Rothwell
2012-07-19  5:28 ` Stephen Rothwell
2012-09-13  6:41 Stephen Rothwell
2012-09-13  6:41 ` Stephen Rothwell
2012-09-13  6:41 ` Stephen Rothwell
2012-09-13  7:09 ` Uwe Kleine-König
2012-09-13  7:09   ` Uwe Kleine-König
2012-11-15  5:27 Stephen Rothwell
2012-11-15  5:27 ` Stephen Rothwell
2012-11-15  5:27 ` Stephen Rothwell

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.