Re: [PATCH v2 3/4] staging: greybus: audio: Cleanup junk codec registers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 17, 2017 at 08:19:29PM +0530, Vaibhav Agarwal wrote:
> From: Vaibhav Agarwal <vaibhav.agarwal@xxxxxxxxxx>
> 
> Dummy codec register were initially added while populating dummy codec
> mixer controls until module topology parser was available. Now, these
> dummy registers are nowhere used and thus can be safely removed.
> 
> Since ASoC framework requires a valid callback for both read & write
> register APIS, currently empty placeholders are kept to avoid panic.
> 
> Later, register mapping logic can be defined:
> 1. Assuming fixed number of maximum modules connected and register bits
> corresponds to basic info of each module OR
> 2. With a logic to dynamically grow register_cache_size based on codec
> modules added/removed.
> 
> Signed-off-by: Vaibhav Agarwal <vaibhav.agarwal@xxxxxxxxxx>
> ---
>  drivers/staging/greybus/audio_codec.c | 39 ++---------------------------------
>  1 file changed, 2 insertions(+), 37 deletions(-)
> 
> diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c
> index b9d66278ff87..30941f9e380d 100644
> --- a/drivers/staging/greybus/audio_codec.c
> +++ b/drivers/staging/greybus/audio_codec.c
> @@ -1026,47 +1026,16 @@ static int gbcodec_remove(struct snd_soc_codec *codec)
>  	return 0;
>  }
>  
> -static u8 gbcodec_reg[GBCODEC_REG_COUNT] = {
> -	[GBCODEC_CTL_REG] = GBCODEC_CTL_REG_DEFAULT,
> -	[GBCODEC_MUTE_REG] = GBCODEC_MUTE_REG_DEFAULT,
> -	[GBCODEC_PB_LVOL_REG] = GBCODEC_PB_VOL_REG_DEFAULT,
> -	[GBCODEC_PB_RVOL_REG] = GBCODEC_PB_VOL_REG_DEFAULT,
> -	[GBCODEC_CAP_LVOL_REG] = GBCODEC_CAP_VOL_REG_DEFAULT,
> -	[GBCODEC_CAP_RVOL_REG] = GBCODEC_CAP_VOL_REG_DEFAULT,
> -	[GBCODEC_APB1_MUX_REG] = GBCODEC_APB1_MUX_REG_DEFAULT,
> -	[GBCODEC_APB2_MUX_REG] = GBCODEC_APB2_MUX_REG_DEFAULT,
> -};
> -

gbcodec_reg_defaults[] and the definitions of 'GBCODEC_CTL_REG_DEFAULT',
etc. can be removed now too, can't they?

The rest looks good.

Mark
--
_______________________________________________
greybus-dev mailing list
greybus-dev@xxxxxxxxxxxxxxxx
https://lists.linaro.org/mailman/listinfo/greybus-dev




[Index of Archives]     [Asterisk App Development]     [PJ SIP]     [Gnu Gatekeeper]     [IETF Sipping]     [Info Cyrus]     [ALSA User]     [Fedora Linux Users]     [Linux SCTP]     [DCCP]     [Gimp]     [Yosemite News]     [Deep Creek Hot Springs]     [Yosemite Campsites]     [ISDN Cause Codes]     [Asterisk Books]

  Powered by Linux