[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <511EA944.1090900@wwwdotorg.org>
Date: Fri, 15 Feb 2013 14:31:48 -0700
From: Stephen Warren <swarren@...dotorg.org>
To: Doug Anderson <dianders@...omium.org>
CC: Wolfram Sang <wsa@...-dreams.de>, linux-doc@...r.kernel.org,
Daniel Kurtz <djkurtz@...omium.org>,
linux-kernel@...r.kernel.org, linux-i2c@...r.kernel.org,
Stephen Warren <swarren@...dia.com>,
Ben Dooks <ben.dooks@...ethink.co.uk>,
u.kleine-koenig@...gutronix.de,
Grant Grundler <grundler@...omium.org>,
devicetree-discuss@...ts.ozlabs.org,
Rob Herring <rob.herring@...xeda.com>,
Jean Delvare <khali@...ux-fr.org>,
"Ben Dooks (embedded platforms)" <ben-linux@...ff.org>,
Girish Shivananjappa <girish.shivananjappa@...aro.org>,
bhushan.r@...sung.com,
Naveen Krishna Chatradhi <ch.naveen@...sung.com>,
sreekumar.c@...sung.com,
Mark Brown <broonie@...nsource.wolfsonmicro.com>,
Peter Korsgaard <peter.korsgaard@...co.com>,
Yuvaraj Kumar <yuvaraj.cd@...il.com>,
Prashanth G <prashanth.g@...sung.com>
Subject: Re: [PATCH v3 1/3] i2c: mux: Add i2c-arbitrator-cros-ec 'mux' driver
On 02/15/2013 12:46 PM, Doug Anderson wrote:
> The i2c-arbitrator-cros-ec driver implements the arbitration scheme
> that the Embedded Controller (EC) on the ARM Chromebook expects to use
> for bus multimastering. This i2c-arbitrator-cros-ec driver could also
> be used in other places where standard I2C bus arbitration can't be
> used and two extra GPIOs are available for arbitration.
>
> This driver is based on code that Simon Glass added to the i2c-s3c2410
> driver in the Chrome OS kernel 3.4 tree. The current incarnation as a
> mux driver is as suggested by Grant Likely. See
> <https://patchwork.kernel.org/patch/1877311/> for some history.
Reviewed-by: Stephen Warren <swarren@...dia.com>
> diff --git a/drivers/i2c/muxes/i2c-arbitrator-cros-ec.c b/drivers/i2c/muxes/i2c-arbitrator-cros-ec.c
> +static int i2c_arbitrator_probe(struct platform_device *pdev)
> + /* Request GPIOs */
> + ret = of_get_named_gpio_flags(np, "ap-claim-gpio", 0, &gpio_flags);
> + if (ret == -EPROBE_DEFER || WARN_ON(!gpio_is_valid(ret)))
> + return ret;
I think by the time that doesn't return -EPROBE_DEFER ...
> + arb->ap_gpio = ret;
> + arb->ap_gpio_release = !!(gpio_flags & OF_GPIO_ACTIVE_LOW);
> + out_init = (gpio_flags & OF_GPIO_ACTIVE_LOW) ?
> + GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW;
> + ret = devm_gpio_request_one(&pdev->dev, arb->ap_gpio, out_init,
> + "ap-claim-gpio");
> + if (ret == -EPROBE_DEFER || WARN_ON(ret))
> + return ret;
... that won't either, since of_get_named_gpio_flags()'s implementation
requires the relevant GPIO driver to be active already.
Still, there's no harm in the code as it stands, so no need to change.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists