[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZuatDOocfDumBzE_@skv.local>
Date: Sun, 15 Sep 2024 12:46:52 +0300
From: Andrey Skvortsov <andrej.skvortzov@...il.com>
To: Chen-Yu Tsai <wenst@...omium.org>
Cc: Rob Herring <robh@...nel.org>, Saravana Kannan <saravanak@...gle.com>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
Wolfram Sang <wsa@...nel.org>, Benson Leung <bleung@...omium.org>,
Tzung-Bi Shih <tzungbi@...nel.org>, Mark Brown <broonie@...nel.org>,
Liam Girdwood <lgirdwood@...il.com>,
chrome-platform@...ts.linux.dev, devicetree@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, linux-kernel@...r.kernel.org,
Douglas Anderson <dianders@...omium.org>,
Johan Hovold <johan@...nel.org>, Jiri Kosina <jikos@...nel.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
linux-i2c@...r.kernel.org
Subject: Re: [PATCH v7 08/10] i2c: of-prober: Add GPIO support to simple
helpers
Hi,
On 24-09-11 15:27, Chen-Yu Tsai wrote:
> Add GPIO support to the simple helpers for the I2C OF component prober.
> Components that the prober intends to probe likely require their
> regulator supplies be enabled, and GPIOs be toggled to enable them or
> bring them out of reset before they will respond to probe attempts.
> Regulator supplies were handled in the previous patch.
>
> The assumption is that the same class of components to be probed are
> always connected in the same fashion with the same regulator supply
> and GPIO. The names may vary due to binding differences, but the
> physical layout does not change.
>
> This supports at most one GPIO pin. The user must specify the GPIO name,
> the polarity, and the amount of time to wait after the GPIO is toggled.
> Devices with more than one GPIO pin likely require specific power
> sequencing beyond what generic code can easily support.
>
> Signed-off-by: Chen-Yu Tsai <wenst@...omium.org>
> diff --git a/include/linux/i2c-of-prober.h b/include/linux/i2c-of-prober.h
> index 541451fbf58d..c5e241163c94 100644
> --- a/include/linux/i2c-of-prober.h
> +++ b/include/linux/i2c-of-prober.h
> @@ -83,6 +83,7 @@ int i2c_of_probe_component(struct device *dev, const struct i2c_of_probe_cfg *cf
> *
> * The following helpers are provided:
> * * i2c_of_probe_simple_get_res()
> + * * i2c_of_probe_simple_free_res_early()
> * * i2c_of_probe_simple_free_res_late()
> * * i2c_of_probe_simple_enable()
> * * i2c_of_probe_simple_cleanup()
> @@ -92,24 +93,33 @@ int i2c_of_probe_component(struct device *dev, const struct i2c_of_probe_cfg *cf
> * struct i2c_of_probe_simple_opts - Options for simple I2C component prober callbacks
> * @res_node_compatible: Compatible string of device node to retrieve resources from.
> * @supply_name: Name of regulator supply.
> + * @gpio_name: Name of GPIO.
> * @post_power_on_delay_ms: Delay in ms after regulators are powered on. Passed to msleep().
> + * @post_reset_deassert_delay_ms: Delay in ms after GPIOs are set. Passed to msleep().
> + * @gpio_high_to_enable: %true if GPIO should be set to electrical high to enable component.
> */
> struct i2c_of_probe_simple_opts {
> const char *res_node_compatible;
> const char *supply_name;
> + const char *gpio_name;
> unsigned int post_power_on_delay_ms;
> + unsigned int post_reset_deassert_delay_ms;
> + bool gpio_high_to_enable;
Missing '#include <linux/types.h>', otherwise compiler complains
about unknown bool type, when 'i2c-of-prober.h' included without any
previous includes.
--
Best regards,
Andrey Skvortsov
Powered by blists - more mailing lists