From patchwork Sun Apr 26 20:45:19 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grazvydas Ignotas X-Patchwork-Id: 20035 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 n3QKjYXq021439 for ; Sun, 26 Apr 2009 20:45:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751750AbZDZUp1 (ORCPT ); Sun, 26 Apr 2009 16:45:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751850AbZDZUp1 (ORCPT ); Sun, 26 Apr 2009 16:45:27 -0400 Received: from mu-out-0910.google.com ([209.85.134.186]:16311 "EHLO mu-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751750AbZDZUp0 (ORCPT ); Sun, 26 Apr 2009 16:45:26 -0400 Received: by mu-out-0910.google.com with SMTP id i2so586756mue.1 for ; Sun, 26 Apr 2009 13:45:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=5gWDryQYU/lDmU6+4ODx59ayXqgf752Jz8b8Y1CHocg=; b=lpaTs6f8otaUfPxIOiFrhXX+JGgzeNdI38e1tgDfJ0Qvl48Vz/yFw46/rBaiHDMA9J 8XHipuG3SJW03crFRylBPgnKlOuZBinDeUgTX5mzoEmiZ5JgOOBOazh4Ij7bOq7G6d/n OVy3oU45XfwGpz51JwRDg8DQl6rnKleb3EHMw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=U3G8agK/uisU7/hbaW9Pc6Qph4PVpRXcZdsFBbHXjHrdQf8VHCgCApitlZWDRC+gHs ks96Y/yM4pVL2octPl8bg4JRie01/dHw7HrcpqIIcHf5l+zCJY1RUvAv7+v/kpNhkCov UY4QQjYArgKLDRTwQOuBzPNl6hASp/V9qf1TA= Received: by 10.103.218.9 with SMTP id v9mr2718621muq.78.1240778725079; Sun, 26 Apr 2009 13:45:25 -0700 (PDT) Received: from localhost.localdomain ([78.60.172.133]) by mx.google.com with ESMTPS id 23sm10313628mum.35.2009.04.26.13.45.24 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 26 Apr 2009 13:45:24 -0700 (PDT) From: Grazvydas Ignotas To: linux-omap@vger.kernel.org Cc: Grazvydas Ignotas , David Brownell Subject: [PATCH] OMAP: pandora: setup regulator framework for MMC Date: Sun, 26 Apr 2009 23:45:19 +0300 Message-Id: <1240778719-26353-1-git-send-email-notasas@gmail.com> X-Mailer: git-send-email 1.5.6.3 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Setup regulators for MMC1 and MMC2 to get those SD slots working again. Signed-off-by: Grazvydas Ignotas CC: David Brownell Acked-by: David Brownell --- arch/arm/mach-omap2/board-omap3pandora.c | 45 ++++++++++++++++++++++++++++++ 1 files changed, 45 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c index c67f62f..c525b16 100644 --- a/arch/arm/mach-omap2/board-omap3pandora.c +++ b/arch/arm/mach-omap2/board-omap3pandora.c @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -171,6 +172,14 @@ static struct omap_uart_config omap3pandora_uart_config __initdata = { .enabled_uarts = (1 << 2), /* UART3 */ }; +static struct regulator_consumer_supply pandora_vmmc1_supply = { + .supply = "vmmc", +}; + +static struct regulator_consumer_supply pandora_vmmc2_supply = { + .supply = "vmmc", +}; + static int omap3pandora_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) { @@ -179,6 +188,10 @@ static int omap3pandora_twl_gpio_setup(struct device *dev, omap3pandora_mmc[1].gpio_cd = gpio + 1; twl4030_mmc_init(omap3pandora_mmc); + /* link regulators to MMC adapters */ + pandora_vmmc1_supply.dev = omap3pandora_mmc[0].dev; + pandora_vmmc2_supply.dev = omap3pandora_mmc[1].dev; + return 0; } @@ -189,6 +202,36 @@ static struct twl4030_gpio_platform_data omap3pandora_gpio_data = { .setup = omap3pandora_twl_gpio_setup, }; +/* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ +static struct regulator_init_data pandora_vmmc1 = { + .constraints = { + .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 = 1, + .consumer_supplies = &pandora_vmmc1_supply, +}; + +/* VMMC2 for MMC2 pins CMD, CLK, DAT0..DAT3 (max 100 mA) */ +static struct regulator_init_data pandora_vmmc2 = { + .constraints = { + .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 = 1, + .consumer_supplies = &pandora_vmmc2_supply, +}; + static struct twl4030_usb_data omap3pandora_usb_data = { .usb_mode = T2_USB_MODE_ULPI, }; @@ -198,6 +241,8 @@ static struct twl4030_platform_data omap3pandora_twldata = { .irq_end = TWL4030_IRQ_END, .gpio = &omap3pandora_gpio_data, .usb = &omap3pandora_usb_data, + .vmmc1 = &pandora_vmmc1, + .vmmc2 = &pandora_vmmc2, }; static struct i2c_board_info __initdata omap3pandora_i2c_boardinfo[] = {