From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Richard Fitzgerald <rf@opensource.cirrus.com>,
Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: alsa-devel@alsa-project.org, patches@opensource.cirrus.com,
linux-kernel@vger.kernel.org, vkoul@kernel.org,
sanyog.r.kale@intel.com, yung-chuan.liao@linux.intel.com
Subject: Re: [PATCH 2/4] soundwire: Provide build stubs for common functions
Date: Tue, 15 Nov 2022 09:12:41 -0600 [thread overview]
Message-ID: <f8206ecf-7215-1f85-02ef-7d4f57a7898f@linux.intel.com> (raw)
In-Reply-To: <730128a9-46ce-02b2-f88d-c9982fff2e69@opensource.cirrus.com>
On 11/15/22 05:41, Richard Fitzgerald wrote:
> On 15/11/2022 11:03, Charles Keepax wrote:
>> On Mon, Nov 14, 2022 at 10:13:07AM -0600, Pierre-Louis Bossart wrote:
>>>
>>>
>>> On 11/14/22 04:29, Charles Keepax wrote:
>>>> Provide stub functions when CONFIG_SOUNDWIRE is not set for functions
>>>> that are quite likely to be used from common code on devices supporting
>>>> multiple control buses.
>>>
>>> So far this case has been covered by splitting SoundWire related code
>>> away from, say I2C, and with a clear 'depends on SOUNDWIRE'. This is the
>>> case for rt5682, max98373, etc.
>>>
>>> Is this not good enough?
>>>
>>> I am not against this patch, just wondering if allowing code for
>>> different interfaces to be part of the same file will lead to confusions
>>> with e.g. register offsets or functionality exposed with different
>>> registers.
>>>
>>
>> I guess this is a bit of a grey area this one. Both work, I guess
>> the reason I was leaning this way is that in order to avoid a
>> circular dependency if I put all the soundwire DAI handling into
>> the soundwire code then I have to duplicate the snd_soc_dai_driver
>> structure into both the sdw and i2c specific code (worth noting
>> the I2S DAIs are still usable when the part is sdw to the host). But
>> there are also downsides to this approach in that it will likely have
>> some small impact on driver size when soundwire is not built in.
>>
>
> I think we should just add the stubs. Other subsystems use stubs to help
> with code that references stuff that might not be available.
>
> Splitting all the soundwire-specifics out into a separate module works
> for simple chips that are either I2S or soundwire. but can get messy for
> a complex codec. I used the separate file method for CS42L42, but for a
> driver I'm working on I abandoned that and put both DAIs in the core
> code. I didn't notice the missing stubs because my defconfig that was
> intended to omit soundwire apparently has something that is selecting
> it anyway.
It would be good if you could look into this, I don't see any 'select
SOUNDWIRE'.
I agree the premise of the split was that the device is used in one mode
of the other, I am not sure however what the a 'complex codec' would
change. It's likely that we will see a second level within a SoundWire
device to deal with independent 'functions', but I don't quite see how
this would matter.
That said, I don't write codec drivers so I am not going to lay on the
tracks over 2 stubs. We can revisit the sdw.h split as well later.
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
next prev parent reply other threads:[~2022-11-15 15:48 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-14 10:29 [PATCH 0/4] Minor SoundWire clean ups Charles Keepax
2022-11-14 10:29 ` [PATCH 1/4] soundwire: bus: export sdw_nwrite_no_pm and sdw_nread_no_pm functions Charles Keepax
2022-11-14 10:29 ` [PATCH 2/4] soundwire: Provide build stubs for common functions Charles Keepax
2022-11-14 16:13 ` Pierre-Louis Bossart
2022-11-15 11:03 ` Charles Keepax
2022-11-15 11:41 ` Richard Fitzgerald
2022-11-15 15:12 ` Pierre-Louis Bossart [this message]
2022-11-14 10:29 ` [PATCH 3/4] soundwire: debugfs: Switch to sdw_read_no_pm Charles Keepax
2022-11-14 16:14 ` Pierre-Louis Bossart
2022-11-15 10:14 ` Charles Keepax
2022-11-21 10:50 ` Dan Carpenter
2022-11-21 13:13 ` Charles Keepax
2022-11-14 10:29 ` [PATCH 4/4] soundwire: stream: Move remaining register accesses over to no_pm Charles Keepax
2022-11-14 16:04 ` Pierre-Louis Bossart
2022-11-15 11:05 ` Charles Keepax
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f8206ecf-7215-1f85-02ef-7d4f57a7898f@linux.intel.com \
--to=pierre-louis.bossart@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=ckeepax@opensource.cirrus.com \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=rf@opensource.cirrus.com \
--cc=sanyog.r.kale@intel.com \
--cc=vkoul@kernel.org \
--cc=yung-chuan.liao@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).