From patchwork Mon Jul 18 16:04:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 105311 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 09ECDB6F18 for ; Tue, 19 Jul 2011 02:04:58 +1000 (EST) Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QiqJM-0002gZ-8D; Mon, 18 Jul 2011 16:04:48 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QiqJL-0007Nr-T1; Mon, 18 Jul 2011 16:04:47 +0000 Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QiqJE-0007NX-9O for linux-arm-kernel@lists.infradead.org; Mon, 18 Jul 2011 16:04:45 +0000 Received: from katana.hi.pengutronix.de ([2001:6f8:1178:2:221:70ff:fe71:1890] helo=pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1QiqJ6-0001pr-SH; Mon, 18 Jul 2011 18:04:32 +0200 From: Wolfram Sang To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 11/10] arm: mxs: mx28evk: add fixed regulators for audio Date: Mon, 18 Jul 2011 18:04:21 +0200 Message-Id: <1311005061-20650-1-git-send-email-w.sang@pengutronix.de> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1310731780-1645-1-git-send-email-b29396@freescale.com> References: <1310731780-1645-1-git-send-email-b29396@freescale.com> X-SA-Exim-Connect-IP: 2001:6f8:1178:2:221:70ff:fe71:1890 X-SA-Exim-Mail-From: w.sang@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110718_120440_796514_2346C339 X-CRM114-Status: GOOD ( 15.01 ) X-Spam-Score: -1.1 (-) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-1.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.1 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: alsa-devel@alsa-project.org, Mark Brown , Dong Aisheng , lrg@ti.com, Wolfram Sang X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org Add fixed regulator to enable basic audio-support until full regulator support is done. Signed-off-by: Wolfram Sang Cc: Dong Aisheng --- Aisheng: This is the other patch (together with [1]) making the sgtl-hack obsolete. Needs fixed regulators, of course. [1] http://mailman.alsa-project.org/pipermail/alsa-devel/2011-July/041974.html arch/arm/mach-mxs/mach-mx28evk.c | 42 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 42 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-mxs/mach-mx28evk.c b/arch/arm/mach-mxs/mach-mx28evk.c index f99fc6b..edab588 100644 --- a/arch/arm/mach-mxs/mach-mx28evk.c +++ b/arch/arm/mach-mxs/mach-mx28evk.c @@ -19,6 +19,8 @@ #include #include #include +#include +#include #include #include @@ -379,6 +381,44 @@ static struct i2c_board_info mxs_i2c0_board_info[] __initdata = { }, }; +#if defined(CONFIG_REGULATOR_FIXED_VOLTAGE) || defined(CONFIG_REGULATOR_FIXED_VOLTAGE_MODULE) +static struct regulator_consumer_supply mx28evk_audio_consumer_supplies[] = { + REGULATOR_SUPPLY("VDDA", "0-000a"), + REGULATOR_SUPPLY("VDDIO", "0-000a"), +}; + +static struct regulator_init_data mx28evk_vdd_reg_init_data = { + .constraints = { + .name = "3V3", + .always_on = 1, + }, + .consumer_supplies = mx28evk_audio_consumer_supplies, + .num_consumer_supplies = ARRAY_SIZE(mx28evk_audio_consumer_supplies), +}; + +static struct fixed_voltage_config mx28evk_vdd_pdata = { + .supply_name = "board-3V3", + .microvolts = 3300000, + .gpio = -EINVAL, + .enabled_at_boot = 1, + .init_data = &mx28evk_vdd_reg_init_data, +}; +static struct platform_device mx28evk_voltage_regulator = { + .name = "reg-fixed-voltage", + .id = -1, + .num_resources = 0, + .dev = { + .platform_data = &mx28evk_vdd_pdata, + }, +}; +static void __init mx28evk_add_regulators(void) +{ + platform_device_register(&mx28evk_voltage_regulator); +} +#else +static void __init mx28evk_add_regulators(void) {} +#endif + static void __init mx28evk_init(void) { int ret; @@ -426,6 +466,8 @@ static void __init mx28evk_init(void) i2c_register_board_info(0, mxs_i2c0_board_info, ARRAY_SIZE(mxs_i2c0_board_info)); + mx28evk_add_regulators(); + mxs_add_platform_device("mxs-sgtl5000", 0, NULL, 0, NULL, 0);