From patchwork Tue Oct 20 13:22:53 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilkka Koskinen X-Patchwork-Id: 54948 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 n9KDOGn6014110 for ; Tue, 20 Oct 2009 13:24:17 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752099AbZJTNXi (ORCPT ); Tue, 20 Oct 2009 09:23:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752100AbZJTNXi (ORCPT ); Tue, 20 Oct 2009 09:23:38 -0400 Received: from smtp.nokia.com ([192.100.105.134]:63442 "EHLO mgw-mx09.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752097AbZJTNXf (ORCPT ); Tue, 20 Oct 2009 09:23:35 -0400 Received: from vaebh106.NOE.Nokia.com (vaebh106.europe.nokia.com [10.160.244.32]) by mgw-mx09.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n9KDNDYw024704; Tue, 20 Oct 2009 08:23:39 -0500 Received: from esebh102.NOE.Nokia.com ([172.21.138.183]) by vaebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 20 Oct 2009 16:23:27 +0300 Received: from mgw-da02.ext.nokia.com ([147.243.128.26]) by esebh102.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Tue, 20 Oct 2009 16:23:27 +0300 Received: from localhost.localdomain (tumpelo.ntc.nokia.com [172.22.144.93]) by mgw-da02.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id n9KDNMAT027940; Tue, 20 Oct 2009 16:23:24 +0300 From: Ilkka Koskinen To: sameo@linux.intel.com Cc: linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: [Resend PATCH 2/2] twl4030: Enable low-power mode to 32kHz oscillator Date: Tue, 20 Oct 2009 16:22:53 +0300 Message-Id: <1256044973-14548-2-git-send-email-ilkka.koskinen@nokia.com> X-Mailer: git-send-email 1.6.0.4 In-Reply-To: <1256044973-14548-1-git-send-email-ilkka.koskinen@nokia.com> References: <1256044973-14548-1-git-send-email-ilkka.koskinen@nokia.com> X-OriginalArrivalTime: 20 Oct 2009 13:23:27.0450 (UTC) FILETIME=[82275BA0:01CA5188] X-Nokia-AV: Clean Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org diff --git a/drivers/mfd/twl4030-core.c b/drivers/mfd/twl4030-core.c index 8cf0a02..5596bb4 100644 --- a/drivers/mfd/twl4030-core.c +++ b/drivers/mfd/twl4030-core.c @@ -177,6 +177,7 @@ #define HFCLK_FREQ_26_MHZ (2 << 0) #define HFCLK_FREQ_38p4_MHZ (3 << 0) #define HIGH_PERF_SQ (1 << 3) +#define CK32K_LOWPWR_EN (1 << 7) /* chip-specific feature flags, for i2c_device_id.driver_data */ @@ -678,7 +679,8 @@ static inline int __init unprotect_pm_master(void) return e; } -static void clocks_init(struct device *dev) +static void clocks_init(struct device *dev, + struct twl4030_clock_init_data *clock) { int e = 0; struct clk *osc; @@ -725,6 +727,9 @@ static void clocks_init(struct device *dev) } ctrl |= HIGH_PERF_SQ; + if (clock && clock->ck32k_lowpwr_enable) + ctrl |= CK32K_LOWPWR_EN; + e |= unprotect_pm_master(); /* effect->MADC+USB ck en */ e |= twl4030_i2c_write_u8(TWL4030_MODULE_PM_MASTER, ctrl, R_CFG_BOOT); @@ -805,7 +810,7 @@ twl4030_probe(struct i2c_client *client, const struct i2c_device_id *id) inuse = true; /* setup clock framework */ - clocks_init(&client->dev); + clocks_init(&client->dev, pdata->clock); /* load power event scripts */ if (twl_has_power() && pdata->power) diff --git a/include/linux/i2c/twl4030.h b/include/linux/i2c/twl4030.h index 508824e..c8d5078 100644 --- a/include/linux/i2c/twl4030.h +++ b/include/linux/i2c/twl4030.h @@ -312,6 +312,10 @@ int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); /*----------------------------------------------------------------------*/ +struct twl4030_clock_init_data { + int ck32k_lowpwr_enable; +}; + struct twl4030_bci_platform_data { int *battery_tmp_tbl; unsigned int tblsize; @@ -403,6 +407,7 @@ extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); struct twl4030_platform_data { unsigned irq_base, irq_end; + struct twl4030_clock_init_data *clock; struct twl4030_bci_platform_data *bci; struct twl4030_gpio_platform_data *gpio; struct twl4030_madc_platform_data *madc;