2010-04-25 13:43:42

by Yoichi Yuasa

[permalink] [raw]
Subject: [PATCH 01/11] staging: crystalhd: remove unused bc_dts_types.h

Signed-off-by: Yoichi Yuasa <[email protected]>
---
drivers/staging/crystalhd/bc_dts_defs.h | 2 -
drivers/staging/crystalhd/bc_dts_types.h | 121 ------------------------------
2 files changed, 0 insertions(+), 123 deletions(-)
delete mode 100644 drivers/staging/crystalhd/bc_dts_types.h

diff --git a/drivers/staging/crystalhd/bc_dts_defs.h b/drivers/staging/crystalhd/bc_dts_defs.h
index c34cc07..cd12605 100644
--- a/drivers/staging/crystalhd/bc_dts_defs.h
+++ b/drivers/staging/crystalhd/bc_dts_defs.h
@@ -26,8 +26,6 @@
#ifndef _BC_DTS_DEFS_H_
#define _BC_DTS_DEFS_H_

-#include "bc_dts_types.h"
-
/* BIT Mask */
#define BC_BIT(_x) (1 << (_x))

diff --git a/drivers/staging/crystalhd/bc_dts_types.h b/drivers/staging/crystalhd/bc_dts_types.h
deleted file mode 100644
index ac0c817..0000000
--- a/drivers/staging/crystalhd/bc_dts_types.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/********************************************************************
- * Copyright(c) 2006-2009 Broadcom Corporation.
- *
- * Name: bc_dts_types.h
- *
- * Description: Data types
- *
- * AU
- *
- * HISTORY:
- *
- ********************************************************************
- * This header is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 2.1 of the License.
- *
- * This header is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License
- * along with this header. If not, see <http://www.gnu.org/licenses/>.
- *******************************************************************/
-
-#ifndef _BC_DTS_TYPES_H_
-#define _BC_DTS_TYPES_H_
-
-#ifdef __LINUX_USER__ // Don't include these for KERNEL..
-#include <stdint.h>
-#endif
-
-#if defined(_WIN64) || defined(_WIN32)
-typedef uint32_t U32;
-typedef int32_t S32;
-typedef uint16_t U16;
-typedef int16_t S16;
-typedef unsigned char U8;
-typedef char S8;
-#endif
-
-#ifndef PVOID
-typedef void *PVOID;
-#endif
-
-#ifndef BOOL
-typedef int BOOL;
-#endif
-
-#ifdef WIN32
- typedef unsigned __int64 U64;
-#elif defined(_WIN64)
- typedef uint64_t U64;
-#endif
-
-#ifdef _WIN64
-#if !(defined(POINTER_32))
-#define POINTER_32 __ptr32
-#endif
-#else /* _WIN32 */
-#define POINTER_32
-#endif
-
-#if defined(__KERNEL__) || defined(__LINUX_USER__)
-
-#ifdef __LINUX_USER__ /* Don't include these for KERNEL */
-typedef uint32_t ULONG;
-typedef int32_t LONG;
-typedef void *HANDLE;
-#ifndef VOID
-typedef void VOID;
-#endif
-typedef void *LPVOID;
-typedef uint32_t DWORD;
-typedef uint32_t UINT32;
-typedef uint32_t *LPDWORD;
-typedef unsigned char *PUCHAR;
-
-#ifndef TRUE
- #define TRUE 1
-#endif
-
-#ifndef FALSE
- #define FALSE 0
-#endif
-
-#define TEXT
-
-#else
-
-/* For Kernel usage.. */
-typedef bool bc_bool_t;
-#endif
-
-#else
-
-#ifndef uint64_t
-typedef struct _uint64_t {
- uint32_t low_dw;
- uint32_t hi_dw;
-} uint64_t;
-#endif
-
-#ifndef int32_t
-typedef signed long int32_t;
-#endif
-
-#ifndef uint32_t
-typedef unsigned long uint32_t;
-#endif
-
-#ifndef uint16_t
-typedef unsigned short uint16_t;
-#endif
-
-#ifndef uint8_t
-typedef unsigned char uint8_t;
-#endif
-#endif
-
-#endif
-
--
1.7.1


2010-04-25 13:43:49

by Yoichi Yuasa

[permalink] [raw]
Subject: [PATCH 02/11] staging: crystalhd: remove unused definitions in header files

Signed-off-by: Yoichi Yuasa <[email protected]>
---
drivers/staging/crystalhd/bc_dts_defs.h | 313 +--------------------------
drivers/staging/crystalhd/bc_dts_glob_lnx.h | 29 +---
drivers/staging/crystalhd/crystalhd_hw.h | 1 -
drivers/staging/crystalhd/crystalhd_lnx.h | 1 -
drivers/staging/crystalhd/crystalhd_misc.c | 21 --
drivers/staging/crystalhd/crystalhd_misc.h | 1 -
6 files changed, 3 insertions(+), 363 deletions(-)

diff --git a/drivers/staging/crystalhd/bc_dts_defs.h b/drivers/staging/crystalhd/bc_dts_defs.h
index cd12605..e825312 100644
--- a/drivers/staging/crystalhd/bc_dts_defs.h
+++ b/drivers/staging/crystalhd/bc_dts_defs.h
@@ -62,38 +62,6 @@ typedef enum _BC_STATUS {
BC_STS_ERROR = -1
} BC_STATUS;

-/*------------------------------------------------------*
- * Registry Key Definitions *
- *------------------------------------------------------*/
-#define BC_REG_KEY_MAIN_PATH "Software\\Broadcom\\MediaPC\\70010"
-#define BC_REG_KEY_FWPATH "FirmwareFilePath"
-#define BC_REG_KEY_SEC_OPT "DbgOptions"
-
-/*
- * Options:
- *
- * b[5] = Enable RSA KEY in EEPROM Support
- * b[6] = Enable Old PIB scheme. (0 = Use PIB with video scheme)
- *
- * b[12] = Enable send message to NotifyIcon
- *
- */
-
-typedef 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{
- uint32_t DbgOptions;
-} BC_REG_CONFIG;
-
-#if defined(__KERNEL__) || defined(__LINUX_USER__)
-#else
-/* Align data structures */
-#define ALIGN(x) __declspec(align(x))
-#endif
-
/* mode
* b[0]..b[7] = _DtsDeviceOpenMode
* b[8] = Load new FW
@@ -113,54 +81,9 @@ enum _DtsDeviceOpenMode {
DTS_HWINIT_MODE
};

-/* To enable the filter to selectively enable/disable fixes or erratas */
-enum _DtsDeviceFixMode {
- DTS_LOAD_NEW_FW = BC_BIT(8),
- DTS_LOAD_FILE_PLAY_FW = BC_BIT(9),
- DTS_DISK_FMT_BD = BC_BIT(10),
- /* b[11]-b[15] : Default output resolution */
- DTS_SKIP_TX_CHK_CPB = BC_BIT(16),
- DTS_ADAPTIVE_OUTPUT_PER = BC_BIT(17),
- DTS_INTELLIMAP = BC_BIT(18),
- /* b[19]-b[21] : select clock frequency */
- DTS_PLAYBACK_DROP_RPT_MODE = BC_BIT(22)
-};
-
-#define DTS_DFLT_RESOLUTION(x) (x<<11)
-
-#define DTS_DFLT_CLOCK(x) (x<<19)
-
-/* F/W File Version corresponding to S/W Releases */
-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))
-};
-
-/*------------------------------------------------------*
- * Stream Types for DtsOpenDecoder() *
- *------------------------------------------------------*/
-enum _DtsOpenDecStreamTypes {
- BC_STREAM_TYPE_ES = 0,
- BC_STREAM_TYPE_PES = 1,
- BC_STREAM_TYPE_TS = 2,
- BC_STREAM_TYPE_ES_TSTAMP = 6,
-};
-
-/*------------------------------------------------------*
- * Video Algorithms for DtsSetVideoParams() *
- *------------------------------------------------------*/
-enum _DtsSetVideoParamsAlgo {
- BC_VID_ALGO_H264 = 0,
- BC_VID_ALGO_MPEG2 = 1,
- BC_VID_ALGO_VC1 = 4,
- BC_VID_ALGO_VC1MP = 7,
-};
-
/*------------------------------------------------------*
* MPEG Extension to the PPB *
*------------------------------------------------------*/
-#define BC_MPEG_VALID_PANSCAN (1)
-
typedef struct _BC_PIB_EXT_MPEG {
uint32_t valid;
/* Always valid, defaults to picture size if no
@@ -179,10 +102,6 @@ typedef struct _BC_PIB_EXT_MPEG {
/*------------------------------------------------------*
* H.264 Extension to the PPB *
*------------------------------------------------------*/
-/* Bit definitions for 'other.h264.valid' field */
-#define H264_VALID_PANSCAN (1)
-#define H264_VALID_SPS_CROP (2)
-#define H264_VALID_VUI (4)

typedef struct _BC_PIB_EXT_H264 {
/* 'valid' specifies which fields (or sets of
@@ -213,7 +132,6 @@ typedef struct _BC_PIB_EXT_H264 {
/*------------------------------------------------------*
* VC1 Extension to the PPB *
*------------------------------------------------------*/
-#define VC1_VALID_PANSCAN (1)

typedef struct _BC_PIB_EXT_VC1 {
uint32_t valid;
@@ -236,133 +154,6 @@ typedef struct _BC_PIB_EXT_VC1 {
/*------------------------------------------------------*
* Picture Information Block *
*------------------------------------------------------*/
-#if defined(_WIN32) || defined(_WIN64) || defined(__LINUX_USER__)
-/* Values for 'pulldown' field. '0' means no pulldown information
- * was present for this picture. */
-enum {
- vdecNoPulldownInfo = 0,
- vdecTop = 1,
- vdecBottom = 2,
- vdecTopBottom = 3,
- vdecBottomTop = 4,
- vdecTopBottomTop = 5,
- vdecBottomTopBottom = 6,
- vdecFrame_X2 = 7,
- vdecFrame_X3 = 8,
- vdecFrame_X1 = 9,
- vdecFrame_X4 = 10,
-};
-
-/* Values for the 'frame_rate' field. */
-enum {
- vdecFrameRateUnknown = 0,
- vdecFrameRate23_97,
- vdecFrameRate24,
- vdecFrameRate25,
- vdecFrameRate29_97,
- vdecFrameRate30,
- vdecFrameRate50,
- vdecFrameRate59_94,
- vdecFrameRate60,
-};
-
-/* Values for the 'aspect_ratio' field. */
-enum {
- vdecAspectRatioUnknown = 0,
- vdecAspectRatioSquare,
- vdecAspectRatio12_11,
- vdecAspectRatio10_11,
- vdecAspectRatio16_11,
- vdecAspectRatio40_33,
- vdecAspectRatio24_11,
- vdecAspectRatio20_11,
- vdecAspectRatio32_11,
- vdecAspectRatio80_33,
- vdecAspectRatio18_11,
- vdecAspectRatio15_11,
- vdecAspectRatio64_33,
- vdecAspectRatio160_99,
- vdecAspectRatio4_3,
- vdecAspectRatio16_9,
- vdecAspectRatio221_1,
- vdecAspectRatioOther = 255,
-};
-
-/* Values for the 'colour_primaries' field. */
-enum {
- vdecColourPrimariesUnknown = 0,
- vdecColourPrimariesBT709,
- vdecColourPrimariesUnspecified,
- vdecColourPrimariesReserved,
- vdecColourPrimariesBT470_2M = 4,
- vdecColourPrimariesBT470_2BG,
- vdecColourPrimariesSMPTE170M,
- vdecColourPrimariesSMPTE240M,
- vdecColourPrimariesGenericFilm,
-};
-
-enum {
- vdecRESOLUTION_CUSTOM = 0x00000000, /* custom */
- vdecRESOLUTION_480i = 0x00000001, /* 480i */
- vdecRESOLUTION_1080i = 0x00000002, /* 1080i (1920x1080, 60i) */
- vdecRESOLUTION_NTSC = 0x00000003, /* NTSC (720x483, 60i) */
- vdecRESOLUTION_480p = 0x00000004, /* 480p (720x480, 60p) */
- vdecRESOLUTION_720p = 0x00000005, /* 720p (1280x720, 60p) */
- vdecRESOLUTION_PAL1 = 0x00000006, /* PAL_1 (720x576, 50i) */
- vdecRESOLUTION_1080i25 = 0x00000007, /* 1080i25 (1920x1080, 50i) */
- vdecRESOLUTION_720p50 = 0x00000008, /* 720p50 (1280x720, 50p) */
- vdecRESOLUTION_576p = 0x00000009, /* 576p (720x576, 50p) */
- vdecRESOLUTION_1080i29_97 = 0x0000000A, /* 1080i (1920x1080, 59.94i) */
- vdecRESOLUTION_720p59_94 = 0x0000000B, /* 720p (1280x720, 59.94p) */
- vdecRESOLUTION_SD_DVD = 0x0000000C, /* SD DVD (720x483, 60i) */
- vdecRESOLUTION_480p656 = 0x0000000D, /* 480p (720x480, 60p), output bus width 8 bit, clock 74.25MHz */
- vdecRESOLUTION_1080p23_976 = 0x0000000E, /* 1080p23_976 (1920x1080, 23.976p) */
- vdecRESOLUTION_720p23_976 = 0x0000000F, /* 720p23_976 (1280x720p, 23.976p) */
- vdecRESOLUTION_240p29_97 = 0x00000010, /* 240p (1440x240, 29.97p ) */
- vdecRESOLUTION_240p30 = 0x00000011, /* 240p (1440x240, 30p) */
- vdecRESOLUTION_288p25 = 0x00000012, /* 288p (1440x288p, 25p) */
- vdecRESOLUTION_1080p29_97 = 0x00000013, /* 1080p29_97 (1920x1080, 29.97p) */
- vdecRESOLUTION_1080p30 = 0x00000014, /* 1080p30 (1920x1080, 30p) */
- vdecRESOLUTION_1080p24 = 0x00000015, /* 1080p24 (1920x1080, 24p) */
- vdecRESOLUTION_1080p25 = 0x00000016, /* 1080p25 (1920x1080, 25p) */
- vdecRESOLUTION_720p24 = 0x00000017, /* 720p24 (1280x720, 25p) */
- vdecRESOLUTION_720p29_97 = 0x00000018, /* 720p29.97 (1280x720, 29.97p) */
- vdecRESOLUTION_480p23_976 = 0x00000019, /* 480p23.976 (720*480, 23.976) */
- vdecRESOLUTION_480p29_97 = 0x0000001A, /* 480p29.976 (720*480, 29.97p) */
- vdecRESOLUTION_576p25 = 0x0000001B, /* 576p25 (720*576, 25p) */
- /* For Zero Frame Rate */
- vdecRESOLUTION_480p0 = 0x0000001C, /* 480p (720x480, 0p) */
- vdecRESOLUTION_480i0 = 0x0000001D, /* 480i (720x480, 0i) */
- vdecRESOLUTION_576p0 = 0x0000001E, /* 576p (720x576, 0p) */
- vdecRESOLUTION_720p0 = 0x0000001F, /* 720p (1280x720, 0p) */
- vdecRESOLUTION_1080p0 = 0x00000020, /* 1080p (1920x1080, 0p) */
- vdecRESOLUTION_1080i0 = 0x00000021, /* 1080i (1920x1080, 0i) */
-};
-
-/* Bit definitions for 'flags' field */
-#define VDEC_FLAG_EOS (0x0004)
-
-#define VDEC_FLAG_FRAME (0x0000)
-#define VDEC_FLAG_FIELDPAIR (0x0008)
-#define VDEC_FLAG_TOPFIELD (0x0010)
-#define VDEC_FLAG_BOTTOMFIELD (0x0018)
-
-#define VDEC_FLAG_PROGRESSIVE_SRC (0x0000)
-#define VDEC_FLAG_INTERLACED_SRC (0x0020)
-#define VDEC_FLAG_UNKNOWN_SRC (0x0040)
-
-#define VDEC_FLAG_BOTTOM_FIRST (0x0080)
-#define VDEC_FLAG_LAST_PICTURE (0x0100)
-
-#define VDEC_FLAG_PICTURE_META_DATA_PRESENT (0x40000)
-
-#endif /* _WIN32 || _WIN64 */
-
-enum _BC_OUTPUT_FORMAT {
- MODE420 = 0x0,
- MODE422_YUY2 = 0x1,
- MODE422_UYVY = 0x2,
-};

typedef struct _BC_PIC_INFO_BLOCK {
/* Common fields. */
@@ -389,108 +180,6 @@ typedef struct _BC_PIC_INFO_BLOCK {
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_{
- /* Flags from App to Device */
- BC_POUT_FLAGS_YV12 = 0x01, /* Copy Data in YV12 format */
- BC_POUT_FLAGS_STRIDE = 0x02, /* Stride size is valid. */
- BC_POUT_FLAGS_SIZE = 0x04, /* Take size information from Application */
- BC_POUT_FLAGS_INTERLACED = 0x08, /* copy only half the bytes */
- BC_POUT_FLAGS_INTERLEAVED = 0x10, /* interleaved frame */
-
- /* Flags from Device to APP */
- BC_POUT_FLAGS_FMT_CHANGE = 0x10000, /* Data is not VALID when this flag is set */
- BC_POUT_FLAGS_PIB_VALID = 0x20000, /* PIB Information valid */
- BC_POUT_FLAGS_ENCRYPTED = 0x40000, /* Data is encrypted. */
- 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
-
-/* Line 21 Closed Caption */
-/* User Data */
-#define MAX_UD_SIZE 1792 /* 1920 - 128 */
-
-typedef 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 */
-
- uint8_t *UVbuff; /* Caller Supplied buffer for UV data */
- uint32_t UVbuffSz; /* Caller Supplied UV buffer size */
- uint32_t UVBuffDoneSz; /* Transferred UV data size */
-
- uint32_t StrideSz; /* Caller supplied Stride Size */
- uint32_t PoutFlags; /* Call IN Flags */
-
- uint32_t discCnt; /* Picture discontinuity count */
-
- BC_PIC_INFO_BLOCK PicInfo; /* Picture Information Block Data */
-
- /* Line 21 Closed Caption */
- /* User Data */
- uint32_t UserDataSz;
- uint8_t UserData[MAX_UD_SIZE];
-
- void *hnd;
- dts_pout_callback AppCallBack;
- uint8_t DropFrames;
- uint8_t b422Mode; /* Picture output Mode */
- uint8_t bPibEnc; /* PIB encrypted */
- uint8_t bRevertScramble;
-
-} BC_DTS_PROC_OUT;
-
-typedef 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) */
- uint8_t reserved_[1];
-
- uint32_t FramesDropped; /* Number of frames dropped. (reported by DIL) */
- uint32_t FramesCaptured; /* Number of frames captured. (reported by DIL) */
- uint32_t FramesRepeated; /* Number of frames repeated. (reported by DIL) */
-
- uint32_t InputCount; /* Times compressed video has been sent to the HW.
- * i.e. Successful DtsProcInput() calls (reported by DIL) */
- uint64_t InputTotalSize; /* Amount of compressed video that has been sent to the HW.
- * (reported by DIL) */
- uint32_t InputBusyCount; /* Times compressed video has attempted to be sent to the HW
- * but the input FIFO was full. (reported by DIL) */
-
- uint32_t PIBMissCount; /* Amount of times a PIB is invalid. (reported by DIL) */
-
- uint32_t cpbEmptySize; /* supported only for H.264, specifically changed for
- * Adobe. Report size of CPB buffer available.
- * Reported by DIL */
- uint64_t NextTimeStamp; /* TimeStamp of the next picture that will be returned
- * by a call to ProcOutput. Added for Adobe. Reported
- * back from the driver */
- uint8_t reserved__[16];
-
-} BC_DTS_STATUS;
-
-#define BC_SWAP32(_v) \
- ((((_v) & 0xFF000000)>>24)| \
- (((_v) & 0x00FF0000)>>8)| \
- (((_v) & 0x0000FF00)<<8)| \
- (((_v) & 0x000000FF)<<24))
-
-#define WM_AGENT_TRAYICON_DECODER_OPEN 10001
-#define WM_AGENT_TRAYICON_DECODER_CLOSE 10002
-#define WM_AGENT_TRAYICON_DECODER_START 10003
-#define WM_AGENT_TRAYICON_DECODER_STOP 10004
-#define WM_AGENT_TRAYICON_DECODER_RUN 10005
-#define WM_AGENT_TRAYICON_DECODER_PAUSE 10006
-
+} BC_PIC_INFO_BLOCK;

#endif /* _BC_DTS_DEFS_H_ */
diff --git a/drivers/staging/crystalhd/bc_dts_glob_lnx.h b/drivers/staging/crystalhd/bc_dts_glob_lnx.h
index b3125e3..cc8a2aa 100644
--- a/drivers/staging/crystalhd/bc_dts_glob_lnx.h
+++ b/drivers/staging/crystalhd/bc_dts_glob_lnx.h
@@ -28,31 +28,10 @@
#ifndef _BC_DTS_GLOB_LNX_H_
#define _BC_DTS_GLOB_LNX_H_

-#ifdef __LINUX_USER__
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <ctype.h>
-#include <string.h>
-#include <errno.h>
-#include <netdb.h>
-#include <sys/time.h>
-#include <time.h>
-#include <arpa/inet.h>
-#include <asm/param.h>
-#include <linux/ioctl.h>
-#include <sys/select.h>
-
-#define DRVIFLIB_INT_API
-
-#endif
-
#include "bc_dts_defs.h"
#include "bcm_70012_regs.h" /* Link Register defs */

#define CRYSTALHD_API_NAME "crystalhd"
-#define CRYSTALHD_API_DEV_NAME "/dev/crystalhd"

/*
* These are SW stack tunable parameters shared
@@ -82,17 +61,13 @@ typedef struct _BC_CMD_DEV_MEM {
} BC_CMD_DEV_MEM;

/* FW Passthrough command structure */
-enum _bc_fw_cmd_flags {
- BC_FW_CMD_FLAGS_NONE = 0,
- BC_FW_CMD_PIB_QS = 0x01,
-};

typedef 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;
+} BC_FW_CMD;

typedef struct _BC_HW_TYPE {
uint16_t PciDevId;
@@ -163,7 +138,7 @@ typedef struct _BC_PROC_INPUT_ {
uint8_t Encrypted;
uint8_t Rsrd[2];
uint32_t DramOffset; /* For debug use only */
-} BC_PROC_INPUT, *PBC_PROC_INPUT;
+} BC_PROC_INPUT;

typedef struct _BC_DEC_YUV_BUFFS {
uint32_t b422Mode;
diff --git a/drivers/staging/crystalhd/crystalhd_hw.h b/drivers/staging/crystalhd/crystalhd_hw.h
index 1c6318e..7fd748f 100644
--- a/drivers/staging/crystalhd/crystalhd_hw.h
+++ b/drivers/staging/crystalhd/crystalhd_hw.h
@@ -34,7 +34,6 @@
#define DMA_ENGINE_CNT 2
#define MAX_PIB_Q_DEPTH 64
#define MIN_PIB_Q_DEPTH 2
-#define WR_POINTER_OFF 4

#define ASPM_L1_ENABLE (BC_BIT(27))

diff --git a/drivers/staging/crystalhd/crystalhd_lnx.h b/drivers/staging/crystalhd/crystalhd_lnx.h
index d338ae9..e4cb6c7 100644
--- a/drivers/staging/crystalhd/crystalhd_lnx.h
+++ b/drivers/staging/crystalhd/crystalhd_lnx.h
@@ -90,7 +90,6 @@ struct crystalhd_adp {


struct crystalhd_adp *chd_get_adp(void);
-void chd_set_log_level(struct crystalhd_adp *adp, char *arg);

#endif

diff --git a/drivers/staging/crystalhd/crystalhd_misc.c b/drivers/staging/crystalhd/crystalhd_misc.c
index 587dcc4..15bfdc4 100644
--- a/drivers/staging/crystalhd/crystalhd_misc.c
+++ b/drivers/staging/crystalhd/crystalhd_misc.c
@@ -1007,24 +1007,3 @@ void crystalhd_delete_elem_pool(struct crystalhd_adp *adp)

BCMLOG(BCMLOG_DBG, "released %d elem\n", dbg_cnt);
}
-
-/*================ Debug support routines.. ================================*/
-void crystalhd_show_buffer(uint32_t off, uint8_t *buff, uint32_t dwcount)
-{
- uint32_t i, k = 1;
-
- for (i = 0; i < dwcount; i++) {
- if (k == 1)
- BCMLOG(BCMLOG_DATA, "0x%08X : ", off);
-
- BCMLOG(BCMLOG_DATA, " 0x%08X ", *((uint32_t *)buff));
-
- buff += sizeof(uint32_t);
- off += sizeof(uint32_t);
- k++;
- if ((i == dwcount - 1) || (k > 4)) {
- BCMLOG(BCMLOG_DATA, "\n");
- k = 1;
- }
- }
-}
diff --git a/drivers/staging/crystalhd/crystalhd_misc.h b/drivers/staging/crystalhd/crystalhd_misc.h
index a2aa6ad..3bf7b8c 100644
--- a/drivers/staging/crystalhd/crystalhd_misc.h
+++ b/drivers/staging/crystalhd/crystalhd_misc.h
@@ -190,7 +190,6 @@ extern void crystalhd_delete_elem_pool(struct crystalhd_adp *);


/*================ Debug routines/macros .. ================================*/
-extern void crystalhd_show_buffer(uint32_t off, uint8_t *buff, uint32_t dwcount);

enum _chd_log_levels {
BCMLOG_ERROR = 0x80000000, /* Don't disable this option */
--
1.7.1

2010-04-25 13:43:56

by Yoichi Yuasa

[permalink] [raw]
Subject: [PATCH 03/11] staging: crystalhd: remove unused BC_STATUS codes

Signed-off-by: Yoichi Yuasa <[email protected]>
---
drivers/staging/crystalhd/bc_dts_defs.h | 13 -------------
drivers/staging/crystalhd/crystalhd_lnx.c | 2 --
2 files changed, 0 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/crystalhd/bc_dts_defs.h b/drivers/staging/crystalhd/bc_dts_defs.h
index e825312..d7e6a9e 100644
--- a/drivers/staging/crystalhd/bc_dts_defs.h
+++ b/drivers/staging/crystalhd/bc_dts_defs.h
@@ -34,28 +34,15 @@ typedef enum _BC_STATUS {
BC_STS_INV_ARG = 1,
BC_STS_BUSY = 2,
BC_STS_NOT_IMPL = 3,
- BC_STS_PGM_QUIT = 4,
- BC_STS_NO_ACCESS = 5,
BC_STS_INSUFF_RES = 6,
BC_STS_IO_ERROR = 7,
BC_STS_NO_DATA = 8,
- BC_STS_VER_MISMATCH = 9,
BC_STS_TIMEOUT = 10,
BC_STS_FW_CMD_ERR = 11,
- BC_STS_DEC_NOT_OPEN = 12,
BC_STS_ERR_USAGE = 13,
BC_STS_IO_USER_ABORT = 14,
- BC_STS_IO_XFR_ERROR = 15,
- BC_STS_DEC_NOT_STARTED = 16,
- BC_STS_FWHEX_NOT_FOUND = 17,
- BC_STS_FMT_CHANGE = 18,
- BC_STS_HIF_ACCESS = 19,
BC_STS_CMD_CANCELLED = 20,
BC_STS_FW_AUTH_FAILED = 21,
- BC_STS_BOOTLOADER_FAILED = 22,
- BC_STS_CERT_VERIFY_ERROR = 23,
- BC_STS_DEC_EXIST_OPEN = 24,
- BC_STS_PENDING = 25,
BC_STS_CLK_NOCHG = 26,

/* Must be the last one.*/
diff --git a/drivers/staging/crystalhd/crystalhd_lnx.c b/drivers/staging/crystalhd/crystalhd_lnx.c
index 3eac70a..6ef54e3 100644
--- a/drivers/staging/crystalhd/crystalhd_lnx.c
+++ b/drivers/staging/crystalhd/crystalhd_lnx.c
@@ -245,8 +245,6 @@ static int chd_dec_api_cmd(struct crystalhd_adp *adp, unsigned long ua,
rc = chd_dec_proc_user_data(adp, temp, ua, 0);
if (!rc) {
sts = func(&adp->cmds, temp);
- if (sts == BC_STS_PENDING)
- sts = BC_STS_NOT_IMPL;
temp->udata.RetSts = sts;
rc = chd_dec_proc_user_data(adp, temp, ua, 1);
}
--
1.7.1

2010-04-25 13:43:58

by Yoichi Yuasa

[permalink] [raw]
Subject: [PATCH 04/11] staging: crystalhd: mark all local functions static

Signed-off-by: Yoichi Yuasa <[email protected]>
---
drivers/staging/crystalhd/crystalhd_lnx.c | 23 ++++++++++++-----------
drivers/staging/crystalhd/crystalhd_lnx.h | 4 ----
2 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/crystalhd/crystalhd_lnx.c b/drivers/staging/crystalhd/crystalhd_lnx.c
index 6ef54e3..a68b5ff 100644
--- a/drivers/staging/crystalhd/crystalhd_lnx.c
+++ b/drivers/staging/crystalhd/crystalhd_lnx.c
@@ -23,6 +23,11 @@ static struct class *crystalhd_class;

static struct crystalhd_adp *g_adp_info;

+static struct crystalhd_adp *chd_get_adp(void)
+{
+ return g_adp_info;
+}
+
static irqreturn_t chd_dec_isr(int irq, void *arg)
{
struct crystalhd_adp *adp = (struct crystalhd_adp *) arg;
@@ -72,7 +77,8 @@ static int chd_dec_disable_int(struct crystalhd_adp *adp)
return 0;
}

-crystalhd_ioctl_data *chd_dec_alloc_iodata(struct crystalhd_adp *adp, bool isr)
+static crystalhd_ioctl_data *chd_dec_alloc_iodata(struct crystalhd_adp *adp,
+ bool isr)
{
unsigned long flags = 0;
crystalhd_ioctl_data *temp;
@@ -92,8 +98,8 @@ crystalhd_ioctl_data *chd_dec_alloc_iodata(struct crystalhd_adp *adp, bool isr)
return temp;
}

-void chd_dec_free_iodata(struct crystalhd_adp *adp, crystalhd_ioctl_data *iodata,
- bool isr)
+static void chd_dec_free_iodata(struct crystalhd_adp *adp,
+ crystalhd_ioctl_data *iodata, bool isr)
{
unsigned long flags = 0;

@@ -613,7 +619,7 @@ static int __devinit chd_dec_pci_probe(struct pci_dev *pdev,
}

#ifdef CONFIG_PM
-int chd_dec_pci_suspend(struct pci_dev *pdev, pm_message_t state)
+static int chd_dec_pci_suspend(struct pci_dev *pdev, pm_message_t state)
{
struct crystalhd_adp *adp;
crystalhd_ioctl_data *temp;
@@ -647,7 +653,7 @@ int chd_dec_pci_suspend(struct pci_dev *pdev, pm_message_t state)
return 0;
}

-int chd_dec_pci_resume(struct pci_dev *pdev)
+static int chd_dec_pci_resume(struct pci_dev *pdev)
{
struct crystalhd_adp *adp;
BC_STATUS sts = BC_STS_SUCCESS;
@@ -705,7 +711,7 @@ static struct pci_driver bc_chd_70012_driver = {
#endif
};

-void chd_set_log_level(struct crystalhd_adp *adp, char *arg)
+static void chd_set_log_level(struct crystalhd_adp *adp, char *arg)
{
if ((!arg) || (strlen(arg) < 3))
g_linklog_level = BCMLOG_ERROR | BCMLOG_DATA;
@@ -725,11 +731,6 @@ void chd_set_log_level(struct crystalhd_adp *adp, char *arg)
g_linklog_level = 0;
}

-struct crystalhd_adp *chd_get_adp(void)
-{
- return g_adp_info;
-}
-
static int __init chd_dec_module_init(void)
{
int rc;
diff --git a/drivers/staging/crystalhd/crystalhd_lnx.h b/drivers/staging/crystalhd/crystalhd_lnx.h
index e4cb6c7..f7fb15a 100644
--- a/drivers/staging/crystalhd/crystalhd_lnx.h
+++ b/drivers/staging/crystalhd/crystalhd_lnx.h
@@ -88,8 +88,4 @@ struct crystalhd_adp {
struct pci_pool *fill_byte_pool;
};

-
-struct crystalhd_adp *chd_get_adp(void);
-
#endif
-
--
1.7.1

2010-04-25 13:44:06

by Yoichi Yuasa

[permalink] [raw]
Subject: [PATCH 05/11] staging: crystalhd: clean up crystalhd_setup_cmd_context() return code

Signed-off-by: Yoichi Yuasa <[email protected]>
---
drivers/staging/crystalhd/crystalhd_cmds.c | 9 +++++----
drivers/staging/crystalhd/crystalhd_cmds.h | 2 +-
drivers/staging/crystalhd/crystalhd_lnx.c | 7 +++----
3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/crystalhd/crystalhd_cmds.c b/drivers/staging/crystalhd/crystalhd_cmds.c
index 26145a8..516e825 100644
--- a/drivers/staging/crystalhd/crystalhd_cmds.c
+++ b/drivers/staging/crystalhd/crystalhd_cmds.c
@@ -948,14 +948,14 @@ 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,
- struct crystalhd_adp *adp)
+int __devinit crystalhd_setup_cmd_context(struct crystalhd_cmd *ctx,
+ struct crystalhd_adp *adp)
{
int i = 0;

if (!ctx || !adp) {
BCMLOG_ERR("Invalid arg!!\n");
- return BC_STS_INV_ARG;
+ return -EINVAL;
}

if (ctx->adp)
@@ -971,7 +971,8 @@ BC_STATUS __devinit crystalhd_setup_cmd_context(struct crystalhd_cmd *ctx,
/*Open and Close the Hardware to put it in to sleep state*/
crystalhd_hw_open(&ctx->hw_ctx, ctx->adp);
crystalhd_hw_close(&ctx->hw_ctx);
- return BC_STS_SUCCESS;
+
+ return 0;
}

/**
diff --git a/drivers/staging/crystalhd/crystalhd_cmds.h b/drivers/staging/crystalhd/crystalhd_cmds.h
index 6b290ae..90b4467 100644
--- a/drivers/staging/crystalhd/crystalhd_cmds.h
+++ b/drivers/staging/crystalhd/crystalhd_cmds.h
@@ -81,7 +81,7 @@ crystalhd_cmd_proc crystalhd_get_cmd_proc(struct crystalhd_cmd *ctx, uint32_t cm
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);
+int crystalhd_setup_cmd_context(struct crystalhd_cmd *ctx, struct crystalhd_adp *adp);
BC_STATUS crystalhd_delete_cmd_context(struct crystalhd_cmd *ctx);
bool crystalhd_cmd_interrupt(struct crystalhd_cmd *ctx);

diff --git a/drivers/staging/crystalhd/crystalhd_lnx.c b/drivers/staging/crystalhd/crystalhd_lnx.c
index a68b5ff..490d2e0 100644
--- a/drivers/staging/crystalhd/crystalhd_lnx.c
+++ b/drivers/staging/crystalhd/crystalhd_lnx.c
@@ -542,7 +542,6 @@ static int __devinit chd_dec_pci_probe(struct pci_dev *pdev,
{
struct crystalhd_adp *pinfo;
int rc;
- BC_STATUS sts = BC_STS_SUCCESS;

BCMLOG(BCMLOG_DBG, "PCI_INFO: Vendor:0x%04x Device:0x%04x "
"s_vendor:0x%04x s_device: 0x%04x\n",
@@ -602,9 +601,9 @@ static int __devinit chd_dec_pci_probe(struct pci_dev *pdev,
return -ENODEV;
}

- sts = crystalhd_setup_cmd_context(&pinfo->cmds, pinfo);
- if (sts != BC_STS_SUCCESS) {
- BCMLOG_ERR("cmd setup :%d \n", sts);
+ rc = crystalhd_setup_cmd_context(&pinfo->cmds, pinfo);
+ if (rc) {
+ BCMLOG_ERR("cmd setup :%d \n", rc);
pci_disable_device(pdev);
return -ENODEV;
}
--
1.7.1

2010-04-25 13:44:13

by Yoichi Yuasa

[permalink] [raw]
Subject: [PATCH 07/11] staging: cyrstalhd: clean up crystalhd_user_close() return code

Signed-off-by: Yoichi Yuasa <[email protected]>
---
drivers/staging/crystalhd/crystalhd_cmds.c | 6 ++----
drivers/staging/crystalhd/crystalhd_cmds.h | 2 +-
2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/crystalhd/crystalhd_cmds.c b/drivers/staging/crystalhd/crystalhd_cmds.c
index bfa11df..d341876 100644
--- a/drivers/staging/crystalhd/crystalhd_cmds.c
+++ b/drivers/staging/crystalhd/crystalhd_cmds.c
@@ -913,7 +913,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)
+void crystalhd_user_close(struct crystalhd_cmd *ctx, struct crystalhd_user *uc)
{
uint32_t mode = uc->mode;

@@ -928,14 +928,12 @@ BC_STATUS crystalhd_user_close(struct crystalhd_cmd *ctx, struct crystalhd_user
crystalhd_hw_free_dma_rings(&ctx->hw_ctx);
crystalhd_destroy_dio_pool(ctx->adp);
} else if (bc_cproc_get_user_count(ctx)) {
- return BC_STS_SUCCESS;
+ return;
}

crystalhd_hw_close(&ctx->hw_ctx);

ctx->state = BC_LINK_INVALID;
-
- return BC_STS_SUCCESS;
}

/**
diff --git a/drivers/staging/crystalhd/crystalhd_cmds.h b/drivers/staging/crystalhd/crystalhd_cmds.h
index ea1b0d4..026a07e 100644
--- a/drivers/staging/crystalhd/crystalhd_cmds.h
+++ b/drivers/staging/crystalhd/crystalhd_cmds.h
@@ -80,7 +80,7 @@ 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);
+void crystalhd_user_close(struct crystalhd_cmd *ctx, struct crystalhd_user *uc);
int crystalhd_setup_cmd_context(struct crystalhd_cmd *ctx, struct crystalhd_adp *adp);
void crystalhd_delete_cmd_context(struct crystalhd_cmd *ctx);
bool crystalhd_cmd_interrupt(struct crystalhd_cmd *ctx);
--
1.7.1

2010-04-25 13:44:19

by Yoichi Yuasa

[permalink] [raw]
Subject: [PATCH 08/11] staging: crystalhd: clean up crystalhd_user_open() return code

Signed-off-by: Yoichi Yuasa <[email protected]>
---
drivers/staging/crystalhd/crystalhd_cmds.c | 10 +++++-----
drivers/staging/crystalhd/crystalhd_cmds.h | 2 +-
drivers/staging/crystalhd/crystalhd_lnx.c | 9 ++++-----
3 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/crystalhd/crystalhd_cmds.c b/drivers/staging/crystalhd/crystalhd_cmds.c
index d341876..1286ed9 100644
--- a/drivers/staging/crystalhd/crystalhd_cmds.c
+++ b/drivers/staging/crystalhd/crystalhd_cmds.c
@@ -875,20 +875,20 @@ 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,
- struct crystalhd_user **user_ctx)
+int crystalhd_user_open(struct crystalhd_cmd *ctx,
+ struct crystalhd_user **user_ctx)
{
struct crystalhd_user *uc;

if (!ctx || !user_ctx) {
BCMLOG_ERR("Invalid arg..\n");
- return BC_STS_INV_ARG;
+ return -EINVAL;
}

uc = bc_cproc_get_uid(ctx);
if (!uc) {
BCMLOG(BCMLOG_INFO, "No free user context...\n");
- return BC_STS_BUSY;
+ return -EBUSY;
}

BCMLOG(BCMLOG_INFO, "Opening new user[%x] handle\n", uc->uid);
@@ -899,7 +899,7 @@ BC_STATUS crystalhd_user_open(struct crystalhd_cmd *ctx,

*user_ctx = uc;

- return BC_STS_SUCCESS;
+ return 0;
}

/**
diff --git a/drivers/staging/crystalhd/crystalhd_cmds.h b/drivers/staging/crystalhd/crystalhd_cmds.h
index 026a07e..8e15bf2 100644
--- a/drivers/staging/crystalhd/crystalhd_cmds.h
+++ b/drivers/staging/crystalhd/crystalhd_cmds.h
@@ -79,7 +79,7 @@ BC_STATUS crystalhd_suspend(struct crystalhd_cmd *ctx, crystalhd_ioctl_data *ida
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);
+int crystalhd_user_open(struct crystalhd_cmd *ctx, struct crystalhd_user **user_ctx);
void crystalhd_user_close(struct crystalhd_cmd *ctx, struct crystalhd_user *uc);
int crystalhd_setup_cmd_context(struct crystalhd_cmd *ctx, struct crystalhd_adp *adp);
void crystalhd_delete_cmd_context(struct crystalhd_cmd *ctx);
diff --git a/drivers/staging/crystalhd/crystalhd_lnx.c b/drivers/staging/crystalhd/crystalhd_lnx.c
index 19769df..6f3c7a0 100644
--- a/drivers/staging/crystalhd/crystalhd_lnx.c
+++ b/drivers/staging/crystalhd/crystalhd_lnx.c
@@ -294,8 +294,7 @@ static int chd_dec_ioctl(struct inode *in, struct file *fd,
static int chd_dec_open(struct inode *in, struct file *fd)
{
struct crystalhd_adp *adp = chd_get_adp();
- int rc = 0;
- BC_STATUS sts = BC_STS_SUCCESS;
+ int rc;
struct crystalhd_user *uc = NULL;

BCMLOG_ENTER;
@@ -309,9 +308,9 @@ static int chd_dec_open(struct inode *in, struct file *fd)
return -EBUSY;
}

- sts = crystalhd_user_open(&adp->cmds, &uc);
- if (sts != BC_STS_SUCCESS) {
- BCMLOG_ERR("cmd_user_open - %d \n", sts);
+ rc = crystalhd_user_open(&adp->cmds, &uc);
+ if (rc) {
+ BCMLOG_ERR("cmd_user_open - %d \n", rc);
rc = -EBUSY;
}

--
1.7.1

2010-04-25 13:44:24

by Yoichi Yuasa

[permalink] [raw]
Subject: [PATCH 09/11] staging: crystalhd: clean up crystalhd_put_ddr2sleep() return code

Signed-off-by: Yoichi Yuasa <[email protected]>
---
drivers/staging/crystalhd/crystalhd_hw.c | 12 ++----------
1 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/crystalhd/crystalhd_hw.c b/drivers/staging/crystalhd/crystalhd_hw.c
index 01819d3..4e4d271 100644
--- a/drivers/staging/crystalhd/crystalhd_hw.c
+++ b/drivers/staging/crystalhd/crystalhd_hw.c
@@ -1565,7 +1565,7 @@ static BC_STATUS crystalhd_fw_cmd_post_proc(struct crystalhd_hw *hw,
return sts;
}

-static BC_STATUS crystalhd_put_ddr2sleep(struct crystalhd_hw *hw)
+static void crystalhd_put_ddr2sleep(struct crystalhd_hw *hw)
{
uint32_t reg;
link_misc_perst_decoder_ctrl rst_cntrl_reg;
@@ -1618,8 +1618,6 @@ static BC_STATUS crystalhd_put_ddr2sleep(struct crystalhd_hw *hw)
reg = bc_dec_reg_rd(hw->adp, DecHt_PllBCtl);
reg |= 0x00008000;
bc_dec_reg_wr(hw->adp, DecHt_PllBCtl, reg);
-
- return BC_STS_SUCCESS;
}

/************************************************
@@ -2289,18 +2287,12 @@ BC_STATUS crystalhd_hw_unpause(struct crystalhd_hw *hw)

BC_STATUS crystalhd_hw_suspend(struct crystalhd_hw *hw)
{
- BC_STATUS sts;
-
if (!hw) {
BCMLOG_ERR("Invalid Arguments\n");
return BC_STS_INV_ARG;
}

- sts = crystalhd_put_ddr2sleep(hw);
- if (sts != BC_STS_SUCCESS) {
- BCMLOG_ERR("Failed to Put DDR To Sleep!!\n");
- return BC_STS_ERROR;
- }
+ crystalhd_put_ddr2sleep(hw);

if (!crystalhd_stop_device(hw->adp)) {
BCMLOG_ERR("Failed to Stop Device!!\n");
--
1.7.1

2010-04-25 13:44:30

by Yoichi Yuasa

[permalink] [raw]
Subject: [PATCH 10/11] staging: crystalhd: remove unneeded crystalhd_put_in_reset() return code

Signed-off-by: Yoichi Yuasa <[email protected]>
---
drivers/staging/crystalhd/crystalhd_hw.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/crystalhd/crystalhd_hw.c b/drivers/staging/crystalhd/crystalhd_hw.c
index 4e4d271..ba81d01 100644
--- a/drivers/staging/crystalhd/crystalhd_hw.c
+++ b/drivers/staging/crystalhd/crystalhd_hw.c
@@ -119,7 +119,7 @@ static bool crystalhd_bring_out_of_rst(struct crystalhd_adp *adp)
return true;
}

-static bool crystalhd_put_in_reset(struct crystalhd_adp *adp)
+static void crystalhd_put_in_reset(struct crystalhd_adp *adp)
{
link_misc_perst_deco_ctrl rst_deco_cntrl;
link_misc_perst_clk_ctrl rst_clk_cntrl;
@@ -171,8 +171,6 @@ static bool crystalhd_put_in_reset(struct crystalhd_adp *adp)

/* restore the transaction configuration register */
crystalhd_reg_wr(adp, PCIE_TL_TRANSACTION_CONFIGURATION, temp);
-
- return true;
}

static void crystalhd_disable_interrupts(struct crystalhd_adp *adp)
@@ -332,8 +330,7 @@ static bool crystalhd_stop_device(struct crystalhd_adp *adp)
crystalhd_clear_errors(adp);
crystalhd_clear_interrupts(adp);

- if (!crystalhd_put_in_reset(adp))
- BCMLOG_ERR("Failed to Put Link To Reset State\n");
+ crystalhd_put_in_reset(adp);

reg = crystalhd_reg_rd(adp, PCIE_DLL_DATA_LINK_CONTROL);
reg |= ASPM_L1_ENABLE;
--
1.7.1

2010-04-25 13:44:38

by Yoichi Yuasa

[permalink] [raw]
Subject: [PATCH 11/11] staging: crystalhd: remove unneeded crystalhd_stop_device() return code

Signed-off-by: Yoichi Yuasa <[email protected]>
---
drivers/staging/crystalhd/crystalhd_hw.c | 9 ++-------
1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/crystalhd/crystalhd_hw.c b/drivers/staging/crystalhd/crystalhd_hw.c
index ba81d01..e407eb8 100644
--- a/drivers/staging/crystalhd/crystalhd_hw.c
+++ b/drivers/staging/crystalhd/crystalhd_hw.c
@@ -320,7 +320,7 @@ static bool crystalhd_start_device(struct crystalhd_adp *adp)
return true;
}

-static bool crystalhd_stop_device(struct crystalhd_adp *adp)
+static void crystalhd_stop_device(struct crystalhd_adp *adp)
{
uint32_t reg;

@@ -340,8 +340,6 @@ static bool crystalhd_stop_device(struct crystalhd_adp *adp)
reg = crystalhd_reg_rd(adp, PCIE_CLK_REQ_REG);
reg |= PCI_CLK_REQ_ENABLE;
crystalhd_reg_wr(adp, PCIE_CLK_REQ_REG, reg);
-
- return true;
}

static crystalhd_rx_dma_pkt *crystalhd_hw_alloc_rx_pkt(struct crystalhd_hw *hw)
@@ -2291,10 +2289,7 @@ BC_STATUS crystalhd_hw_suspend(struct crystalhd_hw *hw)

crystalhd_put_ddr2sleep(hw);

- if (!crystalhd_stop_device(hw->adp)) {
- BCMLOG_ERR("Failed to Stop Device!!\n");
- return BC_STS_ERROR;
- }
+ crystalhd_stop_device(hw->adp);

return BC_STS_SUCCESS;
}
--
1.7.1

2010-04-25 13:45:19

by Yoichi Yuasa

[permalink] [raw]
Subject: [PATCH 06/11] staging: crystalhd: clean up crystalhd_delete_cmd_context() return code

Signed-off-by: Yoichi Yuasa <[email protected]>
---
drivers/staging/crystalhd/crystalhd_cmds.c | 4 +---
drivers/staging/crystalhd/crystalhd_cmds.h | 2 +-
drivers/staging/crystalhd/crystalhd_lnx.c | 5 +----
3 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/crystalhd/crystalhd_cmds.c b/drivers/staging/crystalhd/crystalhd_cmds.c
index 516e825..bfa11df 100644
--- a/drivers/staging/crystalhd/crystalhd_cmds.c
+++ b/drivers/staging/crystalhd/crystalhd_cmds.c
@@ -984,13 +984,11 @@ int __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)
+void __devexit crystalhd_delete_cmd_context(struct crystalhd_cmd *ctx)
{
BCMLOG(BCMLOG_DBG, "Deleting Command context..\n");

ctx->adp = NULL;
-
- return BC_STS_SUCCESS;
}

/**
diff --git a/drivers/staging/crystalhd/crystalhd_cmds.h b/drivers/staging/crystalhd/crystalhd_cmds.h
index 90b4467..ea1b0d4 100644
--- a/drivers/staging/crystalhd/crystalhd_cmds.h
+++ b/drivers/staging/crystalhd/crystalhd_cmds.h
@@ -82,7 +82,7 @@ crystalhd_cmd_proc crystalhd_get_cmd_proc(struct crystalhd_cmd *ctx, uint32_t cm
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);
int crystalhd_setup_cmd_context(struct crystalhd_cmd *ctx, struct crystalhd_adp *adp);
-BC_STATUS crystalhd_delete_cmd_context(struct crystalhd_cmd *ctx);
+void crystalhd_delete_cmd_context(struct crystalhd_cmd *ctx);
bool crystalhd_cmd_interrupt(struct crystalhd_cmd *ctx);

#endif
diff --git a/drivers/staging/crystalhd/crystalhd_lnx.c b/drivers/staging/crystalhd/crystalhd_lnx.c
index 490d2e0..19769df 100644
--- a/drivers/staging/crystalhd/crystalhd_lnx.c
+++ b/drivers/staging/crystalhd/crystalhd_lnx.c
@@ -512,7 +512,6 @@ static void __devexit chd_pci_release_mem(struct crystalhd_adp *pinfo)
static void __devexit chd_dec_pci_remove(struct pci_dev *pdev)
{
struct crystalhd_adp *pinfo;
- BC_STATUS sts = BC_STS_SUCCESS;

BCMLOG_ENTER;

@@ -522,9 +521,7 @@ static void __devexit chd_dec_pci_remove(struct pci_dev *pdev)
return;
}

- sts = crystalhd_delete_cmd_context(&pinfo->cmds);
- if (sts != BC_STS_SUCCESS)
- BCMLOG_ERR("cmd delete :%d \n", sts);
+ crystalhd_delete_cmd_context(&pinfo->cmds);

chd_dec_release_chdev(pinfo);

--
1.7.1

2010-04-30 16:51:23

by Yoichi Yuasa

[permalink] [raw]
Subject: Re: [PATCH 01/11] staging: crystalhd: remove unused bc_dts_types.h

On Thu, 29 Apr 2010 12:10:43 -0700
Greg KH <[email protected]> wrote:

> On Sun, Apr 25, 2010 at 10:18:51PM +0900, Yoichi Yuasa wrote:
> > Signed-off-by: Yoichi Yuasa <[email protected]>
> > ---
> > drivers/staging/crystalhd/bc_dts_defs.h | 2 -
> > drivers/staging/crystalhd/bc_dts_types.h | 121 ------------------------------
>
> Wait, all crystalhd patches should go through Ralf's tree, can you send
> these to him instead?

These patches are not related to MIPS.
I just sent to you.

Thanks,

Yoichi

2010-04-30 17:39:32

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 01/11] staging: crystalhd: remove unused bc_dts_types.h

On Fri, Apr 30, 2010 at 09:40:36AM +0900, Yoichi Yuasa wrote:
> On Thu, 29 Apr 2010 12:10:43 -0700
> Greg KH <[email protected]> wrote:
>
> > On Sun, Apr 25, 2010 at 10:18:51PM +0900, Yoichi Yuasa wrote:
> > > Signed-off-by: Yoichi Yuasa <[email protected]>
> > > ---
> > > drivers/staging/crystalhd/bc_dts_defs.h | 2 -
> > > drivers/staging/crystalhd/bc_dts_types.h | 121 ------------------------------
> >
> > Wait, all crystalhd patches should go through Ralf's tree, can you send
> > these to him instead?
>
> These patches are not related to MIPS.
> I just sent to you.

I understand, but for this driver, Ralf takes the changes through his
tree for a variety of different reasons. So please, resend them to him.

thanks,

greg k-h

2010-04-30 19:00:49

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 01/11] staging: crystalhd: remove unused bc_dts_types.h

On Sun, Apr 25, 2010 at 10:18:51PM +0900, Yoichi Yuasa wrote:
> Signed-off-by: Yoichi Yuasa <[email protected]>
> ---
> drivers/staging/crystalhd/bc_dts_defs.h | 2 -
> drivers/staging/crystalhd/bc_dts_types.h | 121 ------------------------------

Wait, all crystalhd patches should go through Ralf's tree, can you send
these to him instead?

thanks,

greg k-h

2010-04-30 19:02:01

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 01/11] staging: crystalhd: remove unused bc_dts_types.h

On Sun, Apr 25, 2010 at 10:18:51PM +0900, Yoichi Yuasa wrote:
> Signed-off-by: Yoichi Yuasa <[email protected]>
> ---
> drivers/staging/crystalhd/bc_dts_defs.h | 2 -
> drivers/staging/crystalhd/bc_dts_types.h | 121 ------------------------------

This is already in the linux-next tree from someone else :(

thanks,

greg k-h

2010-04-30 19:07:51

by Yoichi Yuasa

[permalink] [raw]
Subject: Re: [PATCH 01/11] staging: crystalhd: remove unused bc_dts_types.h

On Thu, 29 Apr 2010 18:41:59 -0700
Greg KH <[email protected]> wrote:

> On Fri, Apr 30, 2010 at 09:40:36AM +0900, Yoichi Yuasa wrote:
> > On Thu, 29 Apr 2010 12:10:43 -0700
> > Greg KH <[email protected]> wrote:
> >
> > > On Sun, Apr 25, 2010 at 10:18:51PM +0900, Yoichi Yuasa wrote:
> > > > Signed-off-by: Yoichi Yuasa <[email protected]>
> > > > ---
> > > > drivers/staging/crystalhd/bc_dts_defs.h | 2 -
> > > > drivers/staging/crystalhd/bc_dts_types.h | 121 ------------------------------
> > >
> > > Wait, all crystalhd patches should go through Ralf's tree, can you send
> > > these to him instead?
> >
> > These patches are not related to MIPS.
> > I just sent to you.
>
> I understand, but for this driver, Ralf takes the changes through his
> tree for a variety of different reasons. So please, resend them to him.

OK, I'll resend them to Ralf.

Thanks,

Yoichi