From patchwork Wed Jan 23 18:50:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Brugger X-Patchwork-Id: 2026461 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 8DDBA3FCD5 for ; Wed, 23 Jan 2013 18:50:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752262Ab3AWSuu (ORCPT ); Wed, 23 Jan 2013 13:50:50 -0500 Received: from mail-wg0-f52.google.com ([74.125.82.52]:41883 "EHLO mail-wg0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752052Ab3AWSuq (ORCPT ); Wed, 23 Jan 2013 13:50:46 -0500 Received: by mail-wg0-f52.google.com with SMTP id 12so3123461wgh.7 for ; Wed, 23 Jan 2013 10:50:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=o4dOQbi2recY54hOroZihYWq7NQxPFNXIlQdI2obS9U=; b=SuonefBYe36Jb6OnJCzrASSoez47RSWH6brtlPskld4yXA1h3QRqOkByZsLyiRgcjv JEGyQT6zLcv1YZiv0FjgTWpBbZ9R1expUKgJQt3hYU7pmS7JpPHYjm201Q09PO0tiIlw Z/cErvYLFVO4thw1NJ+NPyjra5nhQYOx1upaz1HJNRndn2x87BGAQmYOFWJEl2GyTjtl jrHO4wW8P8fXsvJaOw74o5emWCAIDAPwJaeMPCQ9yab2IKwAOjl2O1R59ZRdcazQh/Ub tSV25v284lLRwAUWrKYtpYwrj0ecURm0Da2oWPdWvWE0w+OjUmVgvXO7NgpfrPwuHLZH 9w3g== X-Received: by 10.181.13.75 with SMTP id ew11mr4443123wid.9.1358967044739; Wed, 23 Jan 2013 10:50:44 -0800 (PST) Received: from ubi.home (206.Red-83-33-115.dynamicIP.rima-tde.net. [83.33.115.206]) by mx.google.com with ESMTPS id s10sm30916343wiw.4.2013.01.23.10.50.42 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 23 Jan 2013 10:50:43 -0800 (PST) From: Matthias Brugger To: tony@atomide.com, linux@arm.linux.org.uk, martinez.javier@gmail.com, eballetbo@iseebcn.com, ezequiel.garcia@free-electrons.com, robertcnelson@gmail.com, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Matthias Brugger Subject: [PATCH] omap2: twl-common: Add default power configuration Date: Wed, 23 Jan 2013 19:50:38 +0100 Message-Id: <1358967038-6615-1-git-send-email-matthias.bgg@gmail.com> X-Mailer: git-send-email 1.7.11.7 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org This patch adds a generic power script configuration. When rebooting an OMAP3530 at 125 MHz, the reboot hangs. With the generic power script, TWL4030 will be reset when a warm reset occures. This way the OMAP3530 does not hang on reboot. Signed-off-by: Matthias Brugger --- arch/arm/mach-omap2/twl-common.c | 38 ++++++++++++++++++++++++++++++++++++++ arch/arm/mach-omap2/twl-common.h | 1 + 2 files changed, 39 insertions(+) diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c index e49b40b..f096beb 100644 --- a/arch/arm/mach-omap2/twl-common.c +++ b/arch/arm/mach-omap2/twl-common.c @@ -120,6 +120,41 @@ static struct twl4030_audio_data omap3_audio_pdata = { .codec = &omap3_codec, }; +static struct twl4030_ins wrst_seq[] __initdata = { + {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_OFF), 2}, + {MSG_SINGULAR(DEV_GRP_P1, 0xf, RES_STATE_WRST), 15}, + {MSG_SINGULAR(DEV_GRP_P1, 0x10, RES_STATE_WRST), 15}, + {MSG_SINGULAR(DEV_GRP_P1, 0x7, RES_STATE_WRST), 0x60}, + {MSG_SINGULAR(DEV_GRP_P1, 0x19, RES_STATE_ACTIVE), 2}, + {MSG_SINGULAR(DEV_GRP_NULL, 0x1b, RES_STATE_ACTIVE), 2}, +}; + +static struct twl4030_script wrst_script __initdata = { + .script = wrst_seq, + .size = ARRAY_SIZE(wrst_seq), + .flags = TWL4030_WRST_SCRIPT, +}; + +static struct twl4030_script *omap3_power_scripts[] __initdata = { + &wrst_script, +}; + +static struct twl4030_resconfig omap3_rconfig[] = { + { .resource = RES_HFCLKOUT, .devgroup = DEV_GRP_P3, .type = -1, + .type2 = -1 }, + { .resource = RES_VDD1, .devgroup = DEV_GRP_P1, .type = -1, + .type2 = -1 }, + { .resource = RES_VDD2, .devgroup = DEV_GRP_P1, .type = -1, + .type2 = -1 }, + { 0, 0}, +}; + +static struct twl4030_power_data omap3_power_pdata = { + .scripts = omap3_power_scripts, + .num = ARRAY_SIZE(omap3_power_scripts), + .resource_config = omap3_rconfig, +}; + static struct regulator_consumer_supply omap3_vdda_dac_supplies[] = { REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"), }; @@ -224,6 +259,9 @@ void __init omap3_pmic_get_config(struct twl4030_platform_data *pmic_data, if (pdata_flags & TWL_COMMON_PDATA_AUDIO && !pmic_data->audio) pmic_data->audio = &omap3_audio_pdata; + if (pdata_flags & TWL_COMMON_PDATA_POWER && !pmic_data->power) + pmic_data->power = &omap3_power_pdata; + /* Common regulator configurations */ if (regulators_flags & TWL_COMMON_REGULATOR_VDAC && !pmic_data->vdac) pmic_data->vdac = &omap3_vdac_idata; diff --git a/arch/arm/mach-omap2/twl-common.h b/arch/arm/mach-omap2/twl-common.h index dcfbad5..dbeb905 100644 --- a/arch/arm/mach-omap2/twl-common.h +++ b/arch/arm/mach-omap2/twl-common.h @@ -7,6 +7,7 @@ #define TWL_COMMON_PDATA_BCI (1 << 1) #define TWL_COMMON_PDATA_MADC (1 << 2) #define TWL_COMMON_PDATA_AUDIO (1 << 3) +#define TWL_COMMON_PDATA_POWER (1 << 4) /* Common LDO regulators for TWL4030/TWL6030 */ #define TWL_COMMON_REGULATOR_VDAC (1 << 0)