From: Johan Hovold <johan@kernel.org>
To: Nishad Kamdar <nishadkamdar@gmail.com>
Cc: Johan Hovold <johan@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Alex Elder <elder@kernel.org>,
Rui Miguel Silva <rmfrfs@gmail.com>,
greybus-dev@lists.linaro.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 3/4] staging: greybus: arche-apb-ctrl.c: Switch to the gpio descriptor interface
Date: Wed, 9 Jan 2019 12:30:43 +0100 [thread overview]
Message-ID: <20190109113043.GK14782@localhost> (raw)
In-Reply-To: <54ba56b6b071ba48ca06713a108ccfb542c5d2e5.1545488665.git.nishadkamdar@gmail.com>
On Sat, Dec 22, 2018 at 08:22:09PM +0530, Nishad Kamdar wrote:
> Use the gpiod interface instead of the deprecated old non-descriptor
> interface.
>
> Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com>
> ---
> Changes in v4:
> - Use gpiod_set_raw_value() for deassert_reset() and
> assert_reset() as gpiod_set_value() will change the
> sematics of these calls by taking any gpio flags
> into account.
Please also mention this in the commit message (i.e. that we continue to
ignore gpio flags from device tree for now).
> - Remove some unnecesssary line breaks.
> - Restore 'spi_en' gpio check in fw_flashing_seq()
> as it is currently optional.
> Changes in v3:
> - Add this patch in a patchset.
> Changes in v2:
> - Resolved compilation errors.
> ---
> @@ -75,11 +74,10 @@ static int coldboot_seq(struct platform_device *pdev)
> return 0;
>
> /* Hold APB in reset state */
> - assert_reset(apb->resetn_gpio);
> + assert_reset(apb->resetn);
>
> - if (apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING &&
> - gpio_is_valid(apb->spi_en_gpio))
> - devm_gpio_free(dev, apb->spi_en_gpio);
> + if (apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING && apb->spi_en)
> + devm_gpiod_put(dev, apb->spi_en);
>
> /* Enable power to APB */
> if (!IS_ERR(apb->vcore)) {
> @@ -101,13 +99,13 @@ static int coldboot_seq(struct platform_device *pdev)
> apb_bootret_deassert(dev);
>
> /* On DB3 clock was not mandatory */
> - if (gpio_is_valid(apb->clk_en_gpio))
> - gpio_set_value(apb->clk_en_gpio, 1);
> + if (apb->clk_en)
> + gpiod_set_value(apb->clk_en, 1);
>
> usleep_range(100, 200);
>
> /* deassert reset to APB : Active-low signal */
> - deassert_reset(apb->resetn_gpio);
> + deassert_reset(apb->resetn);
>
> apb->state = ARCHE_PLATFORM_STATE_ACTIVE;
>
> @@ -136,25 +134,25 @@ static int fw_flashing_seq(struct platform_device *pdev)
> return ret;
> }
>
> - if (gpio_is_valid(apb->spi_en_gpio)) {
> + if (apb->spi_en) {
> unsigned long flags;
>
> if (apb->spi_en_polarity_high)
> - flags = GPIOF_OUT_INIT_HIGH;
> + flags = GPIOD_OUT_HIGH;
> else
> - flags = GPIOF_OUT_INIT_LOW;
> + flags = GPIOD_OUT_LOW;
>
> - ret = devm_gpio_request_one(dev, apb->spi_en_gpio,
> - flags, "apb_spi_en");
> - if (ret) {
> - dev_err(dev, "Failed requesting SPI bus en gpio %d\n",
> - apb->spi_en_gpio);
> + apb->spi_en = devm_gpiod_get(dev, "gb,spi-en-gpio", flags);
I just noticed that you change the name of the device-tree property here
(and later in apb_ctrl_get_devtree_data()). How is that expected to
work without breaking current systems? This will be unavoidable at some
point, but must not be snuck into a patch like this without any comment.
Please keep the current names for now.
I do think you need to drop the "-gpio" suffix when requesting the gpio
though. Please double check to make sure.
Johan
next prev parent reply other threads:[~2019-01-09 11:30 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-22 14:45 [PATCH v4 0/4] greybus: gpio: Switch to the gpio descriptor interface Nishad Kamdar
2018-12-22 14:47 ` [PATCH v4 1/4] staging: greybus: gpio: switch GPIO portions to use GPIOLIB_IRQCHIP Nishad Kamdar
2019-01-09 10:44 ` Johan Hovold
2018-12-22 14:51 ` [PATCH v4 2/4] staging: greybus: gpio: Use gpiochip_get_data() in place of gpio_chip_to_gb_gpio_controller() Nishad Kamdar
2019-01-09 10:58 ` Johan Hovold
2019-01-10 17:39 ` Nishad Kamdar
2018-12-22 14:52 ` [PATCH v4 3/4] staging: greybus: arche-apb-ctrl.c: Switch to the gpio descriptor interface Nishad Kamdar
2019-01-09 11:30 ` Johan Hovold [this message]
2019-01-10 17:41 ` Nishad Kamdar
2018-12-22 14:53 ` [PATCH v4 4/4] staging: greybus: arche-platform: " Nishad Kamdar
2019-01-09 11:35 ` Johan Hovold
2019-01-10 17:43 ` Nishad Kamdar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190109113043.GK14782@localhost \
--to=johan@kernel.org \
--cc=devel@driverdev.osuosl.org \
--cc=elder@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=greybus-dev@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nishadkamdar@gmail.com \
--cc=rmfrfs@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).