From: Tony Lindgren <tony@atomide.com>
To: Steve Sakoman <steve@sakoman.com>
Cc: linux-omap@vger.kernel.org, tomi.valkeinen@ti.com
Subject: Re: [PATCH] omap: overo: Add regulator for ads7846
Date: Tue, 8 Mar 2011 15:16:16 -0800 [thread overview]
Message-ID: <20110308231615.GH26463@atomide.com> (raw)
In-Reply-To: <1299341546-17289-1-git-send-email-steve@sakoman.com>
* Steve Sakoman <steve@sakoman.com> [110305 08:10]:
> The ads7846 driver now requires a regulator. This patch adds the
> necessary regulator to the overo board file. Without it, the
> following error occurs (and the touchscreen will not function):
>
> ads7846 spi1.0: unable to get regulator: -19
>
> Signed-off-by: Steve Sakoman <steve@sakoman.com>
> ---
> Note: this patch should be applied after the "[PATCH v3 0/2] Add DSS2
> support on Overo" series.
Tomi can you please take this one to avoid merge conflicts?
Acked-by: Tony Lindgren <tony@atomide.com>
> arch/arm/mach-omap2/board-overo.c | 31 +++++++++++++++++++++++++++++++
> 1 files changed, 31 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
> index a2c17c9..1aee5b7 100644
> --- a/arch/arm/mach-omap2/board-overo.c
> +++ b/arch/arm/mach-omap2/board-overo.c
> @@ -28,6 +28,7 @@
> #include <linux/platform_device.h>
> #include <linux/i2c/twl.h>
> #include <linux/regulator/machine.h>
> +#include <linux/regulator/fixed.h>
> #include <linux/spi/spi.h>
>
> #include <linux/mtd/mtd.h>
> @@ -97,6 +98,34 @@ static struct ads7846_platform_data ads7846_config = {
> .keep_vref_on = 1,
> };
>
> +/* fixed regulator for ads7846 */
> +static struct regulator_consumer_supply ads7846_supply =
> + REGULATOR_SUPPLY("vcc", "spi1.0");
> +
> +static struct regulator_init_data vads7846_regulator = {
> + .constraints = {
> + .valid_ops_mask = REGULATOR_CHANGE_STATUS,
> + },
> + .num_consumer_supplies = 1,
> + .consumer_supplies = &ads7846_supply,
> +};
> +
> +static struct fixed_voltage_config vads7846 = {
> + .supply_name = "vads7846",
> + .microvolts = 3300000, /* 3.3V */
> + .gpio = -EINVAL,
> + .startup_delay = 0,
> + .init_data = &vads7846_regulator,
> +};
> +
> +static struct platform_device vads7846_device = {
> + .name = "reg-fixed-voltage",
> + .id = 1,
> + .dev = {
> + .platform_data = &vads7846,
> + },
> +};
> +
> static void __init overo_ads7846_init(void)
> {
> if ((gpio_request(OVERO_GPIO_PENDOWN, "ADS7846_PENDOWN") == 0) &&
> @@ -106,6 +135,8 @@ static void __init overo_ads7846_init(void)
> printk(KERN_ERR "could not obtain gpio for ADS7846_PENDOWN\n");
> return;
> }
> +
> + platform_device_register(&vads7846_device);
> }
>
> #else
> --
> 1.7.0.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2011-03-08 23:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-05 16:12 [PATCH] omap: overo: Add regulator for ads7846 Steve Sakoman
2011-03-08 23:16 ` Tony Lindgren [this message]
2011-03-09 0:15 ` Steve Sakoman
2011-03-09 19:18 ` Tony Lindgren
2011-03-09 20:22 ` Steve Sakoman
2011-03-09 5:56 ` Tomi Valkeinen
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=20110308231615.GH26463@atomide.com \
--to=tony@atomide.com \
--cc=linux-omap@vger.kernel.org \
--cc=steve@sakoman.com \
--cc=tomi.valkeinen@ti.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