All of lore.kernel.org
 help / color / mirror / Atom feed
From: Przemyslaw Gaj <pgaj@cadence.com>
To: <bbrezillon@kernel.org>
Cc: linux-i3c@lists.infradead.org, agolec@cadence.com,
	Przemyslaw Gaj <pgaj@cadence.com>,
	rafalc@cadence.com, vitor.soares@synopsys.com
Subject: [PATCH v5 3/7] i3c: export i3c_bus_set_mode function
Date: Sat, 22 Jun 2019 21:55:01 +0100	[thread overview]
Message-ID: <1561236905-8901-4-git-send-email-pgaj@cadence.com> (raw)
In-Reply-To: <1561236905-8901-1-git-send-email-pgaj@cadence.com>

I need to export this function to let secondary master update the bus mode.
Some newly added I2C devices may operate in slower mode.

Signed-off-by: Przemyslaw Gaj <pgaj@cadence.com>
---
 drivers/i3c/master.c       | 10 ++++++++++
 include/linux/i3c/master.h |  1 +
 2 files changed, 11 insertions(+)

diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index 759078f..cbace14 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -566,6 +566,15 @@ static const struct device_type i3c_masterdev_type = {
 	.groups	= i3c_masterdev_groups,
 };
 
+/**
+ * i3c_bus_set_mode() - set a bus mode
+ * @i3cbus: I3C bus object
+ * @mode: new bus mode
+ *
+ * This is called at initialization time and should be called when
+ * bus mode has changed, for example when secondary master registered
+ * devices after successful masership takeover.
+ */
 int i3c_bus_set_mode(struct i3c_bus *i3cbus, enum i3c_bus_mode mode)
 {
 	i3cbus->mode = mode;
@@ -590,6 +599,7 @@ int i3c_bus_set_mode(struct i3c_bus *i3cbus, enum i3c_bus_mode mode)
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(i3c_bus_set_mode);
 
 static struct i3c_master_controller *
 i2c_adapter_to_i3c_master(struct i2c_adapter *adap)
diff --git a/include/linux/i3c/master.h b/include/linux/i3c/master.h
index df3d769..e089771 100644
--- a/include/linux/i3c/master.h
+++ b/include/linux/i3c/master.h
@@ -538,6 +538,7 @@ void i3c_master_cleanup(struct i3c_master_controller *master);
 int i3c_master_register(struct i3c_master_controller *master,
 			struct i3c_device_info *info);
 int i3c_master_unregister(struct i3c_master_controller *master);
+int i3c_bus_set_mode(struct i3c_bus *i3cbus, enum i3c_bus_mode mode);
 
 /**
  * i3c_dev_get_master_data() - get master private data attached to an I3C
-- 
2.4.5


_______________________________________________
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

  parent reply	other threads:[~2019-06-22 20:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-22 20:54 [PATCH v5 0/7] Add the I3C mastership request Przemyslaw Gaj
2019-06-22 20:54 ` [PATCH v5 1/7] i3c: add addr and lvr to i2c_dev_desc structure Przemyslaw Gaj
2019-06-22 20:55 ` [PATCH v5 2/7] i3c: split i3c_master_register into init - register pair Przemyslaw Gaj
2019-07-06  8:48   ` Boris Brezillon
2019-12-02 10:31   ` Przemyslaw Gaj
2019-06-22 20:55 ` Przemyslaw Gaj [this message]
2019-07-06  7:39   ` [PATCH v5 3/7] i3c: export i3c_bus_set_mode function Boris Brezillon
2019-06-22 20:55 ` [PATCH v5 4/7] i3c: Add support for mastership request to I3C subsystem Przemyslaw Gaj
2019-07-06  9:00   ` Boris Brezillon
2019-07-10 18:04   ` Vitor Soares
2019-07-11  5:28     ` Przemyslaw Gaj
2019-07-11 10:11       ` Vitor Soares
2019-07-12 10:10         ` Przemyslaw Gaj
2019-07-12 11:28           ` Vitor Soares
2019-08-11 10:17             ` Boris Brezillon
2019-08-12 13:55               ` Vitor Soares
2019-08-12 14:55                 ` Boris Brezillon
2019-08-22 11:08                   ` Vitor Soares
2019-06-22 20:55 ` [PATCH v5 5/7] i3c: master: cdns: add support for mastership request to Cadence I3C master driver Przemyslaw Gaj
2019-06-22 20:55 ` [PATCH v5 6/7] i3c: master: Add module author Przemyslaw Gaj
2019-06-22 20:55 ` [PATCH v5 7/7] MAINTAINERS: add myself as co-maintainer of i3c subsystem Przemyslaw Gaj

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=1561236905-8901-4-git-send-email-pgaj@cadence.com \
    --to=pgaj@cadence.com \
    --cc=agolec@cadence.com \
    --cc=bbrezillon@kernel.org \
    --cc=linux-i3c@lists.infradead.org \
    --cc=rafalc@cadence.com \
    --cc=vitor.soares@synopsys.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.