* [PATCH] omap: overo: Add regulator for ads7846
@ 2011-03-05 16:12 Steve Sakoman
2011-03-08 23:16 ` Tony Lindgren
0 siblings, 1 reply; 6+ messages in thread
From: Steve Sakoman @ 2011-03-05 16:12 UTC (permalink / raw)
To: linux-omap; +Cc: tomi.valkeinen, Steve Sakoman
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.
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] omap: overo: Add regulator for ads7846
2011-03-05 16:12 [PATCH] omap: overo: Add regulator for ads7846 Steve Sakoman
@ 2011-03-08 23:16 ` Tony Lindgren
2011-03-09 0:15 ` Steve Sakoman
2011-03-09 5:56 ` Tomi Valkeinen
0 siblings, 2 replies; 6+ messages in thread
From: Tony Lindgren @ 2011-03-08 23:16 UTC (permalink / raw)
To: Steve Sakoman; +Cc: linux-omap, tomi.valkeinen
* 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] omap: overo: Add regulator for ads7846
2011-03-08 23:16 ` Tony Lindgren
@ 2011-03-09 0:15 ` Steve Sakoman
2011-03-09 19:18 ` Tony Lindgren
2011-03-09 5:56 ` Tomi Valkeinen
1 sibling, 1 reply; 6+ messages in thread
From: Steve Sakoman @ 2011-03-09 0:15 UTC (permalink / raw)
To: Tony Lindgren; +Cc: linux-omap, tomi.valkeinen
On Tue, Mar 8, 2011 at 3:16 PM, Tony Lindgren <tony@atomide.com> wrote:
> * 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?
Tomi: if it helps, I have this patch in my for-tomba branch (including
Tony's ack):
http://www.sakoman.com/cgi-bin/gitweb.cgi?p=linux-omap-2.6.git;a=shortlog;h=refs/heads/for-tomba
Tony: I have a couple more patches queued up to add gpio-led and
gpio-keys support to Overo. I've been holding off submitting because
I haven't been quite sure what branch to base them on to minimize
merge conflicts. For the moment they are based on Tomi's branch and
sitting in the for-tomba branch. Any suggestions?
Steve
--
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] omap: overo: Add regulator for ads7846
2011-03-08 23:16 ` Tony Lindgren
2011-03-09 0:15 ` Steve Sakoman
@ 2011-03-09 5:56 ` Tomi Valkeinen
1 sibling, 0 replies; 6+ messages in thread
From: Tomi Valkeinen @ 2011-03-09 5:56 UTC (permalink / raw)
To: Tony Lindgren; +Cc: Steve Sakoman, linux-omap@vger.kernel.org
On Tue, 2011-03-08 at 17:16 -0600, Tony Lindgren wrote:
> * 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>
Yes, I can take this. It depends on the Overo board patches in my tree.
Tomi
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] omap: overo: Add regulator for ads7846
2011-03-09 0:15 ` Steve Sakoman
@ 2011-03-09 19:18 ` Tony Lindgren
2011-03-09 20:22 ` Steve Sakoman
0 siblings, 1 reply; 6+ messages in thread
From: Tony Lindgren @ 2011-03-09 19:18 UTC (permalink / raw)
To: Steve Sakoman; +Cc: linux-omap, tomi.valkeinen
* Steve Sakoman <steve@sakoman.com> [110308 16:13]:
>
> Tony: I have a couple more patches queued up to add gpio-led and
> gpio-keys support to Overo. I've been holding off submitting because
> I haven't been quite sure what branch to base them on to minimize
> merge conflicts. For the moment they are based on Tomi's branch and
> sitting in the for-tomba branch. Any suggestions?
Getting those merged via Tomi's branch sounds fine to me for trivial
things like that. Please just make sure they get properly posted
for review to linux-omap and linux-arm-kernel lists.
Regards,
Tony
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] omap: overo: Add regulator for ads7846
2011-03-09 19:18 ` Tony Lindgren
@ 2011-03-09 20:22 ` Steve Sakoman
0 siblings, 0 replies; 6+ messages in thread
From: Steve Sakoman @ 2011-03-09 20:22 UTC (permalink / raw)
To: Tony Lindgren; +Cc: linux-omap, tomi.valkeinen
On Wed, Mar 9, 2011 at 11:18 AM, Tony Lindgren <tony@atomide.com> wrote:
> * Steve Sakoman <steve@sakoman.com> [110308 16:13]:
>>
>> Tony: I have a couple more patches queued up to add gpio-led and
>> gpio-keys support to Overo. I've been holding off submitting because
>> I haven't been quite sure what branch to base them on to minimize
>> merge conflicts. For the moment they are based on Tomi's branch and
>> sitting in the for-tomba branch. Any suggestions?
>
> Getting those merged via Tomi's branch sounds fine to me for trivial
> things like that. Please just make sure they get properly posted
> for review to linux-omap and linux-arm-kernel lists.
Thanks. I just sent the patch series to the linux-omap and
linux-arm-kernel lists.
Steve
--
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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-03-09 20:22 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-05 16:12 [PATCH] omap: overo: Add regulator for ads7846 Steve Sakoman
2011-03-08 23:16 ` Tony Lindgren
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox