From patchwork Thu Aug 1 07:41:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 2836846 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 439A2C0319 for ; Thu, 1 Aug 2013 07:41:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E457120304 for ; Thu, 1 Aug 2013 07:41:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F13DD202B9 for ; Thu, 1 Aug 2013 07:41:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752407Ab3HAHl3 (ORCPT ); Thu, 1 Aug 2013 03:41:29 -0400 Received: from moutng.kundenserver.de ([212.227.17.9]:61388 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752110Ab3HAHl3 (ORCPT ); Thu, 1 Aug 2013 03:41:29 -0400 Received: from axis700.grange (dslb-188-109-039-196.pools.arcor-ip.net [188.109.39.196]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0LjLuJ-1UUNQr2Bxf-00dHDa; Thu, 01 Aug 2013 09:41:23 +0200 Received: from 6a.grange (6a.grange [192.168.1.11]) by axis700.grange (Postfix) with ESMTPS id E6AA040BB3; Thu, 1 Aug 2013 09:41:21 +0200 (CEST) Received: from lyakh by 6a.grange with local (Exim 4.72) (envelope-from ) id 1V4nVh-0000ZH-Ls; Thu, 01 Aug 2013 09:41:21 +0200 From: Guennadi Liakhovetski To: linux-sh@vger.kernel.org Cc: Sergei Shtylyov , Laurent Pinchart , Magnus Damm , Simon Horman , Guennadi Liakhovetski Subject: [PATCH 2/3] ARM: shmobile: ape6evm: update MMC0, SDHI0 and SDHI1 with correct regulators Date: Thu, 1 Aug 2013 09:41:20 +0200 Message-Id: <1375342881-2155-3-git-send-email-g.liakhovetski@gmx.de> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1375342881-2155-1-git-send-email-g.liakhovetski@gmx.de> References: <1375342881-2155-1-git-send-email-g.liakhovetski@gmx.de> X-Provags-ID: V02:K0:cOgF46Aq9LMs6AjXD+3VEuskkwy/Vqdvupbw9Me04qD +mP4LzmCIoQ9mAEJ/iybcGD0VA9+oiH3T4Va/8iMKIuvBmfCXy aA+79FQPkEsRaXtCKDEqlFrigakm0WArcyASs31XIXGM/El9Wh e13gLwXsoYqI8zTPl91C/ZNoz8JKbYl+NUlOc3cgvk3q2Eh/vJ 9zjLVfyMkvwphu0N/PD/68C4O12cq33mgBwdoRJlR71unp1bdw 02lwtGdHyqgMmLnqOx4xRpuVZrdYPNtCO7EKlUlJeVVUCHdJ// zvnrUZ3J/0NzWEAo9ikMLcbGgYsYNOW3RbF5hnccEM5Ratgcje XHw50T6MQkfyVv2pTMvi6gQYONiMHYm6ykEEdV/QAVVMNKRc69 9prls1IIWpXmQ== Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently a dummy fixed always-on regulator is used for all 3 SD/MMC interfaces on ape6evm. This patch updates the board to use correct supplies for MMC0, SDHI0 and SDHI1 VDD. SDHI0 VccQ supply regulator should be implemented in a separate patch. Signed-off-by: Guennadi Liakhovetski Acked-by: Laurent Pinchart --- v4: make SDHI0 Vcc 3.3V instead of 3.0V arch/arm/mach-shmobile/board-ape6evm.c | 54 +++++++++++++++++++++++++++----- 1 files changed, 46 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-shmobile/board-ape6evm.c b/arch/arm/mach-shmobile/board-ape6evm.c index c5e6cba..b613b594 100644 --- a/arch/arm/mach-shmobile/board-ape6evm.c +++ b/arch/arm/mach-shmobile/board-ape6evm.c @@ -59,16 +59,49 @@ static const struct smsc911x_platform_config lan9220_data __initconst = { }; /* - * On APE6EVM power is supplied to MMCIF by a tps80032 regulator. For now we - * model a VDD supply to MMCIF, using a fixed 3.3V regulator. Also use the - * static power supply for SDHI0 and SDHI1, whereas SDHI0's VccQ is also - * supplied by the same tps80032 regulator and thus can also be adjusted - * dynamically. + * MMC0 power supplies: + * Both Vcc and VccQ to eMMC on APE6EVM are supplied by a tps80032 voltage + * regulator. Until support for it is added to this file we simulate the + * Vcc supply by a fixed always-on regulator */ -static struct regulator_consumer_supply fixed3v3_power_consumers[] = +static struct regulator_consumer_supply vcc_mmc0_consumers[] = { REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"), +}; + +/* + * SDHI0 power supplies: + * Vcc to SDHI0 on APE6EVM is supplied by a GPIO-switchable regulator. VccQ is + * provided by the same tps80032 regulator as both MMC0 voltages - see comment + * above + */ +static struct regulator_consumer_supply vcc_sdhi0_consumers[] = +{ REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"), +}; + +static struct regulator_init_data vcc_sdhi0_init_data = { + .constraints = { + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + }, + .num_consumer_supplies = ARRAY_SIZE(vcc_sdhi0_consumers), + .consumer_supplies = vcc_sdhi0_consumers, +}; + +static const struct fixed_voltage_config vcc_sdhi0_info __initconst = { + .supply_name = "SDHI0 Vcc", + .microvolts = 3300000, + .gpio = 76, + .enable_high = 1, + .init_data = &vcc_sdhi0_init_data, +}; + +/* + * SDHI1 power supplies: + * Vcc and VccQ to SDHI1 on APE6EVM are both fixed at 3.3V + */ +static struct regulator_consumer_supply vcc_sdhi1_consumers[] = +{ REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"), }; @@ -161,14 +194,19 @@ static void __init ape6evm_add_standard_devices(void) platform_device_register_resndata(&platform_bus, "smsc911x", -1, lan9220_res, ARRAY_SIZE(lan9220_res), &lan9220_data, sizeof(lan9220_data)); - regulator_register_always_on(1, "fixed-3.3V", fixed3v3_power_consumers, - ARRAY_SIZE(fixed3v3_power_consumers), 3300000); + + regulator_register_always_on(1, "MMC0 Vcc", vcc_mmc0_consumers, + ARRAY_SIZE(vcc_mmc0_consumers), 2800000); platform_device_register_resndata(&platform_bus, "sh_mmcif", 0, mmcif0_resources, ARRAY_SIZE(mmcif0_resources), &mmcif0_pdata, sizeof(mmcif0_pdata)); + platform_device_register_data(&platform_bus, "reg-fixed-voltage", 2, + &vcc_sdhi0_info, sizeof(vcc_sdhi0_info)); platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 0, sdhi0_resources, ARRAY_SIZE(sdhi0_resources), &sdhi0_pdata, sizeof(sdhi0_pdata)); + regulator_register_always_on(3, "SDHI1 Vcc", vcc_sdhi1_consumers, + ARRAY_SIZE(vcc_sdhi1_consumers), 3300000); platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 1, sdhi1_resources, ARRAY_SIZE(sdhi1_resources), &sdhi1_pdata, sizeof(sdhi1_pdata));