From patchwork Sat Apr 17 03:34:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ramos Falcon, Ernesto" X-Patchwork-Id: 93279 X-Patchwork-Delegate: omar.ramirez@ti.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3H3OkwD020235 for ; Sat, 17 Apr 2010 03:34:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758726Ab0DQDeN (ORCPT ); Fri, 16 Apr 2010 23:34:13 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:51803 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758713Ab0DQDeM convert rfc822-to-8bit (ORCPT ); Fri, 16 Apr 2010 23:34:12 -0400 Received: from dlep36.itg.ti.com ([157.170.170.91]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id o3H3YAnQ022490 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 16 Apr 2010 22:34:10 -0500 Received: from dlep26.itg.ti.com (localhost [127.0.0.1]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id o3H3Y9bm016858; Fri, 16 Apr 2010 22:34:09 -0500 (CDT) Received: from dlee74.ent.ti.com (localhost [127.0.0.1]) by dlep26.itg.ti.com (8.13.8/8.13.8) with ESMTP id o3H3Y9I8023455; Fri, 16 Apr 2010 22:34:09 -0500 (CDT) Received: from dlee01.ent.ti.com ([157.170.170.12]) by dlee74.ent.ti.com ([157.170.170.8]) with mapi; Fri, 16 Apr 2010 22:34:09 -0500 From: "Ramos Falcon, Ernesto" To: "linux-omap@vger.kernel.org" CC: Ameya Palande , "Doyu Hiroshi (Nokia-D/Helsinki)" , "Contreras Felipe (Nokia-D/Helsinki)" Date: Fri, 16 Apr 2010 22:34:08 -0500 Subject: [PATCH 4/5] DSPBRIDGE: Remove handles from registry Thread-Topic: [PATCH 4/5] DSPBRIDGE: Remove handles from registry Thread-Index: Acrd3tZQCw5MJTlMS5GY6w9zijsfAQ== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 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.3 (demeter.kernel.org [140.211.167.41]); Sat, 17 Apr 2010 03:34:14 +0000 (UTC) diff --git a/arch/arm/plat-omap/include/dspbridge/drv.h b/arch/arm/plat-omap/include/dspbridge/drv.h index 210ca68..f505b21 100644 --- a/arch/arm/plat-omap/include/dspbridge/drv.h +++ b/arch/arm/plat-omap/include/dspbridge/drv.h @@ -128,6 +128,9 @@ struct drv_data { char *base_img; s32 shm_size; int tc_wordswapon; + void *drv_object; + void *dev_object; + void *mgr_object; }; /* Process Context */ diff --git a/drivers/dsp/bridge/services/cfg.c b/drivers/dsp/bridge/services/cfg.c index 8f9f84c..8e2d614 100644 --- a/drivers/dsp/bridge/services/cfg.c +++ b/drivers/dsp/bridge/services/cfg.c @@ -82,6 +82,10 @@ dsp_status cfg_get_dev_object(struct cfg_devnode *dev_node_obj, { dsp_status status = DSP_SOK; u32 dw_buf_size; + struct drv_data *drv_datap = dev_get_drvdata(bridge); + + if (!drv_datap) + status = DSP_EFAIL; if (!dev_node_obj) status = CFG_E_INVALIDHDEVNODE; @@ -92,14 +96,12 @@ dsp_status cfg_get_dev_object(struct cfg_devnode *dev_node_obj, dw_buf_size = sizeof(pdwValue); if (DSP_SUCCEEDED(status)) { - /* check the device string and then call the reg_set_value */ + /* check the device string and then store dev object */ if (! (strcmp ((char *)((struct drv_ext *)dev_node_obj)->sz_string, "TIOMAP1510"))) - status = - reg_get_value("DEVICE_DSP", (u8 *) pdwValue, - &dw_buf_size); + *pdwValue = (u32)drv_datap->dev_object; } if (DSP_FAILED(status)) pr_err("%s: Failed, status 0x%x\n", __func__, status); @@ -144,23 +146,31 @@ dsp_status cfg_get_exec_file(struct cfg_devnode *dev_node_obj, u32 ul_buf_size, dsp_status cfg_get_object(OUT u32 *pdwValue, u32 dw_type) { dsp_status status = DSP_EINVALIDARG; - u32 dw_buf_size; + struct drv_data *drv_datap = dev_get_drvdata(bridge); + DBC_REQUIRE(pdwValue != NULL); - dw_buf_size = sizeof(pdwValue); + if (!drv_datap) + return DSP_EFAIL; + switch (dw_type) { case (REG_DRV_OBJECT): - status = - reg_get_value(DRVOBJECT, (u8 *) pdwValue, &dw_buf_size); - if (DSP_FAILED(status)) + if (drv_datap->drv_object) { + *pdwValue = (u32)drv_datap->drv_object; + status = DSP_SOK; + } else { status = CFG_E_RESOURCENOTAVAIL; + } break; case (REG_MGR_OBJECT): - status = - reg_get_value(MGROBJECT, (u8 *) pdwValue, &dw_buf_size); - if (DSP_FAILED(status)) + if (drv_datap->mgr_object) { + *pdwValue = (u32)drv_datap->mgr_object; + status = DSP_SOK; + } else { status = CFG_E_RESOURCENOTAVAIL; + } break; + default: break; } @@ -191,18 +201,21 @@ bool cfg_init(void) dsp_status cfg_set_dev_object(struct cfg_devnode *dev_node_obj, u32 dwValue) { dsp_status status = DSP_SOK; - u32 dw_buff_size; + struct drv_data *drv_datap = dev_get_drvdata(bridge); + + if (!drv_datap) { + pr_err("%s: Failed, status 0x%x\n", __func__, status); + return DSP_EFAIL; + } if (!dev_node_obj) status = CFG_E_INVALIDHDEVNODE; - dw_buff_size = sizeof(dwValue); if (DSP_SUCCEEDED(status)) { /* Store the WCD device object in the Registry */ if (!(strcmp((char *)dev_node_obj, "TIOMAP1510"))) { - status = reg_set_value("DEVICE_DSP", (u8 *) &dwValue, - dw_buff_size); + drv_datap->dev_object = (void *) dwValue; } } if (DSP_FAILED(status)) @@ -219,17 +232,19 @@ dsp_status cfg_set_dev_object(struct cfg_devnode *dev_node_obj, u32 dwValue) dsp_status cfg_set_object(u32 dwValue, u32 dw_type) { dsp_status status = DSP_EINVALIDARG; - u32 dw_buff_size; + struct drv_data *drv_datap = dev_get_drvdata(bridge); + + if (!drv_datap) + return DSP_EFAIL; - dw_buff_size = sizeof(dwValue); switch (dw_type) { case (REG_DRV_OBJECT): - status = - reg_set_value(DRVOBJECT, (u8 *) &dwValue, dw_buff_size); + drv_datap->drv_object = (void *)dwValue; + status = DSP_SOK; break; case (REG_MGR_OBJECT): - status = - reg_set_value(MGROBJECT, (u8 *) &dwValue, dw_buff_size); + drv_datap->mgr_object = (void *)dwValue; + status = DSP_SOK; break; default: break;