From: Khalid Masum <khalid.masum.92@gmail.com>
To: Greg KH <greg@kroah.com>
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
linux-acpi@vger.kernel.org,
linux-kernel-mentees@lists.linuxfoundation.org,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
"Rafael J . Wysocki" <rafael@kernel.org>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
Daniel Scally <djrscally@gmail.com>,
Vinod Koul <vkoul@kernel.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Sanyog Kale <sanyog.r.kale@intel.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Bard Liao <yung-chuan.liao@linux.intel.com>,
Len Brown <lenb@kernel.org>
Subject: Re: [RFC PATCH] Soundwire: Initialize multi_link with fwnode props
Date: Mon, 15 Aug 2022 10:08:07 +0600 [thread overview]
Message-ID: <cc6560c3-98c2-bdb5-cfc3-b39d3675382e@gmail.com> (raw)
In-Reply-To: <YvjEIjXg7KxtTT/0@kroah.com>
On 8/14/22 15:45, Greg KH wrote:
> On Sun, Aug 14, 2022 at 02:04:15PM +0600, Khalid Masum wrote:
>> According to the TODO, In sw_bus_master_add, bus->multi_link is to be
>> populated with properties from FW node props. Make this happen by
>> creating a new fwnode_handle flag FWNODE_FLAG_MULTI_LINKED and use
>> the flag to store the multi_link value from intel_link_startup. Use
>> this flag to initialize bus->multi_link.
>>
>> Signed-off-by: Khalid Masum <khalid.masum.92@gmail.com>
>> ---
>> I do not think adding a new flag for fwnode_handle is a good idea.
>> So, what would be the best way to initialize bus->multilink with
>> fwnode props?
>>
>> -- Khalid Masum
>>
>> drivers/soundwire/bus.c | 4 ++--
>> drivers/soundwire/intel.c | 1 +
>> include/linux/fwnode.h | 1 +
>> 3 files changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c
>> index a2bfb0434a67..80df1672c60b 100644
>> --- a/drivers/soundwire/bus.c
>> +++ b/drivers/soundwire/bus.c
>> @@ -74,9 +74,9 @@ int sdw_bus_master_add(struct sdw_bus *bus, struct device *parent,
>>
>> /*
>> * Initialize multi_link flag
>> - * TODO: populate this flag by reading property from FW node
>> */
>> - bus->multi_link = false;
>> + bus->multi_link = (fwnode->flags & FWNODE_FLAG_MULTI_LINKED)
>> + == FWNODE_FLAG_MULTI_LINKED;
>> if (bus->ops->read_prop) {
>> ret = bus->ops->read_prop(bus);
>> if (ret < 0) {
>> diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c
>> index 505c5ef061e3..034d1c523ddf 100644
>> --- a/drivers/soundwire/intel.c
>> +++ b/drivers/soundwire/intel.c
>> @@ -1347,6 +1347,7 @@ int intel_link_startup(struct auxiliary_device *auxdev)
>> */
>> bus->multi_link = true;
>> bus->hw_sync_min_links = 1;
>> + dev->fwnode->flags |= FWNODE_FLAG_MULTI_LINKED;
>> }
>>
>> /* Initialize shim, controller */
>> diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h
>> index 9a81c4410b9f..446a52744953 100644
>> --- a/include/linux/fwnode.h
>> +++ b/include/linux/fwnode.h
>> @@ -32,6 +32,7 @@ struct device;
>> #define FWNODE_FLAG_NOT_DEVICE BIT(1)
>> #define FWNODE_FLAG_INITIALIZED BIT(2)
>> #define FWNODE_FLAG_NEEDS_CHILD_BOUND_ON_ADD BIT(3)
>> +#define FWNODE_FLAG_MULTI_LINKED BIT(4)
>
> What does this commit actually change?
The new flag will lets us save if the device has multilink in
fwnode_handle whenever needed.
Then for soundwire/intel, save the multi_link flag into fwnode during
startup.
Later at master_add, as written in todo, initialize the multilink flag
with fwnode's flag property.
>
> Did you test this on real hardware?
I did not test this on real hardware.
>
> thanks,
>
> greg k-h
thanks,
-- Khalid Masum
next prev parent reply other threads:[~2022-08-15 4:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-14 8:04 [RFC PATCH] Soundwire: Initialize multi_link with fwnode props Khalid Masum
2022-08-14 9:45 ` Greg KH
2022-08-15 4:08 ` Khalid Masum [this message]
2022-08-15 6:37 ` Greg KH
2022-08-15 12:30 ` Khalid Masum
2022-08-14 18:46 ` Andy Shevchenko
2022-08-15 4:28 ` Khalid Masum
2022-08-15 8:16 ` Pierre-Louis Bossart
2022-08-15 12:10 ` Khalid Masum
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=cc6560c3-98c2-bdb5-cfc3-b39d3675382e@gmail.com \
--to=khalid.masum.92@gmail.com \
--cc=alsa-devel@alsa-project.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=djrscally@gmail.com \
--cc=greg@kroah.com \
--cc=heikki.krogerus@linux.intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=rafael@kernel.org \
--cc=sakari.ailus@linux.intel.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