Re: [PATCH v3 3/5] i2c: pca-platform: add devicetree awareness

2017-06-28 Thread Chris Packham
On 28/06/17 21:20, Andy Shevchenko wrote: >> + i2c->adap.dev.of_node = np; >> + } else if (np) { >> + i2c->adap.timeout = HZ; >> + i2c->gpio = devm_gpiod_get_optional(&pdev->dev, >> "reset-gpios", GPIOD_OUT_LOW); >> + if (IS_ERR(i2c->gpio)) >>

Re: [PATCH v3 3/5] i2c: pca-platform: add devicetree awareness

2017-06-28 Thread Wolfram Sang
> > /* If irq is 0, we do polling. */ > > + if (irq < 0) > > + irq = 0; > > This does not belong to what is written in commit message. Looks like > a separate fix. True, this needs explanation. > > + of_property_read_u32_index(np, "clock-frequency", 0,

Re: [PATCH v3 3/5] i2c: pca-platform: add devicetree awareness

2017-06-28 Thread Andy Shevchenko
On Mon, Jun 26, 2017 at 3:44 AM, Chris Packham wrote: > Allow devices that use this driver to be registered via a > devicetree. Device Tree Wolfram was being a bit faster to apply it... > +#include > +#include > + struct device_node *np = pdev->dev.of_node; > /* If irq is 0, we

Re: [PATCH v3 3/5] i2c: pca-platform: add devicetree awareness

2017-06-27 Thread Wolfram Sang
On Mon, Jun 26, 2017 at 12:44:32PM +1200, Chris Packham wrote: > Allow devices that use this driver to be registered via a > devicetree. > > Signed-off-by: Chris Packham ... > + if (IS_ERR(i2c->gpio)) > + return PTR_ERR(i2c->gpio); coccicheck reported: drivers/

[PATCH v3 3/5] i2c: pca-platform: add devicetree awareness

2017-06-25 Thread Chris Packham
Allow devices that use this driver to be registered via a devicetree. Signed-off-by: Chris Packham --- Changes in v2: - Set i2c->adap.dev.of_node so that child nodes are automatically probed - Split dt-binding to separate patch, use "reset-gpios" instead of "gpios". Changes in v3: - None driver