Linux Input/HID development
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Grazvydas Ignotas <notasas@gmail.com>
Cc: linux-input@vger.kernel.org,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-omap@vger.kernel.org
Subject: Re: [PATCH] Input: ads7846: add regulator support
Date: Thu, 4 Feb 2010 14:24:40 +0000	[thread overview]
Message-ID: <20100204142439.GA1139@sirena.org.uk> (raw)
In-Reply-To: <1265290758-2035-1-git-send-email-notasas@gmail.com>

On Thu, Feb 04, 2010 at 03:39:18PM +0200, Grazvydas Ignotas wrote:

> The ADS7846/TSC2046 touchscreen controllers can (and usually are)
> connected to various regulators for power, so add regulator support.
> Make it optional for now to avoid breaking all current users of this
> driver.

This should not be required.  The regulator API stubs itself out when it
is not built so all API calls report as successful.

> +	ts->reg = regulator_get(&spi->dev, "vcc");
> +	if (!IS_ERR(ts->reg)) {
> +		err = regulator_enable(ts->reg);
> +		if (err)
> +			goto err_put_regulator;
> +	}

If the regulator API is not compiled in then the regulator_get() will
return succesfully.  If the regulator API is in use then failure to
acquire the regulator is a serious problem which really should be at a
minimium be being communicated to the user.  For example, the regulator
API may end up powering down regulators which it believes are unused or
the regulator may not be powered by default and needs to be enabled.

The updates to fix up the boards that need this are fairly
straightforward and given that it's fairly easy to identify systems
which are using the driver in mainline so I'd really prefer not to go
down the route of trying to carry on in the face of error, it papers
over stuff now but is not robust in the face of future changes.

  reply	other threads:[~2010-02-04 14:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-04 13:39 [PATCH] Input: ads7846: add regulator support Grazvydas Ignotas
2010-02-04 14:24 ` Mark Brown [this message]
2010-02-04 14:52   ` Grazvydas Ignotas
2010-02-04 16:21     ` Mark Brown
2010-02-04 18:08       ` Dmitry Torokhov
2010-02-04 18:59         ` Mark Brown
2010-02-05 20:45       ` Mike Rapoport
2010-02-08 11:30         ` Mark Brown
2010-02-09  8:55           ` Mike Rapoport
2010-02-04 15:08   ` Mike Rapoport
2010-02-04 16:03     ` Mark Brown

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=20100204142439.GA1139@sirena.org.uk \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=notasas@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