[alsa-devel] [PATCH 11/25] ASoC: Samsung: Add common I2S driver
jassisinghbrar at gmail.com
Fri Oct 22 09:39:05 CEST 2010
On Wed, Oct 20, 2010 at 1:01 PM, Mark Brown
<broonie at opensource.wolfsonmicro.com> wrote:
> On Wed, Oct 20, 2010 at 12:27:43PM +0900, Jassi Brar wrote:
>> On Wed, Oct 20, 2010 at 12:13 PM, Mark Brown
>> > If we have something in the driver data struct specifying the masks to
>> > use then set these at probe time rather than having the if statements -
>> > probably the same mask can be used for playback & record if the
>> > bitfields are lined up similarly. This would then be:
>> > con |= data->active_mask;
>> > con &= ~data->pause_mask;
>> > or similar, possibly with some shifts.
>> Let me see if the space saved is worth the complication.
> I was thinking it should make something similar by making it clear that
> we're just doing the same thing to a different location rather than lots
> of conditional code to follow.
In this case it doesn't fit very neatly. So I am dropping the suggestion, sorry.
>> > How would the index be used with multi-component?
>> For example, please look at [Patch 23/25]
>> + /* Secondary is at offset MAX_I2S from Primary */
>> + str = (char *)smdk_dai[SEC_PLAYBACK].cpu_dai_name;
>> + str[strlen(str) - 1] = '0' + MAX_I2S;
> Hrm, slightly fiddly. Perhaps we want a function people can call which
> will generate the secondary DAI name for you? Might be more directly
> what people want.
We already have to decide on platform_device's id in probe while creating the
secondary dai in CPU driver. So there must exist any such predefined offset in
the common driver.
So, I decided to reuse the symbol and save one addition to the API.
More information about the Alsa-devel