Re: [PATCH 11/25] ASoC: Samsung: Add common I2S driver

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

 



On Wed, Oct 20, 2010 at 1:01 PM, Mark Brown
<broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx> 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.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux