From: Fabio Estevam <fabio.estevam@freescale.com>
To: Philipp Zabel <p.zabel@pengutronix.de>
Cc: linux-input@vger.kernel.org, devicetree-discuss@lists.ozlabs.org,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
festevam@gmail.com, Ashish Jangam <ashish.jangam@kpitcummins.com>
Subject: Re: [PATCH] Input: da9052_tsi: make TSI reference regulator configurable
Date: Fri, 22 Mar 2013 12:51:23 -0300 [thread overview]
Message-ID: <514C7DFB.8000708@freescale.com> (raw)
In-Reply-To: <1363964129-23392-1-git-send-email-p.zabel@pengutronix.de>
Philipp Zabel wrote:
> if (!tsi->stopped) {
> + error = regulator_enable(tsi->tsiref);
> + if (error < 0) {
> + dev_err(tsi->da9052->dev,
> + "Failed to enable TSIREF regualtor: %d\n",
s/regualtor/regulator
> @@ -274,12 +287,20 @@ static int da9052_ts_probe(struct platform_device *pdev)
> /* Disable ADC */
> da9052_ts_adc_toggle(tsi, false);
>
> + tsi->tsiref = regulator_get(tsi->da9052->dev, "tsiref");
You could use devm_regulator_get here ...
> + if (IS_ERR(tsi->tsiref)) {
> + dev_err(tsi->da9052->dev,
> + "Failed to get TSIREF regulator: %ld\n",
> + PTR_ERR(tsi->tsiref));
> + goto err_free_mem;
> + }
> +
> error = da9052_request_irq(tsi->da9052, DA9052_IRQ_PENDOWN,
> "pendown-irq", da9052_ts_pendwn_irq, tsi);
> if (error) {
> dev_err(tsi->da9052->dev,
> "Failed to register PENDWN IRQ: %d\n", error);
> - goto err_free_mem;
> + goto err_put_reg;
> }
>
> error = da9052_request_irq(tsi->da9052, DA9052_IRQ_TSIREADY,
> @@ -310,6 +331,8 @@ err_free_datardy_irq:
> da9052_free_irq(tsi->da9052, DA9052_IRQ_TSIREADY, tsi);
> err_free_pendwn_irq:
> da9052_free_irq(tsi->da9052, DA9052_IRQ_PENDOWN, tsi);
> +err_put_reg:
> + regulator_put(tsi->tsiref);
> err_free_mem:
> kfree(tsi);
> input_free_device(input_dev);
> @@ -321,10 +344,9 @@ static int da9052_ts_remove(struct platform_device *pdev)
> {
> struct da9052_tsi *tsi = platform_get_drvdata(pdev);
>
> - da9052_reg_write(tsi->da9052, DA9052_LDO9_REG, 0x19);
> -
> da9052_free_irq(tsi->da9052, DA9052_IRQ_TSIREADY, tsi);
> da9052_free_irq(tsi->da9052, DA9052_IRQ_PENDOWN, tsi);
> + regulator_put(tsi->tsiref);
and then no need to use the regulator_put.
next prev parent reply other threads:[~2013-03-22 15:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-22 14:55 [PATCH] Input: da9052_tsi: make TSI reference regulator configurable Philipp Zabel
2013-03-22 15:51 ` Fabio Estevam [this message]
2013-03-22 15:55 ` Philipp Zabel
[not found] ` <514C7DFB.8000708-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2013-03-22 15:58 ` Dmitry Torokhov
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=514C7DFB.8000708@freescale.com \
--to=fabio.estevam@freescale.com \
--cc=ashish.jangam@kpitcummins.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=dmitry.torokhov@gmail.com \
--cc=festevam@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
/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