diff options
-rw-r--r-- | drivers/staging/crystalhd/bc_dts_defs.h | 68 | ||||
-rw-r--r-- | drivers/staging/crystalhd/bc_dts_glob_lnx.h | 117 | ||||
-rw-r--r-- | drivers/staging/crystalhd/crystalhd_cmds.c | 160 | ||||
-rw-r--r-- | drivers/staging/crystalhd/crystalhd_cmds.h | 21 | ||||
-rw-r--r-- | drivers/staging/crystalhd/crystalhd_fw_if.h | 60 | ||||
-rw-r--r-- | drivers/staging/crystalhd/crystalhd_hw.c | 183 | ||||
-rw-r--r-- | drivers/staging/crystalhd/crystalhd_hw.h | 121 | ||||
-rw-r--r-- | drivers/staging/crystalhd/crystalhd_lnx.c | 34 | ||||
-rw-r--r-- | drivers/staging/crystalhd/crystalhd_lnx.h | 6 | ||||
-rw-r--r-- | drivers/staging/crystalhd/crystalhd_misc.c | 80 | ||||
-rw-r--r-- | drivers/staging/crystalhd/crystalhd_misc.h | 54 |
11 files changed, 442 insertions, 462 deletions
diff --git a/drivers/staging/crystalhd/bc_dts_defs.h b/drivers/staging/crystalhd/bc_dts_defs.h index f9dd0e3e240..778e76af052 100644 --- a/drivers/staging/crystalhd/bc_dts_defs.h +++ b/drivers/staging/crystalhd/bc_dts_defs.h @@ -26,12 +26,10 @@ #ifndef _BC_DTS_DEFS_H_ #define _BC_DTS_DEFS_H_ -#include "bc_dts_types.h" - /* BIT Mask */ #define BC_BIT(_x) (1 << (_x)) -typedef enum _BC_STATUS { +enum BC_STATUS { BC_STS_SUCCESS = 0, BC_STS_INV_ARG = 1, BC_STS_BUSY = 2, @@ -62,7 +60,7 @@ typedef enum _BC_STATUS { /* Must be the last one.*/ BC_STS_ERROR = -1 -} BC_STATUS; +}; /*------------------------------------------------------* * Registry Key Definitions * @@ -81,14 +79,14 @@ typedef enum _BC_STATUS { * */ -typedef enum _BC_SW_OPTIONS { +enum BC_SW_OPTIONS { BC_OPT_DOSER_OUT_ENCRYPT = BC_BIT(3), BC_OPT_LINK_OUT_ENCRYPT = BC_BIT(29), -} BC_SW_OPTIONS; +}; -typedef struct _BC_REG_CONFIG{ +struct BC_REG_CONFIG{ uint32_t DbgOptions; -} BC_REG_CONFIG; +}; #if defined(__KERNEL__) || defined(__LINUX_USER__) #else @@ -108,7 +106,7 @@ typedef struct _BC_REG_CONFIG{ */ /* To allow multiple apps to open the device. */ -enum _DtsDeviceOpenMode { +enum DtsDeviceOpenMode { DTS_PLAYBACK_MODE = 0, DTS_DIAG_MODE, DTS_MONITOR_MODE, @@ -116,7 +114,7 @@ enum _DtsDeviceOpenMode { }; /* To enable the filter to selectively enable/disable fixes or erratas */ -enum _DtsDeviceFixMode { +enum DtsDeviceFixMode { DTS_LOAD_NEW_FW = BC_BIT(8), DTS_LOAD_FILE_PLAY_FW = BC_BIT(9), DTS_DISK_FMT_BD = BC_BIT(10), @@ -133,7 +131,7 @@ enum _DtsDeviceFixMode { #define DTS_DFLT_CLOCK(x) (x<<19) /* F/W File Version corresponding to S/W Releases */ -enum _FW_FILE_VER { +enum FW_FILE_VER { /* S/W release: 02.04.02 F/W release 2.12.2.0 */ BC_FW_VER_020402 = ((12<<16) | (2<<8) | (0)) }; @@ -141,7 +139,7 @@ enum _FW_FILE_VER { /*------------------------------------------------------* * Stream Types for DtsOpenDecoder() * *------------------------------------------------------*/ -enum _DtsOpenDecStreamTypes { +enum DtsOpenDecStreamTypes { BC_STREAM_TYPE_ES = 0, BC_STREAM_TYPE_PES = 1, BC_STREAM_TYPE_TS = 2, @@ -151,7 +149,7 @@ enum _DtsOpenDecStreamTypes { /*------------------------------------------------------* * Video Algorithms for DtsSetVideoParams() * *------------------------------------------------------*/ -enum _DtsSetVideoParamsAlgo { +enum DtsSetVideoParamsAlgo { BC_VID_ALGO_H264 = 0, BC_VID_ALGO_MPEG2 = 1, BC_VID_ALGO_VC1 = 4, @@ -163,7 +161,7 @@ enum _DtsSetVideoParamsAlgo { *------------------------------------------------------*/ #define BC_MPEG_VALID_PANSCAN (1) -typedef struct _BC_PIB_EXT_MPEG { +struct BC_PIB_EXT_MPEG { uint32_t valid; /* Always valid, defaults to picture size if no * sequence display extension in the stream. */ @@ -175,8 +173,7 @@ typedef struct _BC_PIB_EXT_MPEG { uint32_t offset_count; int32_t horizontal_offset[3]; int32_t vertical_offset[3]; - -} BC_PIB_EXT_MPEG; +}; /*------------------------------------------------------* * H.264 Extension to the PPB * @@ -186,7 +183,7 @@ typedef struct _BC_PIB_EXT_MPEG { #define H264_VALID_SPS_CROP (2) #define H264_VALID_VUI (4) -typedef struct _BC_PIB_EXT_H264 { +struct BC_PIB_EXT_H264 { /* 'valid' specifies which fields (or sets of * fields) below are valid. If the corresponding * bit in 'valid' is NOT set then that field(s) @@ -209,15 +206,14 @@ typedef struct _BC_PIB_EXT_H264 { /* H264_VALID_VUI */ uint32_t chroma_top; uint32_t chroma_bottom; - -} BC_PIB_EXT_H264; +}; /*------------------------------------------------------* * VC1 Extension to the PPB * *------------------------------------------------------*/ #define VC1_VALID_PANSCAN (1) -typedef struct _BC_PIB_EXT_VC1 { +struct BC_PIB_EXT_VC1 { uint32_t valid; /* Always valid, defaults to picture size if no @@ -231,9 +227,7 @@ typedef struct _BC_PIB_EXT_VC1 { int32_t ps_vert_offset[4]; int32_t ps_width[4]; int32_t ps_height[4]; - -} BC_PIB_EXT_VC1; - +}; /*------------------------------------------------------* * Picture Information Block * @@ -366,7 +360,7 @@ enum _BC_OUTPUT_FORMAT { MODE422_UYVY = 0x2, }; -typedef struct _BC_PIC_INFO_BLOCK { +struct BC_PIC_INFO_BLOCK { /* Common fields. */ uint64_t timeStamp; /* Timestamp */ uint32_t picture_number; /* Ordinal display number */ @@ -386,18 +380,18 @@ typedef struct _BC_PIC_INFO_BLOCK { /* Protocol-specific extensions. */ union { - BC_PIB_EXT_H264 h264; - BC_PIB_EXT_MPEG mpeg; - BC_PIB_EXT_VC1 vc1; + struct BC_PIB_EXT_H264 h264; + struct BC_PIB_EXT_MPEG mpeg; + struct BC_PIB_EXT_VC1 vc1; } other; -} BC_PIC_INFO_BLOCK, *PBC_PIC_INFO_BLOCK; +}; /*------------------------------------------------------* * ProcOut Info * *------------------------------------------------------*/ /* Optional flags for ProcOut Interface.*/ -enum _POUT_OPTIONAL_IN_FLAGS_{ +enum POUT_OPTIONAL_IN_FLAGS_{ /* Flags from App to Device */ BC_POUT_FLAGS_YV12 = 0x01, /* Copy Data in YV12 format */ BC_POUT_FLAGS_STRIDE = 0x02, /* Stride size is valid. */ @@ -412,17 +406,13 @@ enum _POUT_OPTIONAL_IN_FLAGS_{ BC_POUT_FLAGS_FLD_BOT = 0x80000, /* Bottom Field data */ }; -#if defined(__KERNEL__) || defined(__LINUX_USER__) -typedef BC_STATUS(*dts_pout_callback)(void *shnd, uint32_t width, uint32_t height, uint32_t stride, void *pOut); -#else -typedef BC_STATUS(*dts_pout_callback)(void *shnd, uint32_t width, uint32_t height, uint32_t stride, struct _BC_DTS_PROC_OUT *pOut); -#endif +typedef enum BC_STATUS(*dts_pout_callback)(void *shnd, uint32_t width, uint32_t height, uint32_t stride, void *pOut); /* Line 21 Closed Caption */ /* User Data */ #define MAX_UD_SIZE 1792 /* 1920 - 128 */ -typedef struct _BC_DTS_PROC_OUT { +struct BC_DTS_PROC_OUT { uint8_t *Ybuff; /* Caller Supplied buffer for Y data */ uint32_t YbuffSz; /* Caller Supplied Y buffer size */ uint32_t YBuffDoneSz; /* Transferred Y datasize */ @@ -436,7 +426,7 @@ typedef struct _BC_DTS_PROC_OUT { uint32_t discCnt; /* Picture discontinuity count */ - BC_PIC_INFO_BLOCK PicInfo; /* Picture Information Block Data */ + struct BC_PIC_INFO_BLOCK PicInfo; /* Picture Information Block Data */ /* Line 21 Closed Caption */ /* User Data */ @@ -450,9 +440,9 @@ typedef struct _BC_DTS_PROC_OUT { uint8_t bPibEnc; /* PIB encrypted */ uint8_t bRevertScramble; -} BC_DTS_PROC_OUT; +}; -typedef struct _BC_DTS_STATUS { +struct BC_DTS_STATUS { uint8_t ReadyListCount; /* Number of frames in ready list (reported by driver) */ uint8_t FreeListCount; /* Number of frame buffers free. (reported by driver) */ uint8_t PowerStateChange; /* Number of active state power transitions (reported by driver) */ @@ -479,7 +469,7 @@ typedef struct _BC_DTS_STATUS { * back from the driver */ uint8_t reserved__[16]; -} BC_DTS_STATUS; +}; #define BC_SWAP32(_v) \ ((((_v) & 0xFF000000)>>24)| \ diff --git a/drivers/staging/crystalhd/bc_dts_glob_lnx.h b/drivers/staging/crystalhd/bc_dts_glob_lnx.h index 0fd34e20dc8..80b7a73a9d4 100644 --- a/drivers/staging/crystalhd/bc_dts_glob_lnx.h +++ b/drivers/staging/crystalhd/bc_dts_glob_lnx.h @@ -58,7 +58,7 @@ * These are SW stack tunable parameters shared * between the driver and the application. */ -enum _BC_DTS_GLOBALS { +enum BC_DTS_GLOBALS { BC_MAX_FW_CMD_BUFF_SZ = 0x40, /* FW passthrough cmd/rsp buffer size */ PCI_CFG_SIZE = 256, /* PCI config size buffer */ BC_IOCTL_DATA_POOL_SIZE = 8, /* BC_IOCTL_DATA Pool size */ @@ -70,62 +70,62 @@ enum _BC_DTS_GLOBALS { BC_INFIFO_THRESHOLD = 0x10000, }; -typedef struct _BC_CMD_REG_ACC { +struct BC_CMD_REG_ACC { uint32_t Offset; uint32_t Value; -} BC_CMD_REG_ACC; +}; -typedef struct _BC_CMD_DEV_MEM { +struct BC_CMD_DEV_MEM { uint32_t StartOff; uint32_t NumDwords; uint32_t Rsrd; -} BC_CMD_DEV_MEM; +}; /* FW Passthrough command structure */ -enum _bc_fw_cmd_flags { +enum bc_fw_cmd_flags { BC_FW_CMD_FLAGS_NONE = 0, BC_FW_CMD_PIB_QS = 0x01, }; -typedef struct _BC_FW_CMD { +struct BC_FW_CMD { uint32_t cmd[BC_MAX_FW_CMD_BUFF_SZ]; uint32_t rsp[BC_MAX_FW_CMD_BUFF_SZ]; uint32_t flags; uint32_t add_data; -} BC_FW_CMD, *PBC_FW_CMD; +}; -typedef struct _BC_HW_TYPE { +struct BC_HW_TYPE { uint16_t PciDevId; uint16_t PciVenId; uint8_t HwRev; uint8_t Align[3]; -} BC_HW_TYPE; +}; -typedef struct _BC_PCI_CFG { +struct BC_PCI_CFG { uint32_t Size; uint32_t Offset; uint8_t pci_cfg_space[PCI_CFG_SIZE]; -} BC_PCI_CFG; +}; -typedef struct _BC_VERSION_INFO_ { +struct BC_VERSION_INFO { uint8_t DriverMajor; uint8_t DriverMinor; uint16_t DriverRevision; -} BC_VERSION_INFO; +}; -typedef struct _BC_START_RX_CAP_ { +struct BC_START_RX_CAP { uint32_t Rsrd; uint32_t StartDeliveryThsh; uint32_t PauseThsh; uint32_t ResumeThsh; -} BC_START_RX_CAP; +}; -typedef struct _BC_FLUSH_RX_CAP_ { +struct BC_FLUSH_RX_CAP { uint32_t Rsrd; uint32_t bDiscardOnly; -} BC_FLUSH_RX_CAP; +}; -typedef struct _BC_DTS_STATS { +struct BC_DTS_STATS { uint8_t drvRLL; uint8_t drvFLL; uint8_t eosDetected; @@ -154,18 +154,18 @@ typedef struct _BC_DTS_STATS { uint32_t DrvRepeatedFrms; uint32_t res1[13]; -} BC_DTS_STATS; +}; -typedef struct _BC_PROC_INPUT_ { +struct BC_PROC_INPUT { uint8_t *pDmaBuff; uint32_t BuffSz; uint8_t Mapped; uint8_t Encrypted; uint8_t Rsrd[2]; uint32_t DramOffset; /* For debug use only */ -} BC_PROC_INPUT, *PBC_PROC_INPUT; +}; -typedef struct _BC_DEC_YUV_BUFFS { +struct BC_DEC_YUV_BUFFS { uint32_t b422Mode; uint8_t *YuvBuff; uint32_t YuvBuffSz; @@ -173,9 +173,9 @@ typedef struct _BC_DEC_YUV_BUFFS { uint32_t YBuffDoneSz; uint32_t UVBuffDoneSz; uint32_t RefCnt; -} BC_DEC_YUV_BUFFS; +}; -enum _DECOUT_COMPLETION_FLAGS{ +enum DECOUT_COMPLETION_FLAGS{ COMP_FLAG_NO_INFO = 0x00, COMP_FLAG_FMT_CHANGE = 0x01, COMP_FLAG_PIB_VALID = 0x02, @@ -184,47 +184,47 @@ enum _DECOUT_COMPLETION_FLAGS{ COMP_FLAG_DATA_BOT = 0x10, }; -typedef struct _BC_DEC_OUT_BUFF{ - BC_DEC_YUV_BUFFS OutPutBuffs; - BC_PIC_INFO_BLOCK PibInfo; +struct BC_DEC_OUT_BUFF{ + struct BC_DEC_YUV_BUFFS OutPutBuffs; + struct BC_PIC_INFO_BLOCK PibInfo; uint32_t Flags; uint32_t BadFrCnt; -} BC_DEC_OUT_BUFF; +}; -typedef struct _BC_NOTIFY_MODE { +struct BC_NOTIFY_MODE { uint32_t Mode; uint32_t Rsvr[3]; -} BC_NOTIFY_MODE; +}; -typedef struct _BC_CLOCK { +struct BC_CLOCK { uint32_t clk; uint32_t Rsvr[3]; -} BC_CLOCK; +}; -typedef struct _BC_IOCTL_DATA { - BC_STATUS RetSts; +struct BC_IOCTL_DATA { + enum BC_STATUS RetSts; uint32_t IoctlDataSz; uint32_t Timeout; union { - BC_CMD_REG_ACC regAcc; - BC_CMD_DEV_MEM devMem; - BC_FW_CMD fwCmd; - BC_HW_TYPE hwType; - BC_PCI_CFG pciCfg; - BC_VERSION_INFO VerInfo; - BC_PROC_INPUT ProcInput; - BC_DEC_YUV_BUFFS RxBuffs; - BC_DEC_OUT_BUFF DecOutData; - BC_START_RX_CAP RxCap; - BC_FLUSH_RX_CAP FlushRxCap; - BC_DTS_STATS drvStat; - BC_NOTIFY_MODE NotifyMode; - BC_CLOCK clockValue; + struct BC_CMD_REG_ACC regAcc; + struct BC_CMD_DEV_MEM devMem; + struct BC_FW_CMD fwCmd; + struct BC_HW_TYPE hwType; + struct BC_PCI_CFG pciCfg; + struct BC_VERSION_INFO VerInfo; + struct BC_PROC_INPUT ProcInput; + struct BC_DEC_YUV_BUFFS RxBuffs; + struct BC_DEC_OUT_BUFF DecOutData; + struct BC_START_RX_CAP RxCap; + struct BC_FLUSH_RX_CAP FlushRxCap; + struct BC_DTS_STATS drvStat; + struct BC_NOTIFY_MODE NotifyMode; + struct BC_CLOCK clockValue; } u; struct _BC_IOCTL_DATA *next; -} BC_IOCTL_DATA; +}; -typedef enum _BC_DRV_CMD{ +enum BC_DRV_CMD { DRV_CMD_VERSION = 0, /* Get SW version */ DRV_CMD_GET_HWTYPE, /* Get HW version and type Dozer/Tank */ DRV_CMD_REG_RD, /* Read Device Register */ @@ -249,12 +249,12 @@ typedef enum _BC_DRV_CMD{ /* MUST be the last one.. */ DRV_CMD_END, /* End of the List.. */ -} BC_DRV_CMD; +}; #define BC_IOC_BASE 'b' #define BC_IOC_VOID _IOC_NONE #define BC_IOC_IOWR(nr, type) _IOWR(BC_IOC_BASE, nr, type) -#define BC_IOCTL_MB BC_IOCTL_DATA +#define BC_IOCTL_MB struct BC_IOCTL_DATA #define BCM_IOC_GET_VERSION BC_IOC_IOWR(DRV_CMD_VERSION, BC_IOCTL_MB) #define BCM_IOC_GET_HWTYPE BC_IOC_IOWR(DRV_CMD_GET_HWTYPE, BC_IOCTL_MB) @@ -280,17 +280,16 @@ typedef enum _BC_DRV_CMD{ #define BCM_IOC_END BC_IOC_VOID /* Wrapper for main IOCTL data */ -typedef struct _crystalhd_ioctl_data { - BC_IOCTL_DATA udata; /* IOCTL from App..*/ +struct crystalhd_ioctl_data { + struct BC_IOCTL_DATA udata; /* IOCTL from App..*/ uint32_t u_id; /* Driver specific user ID */ uint32_t cmd; /* Cmd ID for driver's use. */ void *add_cdata; /* Additional command specific data..*/ uint32_t add_cdata_sz; /* Additional command specific data size */ - struct _crystalhd_ioctl_data *next; /* List/Fifo management */ -} crystalhd_ioctl_data; - + struct crystalhd_ioctl_data *next; /* List/Fifo management */ +}; -enum _crystalhd_kmod_ver{ +enum crystalhd_kmod_ver{ crystalhd_kmod_major = 0, crystalhd_kmod_minor = 9, crystalhd_kmod_rev = 27, diff --git a/drivers/staging/crystalhd/crystalhd_cmds.c b/drivers/staging/crystalhd/crystalhd_cmds.c index 1a7ca8ba7f8..1429608544d 100644 --- a/drivers/staging/crystalhd/crystalhd_cmds.c +++ b/drivers/staging/crystalhd/crystalhd_cmds.c @@ -69,8 +69,8 @@ static void bc_cproc_mark_pwr_state(struct crystalhd_cmd *ctx) } } -static BC_STATUS bc_cproc_notify_mode(struct crystalhd_cmd *ctx, - crystalhd_ioctl_data *idata) +static enum BC_STATUS bc_cproc_notify_mode(struct crystalhd_cmd *ctx, + struct crystalhd_ioctl_data *idata) { int rc = 0, i = 0; @@ -111,8 +111,8 @@ static BC_STATUS bc_cproc_notify_mode(struct crystalhd_cmd *ctx, return crystalhd_hw_setup_dma_rings(&ctx->hw_ctx); } -static BC_STATUS bc_cproc_get_version(struct crystalhd_cmd *ctx, - crystalhd_ioctl_data *idata) +static enum BC_STATUS bc_cproc_get_version(struct crystalhd_cmd *ctx, + struct crystalhd_ioctl_data *idata) { if (!ctx || !idata) { @@ -126,7 +126,8 @@ static BC_STATUS bc_cproc_get_version(struct crystalhd_cmd *ctx, } -static BC_STATUS bc_cproc_get_hwtype(struct crystalhd_cmd *ctx, crystalhd_ioctl_data *idata) +static enum BC_STATUS bc_cproc_get_hwtype(struct crystalhd_cmd *ctx, + struct crystalhd_ioctl_data *idata) { if (!ctx || !idata) { BCMLOG_ERR("Invalid Arg!!\n"); @@ -143,8 +144,8 @@ static BC_STATUS bc_cproc_get_hwtype(struct crystalhd_cmd *ctx, crystalhd_ioctl_ return BC_STS_SUCCESS; } -static BC_STATUS bc_cproc_reg_rd(struct crystalhd_cmd *ctx, - crystalhd_ioctl_data *idata) +static enum BC_STATUS bc_cproc_reg_rd(struct crystalhd_cmd *ctx, + struct crystalhd_ioctl_data *idata) { if (!ctx || !idata) return BC_STS_INV_ARG; @@ -153,8 +154,8 @@ static BC_STATUS bc_cproc_reg_rd(struct crystalhd_cmd *ctx, return BC_STS_SUCCESS; } -static BC_STATUS bc_cproc_reg_wr(struct crystalhd_cmd *ctx, - crystalhd_ioctl_data *idata) +static enum BC_STATUS bc_cproc_reg_wr(struct crystalhd_cmd *ctx, + struct crystalhd_ioctl_data *idata) { if (!ctx || !idata) return BC_STS_INV_ARG; @@ -165,8 +166,8 @@ static BC_STATUS bc_cproc_reg_wr(struct crystalhd_cmd *ctx, return BC_STS_SUCCESS; } -static BC_STATUS bc_cproc_link_reg_rd(struct crystalhd_cmd *ctx, - crystalhd_ioctl_data *idata) +static enum BC_STATUS bc_cproc_link_reg_rd(struct crystalhd_cmd *ctx, + struct crystalhd_ioctl_data *idata) { if (!ctx || !idata) return BC_STS_INV_ARG; @@ -176,8 +177,8 @@ static BC_STATUS bc_cproc_link_reg_rd(struct crystalhd_cmd *ctx, return BC_STS_SUCCESS; } -static BC_STATUS bc_cproc_link_reg_wr(struct crystalhd_cmd *ctx, - crystalhd_ioctl_data *idata) +static enum BC_STATUS bc_cproc_link_reg_wr(struct crystalhd_cmd *ctx, + struct crystalhd_ioctl_data *idata) { if (!ctx || !idata) return BC_STS_INV_ARG; @@ -188,10 +189,10 @@ static BC_STATUS bc_cproc_link_reg_wr(struct crystalhd_cmd *ctx, return BC_STS_SUCCESS; } -static BC_STATUS bc_cproc_mem_rd(struct crystalhd_cmd *ctx, - crystalhd_ioctl_data *idata) +static enum BC_STATUS bc_cproc_mem_rd(struct crystalhd_cmd *ctx, + struct crystalhd_ioctl_data *idata) { - BC_STATUS sts = BC_STS_SUCCESS; + enum BC_STATUS sts = BC_STS_SUCCESS; if (!ctx || !idata || !idata->add_cdata) return BC_STS_INV_ARG; @@ -207,10 +208,10 @@ static BC_STATUS bc_cproc_mem_rd(struct crystalhd_cmd *ctx, } -static BC_STATUS bc_cproc_mem_wr(struct crystalhd_cmd *ctx, - crystalhd_ioctl_data *idata) +static enum BC_STATUS bc_cproc_mem_wr(struct crystalhd_cmd *ctx, + struct crystalhd_ioctl_data *idata) { - BC_STATUS sts = BC_STS_SUCCESS; + enum BC_STATUS sts = BC_STS_SUCCESS; if (!ctx || !idata || !idata->add_cdata) return BC_STS_INV_ARG; @@ -226,11 +227,11 @@ static BC_STATUS bc_cproc_mem_wr(struct crystalhd_cmd *ctx, return sts; } -static BC_STATUS bc_cproc_cfg_rd(struct crystalhd_cmd *ctx, - crystalhd_ioctl_data *idata) +static enum BC_STATUS bc_cproc_cfg_rd(struct crystalhd_cmd *ctx, + struct crystalhd_ioctl_data *idata) { uint32_t ix, cnt, off, len; - BC_STATUS sts = BC_STS_SUCCESS; + enum BC_STATUS sts = BC_STS_SUCCESS; uint32_t *temp; if (!ctx || !idata) @@ -258,11 +259,11 @@ static BC_STATUS bc_cproc_cfg_rd(struct crystalhd_cmd *ctx, return sts; } -static BC_STATUS bc_cproc_cfg_wr(struct crystalhd_cmd *ctx, - crystalhd_ioctl_data *idata) +static enum BC_STATUS bc_cproc_cfg_wr(struct crystalhd_cmd *ctx, + struct crystalhd_ioctl_data *idata) { uint32_t ix, cnt, off, len; - BC_STATUS sts = BC_STS_SUCCESS; + enum BC_STATUS sts = BC_STS_SUCCESS; uint32_t *temp; if (!ctx || !idata) @@ -290,10 +291,10 @@ static BC_STATUS bc_cproc_cfg_wr(struct crystalhd_cmd *ctx, return sts; } -static BC_STATUS bc_cproc_download_fw(struct crystalhd_cmd *ctx, - crystalhd_ioctl_data *idata) +static enum BC_STATUS bc_cproc_download_fw(struct crystalhd_cmd *ctx, + struct crystalhd_ioctl_data *idata) { - BC_STATUS sts = BC_STS_SUCCESS; + enum BC_STATUS sts = BC_STS_SUCCESS; if (!ctx || !idata || !idata->add_cdata || !idata->add_cdata_sz) { BCMLOG_ERR("Invalid Arg!!\n"); @@ -329,9 +330,10 @@ static BC_STATUS bc_cproc_download_fw(struct crystalhd_cmd *ctx, * Abort pending input transfers and issue decoder flush command. * */ -static BC_STATUS bc_cproc_do_fw_cmd(struct crystalhd_cmd *ctx, crystalhd_ioctl_data *idata) +static enum BC_STATUS bc_cproc_do_fw_cmd(struct crystalhd_cmd *ctx, + struct crystalhd_ioctl_data *idata) { - BC_STATUS sts; + enum BC_STATUS sts; uint32_t *cmd; if (!(ctx->state & BC_LINK_INIT)) { @@ -371,8 +373,8 @@ static BC_STATUS bc_cproc_do_fw_cmd(struct crystalhd_cmd *ctx, crystalhd_ioctl_d return sts; } -static void bc_proc_in_completion(crystalhd_dio_req *dio_hnd, - wait_queue_head_t *event, BC_STATUS sts) +static void bc_proc_in_completion(struct crystalhd_dio_req *dio_hnd, + wait_queue_head_t *event, enum BC_STATUS sts) { if (!dio_hnd || !event) { BCMLOG_ERR("Invalid Arg!!\n"); @@ -386,7 +388,7 @@ static void bc_proc_in_completion(crystalhd_dio_req *dio_hnd, crystalhd_set_event(event); } -static BC_STATUS bc_cproc_codein_sleep(struct crystalhd_cmd *ctx) +static enum BC_STATUS bc_cproc_codein_sleep(struct crystalhd_cmd *ctx) { wait_queue_head_t sleep_ev; int rc = 0; @@ -406,12 +408,12 @@ static BC_STATUS bc_cproc_codein_sleep(struct crystalhd_cmd *ctx) return BC_STS_SUCCESS; } -static BC_STATUS bc_cproc_hw_txdma(struct crystalhd_cmd *ctx, - crystalhd_ioctl_data *idata, - crystalhd_dio_req *dio) +static enum BC_STATUS bc_cproc_hw_txdma(struct crystalhd_cmd *ctx, + struct crystalhd_ioctl_data *idata, + struct crystalhd_dio_req *dio) { uint32_t tx_listid = 0; - BC_STATUS sts = BC_STS_SUCCESS; + enum BC_STATUS sts = BC_STS_SUCCESS; wait_queue_head_t event; int rc = 0; @@ -471,7 +473,7 @@ static BC_STATUS bc_cproc_hw_txdma(struct crystalhd_cmd *ctx, } /* Helper function to check on user buffers */ -static BC_STATUS bc_cproc_check_inbuffs(bool pin, void *ubuff, uint32_t ub_sz, +static enum BC_STATUS bc_cproc_check_inbuffs(bool pin, void *ubuff, uint32_t ub_sz, uint32_t uv_off, bool en_422) { if (!ubuff || !ub_sz) { @@ -502,12 +504,13 @@ static BC_STATUS bc_cproc_check_inbuffs(bool pin, void *ubuff, uint32_t ub_sz, return BC_STS_SUCCESS; } -static BC_STATUS bc_cproc_proc_input(struct crystalhd_cmd *ctx, crystalhd_ioctl_data *idata) +static enum BC_STATUS bc_cproc_proc_input(struct crystalhd_cmd *ctx, + struct crystalhd_ioctl_data *idata) { void *ubuff; uint32_t ub_sz; - crystalhd_dio_req *dio_hnd = NULL; - BC_STATUS sts = BC_STS_SUCCESS; + struct crystalhd_dio_req *dio_hnd = NULL; + enum BC_STATUS sts = BC_STS_SUCCESS; if (!ctx || !idata) { BCMLOG_ERR("Invalid Arg!!\n"); @@ -537,14 +540,14 @@ static BC_STATUS bc_cproc_proc_input(struct crystalhd_cmd *ctx, crystalhd_ioctl_ return sts; } -static BC_STATUS bc_cproc_add_cap_buff(struct crystalhd_cmd *ctx, - crystalhd_ioctl_data *idata) +static enum BC_STATUS bc_cproc_add_cap_buff(struct crystalhd_cmd *ctx, + struct crystalhd_ioctl_data *idata) { void *ubuff; uint32_t ub_sz, uv_off; bool en_422; - crystalhd_dio_req *dio_hnd = NULL; - BC_STATUS sts = BC_STS_SUCCESS; + struct crystalhd_dio_req *dio_hnd = NULL; + enum BC_STATUS sts = BC_STS_SUCCESS; if (!ctx || !idata) { BCMLOG_ERR("Invalid Arg!!\n"); @@ -579,10 +582,10 @@ static BC_STATUS bc_cproc_add_cap_buff(struct crystalhd_cmd *ctx, return BC_STS_SUCCESS; } -static BC_STATUS bc_cproc_fmt_change(struct crystalhd_cmd *ctx, - crystalhd_dio_req *dio) +static enum BC_STATUS bc_cproc_fmt_change(struct crystalhd_cmd *ctx, + struct crystalhd_dio_req *dio) { - BC_STATUS sts = BC_STS_SUCCESS; + enum BC_STATUS sts = BC_STS_SUCCESS; sts = crystalhd_hw_add_cap_buffer(&ctx->hw_ctx, dio, 0); if (sts != BC_STS_SUCCESS) @@ -595,12 +598,12 @@ static BC_STATUS bc_cproc_fmt_change(struct crystalhd_cmd *ctx, return sts; } -static BC_STATUS bc_cproc_fetch_frame(struct crystalhd_cmd *ctx, - crystalhd_ioctl_data *idata) +static enum BC_STATUS bc_cproc_fetch_frame(struct crystalhd_cmd *ctx, + struct crystalhd_ioctl_data *idata) { - crystalhd_dio_req *dio = NULL; - BC_STATUS sts = BC_STS_SUCCESS; - BC_DEC_OUT_BUFF *frame; + struct crystalhd_dio_req *dio = NULL; + enum BC_STATUS sts = BC_STS_SUCCESS; + struct BC_DEC_OUT_BUFF *frame; if (!ctx || !idata) { BCMLOG_ERR("Invalid Arg!!\n"); @@ -636,8 +639,8 @@ static BC_STATUS bc_cproc_fetch_frame(struct crystalhd_cmd *ctx, return BC_STS_SUCCESS; } -static BC_STATUS bc_cproc_start_capture(struct crystalhd_cmd *ctx, - crystalhd_ioctl_data *idata) +static enum BC_STATUS bc_cproc_start_capture(struct crystalhd_cmd *ctx, + struct crystalhd_ioctl_data *idata) { ctx->state |= BC_LINK_CAP_EN; if (ctx->state == BC_LINK_READY) @@ -646,12 +649,12 @@ static BC_STATUS bc_cproc_start_capture(struct crystalhd_cmd *ctx, return BC_STS_SUCCESS; } -static BC_STATUS bc_cproc_flush_cap_buffs(struct crystalhd_cmd *ctx, - crystalhd_ioctl_data *idata) +static enum BC_STATUS bc_cproc_flush_cap_buffs(struct crystalhd_cmd *ctx, + struct crystalhd_ioctl_data *idata) { - crystalhd_dio_req *dio = NULL; - BC_STATUS sts = BC_STS_SUCCESS; - BC_DEC_OUT_BUFF *frame; + struct crystalhd_dio_req *dio = NULL; + enum BC_STATUS sts = BC_STS_SUCCESS; + struct BC_DEC_OUT_BUFF *frame; uint32_t count; if (!ctx || !idata) { @@ -681,10 +684,10 @@ static BC_STATUS bc_cproc_flush_cap_buffs(struct crystalhd_cmd *ctx, return crystalhd_hw_stop_capture(&ctx->hw_ctx); } -static BC_STATUS bc_cproc_get_stats(struct crystalhd_cmd *ctx, - crystalhd_ioctl_data *idata) +static enum BC_STATUS bc_cproc_get_stats(struct crystalhd_cmd *ctx, + struct crystalhd_ioctl_data *idata) { - BC_DTS_STATS *stats; + struct BC_DTS_STATS *stats; struct crystalhd_hw_stats hw_stats; if (!ctx || !idata) { @@ -713,20 +716,20 @@ static BC_STATUS bc_cproc_get_stats(struct crystalhd_cmd *ctx, return BC_STS_SUCCESS; } -static BC_STATUS bc_cproc_reset_stats(struct crystalhd_cmd *ctx, - crystalhd_ioctl_data *idata) +static enum BC_STATUS bc_cproc_reset_stats(struct crystalhd_cmd *ctx, + struct crystalhd_ioctl_data *idata) { crystalhd_hw_stats(&ctx->hw_ctx, NULL); return BC_STS_SUCCESS; } -static BC_STATUS bc_cproc_chg_clk(struct crystalhd_cmd *ctx, - crystalhd_ioctl_data *idata) +static enum BC_STATUS bc_cproc_chg_clk(struct crystalhd_cmd *ctx, + struct crystalhd_ioctl_data *idata) { - BC_CLOCK *clock; + struct BC_CLOCK *clock; uint32_t oldClk; - BC_STATUS sts = BC_STS_SUCCESS; + enum BC_STATUS sts = BC_STS_SUCCESS; if (!ctx || !idata) { BCMLOG_ERR("Invalid Arg!!\n"); @@ -749,7 +752,7 @@ static BC_STATUS bc_cproc_chg_clk(struct crystalhd_cmd *ctx, } /*=============== Cmd Proc Table.. ======================================*/ -static const crystalhd_cmd_tbl_t g_crystalhd_cproc_tbl[] = { +static const struct crystalhd_cmd_tbl g_crystalhd_cproc_tbl[] = { { BCM_IOC_GET_VERSION, bc_cproc_get_version, 0}, { BCM_IOC_GET_HWTYPE, bc_cproc_get_hwtype, 0}, { BCM_IOC_REG_RD, bc_cproc_reg_rd, 0}, @@ -796,9 +799,10 @@ static const crystalhd_cmd_tbl_t g_crystalhd_cproc_tbl[] = { * we pass on the power mangement notification to our plug-in by completing * all outstanding requests with BC_STS_IO_USER_ABORT return code. */ -BC_STATUS crystalhd_suspend(struct crystalhd_cmd *ctx, crystalhd_ioctl_data *idata) +enum BC_STATUS crystalhd_suspend(struct crystalhd_cmd *ctx, + struct crystalhd_ioctl_data *idata) { - BC_STATUS sts = BC_STS_SUCCESS; + enum BC_STATUS sts = BC_STS_SUCCESS; if (!ctx || !idata) { BCMLOG_ERR("Invalid Parameters\n"); @@ -854,7 +858,7 @@ BC_STATUS crystalhd_suspend(struct crystalhd_cmd *ctx, crystalhd_ioctl_data *ida * start a new playback session from the pre-suspend clip position. * */ -BC_STATUS crystalhd_resume(struct crystalhd_cmd *ctx) +enum BC_STATUS crystalhd_resume(struct crystalhd_cmd *ctx) { BCMLOG(BCMLOG_DBG, "crystalhd_resume Success %x\n", ctx->state); @@ -875,7 +879,7 @@ BC_STATUS crystalhd_resume(struct crystalhd_cmd *ctx) * application specific resources. HW layer initialization * is done for the first open request. */ -BC_STATUS crystalhd_user_open(struct crystalhd_cmd *ctx, +enum BC_STATUS crystalhd_user_open(struct crystalhd_cmd *ctx, struct crystalhd_user **user_ctx) { struct crystalhd_user *uc; @@ -913,7 +917,7 @@ BC_STATUS crystalhd_user_open(struct crystalhd_cmd *ctx, * Closer aplication handle and release app specific * resources. */ -BC_STATUS crystalhd_user_close(struct crystalhd_cmd *ctx, struct crystalhd_user *uc) +enum BC_STATUS crystalhd_user_close(struct crystalhd_cmd *ctx, struct crystalhd_user *uc) { uint32_t mode = uc->mode; @@ -948,7 +952,7 @@ BC_STATUS crystalhd_user_close(struct crystalhd_cmd *ctx, struct crystalhd_user * * Called at the time of driver load. */ -BC_STATUS __devinit crystalhd_setup_cmd_context(struct crystalhd_cmd *ctx, +enum BC_STATUS __devinit crystalhd_setup_cmd_context(struct crystalhd_cmd *ctx, struct crystalhd_adp *adp) { int i = 0; @@ -983,7 +987,7 @@ BC_STATUS __devinit crystalhd_setup_cmd_context(struct crystalhd_cmd *ctx, * * Called at the time of driver un-load. */ -BC_STATUS __devexit crystalhd_delete_cmd_context(struct crystalhd_cmd *ctx) +enum BC_STATUS __devexit crystalhd_delete_cmd_context(struct crystalhd_cmd *ctx) { BCMLOG(BCMLOG_DBG, "Deleting Command context..\n"); @@ -1021,7 +1025,7 @@ crystalhd_cmd_proc crystalhd_get_cmd_proc(struct crystalhd_cmd *ctx, uint32_t cm return NULL; } - tbl_sz = sizeof(g_crystalhd_cproc_tbl) / sizeof(crystalhd_cmd_tbl_t); + tbl_sz = sizeof(g_crystalhd_cproc_tbl) / sizeof(struct crystalhd_cmd_tbl); for (i = 0; i < tbl_sz; i++) { if (g_crystalhd_cproc_tbl[i].cmd_id == cmd) { if ((uc->mode == DTS_MONITOR_MODE) && diff --git a/drivers/staging/crystalhd/crystalhd_cmds.h b/drivers/staging/crystalhd/crystalhd_cmds.h index 9989038b5c1..10130296601 100644 --- a/drivers/staging/crystalhd/crystalhd_cmds.h +++ b/drivers/staging/crystalhd/crystalhd_cmds.h @@ -36,7 +36,7 @@ #include "crystalhd_misc.h" #include "crystalhd_hw.h" -enum _crystalhd_state{ +enum crystalhd_state{ BC_LINK_INVALID = 0x00, BC_LINK_INIT = 0x01, BC_LINK_CAP_EN = 0x02, @@ -66,23 +66,22 @@ struct crystalhd_cmd { struct crystalhd_hw hw_ctx; }; -typedef BC_STATUS(*crystalhd_cmd_proc)(struct crystalhd_cmd *, crystalhd_ioctl_data *); +typedef enum BC_STATUS(*crystalhd_cmd_proc)(struct crystalhd_cmd *, struct crystalhd_ioctl_data *); -typedef struct _crystalhd_cmd_tbl { +struct crystalhd_cmd_tbl { uint32_t cmd_id; const crystalhd_cmd_proc cmd_proc; uint32_t block_mon; -} crystalhd_cmd_tbl_t; - +}; -BC_STATUS crystalhd_suspend(struct crystalhd_cmd *ctx, crystalhd_ioctl_data *idata); -BC_STATUS crystalhd_resume(struct crystalhd_cmd *ctx); +enum BC_STATUS crystalhd_suspend(struct crystalhd_cmd *ctx, struct crystalhd_ioctl_data *idata); +enum BC_STATUS crystalhd_resume(struct crystalhd_cmd *ctx); crystalhd_cmd_proc crystalhd_get_cmd_proc(struct crystalhd_cmd *ctx, uint32_t cmd, struct crystalhd_user *uc); -BC_STATUS crystalhd_user_open(struct crystalhd_cmd *ctx, struct crystalhd_user **user_ctx); -BC_STATUS crystalhd_user_close(struct crystalhd_cmd *ctx, struct crystalhd_user *uc); -BC_STATUS crystalhd_setup_cmd_context(struct crystalhd_cmd *ctx, struct crystalhd_adp *adp); -BC_STATUS crystalhd_delete_cmd_context(struct crystalhd_cmd *ctx); +enum BC_STATUS crystalhd_user_open(struct crystalhd_cmd *ctx, struct crystalhd_user **user_ctx); +enum BC_STATUS crystalhd_user_close(struct crystalhd_cmd *ctx, struct crystalhd_user *uc); +enum BC_STATUS crystalhd_setup_cmd_context(struct crystalhd_cmd *ctx, struct crystalhd_adp *adp); +enum BC_STATUS crystalhd_delete_cmd_context(struct crystalhd_cmd *ctx); bool crystalhd_cmd_interrupt(struct crystalhd_cmd *ctx); #endif diff --git a/drivers/staging/crystalhd/crystalhd_fw_if.h b/drivers/staging/crystalhd/crystalhd_fw_if.h index 261cd19a0ee..77560d4b680 100644 --- a/drivers/staging/crystalhd/crystalhd_fw_if.h +++ b/drivers/staging/crystalhd/crystalhd_fw_if.h @@ -29,21 +29,17 @@ /* TBD: Pull in only required defs into this file.. */ - - /* User Data Header */ -typedef struct user_data { +struct user_data { struct user_data *next; uint32_t type; uint32_t size; -} UD_HDR; - - +}; /*------------------------------------------------------* * MPEG Extension to the PPB * *------------------------------------------------------*/ -typedef struct { +struct ppb_mpeg { uint32_t to_be_defined; uint32_t valid; @@ -61,15 +57,15 @@ typedef struct { /* MPEG_VALID_USERDATA User data is in the form of a linked list. */ int32_t userDataSize; - UD_HDR *userData; + struct user_data *userData; -} PPB_MPEG; +}; /*------------------------------------------------------* * VC1 Extension to the PPB * *------------------------------------------------------*/ -typedef struct { +struct ppb_vc1 { uint32_t to_be_defined; uint32_t valid; @@ -88,9 +84,9 @@ typedef struct { /* VC1_VALID_USERDATA User data is in the form of a linked list. */ int32_t userDataSize; - UD_HDR *userData; + struct user_data *userData; -} PPB_VC1; +}; /*------------------------------------------------------* * H.264 Extension to the PPB * @@ -108,8 +104,8 @@ typedef struct { /* maximum number of intervals(as many as 256 intervals?) */ #define MAX_FGT_VALUE_INTERVAL (256) -typedef struct FGT_SEI { - struct FGT_SEI *next; +struct fgt_sei { + struct fgt_sei *next; unsigned char model_values[3][MAX_FGT_VALUE_INTERVAL][MAX_FGT_MODEL_VALUE]; unsigned char upper_bound[3][MAX_FGT_VALUE_INTERVAL]; unsigned char lower_bound[3][MAX_FGT_VALUE_INTERVAL]; @@ -134,9 +130,9 @@ typedef struct FGT_SEI { unsigned char num_model_values[3]; /* Number of model values. */ uint16_t repetition_period; /* Repetition period (0-16384) */ -} FGT_SEI; +}; -typedef struct { +struct ppb_h264 { /* 'valid' specifies which fields (or sets of * fields) below are valid. If the corresponding * bit in 'valid' is NOT set then that field(s) @@ -170,14 +166,14 @@ typedef struct { /* H264_VALID_USER */ uint32_t user_data_size; - UD_HDR *user_data; + struct user_data *user_data; |