From patchwork Sat Mar 5 16:12:26 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 612531 X-Patchwork-Delegate: tomi.valkeinen@nokia.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p25GCf0Z013669 for ; Sat, 5 Mar 2011 16:12:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753118Ab1CEQMk (ORCPT ); Sat, 5 Mar 2011 11:12:40 -0500 Received: from mail-yi0-f46.google.com ([209.85.218.46]:38505 "EHLO mail-yi0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753021Ab1CEQMk (ORCPT ); Sat, 5 Mar 2011 11:12:40 -0500 Received: by yia27 with SMTP id 27so1121031yia.19 for ; Sat, 05 Mar 2011 08:12:39 -0800 (PST) Received: by 10.101.58.20 with SMTP id l20mr402094ank.199.1299341559132; Sat, 05 Mar 2011 08:12:39 -0800 (PST) Received: from localhost.localdomain (static-74-41-60-154.dsl1.pco.ca.frontiernet.net [74.41.60.154]) by mx.google.com with ESMTPS id i10sm922487anh.32.2011.03.05.08.12.37 (version=SSLv3 cipher=OTHER); Sat, 05 Mar 2011 08:12:38 -0800 (PST) From: Steve Sakoman To: linux-omap@vger.kernel.org Cc: tomi.valkeinen@ti.com, Steve Sakoman Subject: [PATCH] omap: overo: Add regulator for ads7846 Date: Sat, 5 Mar 2011 08:12:26 -0800 Message-Id: <1299341546-17289-1-git-send-email-steve@sakoman.com> X-Mailer: git-send-email 1.7.0.4 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 05 Mar 2011 16:12:42 +0000 (UTC) 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 #include #include +#include #include #include @@ -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