From patchwork Sat Mar 5 15:29:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nishanth Menon X-Patchwork-Id: 612421 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p25FVZh0024926 for ; Sat, 5 Mar 2011 15:31:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753118Ab1CEPbe (ORCPT ); Sat, 5 Mar 2011 10:31:34 -0500 Received: from na3sys009aog106.obsmtp.com ([74.125.149.77]:35710 "EHLO na3sys009aog106.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753099Ab1CEPbe (ORCPT ); Sat, 5 Mar 2011 10:31:34 -0500 Received: from source ([209.85.213.48]) (using TLSv1) by na3sys009aob106.postini.com ([74.125.148.12]) with SMTP ID DSNKTXJXVSm3QmXpYuOG1EicZ+VNu3UGQUbE@postini.com; Sat, 05 Mar 2011 07:31:33 PST Received: by ywo32 with SMTP id 32so1521591ywo.7 for ; Sat, 05 Mar 2011 07:31:33 -0800 (PST) Received: by 10.151.42.18 with SMTP id u18mr2065029ybj.396.1299339092926; Sat, 05 Mar 2011 07:31:32 -0800 (PST) Received: from localhost (dragon.ti.com [192.94.94.33]) by mx.google.com with ESMTPS id q4sm349560ybe.12.2011.03.05.07.31.28 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 05 Mar 2011 07:31:32 -0800 (PST) From: Nishanth Menon To: linux-omap Cc: linux-arm , Kevin Hilman , Tony , Paul , Nishanth Menon Subject: [PATCH V3 12/19] OMAP3+: SR: introduce class start, stop and priv data Date: Sat, 5 Mar 2011 20:59:15 +0530 Message-Id: <1299338962-5602-13-git-send-email-nm@ti.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1299338962-5602-1-git-send-email-nm@ti.com> References: <1299338962-5602-1-git-send-email-nm@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 05 Mar 2011 15:31:35 +0000 (UTC) diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c index 1e52d61..592e9a0 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c @@ -220,6 +220,13 @@ static void sr_start_vddautocomp(struct omap_sr *sr) return; } + if (sr_class->start && + sr_class->start(sr->voltdm, sr_class->class_priv_data)) { + dev_err(&sr->pdev->dev, + "%s: SRClass initialization failed\n", __func__); + return; + } + if (!sr_class->enable(sr->voltdm)) sr->autocomp_active = true; } @@ -235,6 +242,13 @@ static void sr_stop_vddautocomp(struct omap_sr *sr) if (sr->autocomp_active) { sr_class->disable(sr->voltdm, 1); + if (sr_class->stop && + sr_class->stop(sr->voltdm, + sr_class->class_priv_data)) { + dev_err(&sr->pdev->dev, + "%s: SR[%d]Class deinitialization failed\n", + __func__, sr->srid); + } sr->autocomp_active = false; } } diff --git a/arch/arm/mach-omap2/smartreflex.h b/arch/arm/mach-omap2/smartreflex.h index 5f35b9e..d4b8bee 100644 --- a/arch/arm/mach-omap2/smartreflex.h +++ b/arch/arm/mach-omap2/smartreflex.h @@ -168,6 +168,8 @@ struct omap_sr_pmic_data { * * @enable: API to enable a particular class smaartreflex. * @disable: API to disable a particular class smartreflex. + * @start: API to do class specific initialization (optional) + * @stop: API to do class specific deinitialization (optional) * @configure: API to configure a particular class smartreflex. * @notify: API to notify the class driver about an event in SR. * Not needed for class3. @@ -175,14 +177,18 @@ struct omap_sr_pmic_data { * @class_type: specify which smartreflex class. * Can be used by the SR driver to take any class * based decisions. + * @class_priv_data: Class specific private data (optional) */ struct omap_sr_class_data { int (*enable)(struct voltagedomain *voltdm); int (*disable)(struct voltagedomain *voltdm, int is_volt_reset); + int (*start)(struct voltagedomain *voltdm, void *class_priv_data); + int (*stop)(struct voltagedomain *voltdm, void *class_priv_data); int (*configure)(struct voltagedomain *voltdm); int (*notify)(struct voltagedomain *voltdm, u32 status); u8 notify_flags; u8 class_type; + void *class_priv_data; }; /**