From patchwork Tue Apr 13 09:31:54 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "stanley.miao" X-Patchwork-Id: 92142 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3D9NRKA019585 for ; Tue, 13 Apr 2010 09:23:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752383Ab0DMJX3 (ORCPT ); Tue, 13 Apr 2010 05:23:29 -0400 Received: from mail.windriver.com ([147.11.1.11]:51220 "EHLO mail.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752363Ab0DMJX3 (ORCPT ); Tue, 13 Apr 2010 05:23:29 -0400 Received: from ALA-MAIL03.corp.ad.wrs.com (ala-mail03 [147.11.57.144]) by mail.windriver.com (8.14.3/8.14.3) with ESMTP id o3D9NRnT010206; Tue, 13 Apr 2010 02:23:27 -0700 (PDT) Received: from ala-mail06.corp.ad.wrs.com ([147.11.57.147]) by ALA-MAIL03.corp.ad.wrs.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 13 Apr 2010 02:23:27 -0700 Received: from localhost.localdomain ([128.224.163.169]) by ala-mail06.corp.ad.wrs.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 13 Apr 2010 02:23:26 -0700 From: "Stanley.Miao" To: linux-omap@vger.kernel.org Cc: tony@atomide.com Subject: [PATCH 04/11] AM3517: Add platform init code for regulator driver Date: Tue, 13 Apr 2010 17:31:54 +0800 Message-Id: <1271151118-12999-5-git-send-email-stanley.miao@windriver.com> X-Mailer: git-send-email 1.5.6.3 In-Reply-To: <1271151118-12999-1-git-send-email-stanley.miao@windriver.com> References: <1271151118-12999-1-git-send-email-stanley.miao@windriver.com> X-OriginalArrivalTime: 13 Apr 2010 09:23:26.0827 (UTC) FILETIME=[F900EBB0:01CADAEA] 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.3 (demeter.kernel.org [140.211.167.41]); Tue, 13 Apr 2010 09:23:39 +0000 (UTC) diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c index 5abf333..2d7fd08 100644 --- a/arch/arm/mach-omap2/board-am3517evm.c +++ b/arch/arm/mach-omap2/board-am3517evm.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -159,6 +160,122 @@ static struct i2c_board_info __initdata am3517evm_i2c1_boardinfo[] = { }, }; +/* TPS65023 specific initialization */ +/* VDCDC1 -> VDD_CORE */ +static struct regulator_consumer_supply am3517_evm_vdcdc1_supplies[] = { + { + .supply = "vdd_core", + }, +}; + +/* VDCDC2 -> VDDSHV */ +static struct regulator_consumer_supply am3517_evm_vdcdc2_supplies[] = { + { + .supply = "vddshv", + }, +}; + +/* VDCDC2 |-> VDDS + |-> VDDS_SRAM_CORE_BG + |-> VDDS_SRAM_MPU */ +static struct regulator_consumer_supply am3517_evm_vdcdc3_supplies[] = { + { + .supply = "vdds", + }, + { + .supply = "vdds_sram_core_bg", + }, + { + .supply = "vdds_sram_mpu", + }, +}; + +/* LDO1 |-> VDDA1P8V_USBPHY + |-> VDDA_DAC */ +static struct regulator_consumer_supply am3517_evm_ldo1_supplies[] = { + { + .supply = "vdda1p8v_usbphy", + }, + { + .supply = "vdda_dac", + }, +}; + +/* LDO2 -> VDDA3P3V_USBPHY */ +static struct regulator_consumer_supply am3517_evm_ldo2_supplies[] = { + { + .supply = "vdda3p3v_usbphy", + }, +}; + +static struct regulator_init_data am3517_evm_regulator_data[] = { + /* DCDC1 */ + { + .constraints = { + .min_uV = 1200000, + .max_uV = 1200000, + .valid_modes_mask = REGULATOR_MODE_NORMAL, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + .always_on = true, + .apply_uV = false, + }, + .num_consumer_supplies = ARRAY_SIZE(am3517_evm_vdcdc1_supplies), + .consumer_supplies = am3517_evm_vdcdc1_supplies, + }, + /* DCDC2 */ + { + .constraints = { + .min_uV = 3300000, + .max_uV = 3300000, + .valid_modes_mask = REGULATOR_MODE_NORMAL, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + .always_on = true, + .apply_uV = false, + }, + .num_consumer_supplies = ARRAY_SIZE(am3517_evm_vdcdc2_supplies), + .consumer_supplies = am3517_evm_vdcdc2_supplies, + }, + /* DCDC3 */ + { + .constraints = { + .min_uV = 1800000, + .max_uV = 1800000, + .valid_modes_mask = REGULATOR_MODE_NORMAL, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + .always_on = true, + .apply_uV = false, + }, + .num_consumer_supplies = ARRAY_SIZE(am3517_evm_vdcdc3_supplies), + .consumer_supplies = am3517_evm_vdcdc3_supplies, + }, + /* LDO1 */ + { + .constraints = { + .min_uV = 1800000, + .max_uV = 1800000, + .valid_modes_mask = REGULATOR_MODE_NORMAL, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + .always_on = false, + .apply_uV = false, + }, + .num_consumer_supplies = ARRAY_SIZE(am3517_evm_ldo1_supplies), + .consumer_supplies = am3517_evm_ldo1_supplies, + }, + /* LDO2 */ + { + .constraints = { + .min_uV = 3300000, + .max_uV = 3300000, + .valid_modes_mask = REGULATOR_MODE_NORMAL, + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + .always_on = false, + .apply_uV = false, + }, + .num_consumer_supplies = ARRAY_SIZE(am3517_evm_ldo2_supplies), + .consumer_supplies = am3517_evm_ldo2_supplies, + }, +}; + /* * RTC - S35390A */ @@ -216,6 +333,11 @@ static struct i2c_board_info __initdata am3517evm_i2c3_boardinfo[] = { I2C_BOARD_INFO("tca6416", 0x21), .platform_data = &am3517evm_ui_gpio_expander_info_2, }, + { + I2C_BOARD_INFO("tps65023", 0x48), + .flags = I2C_CLIENT_WAKE, + .platform_data = &am3517_evm_regulator_data[0], + }, }; static int __init am3517_evm_i2c_init(void)