From: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
To: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
vkoul@kernel.org, broonie@kernel.org
Cc: yung-chuan.liao@linux.intel.com, pierre-louis.bossart@linux.dev,
lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com,
krzysztof.kozlowski@linaro.org, linux-kernel@vger.kernel.org,
linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH 2/4] soundwire: bus: add sdw_slave_get_current_bank helper
Date: Fri, 27 Jun 2025 17:20:16 +0100 [thread overview]
Message-ID: <c783a7a0-5fb1-4dcc-99df-433352dd9ee5@oss.qualcomm.com> (raw)
In-Reply-To: <68c06500-a776-4f56-8514-c180b23f7715@oss.qualcomm.com>
On 6/27/25 4:54 PM, Konrad Dybcio wrote:
> On 6/27/25 5:51 PM, srinivas.kandagatla@oss.qualcomm.com wrote:
>> From: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
>>
>> There has been 2 instances of this helper in codec drivers,
>> it does not make sense to keep duplicating this part of code.
>>
>> Lets add a helper sdw_get_current_bank() for codec drivers to use it.
>>
>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
>> ---
>> drivers/soundwire/bus.c | 7 +++++++
>> include/linux/soundwire/sdw.h | 8 ++++++++
>> 2 files changed, 15 insertions(+)
>>
>> diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c
>> index 39aecd34c641..58306c515ccc 100644
>> --- a/drivers/soundwire/bus.c
>> +++ b/drivers/soundwire/bus.c
>> @@ -1363,6 +1363,13 @@ int sdw_slave_get_scale_index(struct sdw_slave *slave, u8 *base)
>> }
>> EXPORT_SYMBOL(sdw_slave_get_scale_index);
>>
>> +int sdw_slave_get_current_bank(struct sdw_slave *sdev)
>> +{
>> + return FIELD_GET(SDW_SCP_STAT_CURR_BANK,
>> + sdw_read(sdev, SDW_SCP_CTRL));
>
> sdw_read can fail (miserably)
I agree, will add check in v2.
--srini
>
> Konrad
next prev parent reply other threads:[~2025-06-27 16:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-27 15:50 [PATCH 0/4] ASoC: codecs: wcd937x/8x/9x: cleanup srinivas.kandagatla
2025-06-27 15:51 ` [PATCH 1/4] soundwire: bus: add of_sdw_find_device_by_node helper srinivas.kandagatla
2025-06-27 16:29 ` Konrad Dybcio
2025-06-27 17:46 ` Vinod Koul
2025-06-28 20:29 ` Srinivas Kandagatla
2025-06-28 2:02 ` Dmitry Baryshkov
2025-06-27 15:51 ` [PATCH 2/4] soundwire: bus: add sdw_slave_get_current_bank helper srinivas.kandagatla
2025-06-27 15:54 ` Konrad Dybcio
2025-06-27 16:20 ` Srinivas Kandagatla [this message]
2025-06-27 15:51 ` [PATCH 3/4] ASoC: codecs: wcdxxxx: use of_sdw_find_device_by_node helper srinivas.kandagatla
2025-06-28 2:01 ` Dmitry Baryshkov
2025-06-27 15:51 ` [PATCH 4/4] ASoC: codecs: wcdxxxx: use sdw_slave_get_current_bank helper srinivas.kandagatla
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=c783a7a0-5fb1-4dcc-99df-433352dd9ee5@oss.qualcomm.com \
--to=srinivas.kandagatla@oss.qualcomm.com \
--cc=broonie@kernel.org \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=krzysztof.kozlowski@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=pierre-louis.bossart@linux.dev \
--cc=tiwai@suse.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
all inboxes | Powered by JetHome®