Commit d2b63918 authored by Ramesh Gupta's avatar Ramesh Gupta Committed by Hari Kanigeri

OMAP4 Syslink dispatcher code format fix

This patch fixes coding style issues and compile
time warnings.
Signed-off-by: default avatarRamesh Gupta G <grgupta@ti.com>
parent 2a1e2f6f
/* =========================================================================== /*
File hw_mbox.c * hw_mbox.c
*
Path $ (PROJROOT)\driver\mailbox * Syslink dispatcher driver support for OMAP Processors.
*
Desc HAL Mailbox messaging & configuration API definitions * Copyright (C) 2008-2009 Texas Instruments, Inc.
*
Rev 0.1.0 * This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
This computer program is copyright to Texas Instruments Incorporated. * published by the Free Software Foundation.
The program may not be used without the written permission of *
Texas Instruments Incorporated or against the terms and conditions * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
stipulated in the agreement under which this program has been supplied. * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
(c) Texas Instruments Incorporated 2008 * PURPOSE.
===========================================================================
*/ */
/* ============================================================================
* STANDARD INCLUDE FILES
* =============================================================================
*/
/* ============================================================================
* PROJECT SPECIFIC INCLUDE FILES
* =============================================================================
*/
#include <syslink/GlobalTypes.h> #include <syslink/GlobalTypes.h>
#include <syslink/MBXRegAcM.h> #include <syslink/MBXRegAcM.h>
#include <syslink/MBXAccInt.h> #include <syslink/MBXAccInt.h>
#include <syslink/hw_defs.h> #include <syslink/hw_defs.h>
#include <syslink/hw_mbox.h> #include <syslink/hw_mbox.h>
#include<linux/module.h> #include<linux/module.h>
MODULE_LICENSE("GPL");
/* ============================================================================
* GLOBAL VARIABLES DECLARATIONS
* =============================================================================
*/
/* ============================================================================
* LOCAL TYPES AND DEFINITIONS
* =============================================================================
*/
/* ============================================================================
* LOCAL VARIABLES DECLARATIONS
* =============================================================================
*/
/* ============================================================================
* LOCAL FUNCTIONS PROTOTYPES
* =============================================================================
*/
/* ============================================================================
* FUNCTIONS
* =============================================================================
*/
#if defined(OMAP3430) #if defined(OMAP3430)
struct mailbox_context mboxsetting = {0, 0, 0}; struct mailbox_context mboxsetting = {0, 0, 0};
/* /*
* ======== HAL_MBOX_saveSettings ======== * func: HAL_MBOX_saveSettings
* purpose: * purpose:
* Saves the mailbox context * Saves the mailbox context
*/ */
...@@ -81,10 +46,8 @@ long hw_mbox_save_settings(unsigned long base_address) ...@@ -81,10 +46,8 @@ long hw_mbox_save_settings(unsigned long base_address)
return status; return status;
} }
/* ==================== Function Separator =============================*/
/* /*
* ======== HAL_MBOX_restoreSettings ======== * func:HAL_MBOX_restoreSettings
* purpose: * purpose:
* Restores the mailbox context * Restores the mailbox context
*/ */
...@@ -133,7 +96,6 @@ long hw_mbox_msg_read( ...@@ -133,7 +96,6 @@ long hw_mbox_msg_read(
return status; return status;
} }
EXPORT_SYMBOL(hw_mbox_msg_read); EXPORT_SYMBOL(hw_mbox_msg_read);
/* ==================== Function Separator =============================*/
long hw_mbox_msg_write(const unsigned long base_address, long hw_mbox_msg_write(const unsigned long base_address,
const enum hw_mbox_id_t mail_box_id, const enum hw_mbox_id_t mail_box_id,
...@@ -144,13 +106,11 @@ long hw_mbox_msg_write(const unsigned long base_address, ...@@ -144,13 +106,11 @@ long hw_mbox_msg_write(const unsigned long base_address,
/* Check input parameters */ /* Check input parameters */
CHECK_INPUT_PARAM(base_address, 0, RET_BAD_NULL_PARAM, CHECK_INPUT_PARAM(base_address, 0, RET_BAD_NULL_PARAM,
RES_MBOX_BASE + RES_INVALID_INPUT_PARAM); RES_MBOX_BASE + RES_INVALID_INPUT_PARAM);
CHECK_INPUT_RANGE_MIN0(mail_box_id, CHECK_INPUT_RANGE_MIN0(mail_box_id,
HAL_MBOX_ID_MAX, HAL_MBOX_ID_MAX,
RET_INVALID_ID, RET_INVALID_ID,
RES_MBOX_BASE + RES_INVALID_INPUT_PARAM); RES_MBOX_BASE + RES_INVALID_INPUT_PARAM);
/* Write 32-bit value to mailbox */ /* Write 32-bit value to mailbox */
MLBMAILBOX_MESSAGE___0_15WriteRegister32(base_address, MLBMAILBOX_MESSAGE___0_15WriteRegister32(base_address,
(unsigned long)mail_box_id, (unsigned long)write_value); (unsigned long)mail_box_id, (unsigned long)write_value);
...@@ -158,8 +118,6 @@ long hw_mbox_msg_write(const unsigned long base_address, ...@@ -158,8 +118,6 @@ long hw_mbox_msg_write(const unsigned long base_address,
return status; return status;
} }
/* ==================== Function Separator =============================*/
long hw_mbox_is_full( long hw_mbox_is_full(
const unsigned long base_address, const unsigned long base_address,
const enum hw_mbox_id_t mail_box_id, const enum hw_mbox_id_t mail_box_id,
...@@ -190,8 +148,6 @@ long hw_mbox_is_full( ...@@ -190,8 +148,6 @@ long hw_mbox_is_full(
return status; return status;
} }
/* ==================== Function Separator =============================*/
long hw_mbox_nomsg_get( long hw_mbox_nomsg_get(
const unsigned long base_address, const unsigned long base_address,
const enum hw_mbox_id_t mail_box_id, const enum hw_mbox_id_t mail_box_id,
...@@ -218,7 +174,6 @@ long hw_mbox_nomsg_get( ...@@ -218,7 +174,6 @@ long hw_mbox_nomsg_get(
return status; return status;
} }
EXPORT_SYMBOL(hw_mbox_nomsg_get); EXPORT_SYMBOL(hw_mbox_nomsg_get);
/* ==================== Function Separator =============================*/
long hw_mbox_event_enable( long hw_mbox_event_enable(
const unsigned long base_address, const unsigned long base_address,
...@@ -275,8 +230,6 @@ long hw_mbox_event_enable( ...@@ -275,8 +230,6 @@ long hw_mbox_event_enable(
} }
EXPORT_SYMBOL(hw_mbox_event_enable); EXPORT_SYMBOL(hw_mbox_event_enable);
/* ==================== Function Separator =============================*/
long hw_mbox_event_disable( long hw_mbox_event_disable(
const unsigned long base_address, const unsigned long base_address,
const enum hw_mbox_id_t mail_box_id, const enum hw_mbox_id_t mail_box_id,
...@@ -331,8 +284,6 @@ long hw_mbox_event_disable( ...@@ -331,8 +284,6 @@ long hw_mbox_event_disable(
} }
EXPORT_SYMBOL(hw_mbox_event_disable); EXPORT_SYMBOL(hw_mbox_event_disable);
/* ==================== Function Separator =============================*/
long hw_mbox_event_status( long hw_mbox_event_status(
const unsigned long base_address, const unsigned long base_address,
const enum hw_mbox_id_t mail_box_id, const enum hw_mbox_id_t mail_box_id,
...@@ -360,8 +311,8 @@ long hw_mbox_event_status( ...@@ -360,8 +311,8 @@ long hw_mbox_event_status(
RES_MBOX_BASE + RES_INVALID_INPUT_PARAM); RES_MBOX_BASE + RES_INVALID_INPUT_PARAM);
#if defined(OMAP44XX) || defined(VPOM4430_1_06) #if defined(OMAP44XX) || defined(VPOM4430_1_06)
irq_status_reg = MLBMAILBOX_IRQSTATUS_CLR___0_3ReadRegister32(base_address, irq_status_reg = MLBMAILBOX_IRQSTATUS_CLR___0_3ReadRegister32(
(unsigned long)user_id); base_address, (unsigned long)user_id);
#else #else
/* Get Irq Status for specified mailbox/User Id */ /* Get Irq Status for specified mailbox/User Id */
irq_status_reg = MLBMAILBOX_IRQSTATUS___0_3ReadRegister32 irq_status_reg = MLBMAILBOX_IRQSTATUS___0_3ReadRegister32
...@@ -376,8 +327,6 @@ long hw_mbox_event_status( ...@@ -376,8 +327,6 @@ long hw_mbox_event_status(
return status; return status;
} }
/* ==================== Function Separator =============================*/
long hw_mbox_event_ack( long hw_mbox_event_ack(
const unsigned long base_address, const unsigned long base_address,
const enum hw_mbox_id_t mail_box_id, const enum hw_mbox_id_t mail_box_id,
...@@ -390,7 +339,6 @@ long hw_mbox_event_ack( ...@@ -390,7 +339,6 @@ long hw_mbox_event_ack(
/* Check input parameters */ /* Check input parameters */
CHECK_INPUT_PARAM(base_address, 0, RET_BAD_NULL_PARAM, CHECK_INPUT_PARAM(base_address, 0, RET_BAD_NULL_PARAM,
RES_MBOX_BASE + RES_INVALID_INPUT_PARAM); RES_MBOX_BASE + RES_INVALID_INPUT_PARAM);
CHECK_INPUT_RANGE_MIN0( CHECK_INPUT_RANGE_MIN0(
irqStatus, irqStatus,
HAL_MBOX_INT_MAX, HAL_MBOX_INT_MAX,
...@@ -406,8 +354,6 @@ long hw_mbox_event_ack( ...@@ -406,8 +354,6 @@ long hw_mbox_event_ack(
HAL_MBOX_USER_MAX, HAL_MBOX_USER_MAX,
RET_INVALID_ID, RET_INVALID_ID,
RES_MBOX_BASE + RES_INVALID_INPUT_PARAM); RES_MBOX_BASE + RES_INVALID_INPUT_PARAM);
/* calculate status to write */ /* calculate status to write */
irq_status_reg = ((unsigned long)event) << irq_status_reg = ((unsigned long)event) <<
(((unsigned long)(mail_box_id))*HW_MBOX_ID_WIDTH); (((unsigned long)(mail_box_id))*HW_MBOX_ID_WIDTH);
......
/*=========================================================================== /*
File hal_ocp.c * hw_ocp.c
*
* Syslink dispatcher driver support for OMAP Processors.
*
* Copyright (C) 2008-2009 Texas Instruments, Inc.
*
* This package is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE.
*/
Path $(PROJROOT)\driver\mailbox
Desc API definitions to setup OCP Socket system registers
Rev 0.1.0
This computer program is copyright to Texas Instruments Incorporated.
The program may not be used without the written permission of
Texas Instruments Incorporated or against the terms and conditions
stipulated in the agreement under which this program has been supplied.
(c) Texas Instruments Incorporated 2008
===========================================================================
*/
/*============================================================================
*STANDARD INCLUDE FILES
*=============================================================================
*/
/*============================================================================
*PROJECT SPECIFIC INCLUDE FILES
*=============================================================================
*/
#include <syslink/GlobalTypes.h> #include <syslink/GlobalTypes.h>
#include <syslink/hw_ocp.h> #include <syslink/hw_ocp.h>
#include <syslink/hw_defs.h> #include <syslink/hw_defs.h>
#include <syslink/MBXRegAcM.h> #include <syslink/MBXRegAcM.h>
#include <syslink/MBXAccInt.h> #include <syslink/MBXAccInt.h>
#include <linux/module.h> #include <linux/module.h>
MODULE_LICENSE("GPL");
/*============================================================================
*GLOBAL VARIABLES DECLARATIONS
*=============================================================================
*/
/*============================================================================
*LOCAL TYPES AND DEFINITIONS
*=============================================================================
*/
/*============================================================================
*LOCAL VARIABLES DECLARATIONS
*=============================================================================
*/
/*============================================================================
*LOCAL FUNCTIONS PROTOTYPES
*=============================================================================
*/
/*============================================================================
*EXPORTED FUNCTIONS
*=============================================================================
*/
long hw_ocp_soft_reset(const unsigned long base_address) long hw_ocp_soft_reset(const unsigned long base_address)
{ {
long status = RET_OK; long status = RET_OK;
...@@ -122,8 +83,3 @@ long hw_ocp_autoidle_get(const unsigned long base_address, ...@@ -122,8 +83,3 @@ long hw_ocp_autoidle_get(const unsigned long base_address,
return status; return status;
} }
/*============================================================================
*LOCAL FUNCTIONS
*=============================================================================
*/
...@@ -289,10 +289,10 @@ int ntfy_disp_read(unsigned long int mbox_module_no, ...@@ -289,10 +289,10 @@ int ntfy_disp_read(unsigned long int mbox_module_no,
} }
/*Read a single message */ /*Read a single message */
hw_mbox_nomsg_get(mailbx_hw_config.mbox_linear_addr , hw_mbox_nomsg_get(mailbx_hw_config.mbox_linear_addr ,
(enum hw_mbox_id_t)a_mbox_no, num_messages); (enum hw_mbox_id_t)a_mbox_no, (unsigned long *const)num_messages);
if (*num_messages > 0) { if (*num_messages > 0) {
hw_mbox_msg_read(mailbx_hw_config.mbox_linear_addr, hw_mbox_msg_read(mailbx_hw_config.mbox_linear_addr,
(enum hw_mbox_id_t)a_mbox_no, messages); (enum hw_mbox_id_t)a_mbox_no, (unsigned long *const)messages);
} else } else
status = -EBUSY; status = -EBUSY;
func_end: func_end:
...@@ -314,8 +314,7 @@ int ntfy_disp_register(unsigned long int mbox_module_no, ...@@ -314,8 +314,7 @@ int ntfy_disp_register(unsigned long int mbox_module_no,
i_mbox_module_no = mbox_module_no; i_mbox_module_no = mbox_module_no;
i_a_irq_bit = a_irq_bit; i_a_irq_bit = a_irq_bit;
/*Validate the parameters */
/*Validate the parameters */
if (mbox_module_no > mailbx_hw_config.mbox_modules) { if (mbox_module_no > mailbx_hw_config.mbox_modules) {
status = -EINVAL; status = -EINVAL;
goto func_end; goto func_end;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment