devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Philipp Zabel <p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: Maxime Ripard
	<maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
	Roger Quadros <rogerq-l0cyMroinI0@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
Subject: Re: [PATCH v2 2/2] reset: Add GPIO support to reset controller framework
Date: Tue, 07 Jan 2014 10:52:21 +0100	[thread overview]
Message-ID: <1389088341.4815.9.camel@pizza.hi.pengutronix.de> (raw)
In-Reply-To: <20140106181422.GS3144@lukather>

Hi Maxime,

Am Montag, den 06.01.2014, 19:14 +0100 schrieb Maxime Ripard:
> > +struct reset_control *gpio_reset_control_get(struct device *dev, const char *id)
> > +{
> > +	const char *assert_prop = "reset-initially-asserted";
> 
> I guess you meant reset-boot-asserted here, right?

Yes, thank you.

> > +	const char *gpio_con_id = "reset";
> > +	struct reset_controller_dev *rcdev;
> > +	struct reset_control *rstc;
> > +	struct gpio_desc *gpiod;
> > +	bool asserted = false;
> > +	char scratch[48];
> > +	int ret;
> > +
> > +	if (id) {
> > +		snprintf(scratch, 48, "%s-reset-boot-asserted", id);
> > +		assert_prop = scratch;
> > +	}
> > +
> > +	asserted = of_property_read_bool(dev->of_node, assert_prop);
> > +
> > +	if (id) {
> > +		snprintf(scratch, 48, "%s-reset", id);
> > +		gpio_con_id = scratch;
> > +	}
> > +
> > +	gpiod = gpiod_get(dev, gpio_con_id);
> > +	if (IS_ERR(gpiod)) {
> > +		dev_err(dev, "Failed to get GPIO reset: %ld\n", PTR_ERR(gpiod));
> > +		return ERR_CAST(gpiod);
> > +	}
> > +
> > +	ret = gpiod_direction_output(gpiod, asserted);
> > +	if (ret < 0)
> > +		goto err_put;
> 
> What happens if the GPIO is active low? I see no way in your binding
> and driver to give that information, and that would change the
> behaviour quite a bit.

I was under the (wrong) impression that gpiod_direction_output takes a
logical value as gpiod_set_value does. Will fix that.

regards
Philipp

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2014-01-07  9:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-06 17:55 [PATCH v2 1/2] Documentation: Add GPIO reset binding to reset binding documentation Philipp Zabel
     [not found] ` <1389030903-27684-1-git-send-email-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2014-01-06 17:55   ` [PATCH v2 2/2] reset: Add GPIO support to reset controller framework Philipp Zabel
     [not found]     ` <1389030903-27684-2-git-send-email-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2014-01-06 18:14       ` Maxime Ripard
2014-01-07  9:52         ` Philipp Zabel [this message]
2014-01-07 11:19           ` Maxime Ripard
2014-01-07 11:28             ` Philipp Zabel
     [not found]               ` <1389094089.4815.22.camel-/rZezPiN1rtR6QfukMTsflXZhhPuCNm+@public.gmane.org>
2014-01-07 11:40                 ` Maxime Ripard

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=1389088341.4815.9.camel@pizza.hi.pengutronix.de \
    --to=p.zabel-bicnvbalz9megne8c9+irq@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=rogerq-l0cyMroinI0@public.gmane.org \
    --cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.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;
as well as URLs for NNTP newsgroup(s).