From patchwork Wed Jul 13 14:00:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 972202 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6DE2Zbq012002 for ; Wed, 13 Jul 2011 14:02:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754619Ab1GMOCe (ORCPT ); Wed, 13 Jul 2011 10:02:34 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:41192 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754568Ab1GMOCd convert rfc822-to-8bit (ORCPT ); Wed, 13 Jul 2011 10:02:33 -0400 Received: from dlep33.itg.ti.com ([157.170.170.112]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id p6DE2Vow027239 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 13 Jul 2011 09:02:31 -0500 Received: from dlep26.itg.ti.com (smtp-le.itg.ti.com [157.170.170.27]) by dlep33.itg.ti.com (8.13.7/8.13.8) with ESMTP id p6DE2UuM010312; Wed, 13 Jul 2011 09:02:30 -0500 (CDT) Received: from dnce72.ent.ti.com (localhost [127.0.0.1]) by dlep26.itg.ti.com (8.13.8/8.13.8) with ESMTP id p6DE1fYC001640; Wed, 13 Jul 2011 09:02:30 -0500 (CDT) thread-index: AcxBZWUzQIjRFHCrSlmbX7wgeZKs7A== Content-Class: urn:content-classes:message Importance: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4657 Received: from localhost.localdomain (172.24.88.12) by dnce72.ent.ti.com (137.167.131.87) with Microsoft SMTP Server (TLS) id 8.3.106.1; Wed, 13 Jul 2011 16:01:42 +0200 From: Tero Kristo To: CC: , , Subject: [PATCHv2 3/5] omap3: beagle: instantiate smps regulators Date: Wed, 13 Jul 2011 17:00:36 +0300 Message-ID: <1310565638-13140-4-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1310565638-13140-1-git-send-email-t-kristo@ti.com> References: <1310565638-13140-1-git-send-email-t-kristo@ti.com> MIME-Version: 1.0 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 (demeter2.kernel.org [140.211.167.43]); Wed, 13 Jul 2011 14:02:35 +0000 (UTC) VDD1 and VDD2 are now available. This requires SMPS regulator driver to work. Signed-off-by: Tero Kristo --- arch/arm/mach-omap2/board-omap3beagle.c | 53 +++++++++++++++++++++++++++++++ 1 files changed, 53 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 78cf5f2..d7ae648 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -31,6 +31,7 @@ #include #include +#include #include #include @@ -274,6 +275,15 @@ static struct regulator_consumer_supply beagle_vsim_supply[] = { REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"), }; +static struct regulator_consumer_supply beagle_smps1_supply[] = { + REGULATOR_SUPPLY("vcc", "mpu"), +}; + +static struct regulator_consumer_supply beagle_smps2_supply[] = { + REGULATOR_SUPPLY("vcc", "core"), +}; + + static struct gpio_led gpio_leds[]; static int beagle_twl_gpio_setup(struct device *dev, @@ -400,6 +410,30 @@ static struct regulator_init_data beagle_vpll2 = { .consumer_supplies = beagle_vdvi_supplies, }; +static struct regulator_init_data beagle_smps1 = { + .constraints = { + .name = "VDD1", + .min_uV = 600000, + .max_uV = 1450000, + .valid_modes_mask = REGULATOR_MODE_NORMAL, + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, + }, + .num_consumer_supplies = ARRAY_SIZE(beagle_smps1_supply), + .consumer_supplies = beagle_smps1_supply, +}; + +static struct regulator_init_data beagle_smps2 = { + .constraints = { + .name = "VDD2", + .min_uV = 600000, + .max_uV = 1450000, + .valid_modes_mask = REGULATOR_MODE_NORMAL, + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, + }, + .num_consumer_supplies = ARRAY_SIZE(beagle_smps2_supply), + .consumer_supplies = beagle_smps2_supply, +}; + static struct twl4030_usb_data beagle_usb_data = { .usb_mode = T2_USB_MODE_ULPI, }; @@ -425,6 +459,16 @@ static struct twl4030_platform_data beagle_twldata = { .vpll2 = &beagle_vpll2, }; +static struct regulator_init_data *beagle_smps_reg_list[] = { + &beagle_smps1, + &beagle_smps2, +}; + +static struct omap_smps_platform_data beagle_smps_info = { + .regulators = beagle_smps_reg_list, + .num_regulators = ARRAY_SIZE(beagle_smps_reg_list), +}; + static struct i2c_board_info __initdata beagle_i2c_eeprom[] = { { I2C_BOARD_INFO("eeprom", 0x50), @@ -494,6 +538,14 @@ static struct platform_device keys_gpio = { }, }; +static struct platform_device beagle_smps = { + .name = "omap-smps", + .id = -1, + .dev = { + .platform_data = &beagle_smps_info, + }, +}; + static void __init omap3_beagle_init_early(void) { omap2_init_common_infrastructure(); @@ -509,6 +561,7 @@ static void __init omap3_beagle_init_irq(void) static struct platform_device *omap3_beagle_devices[] __initdata = { &leds_gpio, &keys_gpio, + &beagle_smps, }; static const struct usbhs_omap_board_data usbhs_bdata __initconst = {