2023-03-22 16:51:10

by Charles Keepax

[permalink] [raw]
Subject: [PATCH v2 1/3] soundwire: bus: Remove now outdated comments on no_pm IO

Things have moved more towards end drivers using the no_pm versions of
the IO functions. See commits:

commit 167790abb90f ("soundwire: export sdw_write/read_no_pm functions")
commit 62dc9f3f2fd0 ("soundwire: bus: export sdw_nwrite_no_pm and
sdw_nread_no_pm functions")

As such this comment is now misleading, so remove it.

Signed-off-by: Charles Keepax <[email protected]>
---

No change since v1.

drivers/soundwire/bus.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c
index b6aca59c31300..3c67266f94834 100644
--- a/drivers/soundwire/bus.c
+++ b/drivers/soundwire/bus.c
@@ -384,9 +384,6 @@ int sdw_fill_msg(struct sdw_msg *msg, struct sdw_slave *slave,

/*
* Read/Write IO functions.
- * no_pm versions can only be called by the bus, e.g. while enumerating or
- * handling suspend-resume sequences.
- * all clients need to use the pm versions
*/

int sdw_nread_no_pm(struct sdw_slave *slave, u32 addr, size_t count, u8 *val)
--
2.30.2


2023-03-22 16:51:31

by Charles Keepax

[permalink] [raw]
Subject: [PATCH v2 2/3] soundwire: bus: Update kernel doc for no_pm functions

The kernel doc should really have been updated when the no_pm versions
of the sdw_write/read functions were exported in commits:

commit 167790abb90f ("soundwire: export sdw_write/read_no_pm functions")
commit 62dc9f3f2fd0 ("soundwire: bus: export sdw_nwrite_no_pm and
sdw_nread_no_pm functions")

Add the missing kernel doc.

Signed-off-by: Charles Keepax <[email protected]>
---

New since v1.

drivers/soundwire/bus.c | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)

diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c
index 3c67266f94834..f1ffb8e0839dd 100644
--- a/drivers/soundwire/bus.c
+++ b/drivers/soundwire/bus.c
@@ -386,6 +386,13 @@ int sdw_fill_msg(struct sdw_msg *msg, struct sdw_slave *slave,
* Read/Write IO functions.
*/

+/**
+ * sdw_nread_no_pm() - Read "n" contiguous SDW Slave registers with no PM
+ * @slave: SDW Slave
+ * @addr: Register address
+ * @count: length
+ * @val: Buffer for values to be read
+ */
int sdw_nread_no_pm(struct sdw_slave *slave, u32 addr, size_t count, u8 *val)
{
struct sdw_msg msg;
@@ -403,6 +410,13 @@ int sdw_nread_no_pm(struct sdw_slave *slave, u32 addr, size_t count, u8 *val)
}
EXPORT_SYMBOL(sdw_nread_no_pm);

+/**
+ * sdw_nwrite_no_pm() - Write "n" contiguous SDW Slave registers with no PM
+ * @slave: SDW Slave
+ * @addr: Register address
+ * @count: length
+ * @val: Buffer for values to be written
+ */
int sdw_nwrite_no_pm(struct sdw_slave *slave, u32 addr, size_t count, const u8 *val)
{
struct sdw_msg msg;
@@ -420,6 +434,12 @@ int sdw_nwrite_no_pm(struct sdw_slave *slave, u32 addr, size_t count, const u8 *
}
EXPORT_SYMBOL(sdw_nwrite_no_pm);

+/**
+ * sdw_write_no_pm() - Write a SDW Slave register with no PM
+ * @slave: SDW Slave
+ * @addr: Register address
+ * @value: Register value
+ */
int sdw_write_no_pm(struct sdw_slave *slave, u32 addr, u8 value)
{
return sdw_nwrite_no_pm(slave, addr, 1, &value);
@@ -492,6 +512,11 @@ int sdw_bwrite_no_pm_unlocked(struct sdw_bus *bus, u16 dev_num, u32 addr, u8 val
}
EXPORT_SYMBOL(sdw_bwrite_no_pm_unlocked);

+/**
+ * sdw_read_no_pm() - Read a SDW Slave register with no PM
+ * @slave: SDW Slave
+ * @addr: Register address
+ */
int sdw_read_no_pm(struct sdw_slave *slave, u32 addr)
{
u8 buf;
@@ -538,6 +563,9 @@ EXPORT_SYMBOL(sdw_update);
* @addr: Register address
* @count: length
* @val: Buffer for values to be read
+ *
+ * This version of the function will take a PM reference to the slave
+ * device.
*/
int sdw_nread(struct sdw_slave *slave, u32 addr, size_t count, u8 *val)
{
@@ -562,6 +590,9 @@ EXPORT_SYMBOL(sdw_nread);
* @addr: Register address
* @count: length
* @val: Buffer for values to be written
+ *
+ * This version of the function will take a PM reference to the slave
+ * device.
*/
int sdw_nwrite(struct sdw_slave *slave, u32 addr, size_t count, const u8 *val)
{
@@ -584,6 +615,9 @@ EXPORT_SYMBOL(sdw_nwrite);
* sdw_read() - Read a SDW Slave register
* @slave: SDW Slave
* @addr: Register address
+ *
+ * This version of the function will take a PM reference to the slave
+ * device.
*/
int sdw_read(struct sdw_slave *slave, u32 addr)
{
@@ -603,6 +637,9 @@ EXPORT_SYMBOL(sdw_read);
* @slave: SDW Slave
* @addr: Register address
* @value: Register value
+ *
+ * This version of the function will take a PM reference to the slave
+ * device.
*/
int sdw_write(struct sdw_slave *slave, u32 addr, u8 value)
{
--
2.30.2

2023-03-31 13:29:58

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH v2 1/3] soundwire: bus: Remove now outdated comments on no_pm IO

On 22-03-23, 16:49, Charles Keepax wrote:
> Things have moved more towards end drivers using the no_pm versions of
> the IO functions. See commits:
>
> commit 167790abb90f ("soundwire: export sdw_write/read_no_pm functions")
> commit 62dc9f3f2fd0 ("soundwire: bus: export sdw_nwrite_no_pm and
> sdw_nread_no_pm functions")
>
> As such this comment is now misleading, so remove it.

Applied all, thanks

--
~Vinod