Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1bfc9e15 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

[media] drx-j: get rid of typedefs in drx_driver.h



Most of the changes were done with scripts like:
	for i in drivers/media/dvb-frontends/drx39xyj/*.[ch]; do perl -ne '$var = "drx_sig_quality"; s,\b($var)_t\s+,struct \1 ,g; s,\bp_*($var)_t\s+,struct \1 *,g; s,\b($var)_t\b,struct \1,g; s,\bp_*($var)_t\b,struct \1 *,g; print $_' <$i >a && mv a $i; done

Acked-by: default avatarDevin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent ffe7c4f9
Loading
Loading
Loading
Loading
+25 −25
Original line number Diff line number Diff line
@@ -33,9 +33,9 @@
static int drx39xxj_set_powerstate(struct dvb_frontend *fe, int enable)
{
	struct drx39xxj_state *state = fe->demodulator_priv;
	drx_demod_instance_t *demod = state->demod;
	struct drx_demod_instance *demod = state->demod;
	int result;
	drx_power_mode_t power_mode;
	enum drx_power_mode power_mode;

	if (enable)
		power_mode = DRX_POWER_UP;
@@ -55,9 +55,9 @@ static int drx39xxj_set_powerstate(struct dvb_frontend *fe, int enable)
static int drx39xxj_read_status(struct dvb_frontend *fe, fe_status_t *status)
{
	struct drx39xxj_state *state = fe->demodulator_priv;
	drx_demod_instance_t *demod = state->demod;
	struct drx_demod_instance *demod = state->demod;
	int result;
	drx_lock_status_t lock_status;
	enum drx_lock_status lock_status;

	*status = 0;

@@ -102,9 +102,9 @@ static int drx39xxj_read_status(struct dvb_frontend *fe, fe_status_t *status)
static int drx39xxj_read_ber(struct dvb_frontend *fe, u32 *ber)
{
	struct drx39xxj_state *state = fe->demodulator_priv;
	drx_demod_instance_t *demod = state->demod;
	struct drx_demod_instance *demod = state->demod;
	int result;
	drx_sig_quality_t sig_quality;
	struct drx_sig_quality sig_quality;

	result = drx_ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality);
	if (result != DRX_STS_OK) {
@@ -121,9 +121,9 @@ static int drx39xxj_read_signal_strength(struct dvb_frontend *fe,
					 u16 *strength)
{
	struct drx39xxj_state *state = fe->demodulator_priv;
	drx_demod_instance_t *demod = state->demod;
	struct drx_demod_instance *demod = state->demod;
	int result;
	drx_sig_quality_t sig_quality;
	struct drx_sig_quality sig_quality;

	result = drx_ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality);
	if (result != DRX_STS_OK) {
@@ -140,9 +140,9 @@ static int drx39xxj_read_signal_strength(struct dvb_frontend *fe,
static int drx39xxj_read_snr(struct dvb_frontend *fe, u16 *snr)
{
	struct drx39xxj_state *state = fe->demodulator_priv;
	drx_demod_instance_t *demod = state->demod;
	struct drx_demod_instance *demod = state->demod;
	int result;
	drx_sig_quality_t sig_quality;
	struct drx_sig_quality sig_quality;

	result = drx_ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality);
	if (result != DRX_STS_OK) {
@@ -158,9 +158,9 @@ static int drx39xxj_read_snr(struct dvb_frontend *fe, u16 *snr)
static int drx39xxj_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
{
	struct drx39xxj_state *state = fe->demodulator_priv;
	drx_demod_instance_t *demod = state->demod;
	struct drx_demod_instance *demod = state->demod;
	int result;
	drx_sig_quality_t sig_quality;
	struct drx_sig_quality sig_quality;

	result = drx_ctrl(demod, DRX_CTRL_SIG_QUALITY, &sig_quality);
	if (result != DRX_STS_OK) {
@@ -180,12 +180,12 @@ static int drx39xxj_set_frontend(struct dvb_frontend *fe)
#endif
	struct dtv_frontend_properties *p = &fe->dtv_property_cache;
	struct drx39xxj_state *state = fe->demodulator_priv;
	drx_demod_instance_t *demod = state->demod;
	struct drx_demod_instance *demod = state->demod;
	enum drx_standard standard = DRX_STANDARD_8VSB;
	drx_channel_t channel;
	struct drx_channel channel;
	int result;
	drxuio_data_t uio_data;
	drx_channel_t def_channel = { /* frequency      */ 0,
	struct drxuio_data uio_data;
	struct drx_channel def_channel = { /* frequency      */ 0,
		/* bandwidth      */ DRX_BANDWIDTH_6MHZ,
		/* mirror         */ DRX_MIRROR_NO,
		/* constellation  */ DRX_CONSTELLATION_AUTO,
@@ -268,7 +268,7 @@ static int drx39xxj_sleep(struct dvb_frontend *fe)
static int drx39xxj_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
{
	struct drx39xxj_state *state = fe->demodulator_priv;
	drx_demod_instance_t *demod = state->demod;
	struct drx_demod_instance *demod = state->demod;
	bool i2c_gate_state;
	int result;

@@ -326,11 +326,11 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c)
	struct drx39xxj_state *state = NULL;

	struct i2c_device_addr *demod_addr = NULL;
	drx_common_attr_t *demod_comm_attr = NULL;
	struct drx_common_attr *demod_comm_attr = NULL;
	drxj_data_t *demod_ext_attr = NULL;
	drx_demod_instance_t *demod = NULL;
	drxuio_cfg_t uio_cfg;
	drxuio_data_t uio_data;
	struct drx_demod_instance *demod = NULL;
	struct drxuio_cfg uio_cfg;
	struct drxuio_data uio_data;
	int result;

	/* allocate memory for the internal state */
@@ -338,7 +338,7 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c)
	if (state == NULL)
		goto error;

	demod = kmalloc(sizeof(drx_demod_instance_t), GFP_KERNEL);
	demod = kmalloc(sizeof(struct drx_demod_instance), GFP_KERNEL);
	if (demod == NULL)
		goto error;

@@ -346,7 +346,7 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c)
	if (demod_addr == NULL)
		goto error;

	demod_comm_attr = kmalloc(sizeof(drx_common_attr_t), GFP_KERNEL);
	demod_comm_attr = kmalloc(sizeof(struct drx_common_attr), GFP_KERNEL);
	if (demod_comm_attr == NULL)
		goto error;

@@ -358,7 +358,7 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c)
	state->i2c = i2c;
	state->demod = demod;

	memcpy(demod, &drxj_default_demod_g, sizeof(drx_demod_instance_t));
	memcpy(demod, &drxj_default_demod_g, sizeof(struct drx_demod_instance));

	demod->my_i2c_dev_addr = demod_addr;
	memcpy(demod->my_i2c_dev_addr, &drxj_default_addr_g,
@@ -366,7 +366,7 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c)
	demod->my_i2c_dev_addr->user_data = state;
	demod->my_common_attr = demod_comm_attr;
	memcpy(demod->my_common_attr, &drxj_default_comm_attr_g,
	       sizeof(drx_common_attr_t));
	       sizeof(struct drx_common_attr));
	demod->my_common_attr->microcode = DRXJ_MC_MAIN;
#if 0
	demod->my_common_attr->verify_microcode = false;
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@

struct drx39xxj_state {
	struct i2c_adapter *i2c;
	drx_demod_instance_t *demod;
	struct drx_demod_instance *demod;
	enum drx_standard current_standard;
	struct dvb_frontend frontend;
	int powered_up:1;
+60 −60
Original line number Diff line number Diff line
@@ -56,62 +56,62 @@

/* Function prototypes */
static int drxdap_fasi_write_block(struct i2c_device_addr *dev_addr,	/* address of I2C device        */
					  dr_xaddr_t addr,	/* address of register/memory   */
					  u32 addr,	/* address of register/memory   */
					  u16 datasize,	/* size of data                 */
					  u8 *data,	/* data to send                 */
					  dr_xflags_t flags);	/* special device flags         */
					  u32 flags);	/* special device flags         */

static int drxdap_fasi_read_block(struct i2c_device_addr *dev_addr,	/* address of I2C device        */
					 dr_xaddr_t addr,	/* address of register/memory   */
					 u32 addr,	/* address of register/memory   */
					 u16 datasize,	/* size of data                 */
					 u8 *data,	/* data to send                 */
					 dr_xflags_t flags);	/* special device flags         */
					 u32 flags);	/* special device flags         */

static int drxdap_fasi_write_reg8(struct i2c_device_addr *dev_addr,	/* address of I2C device        */
					 dr_xaddr_t addr,	/* address of register          */
					 u32 addr,	/* address of register          */
					 u8 data,	/* data to write                */
					 dr_xflags_t flags);	/* special device flags         */
					 u32 flags);	/* special device flags         */

static int drxdap_fasi_read_reg8(struct i2c_device_addr *dev_addr,	/* address of I2C device        */
					dr_xaddr_t addr,	/* address of register          */
					u32 addr,	/* address of register          */
					u8 *data,	/* buffer to receive data       */
					dr_xflags_t flags);	/* special device flags         */
					u32 flags);	/* special device flags         */

static int drxdap_fasi_read_modify_write_reg8(struct i2c_device_addr *dev_addr,	/* address of I2C device        */
						   dr_xaddr_t waddr,	/* address of register          */
						   dr_xaddr_t raddr,	/* address to read back from    */
						   u32 waddr,	/* address of register          */
						   u32 raddr,	/* address to read back from    */
						   u8 datain,	/* data to send                 */
						   u8 *dataout);	/* data to receive back         */

static int drxdap_fasi_write_reg16(struct i2c_device_addr *dev_addr,	/* address of I2C device        */
					  dr_xaddr_t addr,	/* address of register          */
					  u32 addr,	/* address of register          */
					  u16 data,	/* data to write                */
					  dr_xflags_t flags);	/* special device flags         */
					  u32 flags);	/* special device flags         */

static int drxdap_fasi_read_reg16(struct i2c_device_addr *dev_addr,	/* address of I2C device        */
					 dr_xaddr_t addr,	/* address of register          */
					 u32 addr,	/* address of register          */
					 u16 *data,	/* buffer to receive data       */
					 dr_xflags_t flags);	/* special device flags         */
					 u32 flags);	/* special device flags         */

static int drxdap_fasi_read_modify_write_reg16(struct i2c_device_addr *dev_addr,	/* address of I2C device        */
						    dr_xaddr_t waddr,	/* address of register          */
						    dr_xaddr_t raddr,	/* address to read back from    */
						    u32 waddr,	/* address of register          */
						    u32 raddr,	/* address to read back from    */
						    u16 datain,	/* data to send                 */
						    u16 *dataout);	/* data to receive back         */

static int drxdap_fasi_write_reg32(struct i2c_device_addr *dev_addr,	/* address of I2C device        */
					  dr_xaddr_t addr,	/* address of register          */
					  u32 addr,	/* address of register          */
					  u32 data,	/* data to write                */
					  dr_xflags_t flags);	/* special device flags         */
					  u32 flags);	/* special device flags         */

static int drxdap_fasi_read_reg32(struct i2c_device_addr *dev_addr,	/* address of I2C device        */
					 dr_xaddr_t addr,	/* address of register          */
					 u32 addr,	/* address of register          */
					 u32 *data,	/* buffer to receive data       */
					 dr_xflags_t flags);	/* special device flags         */
					 u32 flags);	/* special device flags         */

static int drxdap_fasi_read_modify_write_reg32(struct i2c_device_addr *dev_addr,	/* address of I2C device        */
						    dr_xaddr_t waddr,	/* address of register          */
						    dr_xaddr_t raddr,	/* address to read back from    */
						    u32 waddr,	/* address of register          */
						    u32 raddr,	/* address to read back from    */
						    u32 datain,	/* data to send                 */
						    u32 *dataout);	/* data to receive back         */

@@ -119,7 +119,7 @@ static int drxdap_fasi_read_modify_write_reg32(struct i2c_device_addr *dev_addr,
char drx_dap_fasi_module_name[] = "FASI Data Access Protocol";
char drx_dap_fasi_version_text[] = "";

drx_version_t drx_dap_fasi_version = {
struct drx_version drx_dap_fasi_version = {
	DRX_MODULE_DAP,	      /**< type identifier of the module */
	drx_dap_fasi_module_name, /**< name or description of module */

@@ -130,7 +130,7 @@ drx_version_t drx_dap_fasi_version = {
};

/* The structure containing the protocol interface */
drx_access_func_t drx_dap_fasi_funct_g = {
struct drx_access_func drx_dap_fasi_funct_g = {
	&drx_dap_fasi_version,
	drxdap_fasi_write_block,	/* Supported */
	drxdap_fasi_read_block,	/* Supported */
@@ -150,24 +150,24 @@ drx_access_func_t drx_dap_fasi_funct_g = {
/* Functions not supported by protocol*/

static int drxdap_fasi_write_reg8(struct i2c_device_addr *dev_addr,	/* address of I2C device        */
					 dr_xaddr_t addr,	/* address of register          */
					 u32 addr,	/* address of register          */
					 u8 data,	/* data to write                */
					 dr_xflags_t flags)
					 u32 flags)
{				/* special device flags         */
	return DRX_STS_ERROR;
}

static int drxdap_fasi_read_reg8(struct i2c_device_addr *dev_addr,	/* address of I2C device        */
					dr_xaddr_t addr,	/* address of register          */
					u32 addr,	/* address of register          */
					u8 *data,	/* buffer to receive data       */
					dr_xflags_t flags)
					u32 flags)
{				/* special device flags         */
	return DRX_STS_ERROR;
}

static int drxdap_fasi_read_modify_write_reg8(struct i2c_device_addr *dev_addr,	/* address of I2C device        */
						   dr_xaddr_t waddr,	/* address of register          */
						   dr_xaddr_t raddr,	/* address to read back from    */
						   u32 waddr,	/* address of register          */
						   u32 raddr,	/* address to read back from    */
						   u8 datain,	/* data to send                 */
						   u8 *dataout)
{				/* data to receive back         */
@@ -175,8 +175,8 @@ static int drxdap_fasi_read_modify_write_reg8(struct i2c_device_addr *dev_addr,
}

static int drxdap_fasi_read_modify_write_reg32(struct i2c_device_addr *dev_addr,	/* address of I2C device        */
						    dr_xaddr_t waddr,	/* address of register          */
						    dr_xaddr_t raddr,	/* address to read back from    */
						    u32 waddr,	/* address of register          */
						    u32 raddr,	/* address to read back from    */
						    u32 datain,	/* data to send                 */
						    u32 *dataout)
{				/* data to receive back         */
@@ -189,10 +189,10 @@ static int drxdap_fasi_read_modify_write_reg32(struct i2c_device_addr *dev_addr,
*
* int drxdap_fasi_read_block (
*      struct i2c_device_addr *dev_addr,      -- address of I2C device
*      dr_xaddr_t        addr,         -- address of chip register/memory
*      u32 addr,         -- address of chip register/memory
*      u16            datasize,     -- number of bytes to read
*      u8 *data,         -- data to receive
*      dr_xflags_t       flags)        -- special device flags
*      u32 flags)        -- special device flags
*
* Read block data from chip address. Because the chip is word oriented,
* the number of bytes to read must be even.
@@ -211,9 +211,9 @@ static int drxdap_fasi_read_modify_write_reg32(struct i2c_device_addr *dev_addr,
******************************/

static int drxdap_fasi_read_block(struct i2c_device_addr *dev_addr,
					 dr_xaddr_t addr,
					 u32 addr,
					 u16 datasize,
					 u8 *data, dr_xflags_t flags)
					 u8 *data, u32 flags)
{
	u8 buf[4];
	u16 bufx;
@@ -304,8 +304,8 @@ static int drxdap_fasi_read_block(struct i2c_device_addr *dev_addr,
*
* int drxdap_fasi_read_modify_write_reg16 (
*      struct i2c_device_addr *dev_addr,   -- address of I2C device
*      dr_xaddr_t        waddr,     -- address of chip register/memory
*      dr_xaddr_t        raddr,     -- chip address to read back from
*      u32 waddr,     -- address of chip register/memory
*      u32 raddr,     -- chip address to read back from
*      u16            wdata,     -- data to send
*      u16 *rdata)     -- data to receive back
*
@@ -326,8 +326,8 @@ static int drxdap_fasi_read_block(struct i2c_device_addr *dev_addr,
******************************/

static int drxdap_fasi_read_modify_write_reg16(struct i2c_device_addr *dev_addr,
						    dr_xaddr_t waddr,
						    dr_xaddr_t raddr,
						    u32 waddr,
						    u32 raddr,
						    u16 wdata, u16 *rdata)
{
	int rc = DRX_STS_ERROR;
@@ -350,9 +350,9 @@ static int drxdap_fasi_read_modify_write_reg16(struct i2c_device_addr *dev_addr,
*
* int drxdap_fasi_read_reg16 (
*     struct i2c_device_addr *dev_addr, -- address of I2C device
*     dr_xaddr_t        addr,    -- address of chip register/memory
*     u32 addr,    -- address of chip register/memory
*     u16 *data,    -- data to receive
*     dr_xflags_t       flags)   -- special device flags
*     u32 flags)   -- special device flags
*
* Read one 16-bit register or memory location. The data received back is
* converted back to the target platform's endianness.
@@ -365,8 +365,8 @@ static int drxdap_fasi_read_modify_write_reg16(struct i2c_device_addr *dev_addr,
******************************/

static int drxdap_fasi_read_reg16(struct i2c_device_addr *dev_addr,
					 dr_xaddr_t addr,
					 u16 *data, dr_xflags_t flags)
					 u32 addr,
					 u16 *data, u32 flags)
{
	u8 buf[sizeof(*data)];
	int rc;
@@ -383,9 +383,9 @@ static int drxdap_fasi_read_reg16(struct i2c_device_addr *dev_addr,
*
* int drxdap_fasi_read_reg32 (
*     struct i2c_device_addr *dev_addr, -- address of I2C device
*     dr_xaddr_t        addr,    -- address of chip register/memory
*     u32 addr,    -- address of chip register/memory
*     u32 *data,    -- data to receive
*     dr_xflags_t       flags)   -- special device flags
*     u32 flags)   -- special device flags
*
* Read one 32-bit register or memory location. The data received back is
* converted back to the target platform's endianness.
@@ -398,8 +398,8 @@ static int drxdap_fasi_read_reg16(struct i2c_device_addr *dev_addr,
******************************/

static int drxdap_fasi_read_reg32(struct i2c_device_addr *dev_addr,
					 dr_xaddr_t addr,
					 u32 *data, dr_xflags_t flags)
					 u32 addr,
					 u32 *data, u32 flags)
{
	u8 buf[sizeof(*data)];
	int rc;
@@ -418,10 +418,10 @@ static int drxdap_fasi_read_reg32(struct i2c_device_addr *dev_addr,
*
* int drxdap_fasi_write_block (
*      struct i2c_device_addr *dev_addr,    -- address of I2C device
*      dr_xaddr_t        addr,       -- address of chip register/memory
*      u32 addr,       -- address of chip register/memory
*      u16            datasize,   -- number of bytes to read
*      u8 *data,       -- data to receive
*      dr_xflags_t       flags)      -- special device flags
*      u32 flags)      -- special device flags
*
* Write block data to chip address. Because the chip is word oriented,
* the number of bytes to write must be even.
@@ -437,9 +437,9 @@ static int drxdap_fasi_read_reg32(struct i2c_device_addr *dev_addr,
******************************/

static int drxdap_fasi_write_block(struct i2c_device_addr *dev_addr,
					  dr_xaddr_t addr,
					  u32 addr,
					  u16 datasize,
					  u8 *data, dr_xflags_t flags)
					  u8 *data, u32 flags)
{
	u8 buf[DRXDAP_MAX_WCHUNKSIZE];
	int st = DRX_STS_ERROR;
@@ -562,9 +562,9 @@ static int drxdap_fasi_write_block(struct i2c_device_addr *dev_addr,
*
* int drxdap_fasi_write_reg16 (
*     struct i2c_device_addr *dev_addr, -- address of I2C device
*     dr_xaddr_t        addr,    -- address of chip register/memory
*     u32 addr,    -- address of chip register/memory
*     u16            data,    -- data to send
*     dr_xflags_t       flags)   -- special device flags
*     u32 flags)   -- special device flags
*
* Write one 16-bit register or memory location. The data being written is
* converted from the target platform's endianness to little endian.
@@ -576,8 +576,8 @@ static int drxdap_fasi_write_block(struct i2c_device_addr *dev_addr,
******************************/

static int drxdap_fasi_write_reg16(struct i2c_device_addr *dev_addr,
					  dr_xaddr_t addr,
					  u16 data, dr_xflags_t flags)
					  u32 addr,
					  u16 data, u32 flags)
{
	u8 buf[sizeof(data)];

@@ -591,9 +591,9 @@ static int drxdap_fasi_write_reg16(struct i2c_device_addr *dev_addr,
*
* int drxdap_fasi_write_reg32 (
*     struct i2c_device_addr *dev_addr, -- address of I2C device
*     dr_xaddr_t        addr,    -- address of chip register/memory
*     u32 addr,    -- address of chip register/memory
*     u32            data,    -- data to send
*     dr_xflags_t       flags)   -- special device flags
*     u32 flags)   -- special device flags
*
* Write one 32-bit register or memory location. The data being written is
* converted from the target platform's endianness to little endian.
@@ -605,8 +605,8 @@ static int drxdap_fasi_write_reg16(struct i2c_device_addr *dev_addr,
******************************/

static int drxdap_fasi_write_reg32(struct i2c_device_addr *dev_addr,
					  dr_xaddr_t addr,
					  u32 data, dr_xflags_t flags)
					  u32 addr,
					  u32 data, u32 flags)
{
	u8 buf[sizeof(data)];

+1 −1
Original line number Diff line number Diff line
@@ -238,7 +238,7 @@
extern "C" {
#endif

	extern drx_access_func_t drx_dap_fasi_funct_g;
	extern struct drx_access_func drx_dap_fasi_funct_g;

#define DRXDAP_FASI_RMW           0x10000000
#define DRXDAP_FASI_BROADCAST     0x20000000
+55 −55

File changed.

Preview size limit exceeded, changes collapsed.

Loading