Commit 61263c75 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab Committed by Mauro Carvalho Chehab

[media] drx-j: get rid of most of the typedefs

There are lots of typedefs there. Let's get rid of them.

Most of the work here is due to this small script:

	if [ "$3" == "" ]; then
		echo "usage: $0 type DRXName drx_name"
	fi
	t=$1; f=$2; g=$3
	for i in *.[ch]; do
		sed s,"p${f}_t","$t $g *",g <$i >a && mv a $i && \
		sed s,"${f}_t","$t $g",g <$i >a && mv a $i
	done

Just kept there the function typedefs, as those are still useful.

Yet, all those tuner_ops can likely be just removed on a latter
cleanup patch.
Acked-by: default avatarDevin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 6c1d56c5
...@@ -34,7 +34,7 @@ static int drx39xxj_set_powerstate(struct dvb_frontend *fe, int enable) ...@@ -34,7 +34,7 @@ static int drx39xxj_set_powerstate(struct dvb_frontend *fe, int enable)
{ {
struct drx39xxj_state *state = fe->demodulator_priv; struct drx39xxj_state *state = fe->demodulator_priv;
DRXDemodInstance_t *demod = state->demod; DRXDemodInstance_t *demod = state->demod;
DRXStatus_t result; int result;
DRXPowerMode_t powerMode; DRXPowerMode_t powerMode;
if (enable) if (enable)
...@@ -56,7 +56,7 @@ static int drx39xxj_read_status(struct dvb_frontend *fe, fe_status_t *status) ...@@ -56,7 +56,7 @@ static int drx39xxj_read_status(struct dvb_frontend *fe, fe_status_t *status)
{ {
struct drx39xxj_state *state = fe->demodulator_priv; struct drx39xxj_state *state = fe->demodulator_priv;
DRXDemodInstance_t *demod = state->demod; DRXDemodInstance_t *demod = state->demod;
DRXStatus_t result; int result;
DRXLockStatus_t lock_status; DRXLockStatus_t lock_status;
*status = 0; *status = 0;
...@@ -103,7 +103,7 @@ static int drx39xxj_read_ber(struct dvb_frontend *fe, u32 *ber) ...@@ -103,7 +103,7 @@ static int drx39xxj_read_ber(struct dvb_frontend *fe, u32 *ber)
{ {
struct drx39xxj_state *state = fe->demodulator_priv; struct drx39xxj_state *state = fe->demodulator_priv;
DRXDemodInstance_t *demod = state->demod; DRXDemodInstance_t *demod = state->demod;
DRXStatus_t result; int result;
DRXSigQuality_t sig_quality; DRXSigQuality_t sig_quality;
result = DRX_Ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality); result = DRX_Ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality);
...@@ -122,7 +122,7 @@ static int drx39xxj_read_signal_strength(struct dvb_frontend *fe, ...@@ -122,7 +122,7 @@ static int drx39xxj_read_signal_strength(struct dvb_frontend *fe,
{ {
struct drx39xxj_state *state = fe->demodulator_priv; struct drx39xxj_state *state = fe->demodulator_priv;
DRXDemodInstance_t *demod = state->demod; DRXDemodInstance_t *demod = state->demod;
DRXStatus_t result; int result;
DRXSigQuality_t sig_quality; DRXSigQuality_t sig_quality;
result = DRX_Ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality); result = DRX_Ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality);
...@@ -141,7 +141,7 @@ static int drx39xxj_read_snr(struct dvb_frontend *fe, u16 *snr) ...@@ -141,7 +141,7 @@ static int drx39xxj_read_snr(struct dvb_frontend *fe, u16 *snr)
{ {
struct drx39xxj_state *state = fe->demodulator_priv; struct drx39xxj_state *state = fe->demodulator_priv;
DRXDemodInstance_t *demod = state->demod; DRXDemodInstance_t *demod = state->demod;
DRXStatus_t result; int result;
DRXSigQuality_t sig_quality; DRXSigQuality_t sig_quality;
result = DRX_Ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality); result = DRX_Ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality);
...@@ -159,7 +159,7 @@ static int drx39xxj_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks) ...@@ -159,7 +159,7 @@ static int drx39xxj_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
{ {
struct drx39xxj_state *state = fe->demodulator_priv; struct drx39xxj_state *state = fe->demodulator_priv;
DRXDemodInstance_t *demod = state->demod; DRXDemodInstance_t *demod = state->demod;
DRXStatus_t result; int result;
DRXSigQuality_t sig_quality; DRXSigQuality_t sig_quality;
result = DRX_Ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality); result = DRX_Ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality);
...@@ -181,9 +181,9 @@ static int drx39xxj_set_frontend(struct dvb_frontend *fe) ...@@ -181,9 +181,9 @@ static int drx39xxj_set_frontend(struct dvb_frontend *fe)
struct dtv_frontend_properties *p = &fe->dtv_property_cache; struct dtv_frontend_properties *p = &fe->dtv_property_cache;
struct drx39xxj_state *state = fe->demodulator_priv; struct drx39xxj_state *state = fe->demodulator_priv;
DRXDemodInstance_t *demod = state->demod; DRXDemodInstance_t *demod = state->demod;
DRXStandard_t standard = DRX_STANDARD_8VSB; enum drx_standard standard = DRX_STANDARD_8VSB;
DRXChannel_t channel; DRXChannel_t channel;
DRXStatus_t result; int result;
DRXUIOData_t uioData; DRXUIOData_t uioData;
DRXChannel_t defChannel = { /* frequency */ 0, DRXChannel_t defChannel = { /* frequency */ 0,
/* bandwidth */ DRX_BANDWIDTH_6MHZ, /* bandwidth */ DRX_BANDWIDTH_6MHZ,
...@@ -270,7 +270,7 @@ static int drx39xxj_i2c_gate_ctrl(struct dvb_frontend *fe, int enable) ...@@ -270,7 +270,7 @@ static int drx39xxj_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
struct drx39xxj_state *state = fe->demodulator_priv; struct drx39xxj_state *state = fe->demodulator_priv;
DRXDemodInstance_t *demod = state->demod; DRXDemodInstance_t *demod = state->demod;
bool i2c_gate_state; bool i2c_gate_state;
DRXStatus_t result; int result;
#ifdef DJH_DEBUG #ifdef DJH_DEBUG
printk(KERN_DBG "i2c gate call: enable=%d state=%d\n", enable, printk(KERN_DBG "i2c gate call: enable=%d state=%d\n", enable,
...@@ -331,7 +331,7 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c) ...@@ -331,7 +331,7 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c)
DRXDemodInstance_t *demod = NULL; DRXDemodInstance_t *demod = NULL;
DRXUIOCfg_t uioCfg; DRXUIOCfg_t uioCfg;
DRXUIOData_t uioData; DRXUIOData_t uioData;
DRXStatus_t result; int result;
/* allocate memory for the internal state */ /* allocate memory for the internal state */
state = kmalloc(sizeof(struct drx39xxj_state), GFP_KERNEL); state = kmalloc(sizeof(struct drx39xxj_state), GFP_KERNEL);
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
struct drx39xxj_state { struct drx39xxj_state {
struct i2c_adapter *i2c; struct i2c_adapter *i2c;
DRXDemodInstance_t *demod; DRXDemodInstance_t *demod;
DRXStandard_t current_standard; enum drx_standard current_standard;
struct dvb_frontend frontend; struct dvb_frontend frontend;
int powered_up:1; int powered_up:1;
unsigned int i2c_gate_open:1; unsigned int i2c_gate_open:1;
......
...@@ -11,33 +11,33 @@ ...@@ -11,33 +11,33 @@
#include "drx39xxj.h" #include "drx39xxj.h"
/* Dummy function to satisfy drxj.c */ /* Dummy function to satisfy drxj.c */
DRXStatus_t DRXBSP_TUNER_Open(pTUNERInstance_t tuner) int DRXBSP_TUNER_Open(struct tuner_instance *tuner)
{ {
return DRX_STS_OK; return DRX_STS_OK;
} }
DRXStatus_t DRXBSP_TUNER_Close(pTUNERInstance_t tuner) int DRXBSP_TUNER_Close(struct tuner_instance *tuner)
{ {
return DRX_STS_OK; return DRX_STS_OK;
} }
DRXStatus_t DRXBSP_TUNER_SetFrequency(pTUNERInstance_t tuner, int DRXBSP_TUNER_SetFrequency(struct tuner_instance *tuner,
TUNERMode_t mode, u32 mode,
s32 centerFrequency) s32 centerFrequency)
{ {
return DRX_STS_OK; return DRX_STS_OK;
} }
DRXStatus_t int
DRXBSP_TUNER_GetFrequency(pTUNERInstance_t tuner, DRXBSP_TUNER_GetFrequency(struct tuner_instance *tuner,
TUNERMode_t mode, u32 mode,
s32 *RFfrequency, s32 *RFfrequency,
s32 *IFfrequency) s32 *IFfrequency)
{ {
return DRX_STS_OK; return DRX_STS_OK;
} }
DRXStatus_t DRXBSP_HST_Sleep(u32 n) int DRXBSP_HST_Sleep(u32 n)
{ {
msleep(n); msleep(n);
return DRX_STS_OK; return DRX_STS_OK;
...@@ -58,7 +58,7 @@ void *DRXBSP_HST_Memcpy(void *to, void *from, u32 n) ...@@ -58,7 +58,7 @@ void *DRXBSP_HST_Memcpy(void *to, void *from, u32 n)
return (memcpy(to, from, (size_t) n)); return (memcpy(to, from, (size_t) n));
} }
DRXStatus_t DRXBSP_I2C_WriteRead(struct i2c_device_addr *wDevAddr, int DRXBSP_I2C_WriteRead(struct i2c_device_addr *wDevAddr,
u16 wCount, u16 wCount,
u8 *wData, u8 *wData,
struct i2c_device_addr *rDevAddr, struct i2c_device_addr *rDevAddr,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -184,7 +184,7 @@ TYPEDEFS ...@@ -184,7 +184,7 @@ TYPEDEFS
* Generic interface for all AGCs present on the DRXJ. * Generic interface for all AGCs present on the DRXJ.
*/ */
typedef struct { typedef struct {
DRXStandard_t standard; /* standard for which these settings apply */ enum drx_standard standard; /* standard for which these settings apply */
DRXJAgcCtrlMode_t ctrlMode; /* off, user, auto */ DRXJAgcCtrlMode_t ctrlMode; /* off, user, auto */
u16 outputLevel; /* range dependent on AGC */ u16 outputLevel; /* range dependent on AGC */
u16 minOutputLevel; /* range dependent on AGC */ u16 minOutputLevel; /* range dependent on AGC */
...@@ -202,7 +202,7 @@ TYPEDEFS ...@@ -202,7 +202,7 @@ TYPEDEFS
* Interface to configure pre SAW sense. * Interface to configure pre SAW sense.
*/ */
typedef struct { typedef struct {
DRXStandard_t standard; /* standard to which these settings apply */ enum drx_standard standard; /* standard to which these settings apply */
u16 reference; /* pre SAW reference value, range 0 .. 31 */ u16 reference; /* pre SAW reference value, range 0 .. 31 */
bool usePreSaw; /* true algorithms must use pre SAW sense */ bool usePreSaw; /* true algorithms must use pre SAW sense */
} DRXJCfgPreSaw_t, *pDRXJCfgPreSaw_t; } DRXJCfgPreSaw_t, *pDRXJCfgPreSaw_t;
...@@ -214,7 +214,7 @@ TYPEDEFS ...@@ -214,7 +214,7 @@ TYPEDEFS
* Interface to configure gain of AFE (LNA + PGA). * Interface to configure gain of AFE (LNA + PGA).
*/ */
typedef struct { typedef struct {
DRXStandard_t standard; /* standard to which these settings apply */ enum drx_standard standard; /* standard to which these settings apply */
u16 gain; /* gain in 0.1 dB steps, DRXJ range 140 .. 335 */ u16 gain; /* gain in 0.1 dB steps, DRXJ range 140 .. 335 */
} DRXJCfgAfeGain_t, *pDRXJCfgAfeGain_t; } DRXJCfgAfeGain_t, *pDRXJCfgAfeGain_t;
...@@ -462,13 +462,13 @@ TYPEDEFS ...@@ -462,13 +462,13 @@ TYPEDEFS
bool mirrorFreqSpectOOB;/**< tuner inversion (true = tuner mirrors the signal */ bool mirrorFreqSpectOOB;/**< tuner inversion (true = tuner mirrors the signal */
/* standard/channel settings */ /* standard/channel settings */
DRXStandard_t standard; /**< current standard information */ enum drx_standard standard; /**< current standard information */
DRXConstellation_t constellation; enum drx_modulation constellation;
/**< current constellation */ /**< current constellation */
s32 frequency; /**< center signal frequency in KHz */ s32 frequency; /**< center signal frequency in KHz */
DRXBandwidth_t currBandwidth; enum drx_bandwidth currBandwidth;
/**< current channel bandwidth */ /**< current channel bandwidth */
DRXMirror_t mirror; /**< current channel mirror */ enum drx_mirror mirror; /**< current channel mirror */
/* signal quality information */ /* signal quality information */
u32 fecBitsDesired; /**< BER accounting period */ u32 fecBitsDesired; /**< BER accounting period */
...@@ -723,10 +723,10 @@ STRUCTS ...@@ -723,10 +723,10 @@ STRUCTS
Exported FUNCTIONS Exported FUNCTIONS
-------------------------------------------------------------------------*/ -------------------------------------------------------------------------*/
extern DRXStatus_t DRXJ_Open(pDRXDemodInstance_t demod); extern int DRXJ_Open(pDRXDemodInstance_t demod);
extern DRXStatus_t DRXJ_Close(pDRXDemodInstance_t demod); extern int DRXJ_Close(pDRXDemodInstance_t demod);
extern DRXStatus_t DRXJ_Ctrl(pDRXDemodInstance_t demod, extern int DRXJ_Ctrl(pDRXDemodInstance_t demod,
DRXCtrlIndex_t ctrl, void *ctrlData); u32 ctrl, void *ctrlData);
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
Exported GLOBAL VARIABLES Exported GLOBAL VARIABLES
......
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