
Subject: Re: [PATCH] ASoC: io: Clean up snd_soc_codec_set_cache_io()
On Thu, Feb 27, 2014 at 09:37:45AM +0800, Xiubo Li wrote:
I'm also thinking could we just discard snd_soc_codec_set_cache_io() calling from each individual driver to simply the code? And just bind it to devm_regmap_init_i2c() and devm_regmap_init_spi()...
Is there any other limitations for snd_soc_codec_set_cache_io() usage?
That's the goal overall, I'm not sure it's worth going through and changing the signature of the function and then later going through and merging it, it's just too much churn. The main thing we need to do in order to do that is to make sure nothing is relying on specific sequencing during startup, probably by providing a way to manually set the regmap pointer in the main device probe function rather than in the ASoC one.
Yes, that's also what I'm thinking about.
And for most CODEC drivers which the REGMAP is used, the soc_probe_codec() will do the stuff work of snd_soc_codec_set_cache_io(), which the CODEC's ASoC probe will do too, and almost at the same time.
Then the CODEC drivers stuff work of this is redundant, so we could just discard the snd_soc_codec_set_cache_io() for the CODEC drivers to simplify the code.
I'll send one RFC patch of this, and please ignore this patch.
Thanks,
-- Best Regards, Xiubo