From patchwork Sat May 1 00:45:46 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gomez Castellanos, Ivan" X-Patchwork-Id: 96129 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 o410rFrB014919 for ; Sat, 1 May 2010 00:53:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758460Ab0EAAxN (ORCPT ); Fri, 30 Apr 2010 20:53:13 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:35602 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757374Ab0EAAwz (ORCPT ); Fri, 30 Apr 2010 20:52:55 -0400 Received: from dlep33.itg.ti.com ([157.170.170.112]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id o410qmEW006945 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 30 Apr 2010 19:52:48 -0500 Received: from emcc1.sasken-mty.naucm.ext.ti.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id o410qlU8021102; Fri, 30 Apr 2010 19:52:47 -0500 (CDT) Received: from localhost.localdomain (x0128362-desktop.sasken-mty.naucm.ext.ti.com [10.87.231.130]) by emcc1.sasken-mty.naucm.ext.ti.com (8.13.8+Sun/8.13.8) with ESMTP id o410qj6G019432; Fri, 30 Apr 2010 19:52:47 -0500 (CDT) From: Ivan Gomez Castellanos To: linux-omap@vger.kernel.org Cc: Hiroshi.DOYU@nokia.com, ameya.palande@nokia.com, felipe.contreras@nokia.com, Ivan Gomez Castellanos Subject: [PATCH 06/11] DSPBRIDGE: Replace code containing "wcd" Date: Fri, 30 Apr 2010 19:45:46 -0500 Message-Id: <1272674751-21557-7-git-send-email-ivan.gomez@ti.com> X-Mailer: git-send-email 1.7.0.3 In-Reply-To: <1272674751-21557-1-git-send-email-ivan.gomez@ti.com> References: <1272674751-21557-1-git-send-email-ivan.gomez@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.3 (demeter.kernel.org [140.211.167.41]); Sat, 01 May 2010 00:53:16 +0000 (UTC) diff --git a/arch/arm/plat-omap/include/dspbridge/_dcd.h b/arch/arm/plat-omap/include/dspbridge/_dcd.h index 1350feb..589cd42 100644 --- a/arch/arm/plat-omap/include/dspbridge/_dcd.h +++ b/arch/arm/plat-omap/include/dspbridge/_dcd.h @@ -23,9 +23,9 @@ #include /* - * ======== wcd_call_dev_io_ctl ======== + * ======== api_call_dev_ioctl ======== * Purpose: - * Call the (wrapper) function for the corresponding WCD IOCTL. + * Call the (wrapper) function for the corresponding API IOCTL. * Parameters: * cmd: IOCTL id, base 0. * args: Argument structure. @@ -36,28 +36,28 @@ * Requires: * Ensures: */ -extern dsp_status wcd_call_dev_io_ctl(unsigned int cmd, +extern dsp_status api_call_dev_ioctl(unsigned int cmd, union Trapped_Args *args, u32 *pResult, void *pr_ctxt); /* - * ======== wcd_init ======== + * ======== api_init ======== * Purpose: - * Initialize WCD modules, and export WCD services to WMD's. - * This procedure is called when the class driver is loaded. + * Initialize modules used by Bridge API. + * This procedure is called when the driver is loaded. * Parameters: * Returns: * TRUE if success; FALSE otherwise. * Requires: * Ensures: */ -extern bool wcd_init(void); +extern bool api_init(void); /* - * ======== wcd_init_complete2 ======== + * ======== api_init_complete2 ======== * Purpose: - * Perform any required WCD, and WMD initialization which - * cannot not be performed in wcd_init(void) or dev_start_device() due + * Perform any required bridge initialization which cannot + * be performed in api_init() or dev_start_device() due * to the fact that some services are not yet * completely initialized. * Parameters: @@ -65,24 +65,24 @@ extern bool wcd_init(void); * DSP_SOK: Allow this device to load * DSP_EFAIL: Failure. * Requires: - * WCD initialized. + * Bridge API initialized. * Ensures: */ -extern dsp_status wcd_init_complete2(void); +extern dsp_status api_init_complete2(void); /* - * ======== wcd_exit ======== + * ======== api_exit ======== * Purpose: - * Exit all modules initialized in wcd_init(void). - * This procedure is called when the class driver is unloaded. + * Exit all modules initialized in api_init(void). + * This procedure is called when the driver is unloaded. * Parameters: * Returns: * Requires: - * wcd_init(void) was previously called. + * api_init(void) was previously called. * Ensures: - * Resources acquired in wcd_init(void) are freed. + * Resources acquired in api_init(void) are freed. */ -extern void wcd_exit(void); +extern void api_exit(void); /* MGR wrapper functions */ extern u32 mgrwrap_enum_node_info(union Trapped_Args *args, void *pr_ctxt); diff --git a/arch/arm/plat-omap/include/dspbridge/dev.h b/arch/arm/plat-omap/include/dspbridge/dev.h index c26e9d0..3ada31d 100644 --- a/arch/arm/plat-omap/include/dspbridge/dev.h +++ b/arch/arm/plat-omap/include/dspbridge/dev.h @@ -152,7 +152,7 @@ extern dsp_status dev_create_iva_device(OUT struct dev_object /* * ======== dev_create2 ======== * Purpose: - * After successful loading of the image from wcd_init_complete2 + * After successful loading of the image from api_init_complete2 * (PROC Auto_Start) or proc_load this fxn is called. This creates * the Node Manager and updates the DEV Object. * Parameters: diff --git a/arch/arm/plat-omap/include/dspbridge/wcd.h b/arch/arm/plat-omap/include/dspbridge/wcd.h index f609627..1a68baa 100644 --- a/arch/arm/plat-omap/include/dspbridge/wcd.h +++ b/arch/arm/plat-omap/include/dspbridge/wcd.h @@ -29,8 +29,8 @@ #ifndef WCD_ #define WCD_ -/* This WCD Library Version: */ -#define WCD_MAJOR_VERSION (u32)8 /* .8x - Alpha, .9x - Beta, 1.x FCS */ -#define WCD_MINOR_VERSION (u32)0 +/* This BRD API Library Version: */ +#define BRD_API_MAJOR_VERSION (u32)8 /* .8x - Alpha, .9x - Beta, 1.x FCS */ +#define BRD_API_MINOR_VERSION (u32)0 #endif /* WCD_ */ diff --git a/arch/arm/plat-omap/include/dspbridge/wmd.h b/arch/arm/plat-omap/include/dspbridge/wmd.h index cebc8c5..d861cdf 100644 --- a/arch/arm/plat-omap/include/dspbridge/wmd.h +++ b/arch/arm/plat-omap/include/dspbridge/wmd.h @@ -1055,8 +1055,8 @@ typedef void (*fxn_msg_setqueueid) (struct msg_queue *msg_queue_obj, * the WMD_CHNL_* entries must be set to NULL. */ struct bridge_drv_interface { - u32 dw_wcd_major_version; /* Set to WCD_MAJOR_VERSION. */ - u32 dw_wcd_minor_version; /* Set to WCD_MINOR_VERSION. */ + u32 brd_api_major_version; /* Set to BRD_API_MAJOR_VERSION. */ + u32 brd_api_minor_version; /* Set to BRD_API_MINOR_VERSION. */ fxn_dev_create pfn_dev_create; /* Create device context */ fxn_dev_destroy pfn_dev_destroy; /* Destroy device context */ fxn_dev_ctrl pfn_dev_cntrl; /* Optional vendor interface */ diff --git a/drivers/dsp/bridge/pmgr/dev.c b/drivers/dsp/bridge/pmgr/dev.c index e1ebb5d..f94eebc 100644 --- a/drivers/dsp/bridge/pmgr/dev.c +++ b/drivers/dsp/bridge/pmgr/dev.c @@ -56,7 +56,8 @@ /* ----------------------------------- Defines, Data Structures, Typedefs */ #define MAKEVERSION(major, minor) (major * 10 + minor) -#define WCDVERSION MAKEVERSION(WCD_MAJOR_VERSION, WCD_MINOR_VERSION) +#define BRD_API_VERSION MAKEVERSION(BRD_API_MAJOR_VERSION, \ + BRD_API_MINOR_VERSION) /* The WMD device object: */ struct dev_object { @@ -277,7 +278,7 @@ dsp_status dev_create_device(OUT struct dev_object **phDevObject, /* * ======== dev_create2 ======== * Purpose: - * After successful loading of the image from wcd_init_complete2 + * After successful loading of the image from api_init_complete2 * (PROC Auto_Start) or proc_load this fxn is called. This creates * the Node Manager and updates the DEV Object. */ @@ -1089,12 +1090,12 @@ static void store_interface_fxns(struct bridge_drv_interface *drv_fxns, DBC_REQUIRE(intf_fxns != NULL); DBC_REQUIRE(drv_fxns != NULL); - DBC_REQUIRE(MAKEVERSION(drv_fxns->dw_wcd_major_version, - drv_fxns->dw_wcd_minor_version) <= WCDVERSION); - version = MAKEVERSION(drv_fxns->dw_wcd_major_version, - drv_fxns->dw_wcd_minor_version); - intf_fxns->dw_wcd_major_version = drv_fxns->dw_wcd_major_version; - intf_fxns->dw_wcd_minor_version = drv_fxns->dw_wcd_minor_version; + DBC_REQUIRE(MAKEVERSION(drv_fxns->brd_api_major_version, + drv_fxns->brd_api_minor_version) <= BRD_API_VERSION); + version = MAKEVERSION(drv_fxns->brd_api_major_version, + drv_fxns->brd_api_minor_version); + intf_fxns->brd_api_major_version = drv_fxns->brd_api_major_version; + intf_fxns->brd_api_minor_version = drv_fxns->brd_api_minor_version; /* Install functions up to WCD version .80 (first alpha): */ if (version > 0) { STORE_FXN(fxn_dev_create, pfn_dev_create); diff --git a/drivers/dsp/bridge/pmgr/wcd.c b/drivers/dsp/bridge/pmgr/wcd.c index 9f734ab..a63ae8f 100644 --- a/drivers/dsp/bridge/pmgr/wcd.c +++ b/drivers/dsp/bridge/pmgr/wcd.c @@ -69,13 +69,13 @@ #define DB_GET_IOC_TABLE(cmd) (DB_GET_MODULE(cmd) >> DB_MODULE_SHIFT) /* Device IOCtl function pointer */ -struct wcd_cmd { +struct api_cmd { u32(*fxn) (union Trapped_Args *args, void *pr_ctxt); u32 dw_index; }; /* ----------------------------------- Globals */ -static u32 wcd_c_refs; +static u32 api_c_refs; /* * Function tables. @@ -85,7 +85,7 @@ static u32 wcd_c_refs; */ /* MGR wrapper functions */ -static struct wcd_cmd mgr_cmd[] = { +static struct api_cmd mgr_cmd[] = { {mgrwrap_enum_node_info}, /* MGR_ENUMNODE_INFO */ {mgrwrap_enum_proc_info}, /* MGR_ENUMPROC_INFO */ {mgrwrap_register_object}, /* MGR_REGISTEROBJECT */ @@ -95,7 +95,7 @@ static struct wcd_cmd mgr_cmd[] = { }; /* PROC wrapper functions */ -static struct wcd_cmd proc_cmd[] = { +static struct api_cmd proc_cmd[] = { {procwrap_attach}, /* PROC_ATTACH */ {procwrap_ctrl}, /* PROC_CTRL */ {procwrap_detach}, /* PROC_DETACH */ @@ -116,7 +116,7 @@ static struct wcd_cmd proc_cmd[] = { }; /* NODE wrapper functions */ -static struct wcd_cmd node_cmd[] = { +static struct api_cmd node_cmd[] = { {nodewrap_allocate}, /* NODE_ALLOCATE */ {nodewrap_alloc_msg_buf}, /* NODE_ALLOCMSGBUF */ {nodewrap_change_priority}, /* NODE_CHANGEPRIORITY */ @@ -135,7 +135,7 @@ static struct wcd_cmd node_cmd[] = { }; /* STRM wrapper functions */ -static struct wcd_cmd strm_cmd[] = { +static struct api_cmd strm_cmd[] = { {strmwrap_allocate_buffer}, /* STRM_ALLOCATEBUFFER */ {strmwrap_close}, /* STRM_CLOSE */ {strmwrap_free_buffer}, /* STRM_FREEBUFFER */ @@ -150,7 +150,7 @@ static struct wcd_cmd strm_cmd[] = { }; /* CMM wrapper functions */ -static struct wcd_cmd cmm_cmd[] = { +static struct api_cmd cmm_cmd[] = { {cmmwrap_calloc_buf}, /* CMM_ALLOCBUF */ {cmmwrap_free_buf}, /* CMM_FREEBUF */ {cmmwrap_get_handle}, /* CMM_GETHANDLE */ @@ -203,11 +203,11 @@ static inline void _cp_to_usr(void __user *to, const void *from, _cp_to_usr(to, from, &(err), (n) * sizeof(*(from))) /* - * ======== wcd_call_dev_io_ctl ======== + * ======== api_call_dev_ioctl ======== * Purpose: - * Call the (wrapper) function for the corresponding WCD IOCTL. + * Call the (wrapper) function for the corresponding API IOCTL. */ -inline dsp_status wcd_call_dev_io_ctl(u32 cmd, union Trapped_Args *args, +inline dsp_status api_call_dev_ioctl(u32 cmd, union Trapped_Args *args, u32 *result, void *pr_ctxt) { u32(*ioctl_cmd) (union Trapped_Args *args, void *pr_ctxt) = NULL; @@ -263,15 +263,15 @@ err: } /* - * ======== wcd_exit ======== + * ======== api_exit ======== */ -void wcd_exit(void) +void api_exit(void) { - DBC_REQUIRE(wcd_c_refs > 0); - wcd_c_refs--; + DBC_REQUIRE(api_c_refs > 0); + api_c_refs--; - if (wcd_c_refs == 0) { - /* Release all WCD modules initialized in wcd_init(). */ + if (api_c_refs == 0) { + /* Release all modules initialized in api_init(). */ cod_exit(); dev_exit(); chnl_exit(); @@ -285,22 +285,22 @@ void wcd_exit(void) rmm_exit(); drv_exit(); } - DBC_ENSURE(wcd_c_refs >= 0); + DBC_ENSURE(api_c_refs >= 0); } /* - * ======== wcd_init ======== + * ======== api_init ======== * Purpose: - * Module initialization is done by SERVICES Init. + * Module initialization used by Bridge API. */ -bool wcd_init(void) +bool api_init(void) { bool ret = true; bool fdrv, fdev, fcod, fchnl, fmsg, fio; bool fmgr, fproc, fnode, fdisp, fstrm, frmm; - if (wcd_c_refs == 0) { - /* initialize class driver and other modules */ + if (api_c_refs == 0) { + /* initialize driver and other modules */ fdrv = drv_init(); fmgr = mgr_init(); fproc = proc_init(); @@ -355,16 +355,16 @@ bool wcd_init(void) } } if (ret) - wcd_c_refs++; + api_c_refs++; return ret; } /* - * ======== wcd_init_complete2 ======== + * ======== api_init_complete2 ======== * Purpose: - * Perform any required WCD, and WMD initialization which - * cannot not be performed in wcd_init() or dev_start_device() due + * Perform any required bridge initialization which cannot + * be performed in api_init() or dev_start_device() due * to the fact that some services are not yet * completely initialized. * Parameters: @@ -372,17 +372,17 @@ bool wcd_init(void) * DSP_SOK: Allow this device to load * DSP_EFAIL: Failure. * Requires: - * WCD initialized. + * Bridge API initialized. * Ensures: */ -dsp_status wcd_init_complete2(void) +dsp_status api_init_complete2(void) { dsp_status status = DSP_SOK; struct cfg_devnode *dev_node; struct dev_object *hdev_obj; u32 dev_type, tmp; - DBC_REQUIRE(wcd_c_refs > 0); + DBC_REQUIRE(api_c_refs > 0); /* Walk the list of DevObjects, get each devnode, and attempting to * autostart the board. Note that this requires COF loading, which diff --git a/drivers/dsp/bridge/rmgr/drv_interface.c b/drivers/dsp/bridge/rmgr/drv_interface.c index f53e02d..dd2fe8b 100644 --- a/drivers/dsp/bridge/rmgr/drv_interface.c +++ b/drivers/dsp/bridge/rmgr/drv_interface.c @@ -562,7 +562,7 @@ static long bridge_ioctl(struct file *filp, unsigned int code, sizeof(union Trapped_Args)); if (!status) { - status = wcd_call_dev_io_ctl(code, &buf_in, &retval, + status = api_call_dev_ioctl(code, &buf_in, &retval, filp->private_data); if (DSP_SUCCEEDED(status)) { diff --git a/drivers/dsp/bridge/rmgr/dspdrv.c b/drivers/dsp/bridge/rmgr/dspdrv.c index 94f7605..175582a 100644 --- a/drivers/dsp/bridge/rmgr/dspdrv.c +++ b/drivers/dsp/bridge/rmgr/dspdrv.c @@ -54,12 +54,12 @@ u32 dsp_init(OUT u32 *init_status) u32 device_node; u32 device_node_string; - if (!wcd_init()) + if (!api_init()) goto func_cont; status = drv_create(&drv_obj); if (DSP_FAILED(status)) { - wcd_exit(); + api_exit(); goto func_cont; } @@ -83,7 +83,7 @@ u32 dsp_init(OUT u32 *init_status) /* irrespective of the status of dev_remove_device we conitinue * unloading. Get the Driver Object iterate through and remove. * Reset the status to E_FAIL to avoid going through - * wcd_init_complete2. */ + * api_init_complete2. */ for (device_node = drv_get_first_dev_extension(); device_node != 0; device_node = drv_get_next_dev_extension(device_node)) { @@ -94,7 +94,7 @@ u32 dsp_init(OUT u32 *init_status) /* Remove the Driver Object */ (void)drv_destroy(drv_obj); drv_obj = NULL; - wcd_exit(); + api_exit(); dev_dbg(bridge, "%s: Logical device failed init\n", __func__); } /* Unwinding the loaded drivers */ func_cont: @@ -103,10 +103,10 @@ func_cont: /* BRD_AutoStart could fail if the dsp execuetable is not the * correct one. We should not propagate that error * into the device loader. */ - (void)wcd_init_complete2(); + (void)api_init_complete2(); } else { dev_dbg(bridge, "%s: Failed\n", __func__); - } /* End wcd_init_complete2 */ + } /* End api_init_complete2 */ DBC_ENSURE((DSP_SUCCEEDED(status) && drv_obj != NULL) || (DSP_FAILED(status) && drv_obj == NULL)); *init_status = status; @@ -138,7 +138,7 @@ bool dsp_deinit(u32 deviceContext) if (DSP_SUCCEEDED(cfg_get_object((u32 *) &mgr_obj, REG_MGR_OBJECT))) (void)mgr_destroy(mgr_obj); - wcd_exit(); + api_exit(); return ret; } diff --git a/drivers/dsp/bridge/wmd/tiomap3430.c b/drivers/dsp/bridge/wmd/tiomap3430.c index d01cd63..d2c4691 100644 --- a/drivers/dsp/bridge/wmd/tiomap3430.c +++ b/drivers/dsp/bridge/wmd/tiomap3430.c @@ -171,9 +171,9 @@ extern s32 dsp_debug; * This mini driver's function interface table. */ static struct bridge_drv_interface drv_interface_fxns = { - /* WCD ver. for which this mini driver is built. */ - WCD_MAJOR_VERSION, - WCD_MINOR_VERSION, + /* Bridge API ver. for which this bridge driver is built. */ + BRD_API_MAJOR_VERSION, + BRD_API_MINOR_VERSION, bridge_dev_create, bridge_dev_destroy, bridge_dev_ctrl,