提交 66640898 编写于 作者: S Sudip Mukherjee 提交者: Takashi Iwai

ALSA: ctxfi: changed void * to struct hw *

in the code we have void *hw and while using we are always typecasting
it to (struct hw *). it is better to use void type of pointer when we
store different types of pointer , but in this code we are only having
struct hw.
So changed all the relevant reference of void *hw to struct hw *hw,
without any modification of the existing code logic.
the next patch of the series will remove the typecasting which is
not required now.
Signed-off-by: NSudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 7a7686bd
...@@ -296,7 +296,7 @@ static int put_amixer_rsc(struct amixer_mgr *mgr, struct amixer *amixer) ...@@ -296,7 +296,7 @@ static int put_amixer_rsc(struct amixer_mgr *mgr, struct amixer *amixer)
return 0; return 0;
} }
int amixer_mgr_create(void *hw, struct amixer_mgr **ramixer_mgr) int amixer_mgr_create(struct hw *hw, struct amixer_mgr **ramixer_mgr)
{ {
int err; int err;
struct amixer_mgr *amixer_mgr; struct amixer_mgr *amixer_mgr;
...@@ -449,7 +449,7 @@ static int put_sum_rsc(struct sum_mgr *mgr, struct sum *sum) ...@@ -449,7 +449,7 @@ static int put_sum_rsc(struct sum_mgr *mgr, struct sum *sum)
return 0; return 0;
} }
int sum_mgr_create(void *hw, struct sum_mgr **rsum_mgr) int sum_mgr_create(struct hw *hw, struct sum_mgr **rsum_mgr)
{ {
int err; int err;
struct sum_mgr *sum_mgr; struct sum_mgr *sum_mgr;
......
...@@ -45,7 +45,7 @@ struct sum_mgr { ...@@ -45,7 +45,7 @@ struct sum_mgr {
}; };
/* Constructor and destructor of daio resource manager */ /* Constructor and destructor of daio resource manager */
int sum_mgr_create(void *hw, struct sum_mgr **rsum_mgr); int sum_mgr_create(struct hw *hw, struct sum_mgr **rsum_mgr);
int sum_mgr_destroy(struct sum_mgr *sum_mgr); int sum_mgr_destroy(struct sum_mgr *sum_mgr);
/* Define the descriptor of a amixer resource */ /* Define the descriptor of a amixer resource */
...@@ -90,7 +90,7 @@ struct amixer_mgr { ...@@ -90,7 +90,7 @@ struct amixer_mgr {
}; };
/* Constructor and destructor of amixer resource manager */ /* Constructor and destructor of amixer resource manager */
int amixer_mgr_create(void *hw, struct amixer_mgr **ramixer_mgr); int amixer_mgr_create(struct hw *hw, struct amixer_mgr **ramixer_mgr);
int amixer_mgr_destroy(struct amixer_mgr *amixer_mgr); int amixer_mgr_destroy(struct amixer_mgr *amixer_mgr);
#endif /* CTAMIXER_H */ #endif /* CTAMIXER_H */
...@@ -106,11 +106,11 @@ static struct { ...@@ -106,11 +106,11 @@ static struct {
.public_name = "Mixer"} .public_name = "Mixer"}
}; };
typedef int (*create_t)(void *, void **); typedef int (*create_t)(struct hw *, void **);
typedef int (*destroy_t)(void *); typedef int (*destroy_t)(void *);
static struct { static struct {
int (*create)(void *hw, void **rmgr); int (*create)(struct hw *hw, void **rmgr);
int (*destroy)(void *mgr); int (*destroy)(void *mgr);
} rsc_mgr_funcs[NUM_RSCTYP] = { } rsc_mgr_funcs[NUM_RSCTYP] = {
[SRC] = { .create = (create_t)src_mgr_create, [SRC] = { .create = (create_t)src_mgr_create,
......
...@@ -131,7 +131,7 @@ struct ct_atc { ...@@ -131,7 +131,7 @@ struct ct_atc {
/* Don't touch! Used for internal object. */ /* Don't touch! Used for internal object. */
void *rsc_mgrs[NUM_RSCTYP]; /* chip resource managers */ void *rsc_mgrs[NUM_RSCTYP]; /* chip resource managers */
void *mixer; /* internal mixer object */ void *mixer; /* internal mixer object */
void *hw; /* chip specific hardware access object */ struct hw *hw; /* chip specific hardware access object */
void **daios; /* digital audio io resources */ void **daios; /* digital audio io resources */
void **pcm; /* SUMs for collecting all pcm stream */ void **pcm; /* SUMs for collecting all pcm stream */
void **srcs; /* Sample Rate Converters for input signal */ void **srcs; /* Sample Rate Converters for input signal */
......
...@@ -331,7 +331,7 @@ static struct dai_rsc_ops dai_ops = { ...@@ -331,7 +331,7 @@ static struct dai_rsc_ops dai_ops = {
static int daio_rsc_init(struct daio *daio, static int daio_rsc_init(struct daio *daio,
const struct daio_desc *desc, const struct daio_desc *desc,
void *hw) struct hw *hw)
{ {
int err; int err;
unsigned int idx_l, idx_r; unsigned int idx_l, idx_r;
...@@ -692,7 +692,7 @@ static int daio_mgr_commit_write(struct daio_mgr *mgr) ...@@ -692,7 +692,7 @@ static int daio_mgr_commit_write(struct daio_mgr *mgr)
return 0; return 0;
} }
int daio_mgr_create(void *hw, struct daio_mgr **rdaio_mgr) int daio_mgr_create(struct hw *hw, struct daio_mgr **rdaio_mgr)
{ {
int err, i; int err, i;
struct daio_mgr *daio_mgr; struct daio_mgr *daio_mgr;
......
...@@ -53,14 +53,14 @@ struct dao { ...@@ -53,14 +53,14 @@ struct dao {
struct dao_rsc_ops *ops; /* DAO specific operations */ struct dao_rsc_ops *ops; /* DAO specific operations */
struct imapper **imappers; struct imapper **imappers;
struct daio_mgr *mgr; struct daio_mgr *mgr;
void *hw; struct hw *hw;
void *ctrl_blk; void *ctrl_blk;
}; };
struct dai { struct dai {
struct daio daio; struct daio daio;
struct dai_rsc_ops *ops; /* DAI specific operations */ struct dai_rsc_ops *ops; /* DAI specific operations */
void *hw; struct hw *hw;
void *ctrl_blk; void *ctrl_blk;
}; };
...@@ -117,7 +117,7 @@ struct daio_mgr { ...@@ -117,7 +117,7 @@ struct daio_mgr {
}; };
/* Constructor and destructor of daio resource manager */ /* Constructor and destructor of daio resource manager */
int daio_mgr_create(void *hw, struct daio_mgr **rdaio_mgr); int daio_mgr_create(struct hw *hw, struct daio_mgr **rdaio_mgr);
int daio_mgr_destroy(struct daio_mgr *daio_mgr); int daio_mgr_destroy(struct daio_mgr *daio_mgr);
#endif /* CTDAIO_H */ #endif /* CTDAIO_H */
...@@ -134,7 +134,8 @@ static struct rsc_ops rsc_generic_ops = { ...@@ -134,7 +134,8 @@ static struct rsc_ops rsc_generic_ops = {
.next_conj = rsc_next_conj, .next_conj = rsc_next_conj,
}; };
int rsc_init(struct rsc *rsc, u32 idx, enum RSCTYP type, u32 msr, void *hw) int
rsc_init(struct rsc *rsc, u32 idx, enum RSCTYP type, u32 msr, struct hw *hw)
{ {
int err = 0; int err = 0;
...@@ -206,7 +207,7 @@ int rsc_uninit(struct rsc *rsc) ...@@ -206,7 +207,7 @@ int rsc_uninit(struct rsc *rsc)
} }
int rsc_mgr_init(struct rsc_mgr *mgr, enum RSCTYP type, int rsc_mgr_init(struct rsc_mgr *mgr, enum RSCTYP type,
unsigned int amount, void *hw_obj) unsigned int amount, struct hw *hw_obj)
{ {
int err = 0; int err = 0;
struct hw *hw = hw_obj; struct hw *hw = hw_obj;
......
...@@ -38,7 +38,7 @@ struct rsc { ...@@ -38,7 +38,7 @@ struct rsc {
u32 conj:12; /* Current conjugate index */ u32 conj:12; /* Current conjugate index */
u32 msr:4; /* The Master Sample Rate a resource working on */ u32 msr:4; /* The Master Sample Rate a resource working on */
void *ctrl_blk; /* Chip specific control info block for a resource */ void *ctrl_blk; /* Chip specific control info block for a resource */
void *hw; /* Chip specific object for hardware access means */ struct hw *hw; /* Chip specific object for hardware access means */
struct rsc_ops *ops; /* Generic resource operations */ struct rsc_ops *ops; /* Generic resource operations */
}; };
...@@ -50,7 +50,8 @@ struct rsc_ops { ...@@ -50,7 +50,8 @@ struct rsc_ops {
int (*output_slot)(const struct rsc *rsc); int (*output_slot)(const struct rsc *rsc);
}; };
int rsc_init(struct rsc *rsc, u32 idx, enum RSCTYP type, u32 msr, void *hw); int
rsc_init(struct rsc *rsc, u32 idx, enum RSCTYP type, u32 msr, struct hw *hw);
int rsc_uninit(struct rsc *rsc); int rsc_uninit(struct rsc *rsc);
struct rsc_mgr { struct rsc_mgr {
...@@ -59,12 +60,12 @@ struct rsc_mgr { ...@@ -59,12 +60,12 @@ struct rsc_mgr {
unsigned int avail; /* The amount of currently available resources */ unsigned int avail; /* The amount of currently available resources */
unsigned char *rscs; /* The bit-map for resource allocation */ unsigned char *rscs; /* The bit-map for resource allocation */
void *ctrl_blk; /* Chip specific control info block */ void *ctrl_blk; /* Chip specific control info block */
void *hw; /* Chip specific object for hardware access */ struct hw *hw; /* Chip specific object for hardware access */
}; };
/* Resource management is based on bit-map mechanism */ /* Resource management is based on bit-map mechanism */
int rsc_mgr_init(struct rsc_mgr *mgr, enum RSCTYP type, int rsc_mgr_init(struct rsc_mgr *mgr, enum RSCTYP type,
unsigned int amount, void *hw); unsigned int amount, struct hw *hw);
int rsc_mgr_uninit(struct rsc_mgr *mgr); int rsc_mgr_uninit(struct rsc_mgr *mgr);
int mgr_get_resource(struct rsc_mgr *mgr, unsigned int n, unsigned int *ridx); int mgr_get_resource(struct rsc_mgr *mgr, unsigned int n, unsigned int *ridx);
int mgr_put_resource(struct rsc_mgr *mgr, unsigned int n, unsigned int idx); int mgr_put_resource(struct rsc_mgr *mgr, unsigned int n, unsigned int idx);
......
...@@ -543,7 +543,7 @@ static int src_mgr_commit_write(struct src_mgr *mgr) ...@@ -543,7 +543,7 @@ static int src_mgr_commit_write(struct src_mgr *mgr)
return 0; return 0;
} }
int src_mgr_create(void *hw, struct src_mgr **rsrc_mgr) int src_mgr_create(struct hw *hw, struct src_mgr **rsrc_mgr)
{ {
int err, i; int err, i;
struct src_mgr *src_mgr; struct src_mgr *src_mgr;
...@@ -825,7 +825,7 @@ static int srcimp_imap_delete(struct srcimp_mgr *mgr, struct imapper *entry) ...@@ -825,7 +825,7 @@ static int srcimp_imap_delete(struct srcimp_mgr *mgr, struct imapper *entry)
return err; return err;
} }
int srcimp_mgr_create(void *hw, struct srcimp_mgr **rsrcimp_mgr) int srcimp_mgr_create(struct hw *hw, struct srcimp_mgr **rsrcimp_mgr)
{ {
int err; int err;
struct srcimp_mgr *srcimp_mgr; struct srcimp_mgr *srcimp_mgr;
......
...@@ -140,10 +140,10 @@ struct srcimp_mgr { ...@@ -140,10 +140,10 @@ struct srcimp_mgr {
}; };
/* Constructor and destructor of SRC resource manager */ /* Constructor and destructor of SRC resource manager */
int src_mgr_create(void *hw, struct src_mgr **rsrc_mgr); int src_mgr_create(struct hw *hw, struct src_mgr **rsrc_mgr);
int src_mgr_destroy(struct src_mgr *src_mgr); int src_mgr_destroy(struct src_mgr *src_mgr);
/* Constructor and destructor of SRCIMP resource manager */ /* Constructor and destructor of SRCIMP resource manager */
int srcimp_mgr_create(void *hw, struct srcimp_mgr **rsrc_mgr); int srcimp_mgr_create(struct hw *hw, struct srcimp_mgr **rsrc_mgr);
int srcimp_mgr_destroy(struct srcimp_mgr *srcimp_mgr); int srcimp_mgr_destroy(struct srcimp_mgr *srcimp_mgr);
#endif /* CTSRC_H */ #endif /* CTSRC_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册