public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Cc: "Linux Media Mailing List" <linux-media@vger.kernel.org>,
	"Mauro Carvalho Chehab" <mchehab@infradead.org>,
	"Hans Verkuil" <hans.verkuil@cisco.com>,
	"Sakari Ailus" <sakari.ailus@linux.intel.com>,
	"Pali Rohár" <pali.rohar@gmail.com>,
	"Ramiro Oliveira" <Ramiro.Oliveira@synopsys.com>,
	"Todor Tomov" <todor.tomov@linaro.org>,
	"Robert Jarzmik" <robert.jarzmik@free.fr>,
	"Steve Longerbeam" <slongerbeam@gmail.com>,
	"Guennadi Liakhovetski" <g.liakhovetski@gmx.de>,
	"Hugues Fruchet" <hugues.fruchet@st.com>,
	"Bhumika Goyal" <bhumirks@gmail.com>
Subject: Re: [PATCH] [media] ov2640: make GPIOLIB an optional dependency
Date: Fri, 21 Apr 2017 08:33:12 +0200	[thread overview]
Message-ID: <20170421063312.GA21434@amd> (raw)
In-Reply-To: <20170419110300.2dbbf784@vento.lan>

[-- Attachment #1: Type: text/plain, Size: 1372 bytes --]

Hi!

> > Better solution would be for VIDEO_EM28XX_V4L2 to depend on GPIOLIB,
> > too, no? If not, should there be BUG_ON(priv->pwdn_gpio);
> > BUG_ON(priv->resetb_gpio);?
> 
> Pavel,
> 
> The em28xx driver was added upstream several years the gpio driver. 
> It controls GPIO using a different logic. It makes no sense to make
> it dependent on GPIOLIB, except if someone converts it to use it.

At least comment in the sourcecode...? Remove pwdn_gpio fields from
structure in !GPIOLIB case, because otherwise they are trap for the
programmer trying to understand what is going on?

Plus, something like this, because otherwise it is quite confusing?

Thanks,
								Pavel

diff --git a/drivers/media/i2c/soc_camera/ov2640.c b/drivers/media/i2c/soc_camera/ov2640.c
index 56de182..85620e1 100644
--- a/drivers/media/i2c/soc_camera/ov2640.c
+++ b/drivers/media/i2c/soc_camera/ov2640.c
@@ -1060,7 +1060,7 @@ static int ov2640_hw_reset(struct device *dev)
 		/* Active the resetb pin to perform a reset pulse */
 		gpiod_direction_output(priv->resetb_gpio, 1);
 		usleep_range(3000, 5000);
-		gpiod_direction_output(priv->resetb_gpio, 0);
+		gpiod_set_value(priv->resetb_gpio, 0);
 	}
 
 	return 0;

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  reply	other threads:[~2017-04-21  6:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-19 11:49 [PATCH] [media] ov2640: make GPIOLIB an optional dependency Mauro Carvalho Chehab
2017-04-19 13:23 ` Pavel Machek
2017-04-19 14:03   ` Mauro Carvalho Chehab
2017-04-21  6:33     ` Pavel Machek [this message]
2017-04-21 14:39       ` Mauro Carvalho Chehab
2017-04-24 14:44         ` Sakari Ailus
2017-04-24 15:50           ` Mauro Carvalho Chehab
2017-04-24 17:38             ` Sakari Ailus
2017-04-24 17:50               ` Sakari Ailus
2017-04-25  2:05               ` Mauro Carvalho Chehab
2017-04-25  8:57                 ` Sakari Ailus
2017-06-19  9:50       ` Hans Verkuil
2017-06-19 10:48         ` Pavel Machek

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=20170421063312.GA21434@amd \
    --to=pavel@ucw.cz \
    --cc=Ramiro.Oliveira@synopsys.com \
    --cc=bhumirks@gmail.com \
    --cc=g.liakhovetski@gmx.de \
    --cc=hans.verkuil@cisco.com \
    --cc=hugues.fruchet@st.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=mchehab@s-opensource.com \
    --cc=pali.rohar@gmail.com \
    --cc=robert.jarzmik@free.fr \
    --cc=sakari.ailus@linux.intel.com \
    --cc=slongerbeam@gmail.com \
    --cc=todor.tomov@linaro.org \
    /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