Re: [PATCH] i2c: Driver to expose PowerNV platform i2c busses

2014-11-14 Thread Neelesh Gupta
On 11/13/2014 01:28 PM, Wolfram Sang wrote: Hi, I am basically fine if this goes via the powerpc-tree and I was hoping that I could ack it right now. However, the driver looks a bit rushed and definately needs updates before it is ready to go. On Mon, Nov 10, 2014 at 11:35:39AM +0530, Neelesh

Re: [PATCH] i2c: Driver to expose PowerNV platform i2c busses

2014-11-13 Thread Benjamin Herrenschmidt
On Thu, 2014-11-13 at 08:58 +0100, Wolfram Sang wrote: +#include linux/module.h +#include linux/kernel.h +#include linux/slab.h +#include linux/i2c.h +#include linux/device.h +#include linux/platform_device.h +#include linux/of.h +#include linux/mm.h +#include asm/opal.h

Re: [PATCH] i2c: Driver to expose PowerNV platform i2c busses

2014-11-13 Thread Benjamin Herrenschmidt
On Thu, 2014-11-13 at 21:56 +1100, Benjamin Herrenschmidt wrote: No, there is no timeout, if that fails something went quite wrong, it could almost be a BUG_ON (basically we passed a wrong token or a NULL msg). + } + + rc = be64_to_cpu(msg.params[1]); + if (rc !=

Re: [PATCH] i2c: Driver to expose PowerNV platform i2c busses

2014-11-13 Thread Wolfram Sang
Please sort the includes. Ugh ? Since when do we do that ? :-) Since I realised it is more readable and reduces likeliness of duplicated includes. + rc = opal_i2c_request(token, bus_id, req); + if (rc != OPAL_ASYNC_COMPLETION) { + rc = -EIO; + goto exit; + }

Re: [PATCH] i2c: Driver to expose PowerNV platform i2c busses

2014-11-13 Thread Neelesh Gupta
On 11/13/2014 06:10 PM, Benjamin Herrenschmidt wrote: On Thu, 2014-11-13 at 21:56 +1100, Benjamin Herrenschmidt wrote: No, there is no timeout, if that fails something went quite wrong, it could almost be a BUG_ON (basically we passed a wrong token or a NULL msg). + } + + rc =

Re: [PATCH] i2c: Driver to expose PowerNV platform i2c busses

2014-11-13 Thread Benjamin Herrenschmidt
On Fri, 2014-11-14 at 07:53 +1100, Benjamin Herrenschmidt wrote: + adapter-dev.parent = pdev-dev; + adapter-dev.of_node = of_node_get(pdev-dev.of_node); + pname = of_get_property(pdev-dev.of_node, port-name, NULL); I have never seen this binding before, it

Re: [PATCH] i2c: Driver to expose PowerNV platform i2c busses

2014-11-12 Thread Wolfram Sang
Hi, I am basically fine if this goes via the powerpc-tree and I was hoping that I could ack it right now. However, the driver looks a bit rushed and definately needs updates before it is ready to go. On Mon, Nov 10, 2014 at 11:35:39AM +0530, Neelesh Gupta wrote: The patch exposes the available

[PATCH] i2c: Driver to expose PowerNV platform i2c busses

2014-11-09 Thread Neelesh Gupta
The patch exposes the available i2c busses on the PowerNV platform to the kernel and implements the bus driver to support i2c and smbus commands. The driver uses the platform device infrastructure to probe the busses on the platform and registers them with the i2c driver framework. Signed-off-by: