From patchwork Thu Nov 5 16:39:41 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aggarwal, Anuj" X-Patchwork-Id: 57909 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nA5GdvCq009758 for ; Thu, 5 Nov 2009 16:39:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757584AbZKEQjn (ORCPT ); Thu, 5 Nov 2009 11:39:43 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757577AbZKEQjn (ORCPT ); Thu, 5 Nov 2009 11:39:43 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:47084 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757543AbZKEQjn (ORCPT ); Thu, 5 Nov 2009 11:39:43 -0500 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id nA5Gdg2S002009 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 5 Nov 2009 10:39:44 -0600 Received: from psplinux050.india.ti.com (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id nA5Gdf4k013654; Thu, 5 Nov 2009 22:09:41 +0530 (IST) Received: from psplinux050.india.ti.com (localhost [127.0.0.1]) by psplinux050.india.ti.com (8.13.1/8.13.1) with ESMTP id nA5Gdf0C029406; Thu, 5 Nov 2009 22:09:41 +0530 Received: (from a0393534@localhost) by psplinux050.india.ti.com (8.13.1/8.13.1/Submit) id nA5GdfG8029400; Thu, 5 Nov 2009 22:09:41 +0530 From: Anuj Aggarwal To: linux-omap@vger.kernel.org Cc: broonie@opensource.wolfsonmicro.com, lrg@slimlogic.co.uk, Anuj Aggarwal Subject: [PATCH 4/5] Regulator: Adding OMAP3EVM/TWL4030 specific code in board-omap35x-pmic.c Date: Thu, 5 Nov 2009 22:09:41 +0530 Message-Id: <1257439181-29257-1-git-send-email-anuj.aggarwal@ti.com> X-Mailer: git-send-email 1.6.2.4 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org diff --git a/arch/arm/mach-omap2/board-omap35x-pmic.c b/arch/arm/mach-omap2/board-omap35x-pmic.c index aae07ab..2ef4932 100644 --- a/arch/arm/mach-omap2/board-omap35x-pmic.c +++ b/arch/arm/mach-omap2/board-omap35x-pmic.c @@ -24,10 +24,87 @@ * Definitions specific to TWL4030/TPS65950 */ #if defined(CONFIG_PMIC_TWL4030) -static inline void pmic_twl4030_init(void) +#if defined(CONFIG_MACH_OMAP3EVM) +#include + +extern struct twl4030_platform_data omap3evm_twldata; + +/* VDAC */ +static struct regulator_consumer_supply vdac_consumers[] = { + { + .supply = "dac", + }, +}; + +static struct regulator_init_data vdac_data = { + .constraints = { + .name = "VDAC", + .min_uV = 1800000, + .max_uV = 1800000, + .apply_uV = true, + .valid_modes_mask = REGULATOR_MODE_NORMAL + | REGULATOR_MODE_STANDBY, + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = ARRAY_SIZE(vdac_consumers), + .consumer_supplies = vdac_consumers, +}; + +/* VPLL2 */ +static struct regulator_consumer_supply vpll2_consumers[] = { + { + .supply = "lcd", + }, + { + .supply = "sdi", + }, +}; + +static struct regulator_init_data vpll2_data = { + .constraints = { + .name = "VPLL2", + .min_uV = 1800000, + .max_uV = 1800000, + .apply_uV = true, + .valid_modes_mask = REGULATOR_MODE_NORMAL + | REGULATOR_MODE_STANDBY, + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = ARRAY_SIZE(vpll2_consumers), + .consumer_supplies = vpll2_consumers, +}; + +/* VMMC1 */ +struct regulator_consumer_supply vmmc1_consumers[] = { + { + .supply = "mmc", + }, +}; + +static struct regulator_init_data vmmc1_data = { + .constraints = { + .name = "VMMC1", + .min_uV = 1850000, + .max_uV = 3150000, + .valid_modes_mask = REGULATOR_MODE_NORMAL + | REGULATOR_MODE_STANDBY, + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE + | REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = ARRAY_SIZE(vmmc1_consumers), + .consumer_supplies = vmmc1_consumers, +}; + +static void __init pmic_twl4030_init(void) { - /* TWL4030 specific init code */ + /* Initialize the regulator specific fields here */ + omap3evm_twldata.vdac = &vdac_data; + omap3evm_twldata.vpll2 = &vpll2_data; + omap3evm_twldata.vmmc1 = &vmmc1_data; } +#endif /* CONFIG_MACH_OMAP3EVM */ #else static inline void pmic_twl4030_init(void) { diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index dbdf062..10ac0d2 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c @@ -197,7 +197,7 @@ static struct twl4030_madc_platform_data omap3evm_madc_data = { .irq_line = 1, }; -static struct twl4030_platform_data omap3evm_twldata = { +struct twl4030_platform_data omap3evm_twldata = { .irq_base = TWL4030_IRQ_BASE, .irq_end = TWL4030_IRQ_END,