From patchwork Mon May 27 11:09:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrii Tseglytskyi X-Patchwork-Id: 2619171 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 99DF53FDBC for ; Mon, 27 May 2013 11:10:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757818Ab3E0LJc (ORCPT ); Mon, 27 May 2013 07:09:32 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:56105 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757791Ab3E0LJa (ORCPT ); Mon, 27 May 2013 07:09:30 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id r4RB9TI8002173; Mon, 27 May 2013 06:09:29 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id r4RB9TKN028867; Mon, 27 May 2013 06:09:29 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.2.342.3; Mon, 27 May 2013 06:09:29 -0500 Received: from localhost (uglx0174653.ucm2.emeaucm.ext.ti.com [10.167.145.64]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r4RB9SPq027236; Mon, 27 May 2013 06:09:29 -0500 From: Andrii Tseglytskyi To: Kevin Hilman , J Keerthy CC: , Subject: [PATCH v1 2/3] PM / AVS: SmartReflex: use omap_sr * for minmax interfaces Date: Mon, 27 May 2013 14:09:23 +0300 Message-ID: <1369652964-14484-3-git-send-email-andrii.tseglytskyi@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1369652964-14484-1-git-send-email-andrii.tseglytskyi@ti.com> References: <1369652964-14484-1-git-send-email-andrii.tseglytskyi@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org SmartReflex driver interface is natively divided to two parts: - external SmartReflex interface - interface between SmartReflex driver and SmartReflex Class Functions which belong to AVS class interface can use struct omap_sr* instead of struct voltatedomain*, to provide a direct connection between SR driver and SR class. This allows us to optimize and not do additional lookups where none is required. sr_configure_minmax() is interface function between SR driver and SR class. It is typically used by Class driver to configure MINMAXAVG module inside SmartReflex module. Now it takes struct omap_sr* as input parameter. Signed-off-by: Andrii Tseglytskyi Acked-by: Nishanth Menon --- drivers/power/avs/smartreflex.c | 14 +++++++------- include/linux/power/smartreflex.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/power/avs/smartreflex.c b/drivers/power/avs/smartreflex.c index 155a050..ef92716 100644 --- a/drivers/power/avs/smartreflex.c +++ b/drivers/power/avs/smartreflex.c @@ -459,9 +459,9 @@ int sr_disable_errgen(struct omap_sr *sr) } /** - * sr_configure_minmax() - Configures the smrtreflex to perform AVS using the + * sr_configure_minmax() - Configures the SmartReflex to perform AVS using the * minmaxavg module. - * @voltdm: VDD pointer to which the SR module to be configured belongs to. + * @sr: SR module to be configured. * * This API is to be called from the smartreflex class driver to * configure the minmaxavg module inside the smartreflex module. @@ -470,16 +470,16 @@ int sr_disable_errgen(struct omap_sr *sr) * SR CLASS 2 can choose between ERROR module and MINMAXAVG * module. Returns 0 on success and error value in case of failure. */ -int sr_configure_minmax(struct voltagedomain *voltdm) +int sr_configure_minmax(struct omap_sr *sr) { u32 sr_config, sr_avgwt; u32 senp_en = 0, senn_en = 0; u8 senp_shift, senn_shift; - struct omap_sr *sr = _sr_lookup(voltdm); - if (IS_ERR(sr)) { - pr_warning("%s: omap_sr struct for voltdm not found\n", __func__); - return PTR_ERR(sr); + if (!sr) { + pr_warn("%s: NULL omap_sr from %pF\n", __func__, + (void *)_RET_IP_); + return -EINVAL; } if (!sr->clk_length) diff --git a/include/linux/power/smartreflex.h b/include/linux/power/smartreflex.h index 9c3b9ad..648be77 100644 --- a/include/linux/power/smartreflex.h +++ b/include/linux/power/smartreflex.h @@ -303,7 +303,7 @@ int sr_enable(struct voltagedomain *voltdm, unsigned long volt); void sr_disable(struct voltagedomain *voltdm); int sr_configure_errgen(struct omap_sr *sr); int sr_disable_errgen(struct omap_sr *sr); -int sr_configure_minmax(struct voltagedomain *voltdm); +int sr_configure_minmax(struct omap_sr *sr); /* API to register the smartreflex class driver with the smartreflex driver */ int sr_register_class(struct omap_sr_class_data *class_data);