Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1548673

Re: [PATCH 10/20] gpio: pca953x: Add optional reset gpio control

From Steve Longerbeam <slongerbeam@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 10/20] gpio: pca953x: Add optional reset gpio control
Date 2016-12-30 19:10 +0100
Message-ID <sU9MR-7Nf-1@gated-at.bofh.it> (permalink)
References <sTRmV-46t-3@gated-at.bofh.it> <sTRwD-4al-61@gated-at.bofh.it> <sU5gd-4PM-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Linus, Lothar,


On 12/30/2016 05:17 AM, Linus Walleij wrote:
> On Thu, Dec 29, 2016 at 11:27 PM, Steve Longerbeam
> <slongerbeam@gmail.com> wrote:
>
>> Add optional reset-gpios pin control. If present, de-assert the
>> specified reset gpio pin to bring the chip out of reset.
>>
>> Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
>> Cc: Linus Walleij <linus.walleij@linaro.org>
>> Cc: Alexandre Courbot <gnurou@gmail.com>
>> Cc: linux-gpio@vger.kernel.org
>> Cc: linux-kernel@vger.kernel.org
> This seems like a separate patch from the other 19 patches so please send it
> separately so I can handle logistics easier in the future.

Ok, I'll send the next version separately.

>
>
>> @@ -133,6 +134,7 @@ struct pca953x_chip {
>>          const char *const *names;
>>          unsigned long driver_data;
>>          struct regulator *regulator;
>> +       struct gpio_desc *reset_gpio;
> Why do you even keep this around in the device state container?
>
> As you only use it in the probe() function, use a local variable.
>
> The descriptor will be free():ed by the devm infrastructure anyways.

I think my reasoning for putting the gpio handle into the device
struct was for possibly using it for run-time reset control at some
point. But that could be done later if needed, so I'll go ahead and
make it local.

>> +               /* see if we need to de-assert a reset pin */
>> +               chip->reset_gpio = devm_gpiod_get_optional(&client->dev,
>> +                                                          "reset",
>> +                                                          GPIOD_OUT_LOW);
>> +               if (IS_ERR(chip->reset_gpio)) {
>> +                       dev_err(&client->dev, "request for reset pin failed\n");
>> +                       return PTR_ERR(chip->reset_gpio);
>> +               }
> Nice.
>
>> +               if (chip->reset_gpio) {
>> +                       /* bring chip out of reset */
>> +                       dev_info(&client->dev, "releasing reset\n");
>> +                       gpiod_set_value(chip->reset_gpio, 0);
>> +               }
> Is this really needed given that you set it low in the
> devm_gpiod_get_optional()?

Yep, this is left over from a previous iteration, but it isn't needed now.
I'll remove it.

Steve

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/20] i.MX Media Driver Steve Longerbeam <slongerbeam@gmail.com> - 2016-12-29 23:30 +0100
  [PATCH 20/20] ARM: imx_v6_v7_defconfig: Enable staging video4linux drivers Steve Longerbeam <slongerbeam@gmail.com> - 2016-12-29 23:30 +0100
  [PATCH 16/20] media: imx: Add MIPI CSI-2 Receiver subdev driver Steve Longerbeam <slongerbeam@gmail.com> - 2016-12-29 23:30 +0100
  [PATCH 09/20] ARM: dts: imx6-sabreauto: add the ADV7180 video decoder Steve Longerbeam <slongerbeam@gmail.com> - 2016-12-29 23:30 +0100
  [PATCH 06/20] ARM: dts: imx6-sabreauto: create i2cmux for i2c3 Steve Longerbeam <slongerbeam@gmail.com> - 2016-12-29 23:40 +0100
  [PATCH 08/20] ARM: dts: imx6-sabreauto: add pinctrl for gpt input capture Steve Longerbeam <slongerbeam@gmail.com> - 2016-12-29 23:40 +0100
  [PATCH 03/20] ARM: dts: imx6qdl: add media device Steve Longerbeam <slongerbeam@gmail.com> - 2016-12-29 23:40 +0100
  [PATCH 02/20] ARM: dts: imx6qdl: Add mipi_ipu1/2 multiplexers, mipi_csi, and their connections Steve Longerbeam <slongerbeam@gmail.com> - 2016-12-29 23:40 +0100
  [PATCH 15/20] media: imx: Add Camera Interface subdev driver Steve Longerbeam <slongerbeam@gmail.com> - 2016-12-29 23:40 +0100
  [PATCH 07/20] ARM: dts: imx6-sabreauto: add reset-gpios property for max7310_b Steve Longerbeam <slongerbeam@gmail.com> - 2016-12-29 23:40 +0100
  [PATCH 13/20] media: imx: Add SMFC subdev driver Steve Longerbeam <slongerbeam@gmail.com> - 2016-12-29 23:40 +0100
  [PATCH 05/20] ARM: dts: imx6-sabresd: add OV5642 and OV5640 camera sensors Steve Longerbeam <slongerbeam@gmail.com> - 2016-12-29 23:40 +0100
  [PATCH 01/20] ARM: dts: imx6qdl: Add compatible, clocks, irqs to MIPI CSI-2 node Steve Longerbeam <slongerbeam@gmail.com> - 2016-12-29 23:40 +0100
  [PATCH 12/20] media: imx: Add CSI subdev driver Steve Longerbeam <slongerbeam@gmail.com> - 2016-12-29 23:40 +0100
  [PATCH 04/20] ARM: dts: imx6-sabrelite: add OV5642 and OV5640 camera sensors Steve Longerbeam <slongerbeam@gmail.com> - 2016-12-29 23:40 +0100
  [PATCH 10/20] gpio: pca953x: Add optional reset gpio control Steve Longerbeam <slongerbeam@gmail.com> - 2016-12-29 23:40 +0100
    Re: [PATCH 10/20] gpio: pca953x: Add optional reset gpio control Lothar Waßmann <LW@KARO-electronics.de> - 2016-12-30 08:30 +0100
    Re: [PATCH 10/20] gpio: pca953x: Add optional reset gpio control Linus Walleij <linus.walleij@linaro.org> - 2016-12-30 14:20 +0100
      Re: [PATCH 10/20] gpio: pca953x: Add optional reset gpio control Steve Longerbeam <slongerbeam@gmail.com> - 2016-12-30 19:10 +0100
  Re: [PATCH 00/20] i.MX Media Driver Fabio Estevam <festevam@gmail.com> - 2017-01-02 22:20 +0100

csiph-web